-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
206 lines (142 loc) Β· 5.13 KB
/
script.js
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// <!-- Initialize Swiper -->
// <!-- https://swiperjs.com/swiper-api#initialize-swiper -->
var swiper = new Swiper(".swiper", {
// autoplay: {
// delay: 5000,
// },
initialSlide: 0,
//centeredSlides: true,
//spaceBetween: 50,
freeMode: {
enabled: true,
sticky: false,
},
slidesPerView: 6,
loop: true,
mousewheel: {
enabled: true,
sensitivity: 0.5,
forceToAxis: true,
},
});
var swipertop = new Swiper(".swipertop", {
initialSlide: 0, //index number of initial slide.
freeMode: {
enabled: true,
sticky: false,
},
slidesPerView: 5,
loop: true,
mousewheel: {
enabled: true,
sensitivity: 0.5,
forceToAxis: true,
},
});
var mybswiper = new Swiper(".myb-swiper", {
initialSlide: 0, //index number of initial slide.
parallax: true,
speed: 1500,
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
renderBullet: function (index, className) {
if (index == 0)
return '<span class="' + className + ' barista' + (index + 1) + '"></span>';
if (index == 1)
return '<span class="' + className + ' barista' + (index + 1) + '"></span>';
if (index == 2)
return '<span class="' + className + ' barista' + (index + 1) + '"></span>';
if (index == 3)
return '<span class="' + className + ' barista' + (index + 1) + '"></span>';
if (index == 4)
return '<span class="' + className + ' barista' + (index + 1) + '"></span>';
if (index == 5)
return '<span class="' + className + ' barista' + (index + 1) + '"></span>';
}
},
autoplay: {
delay: 5000,
disableOnInteraction: true,
pauseOnMouseEnter: false, //was true blah blah
},
freeMode: {
enabled: true,
sticky: true,
},
slidesPerView: 1,
loop: true,
mousewheel: {
enabled: true,
sensitivity: 0.5,
forceToAxis: true,
},
});
//go to today's slide, shifted over by one
var dateobj = new Date();
var dayofweek = dateobj.getDay();
shiftedday = dayofweek - 1;
if (dayofweek == 0)
shiftedday = 6;
$($(".swiper-slide.top > .ttttoday")[dayofweek]).css("display", "flex");
//3x needed because of loop
swipertop.slideToLoop(shiftedday, 0);
swipertop.slideToLoop(shiftedday, 0);
swipertop.slideToLoop(shiftedday, 0);
//delay needed for DOM
//setTimeout(function(){
//$(".swiper-slide.top.swiper-slide-next > .ttttoday").css("display", "flex");
//},10);
// function test() {
const e = "\n display: inline-block;\n font-size: 14px;\n background: linear-gradient(to right, #455EEE, #985DD0, #B62286);\n color: white;\n padding: 4px;\n border-radius: 4px;";
const aaa = "color: white; font-family: sans-serif; font-size: 6vw; background: linear-gradient(45deg, #f36565, #5e7cc9, #83ae40); padding: 10px 10px 10px 10px;";
let t = "\n\n";
t += "π Increased conversion rates\n",
t += "π Increased average order value\n",
t += "π Increased customer lifetime value\n",
t += "\n\n",
t += "Learn more at: https://flowghost.com/\n\n",
t += "FLOW GHOST π»"
console.group("%cFLOW GHOST π»", aaa),
console.log(`%c${t}`, "font-size: 14px;"),
console.groupEnd(),
// }
//test();
console.log("%cFLOW GHOST π»", "color: white; font-family: sans-serif; font-size: 50px; background: linear-gradient(45deg, #f36565, #5e7cc9, #83ae40); padding: 10px 10px 10px 10px; border-radius: 25px; border: 5px solid #fefefe;");
// <!-- LOTTIE PRELOADER -->
// Return a promise that resolves to true once animation is loaded
async function animationLoaded (animation) {
if (animation.isLoaded) {
return true
}
return new Promise((resolve, reject) => {
animation.addEventListener('DOMLoaded', () => {
resolve(true)
})
})
}
// Return a promise that resolves to true once all animations are loaded
async function waitForAnimationsLoaded (animations) {
await Promise.all(animations.map(animationLoaded))
}
async function initAnimations () {
const lottie = Webflow.require('lottie').lottie
const animations = lottie.getRegisteredAnimations()
await waitForAnimationsLoaded(animations)
}
var Webflow = Webflow || []
Webflow.push(() => {
initAnimations()
.then(() => {
console.log('Initialized animations')
// hide splash screen
const splash = document.getElementById('splash')
splash.style.opacity = 0
setTimeout(() => splash.style.display = 'none', 200)
})
.catch((error) => {
console.error(error)
})
})
// <!-- END LOTTIE PRELOADER -->