onnxruntime/src/app.html
Maanav Dalal e8b82b6f3f
Large UX updates, replaced banner, moved analytics, linted everything (#20004)
https://maanavd.github.io/onnxruntime/

### Description
Many changes, most small, but quite a few. Listed here:

- Infinitely scrolling testimonial banner on homepage
- New Microsoft-approved cookie consent banner (only shows up in correct
regions, here's a screen of it working):
![image](https://github.com/microsoft/onnxruntime/assets/24942306/b210b55f-d0cb-413a-a5c7-7156e003414a)
You can duplicate this behavior if you want using: [this
link](https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/wcp/privacy/wcp-cookie-consent-api#cookie-consent-library---javascript:~:text=siteConsent.manageConsent()%3B%0A%20%20%20%20%7D-,How%20to%20test%20if%20banner%20is%20loading%20for%20EU%20visitors,-You%20can%20use)
- removed SAOS animations, relying on native tailwind animations
- ran a linting pass
- easter egg for hovering onnxruntime pinwheel

---------

Co-authored-by: MaanavD <maanavdalal@microsoft.com>
2024-03-21 14:40:45 -07:00

106 lines
2.7 KiB
HTML

<!DOCTYPE html>
<html lang="en" data-theme="lightmode">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<script src="https://wcpstatic.microsoft.com/mscc/lib/v2/wcp-consent.js"></script>
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-156955408-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied'
});
gtag('js', new Date());
gtag('config', 'UA-156955408-1');
</script>
<!-- Adobe Analytics -->
<script type="text/javascript">
const analytics = new oneDS.ApplicationInsights();
var config = {
instrumentationKey:
'360b0e675e0044398fd28c8bdf711b8e-1fe5434d-ee99-4837-99cc-a3a16462d82d-7262',
channelConfiguration: {
// Post channel configuration
eventsLimitInMem: 50
},
propertyConfiguration: {
// Properties Plugin configuration
env: 'PROD' // Environment can be set to PPE or PROD as needed.
},
webAnalyticsConfiguration: {
// Web Analytics Plugin configuration
//urlCollectQuery:true,
autoCapture: {
scroll: true,
pageView: true,
onLoad: true,
onUnload: true,
click: true,
resize: true,
jsError: true
}
}
};
//Initialize SDK
analytics.initialize(config, []);
</script>
<!-- MS Analytics -->
<script
type="text/javascript"
src="https://js.monitor.azure.com/scripts/c/ms.analytics-web-3.min.js"
></script>
</head>
<body data-sveltekit-preload-data="hover">
<div id="cookie-banner"></div>
<div style="display: contents">%sveltekit.body%</div>
</body>
<script>
let choices = {
marketing: false,
tracking: false,
analytics: {
label: 'Analytics',
description:
'We use analytics cookies to track visits, helping create a better experience for you!',
value: true
},
necessary: {
label: 'Necessary',
description: 'Used for cookie control.',
value: true
}
};
WcpConsent.init(
'en-US',
'cookie-banner',
function (err, _siteConsent) {
if (!err) {
siteConsent = _siteConsent; //siteConsent is used to get the current consent
} else {
console.log('Error initializing WcpConsent: ' + err);
}
},
onConsentChanged,
WcpConsent.themes.light
);
function onConsentChanged(categoryPreferences) {
if (categoryPreferences.Analytics) {
// Google Analytics
gtag('consent', 'update', {
ad_storage: 'granted',
analytics_storage: 'granted'
});
// Adobe Analytics
}
}
</script>
</html>