- Introduced a new workspace for FaceAI in package.json. - Implemented FaceAI handoff logic in faceai_handoff.php, including identity verification and token signing. - Created faceai_return.php to handle return requests from FaceAI, validating tokens and forwarding results. - Developed faceai_simulator.php and faceai_simulator_view.php for simulating the FaceAI interface with demo photos. - Enhanced rus-ecom-240621.js to support new FaceAI features, including dynamic URL building and button integration. - Added faceai_config.php for configuration management, including environment variable handling and utility functions. - Updated HTML structure and styles in simulator view for better user experience.
26 lines
842 B
JavaScript
26 lines
842 B
JavaScript
const legacyAssetBaseUrl = (import.meta.env.VITE_LEGACY_ASSET_BASE_URL || '/legacy-static').replace(/\/$/, '');
|
|
|
|
export function legacyAsset(path) {
|
|
return `${legacyAssetBaseUrl}${path.startsWith('/') ? path : `/${path}`}`;
|
|
}
|
|
|
|
export function injectLegacyStylesheets() {
|
|
const stylesheets = [
|
|
legacyAsset('/vendor/bootstrap/css/bootstrap.min.css'),
|
|
legacyAsset('/css/font-awesome.min.css'),
|
|
'https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i',
|
|
legacyAsset('/css/custom-style.css')
|
|
];
|
|
|
|
stylesheets.forEach((href) => {
|
|
if (document.head.querySelector(`link[data-legacy-href="${href}"]`)) {
|
|
return;
|
|
}
|
|
|
|
const link = document.createElement('link');
|
|
link.rel = 'stylesheet';
|
|
link.href = href;
|
|
link.dataset.legacyHref = href;
|
|
document.head.appendChild(link);
|
|
});
|
|
}
|