-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathapp.html
53 lines (50 loc) · 1.62 KB
/
app.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}>
{{ HEAD }}
</head>
<body {{ BODY_ATTRS }}>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FF1GKM9QVT"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-FF1GKM9QVT');
</script>
<script>
document.addEventListener('snipcart.ready', () => {
window.toggleDarkMode = function(isDarkMode){
const body = document.querySelector('body')
window.localStorage.setItem('isDarkMode', isDarkMode)
const lightModeColors = {
input: {
color: '#2e3338'
},
label: {
color: '#2e3338'
}
};
const darkModeColors = {
input: {
color: '#e6e6e6'
},
label: {
color: '#e6e6e6'
}
};
if(isDarkMode){
body.classList.add('dark-mode')
Snipcart.api.theme.customization.registerPaymentFormCustomization(darkModeColors);
}else{
body.classList.remove('dark-mode')
Snipcart.api.theme.customization.registerPaymentFormCustomization(lightModeColors);
}
}
window.toggleDarkMode(window.localStorage.getItem('isDarkMode') == null || window.localStorage.getItem('isDarkMode') == "false" ? false: true)
});
</script>
{{ APP }}
</body>
<script src="/loader.js"></script>
</html>