marquee-content 3.1.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +30 -14
- package/dist/index.js +101 -116
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +99 -114
- package/dist/index.module.js.map +1 -1
- package/package.json +5 -6
- package/src/index.js +45 -53
- package/src/utils.js +95 -0
- package/dist/index.468c551c.js +0 -764
- package/dist/index.html +0 -262
- package/src/index.html +0 -150
- package/src/utils/animation.js +0 -39
- package/src/utils/breakpoints.js +0 -11
- package/src/utils/clearTimeline.js +0 -10
- package/src/utils/cloning.js +0 -22
- package/src/utils/skewed.js +0 -18
- package/src/utils/update.js +0 -15
package/dist/index.html
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="ru">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="robots" content="index, follow">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
|
|
7
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
8
|
-
<title></title>
|
|
9
|
-
<style>html {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
font-family: system-ui, -apple-system, Open Sans, Helvetica Neue, Arial, Noto Sans, Liberation Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
|
12
|
-
font-size: 10px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
body {
|
|
16
|
-
--c-cells: #f2f2f2;
|
|
17
|
-
font-feature-settings: "kern" 1, "liga" 0;
|
|
18
|
-
background-image: -o-linear-gradient(45deg, var(--c-cells) 25%, transparent 25%), -o-linear-gradient(135deg, var(--c-cells) 25%, transparent 25%), -o-linear-gradient(45deg, transparent 75%, var(--c-cells) 75%), -o-linear-gradient(135deg, transparent 75%, var(--c-cells) 75%);
|
|
19
|
-
background-image: linear-gradient(45deg, var(--c-cells) 25%, transparent 25%), linear-gradient(-45deg, var(--c-cells) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--c-cells) 75%), linear-gradient(-45deg, transparent 75%, var(--c-cells) 75%);
|
|
20
|
-
width: 100vw;
|
|
21
|
-
background-position: 0 0, 0 1rem, 1rem -1rem, -1rem 0;
|
|
22
|
-
background-size: 2rem 2rem;
|
|
23
|
-
margin: 40px;
|
|
24
|
-
font-size: 1.6rem;
|
|
25
|
-
font-weight: 400;
|
|
26
|
-
line-height: 1.5;
|
|
27
|
-
overflow-x: clip;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
marquee-content {
|
|
31
|
-
width: 100vw;
|
|
32
|
-
pointer-events: none;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
align-items: center;
|
|
35
|
-
display: flex;
|
|
36
|
-
position: relative;
|
|
37
|
-
overflow: hidden;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
marquee-content > * {
|
|
41
|
-
will-change: transform;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
html {
|
|
45
|
-
font-family: system-ui, -apple-system, Open Sans, Helvetica Neue, Arial, Noto Sans, Liberation Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
|
46
|
-
font-size: 10px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
body {
|
|
50
|
-
font-feature-settings: "kern" 1, "liga" 0;
|
|
51
|
-
color: #444;
|
|
52
|
-
margin: 80px 0 400px;
|
|
53
|
-
font-size: 1.6rem;
|
|
54
|
-
font-weight: 400;
|
|
55
|
-
line-height: 1.5;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
html, body, input, textarea, button {
|
|
59
|
-
-webkit-font-smoothing: subpixel-antialiased;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.marquee-content {
|
|
63
|
-
pointer-events: none;
|
|
64
|
-
max-width: 100vw;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
align-items: center;
|
|
67
|
-
display: flex;
|
|
68
|
-
position: relative;
|
|
69
|
-
overflow: hidden;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.font {
|
|
73
|
-
white-space: nowrap;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.alkatra {
|
|
77
|
-
font-family: Alkatra, cursive;
|
|
78
|
-
font-size: 48px;
|
|
79
|
-
font-weight: 700;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.anton {
|
|
83
|
-
font-family: Anton, sans-serif;
|
|
84
|
-
font-size: 40px;
|
|
85
|
-
font-weight: 700;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.pt {
|
|
89
|
-
font-family: PT Sans Narrow, sans-serif;
|
|
90
|
-
font-size: 52px;
|
|
91
|
-
font-weight: 400;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.lobster {
|
|
95
|
-
font-family: Lobster, cursive;
|
|
96
|
-
font-size: 50px;
|
|
97
|
-
font-weight: 400;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.prompt {
|
|
101
|
-
font-family: Prompt, sans-serif;
|
|
102
|
-
font-size: 48px;
|
|
103
|
-
font-weight: 500;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
ul {
|
|
107
|
-
align-items: center;
|
|
108
|
-
margin: 0;
|
|
109
|
-
padding: 0;
|
|
110
|
-
list-style: none;
|
|
111
|
-
display: flex;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
li {
|
|
115
|
-
text-align: center;
|
|
116
|
-
padding: 0 10px;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.example-1 li {
|
|
120
|
-
background: url("data:image/svg xml,<svg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M15.0527 10.9474L13 0L10.9473 10.9474L0 13L10.9473 15.0526L13 26L15.0527 15.0526L26 13L15.0527 10.9474Z' fill='#444444'/></svg>")center left 20px / 26px 26pxno-repeat;
|
|
121
|
-
padding: 0 0 0 66px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.example-2 li {
|
|
125
|
-
padding: 0 15px;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.example-3 li {
|
|
129
|
-
padding: 0 0 0 56px;
|
|
130
|
-
position: relative;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.example-3 li:before {
|
|
134
|
-
content: "";
|
|
135
|
-
width: 7px;
|
|
136
|
-
height: 7px;
|
|
137
|
-
background: #444;
|
|
138
|
-
border-radius: 100%;
|
|
139
|
-
margin: auto;
|
|
140
|
-
position: absolute;
|
|
141
|
-
inset: 0 -33px 0 auto;
|
|
142
|
-
transform: translateY(5px);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.example-4 {
|
|
146
|
-
text-transform: uppercase;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.data-code {
|
|
150
|
-
max-width: 1400px;
|
|
151
|
-
margin: 0 auto;
|
|
152
|
-
padding: 120px 20px 30px;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.data-code strong {
|
|
156
|
-
border: 1px dotted #ccc;
|
|
157
|
-
padding: 5px 12px;
|
|
158
|
-
display: inline-flex;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
</style>
|
|
162
|
-
</head>
|
|
163
|
-
<body>
|
|
164
|
-
<section class="example-1">
|
|
165
|
-
<marquee-content data-mc-duration="60" role="marquee">
|
|
166
|
-
<ul class="font alkatra">
|
|
167
|
-
<li>Monarch</li>
|
|
168
|
-
<li>Benassi</li>
|
|
169
|
-
<li>Air Max</li>
|
|
170
|
-
<li>Cortez</li>
|
|
171
|
-
<li>Jordan</li>
|
|
172
|
-
<li>Presto</li>
|
|
173
|
-
<li>Vomero</li>
|
|
174
|
-
<li>Pegasus</li>
|
|
175
|
-
</ul>
|
|
176
|
-
</marquee-content>
|
|
177
|
-
</section>
|
|
178
|
-
|
|
179
|
-
<section class="example-7">
|
|
180
|
-
<marquee-content data-mc-duration="20" role="marquee">
|
|
181
|
-
<ul>
|
|
182
|
-
<li><img src="//fastly.picsum.photos/id/634/180/100.jpg?hmac=qB-PFAiiEVuXFwVxRbYUzImrQ4RZ2np6oWeK-XHPnXk" alt=""></li>
|
|
183
|
-
<li><img src="//fastly.picsum.photos/id/719/180/100.jpg?hmac=_Toti9aQVjjnNHabofyq_la4a0kIFSDp3o65zxnvtRY" alt=""></li>
|
|
184
|
-
<li><img src="//fastly.picsum.photos/id/235/180/100.jpg?hmac=5KlYbDb93R7me0GThn6FFoK_OZ8ziPn-fb98FHIMb5c" alt=""></li>
|
|
185
|
-
<li><img src="//fastly.picsum.photos/id/1050/180/100.jpg?hmac=f9i0nGYKBetkohJors44GETXmUhSbLcXMUlSvMCluJY" alt=""></li>
|
|
186
|
-
</ul>
|
|
187
|
-
</marquee-content>
|
|
188
|
-
</section>
|
|
189
|
-
|
|
190
|
-
<section class="example-2">
|
|
191
|
-
<marquee-content data-mc-duration="60" data-mc-direction="ltr" role="marquee">
|
|
192
|
-
<ul>
|
|
193
|
-
<li><span class="font anton">Monarch</span></li>
|
|
194
|
-
<li><span class="font pt">Benassi</span></li>
|
|
195
|
-
<li><span class="font lobster">Air Max</span></li>
|
|
196
|
-
<li><span class="font prompt">Cortez</span></li>
|
|
197
|
-
<li><span class="font anton">Jordan</span></li>
|
|
198
|
-
<li><span class="font pt">Presto</span></li>
|
|
199
|
-
<li><span class="font prompt">Tempo</span></li>
|
|
200
|
-
<li><span class="font anton">Vomero</span></li>
|
|
201
|
-
<li><span class="font pt">Pegasus</span></li>
|
|
202
|
-
</ul>
|
|
203
|
-
</marquee-content>
|
|
204
|
-
</section>
|
|
205
|
-
|
|
206
|
-
<section class="example-3">
|
|
207
|
-
<marquee-content data-mc-duration="60" data-mc-direction="auto" role="marquee">
|
|
208
|
-
<ul class="font lobster">
|
|
209
|
-
<li>Monarch</li>
|
|
210
|
-
<li>Benassi</li>
|
|
211
|
-
<li>Air Max</li>
|
|
212
|
-
<li>Cortez</li>
|
|
213
|
-
<li>Jordan</li>
|
|
214
|
-
<li>Presto</li>
|
|
215
|
-
<li>Tempo</li>
|
|
216
|
-
<li>Vomero</li>
|
|
217
|
-
<li>Pegasus</li>
|
|
218
|
-
</ul>
|
|
219
|
-
</marquee-content>
|
|
220
|
-
</section>
|
|
221
|
-
|
|
222
|
-
<section class="example-4">
|
|
223
|
-
<marquee-content data-mc-duration="60" data-mc-skew="-3" role="marquee">
|
|
224
|
-
<ul class="font pt">
|
|
225
|
-
<li>Monarch</li>
|
|
226
|
-
<li>Benassi</li>
|
|
227
|
-
<li>Air Max</li>
|
|
228
|
-
<li>Cortez</li>
|
|
229
|
-
<li>Jordan</li>
|
|
230
|
-
<li>Presto</li>
|
|
231
|
-
<li>Tempo</li>
|
|
232
|
-
<li>Vomero</li>
|
|
233
|
-
<li>Pegasus</li>
|
|
234
|
-
</ul>
|
|
235
|
-
</marquee-content>
|
|
236
|
-
</section>
|
|
237
|
-
|
|
238
|
-
<section class="example-6">
|
|
239
|
-
<marquee-content data-mc-duration="5" data-mc-max="992" role="marquee">
|
|
240
|
-
<ul class="font pt">
|
|
241
|
-
<li>Jordan</li>
|
|
242
|
-
</ul>
|
|
243
|
-
</marquee-content>
|
|
244
|
-
</section>
|
|
245
|
-
|
|
246
|
-
<section class="example-5">
|
|
247
|
-
<marquee-content data-mc-duration="5" data-mc-min="992" role="marquee">
|
|
248
|
-
<ul class="font pt">
|
|
249
|
-
<li>Cortez</li>
|
|
250
|
-
</ul>
|
|
251
|
-
</marquee-content>
|
|
252
|
-
</section>
|
|
253
|
-
|
|
254
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
|
|
255
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/ScrollTrigger.min.js"></script>
|
|
256
|
-
<script src="/index.468c551c.js" defer=""></script>
|
|
257
|
-
<script>gsap.registerPlugin(ScrollTrigger);
|
|
258
|
-
MarqueeContent.registerGSAP(gsap);
|
|
259
|
-
|
|
260
|
-
</script>
|
|
261
|
-
</body>
|
|
262
|
-
</html>
|
package/src/index.html
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="ru">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="robots" content="index, follow" />
|
|
6
|
-
<meta
|
|
7
|
-
name="viewport"
|
|
8
|
-
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"
|
|
9
|
-
/>
|
|
10
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
11
|
-
<title></title>
|
|
12
|
-
<style>
|
|
13
|
-
html {
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
font-family: system-ui, -apple-system, "Open Sans", "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
16
|
-
font-size: 10px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
body {
|
|
20
|
-
--c-cells: hsl(0 0% 95%);
|
|
21
|
-
font-feature-settings: "kern" 1,"liga" 0;
|
|
22
|
-
font-size: 1.6rem;
|
|
23
|
-
font-weight: 400;
|
|
24
|
-
line-height: 1.5;
|
|
25
|
-
background-image: -o-linear-gradient(45deg,var(--c-cells) 25%,transparent 25%),-o-linear-gradient(135deg,var(--c-cells) 25%,transparent 25%),-o-linear-gradient(45deg,transparent 75%,var(--c-cells) 75%),-o-linear-gradient(135deg,transparent 75%,var(--c-cells) 75%);
|
|
26
|
-
background-image: linear-gradient(45deg,var(--c-cells) 25%,transparent 25%),linear-gradient(-45deg,var(--c-cells) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--c-cells) 75%),linear-gradient(-45deg,transparent 75%,var(--c-cells) 75%);
|
|
27
|
-
background-size: 2rem 2rem;
|
|
28
|
-
background-position: 0 0,0 1rem,1rem -1rem,-1rem 0;
|
|
29
|
-
margin: 40px;
|
|
30
|
-
width: 100vw;
|
|
31
|
-
overflow-x: clip;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
marquee-content {
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
position: relative;
|
|
37
|
-
width: 100vw;
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
align-items: center;
|
|
41
|
-
pointer-events: none;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
marquee-content > * {
|
|
45
|
-
will-change: transform;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
html{font-family: system-ui, -apple-system, "Open Sans", "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-size: 10px}body{margin: 80px 0 400px;font-feature-settings: "kern" 1,"liga" 0;font-size: 1.6rem;font-weight: 400;line-height: 1.5;color: #444}html,body,input,textarea,button{-webkit-font-smoothing: subpixel-antialiased}.marquee-content{pointer-events: none;max-width: 100vw;justify-content: center;align-items: center;display: flex;position: relative;overflow: hidden}.font{white-space: nowrap}.alkatra{font-family: 'Alkatra', cursive;font-weight: 700;font-size: 48px}.anton{font-family: 'Anton', sans-serif;font-weight: 700;font-size: 40px}.pt{font-family: 'PT Sans Narrow', sans-serif;font-weight: 400;font-size: 52px}.lobster{font-family: 'Lobster', cursive;font-weight: 400;font-size: 50px}.prompt{font-family: 'Prompt', sans-serif;font-weight: 500;font-size: 48px}ul{list-style: none;margin: 0;padding: 0;display: flex;align-items: center}li{padding: 0 10px;text-align: center}.example-1 li{padding: 0 0 0 66px;background:url("data:image/svg xml,<svg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M15.0527 10.9474L13 0L10.9473 10.9474L0 13L10.9473 15.0526L13 26L15.0527 15.0526L26 13L15.0527 10.9474Z' fill='#444444'/></svg>")center left 20px / 26px 26pxno-repeat}.example-2 li{padding: 0 15px}.example-3 li{position: relative;padding: 0 0 0 56px}.example-3 li::before{content: '';position: absolute;top: 0;right: -33px;bottom: 0;left: auto;margin: auto;width: 7px;height: 7px;transform: translateY(5px);background: #444;border-radius: 100%}.example-4{text-transform: uppercase}.data-code{margin: 0 auto;padding: 120px 20px 30px;max-width: 1400px}.data-code strong{display: inline-flex;padding: 5px 12px;border: 1px dotted #ccc}
|
|
49
|
-
</style>
|
|
50
|
-
</head>
|
|
51
|
-
<body>
|
|
52
|
-
<section class="example-1">
|
|
53
|
-
<marquee-content data-mc-duration="60" role="marquee">
|
|
54
|
-
<ul class="font alkatra">
|
|
55
|
-
<li>Monarch</li>
|
|
56
|
-
<li>Benassi</li>
|
|
57
|
-
<li>Air Max</li>
|
|
58
|
-
<li>Cortez</li>
|
|
59
|
-
<li>Jordan</li>
|
|
60
|
-
<li>Presto</li>
|
|
61
|
-
<li>Vomero</li>
|
|
62
|
-
<li>Pegasus</li>
|
|
63
|
-
</ul>
|
|
64
|
-
</marquee-content>
|
|
65
|
-
</section>
|
|
66
|
-
|
|
67
|
-
<section class="example-7">
|
|
68
|
-
<marquee-content data-mc-duration="20" role="marquee">
|
|
69
|
-
<ul>
|
|
70
|
-
<li><img src="//fastly.picsum.photos/id/634/180/100.jpg?hmac=qB-PFAiiEVuXFwVxRbYUzImrQ4RZ2np6oWeK-XHPnXk" alt=""/></li>
|
|
71
|
-
<li><img src="//fastly.picsum.photos/id/719/180/100.jpg?hmac=_Toti9aQVjjnNHabofyq_la4a0kIFSDp3o65zxnvtRY" alt=""/></li>
|
|
72
|
-
<li><img src="//fastly.picsum.photos/id/235/180/100.jpg?hmac=5KlYbDb93R7me0GThn6FFoK_OZ8ziPn-fb98FHIMb5c" alt=""/></li>
|
|
73
|
-
<li><img src="//fastly.picsum.photos/id/1050/180/100.jpg?hmac=f9i0nGYKBetkohJors44GETXmUhSbLcXMUlSvMCluJY" alt=""/></li>
|
|
74
|
-
</ul>
|
|
75
|
-
</marquee-content>
|
|
76
|
-
</section>
|
|
77
|
-
|
|
78
|
-
<section class="example-2">
|
|
79
|
-
<marquee-content data-mc-duration="60" data-mc-direction="ltr" role="marquee">
|
|
80
|
-
<ul>
|
|
81
|
-
<li><span class="font anton">Monarch</span></li>
|
|
82
|
-
<li><span class="font pt">Benassi</span></li>
|
|
83
|
-
<li><span class="font lobster">Air Max</span></li>
|
|
84
|
-
<li><span class="font prompt">Cortez</span></li>
|
|
85
|
-
<li><span class="font anton">Jordan</span></li>
|
|
86
|
-
<li><span class="font pt">Presto</span></li>
|
|
87
|
-
<li><span class="font prompt">Tempo</span></li>
|
|
88
|
-
<li><span class="font anton">Vomero</span></li>
|
|
89
|
-
<li><span class="font pt">Pegasus</span></li>
|
|
90
|
-
</ul>
|
|
91
|
-
</marquee-content>
|
|
92
|
-
</section>
|
|
93
|
-
|
|
94
|
-
<section class="example-3">
|
|
95
|
-
<marquee-content data-mc-duration="60" data-mc-direction="auto" role="marquee">
|
|
96
|
-
<ul class="font lobster">
|
|
97
|
-
<li>Monarch</li>
|
|
98
|
-
<li>Benassi</li>
|
|
99
|
-
<li>Air Max</li>
|
|
100
|
-
<li>Cortez</li>
|
|
101
|
-
<li>Jordan</li>
|
|
102
|
-
<li>Presto</li>
|
|
103
|
-
<li>Tempo</li>
|
|
104
|
-
<li>Vomero</li>
|
|
105
|
-
<li>Pegasus</li>
|
|
106
|
-
</ul>
|
|
107
|
-
</marquee-content>
|
|
108
|
-
</section>
|
|
109
|
-
|
|
110
|
-
<section class="example-4">
|
|
111
|
-
<marquee-content data-mc-duration="60" data-mc-skew="-3" role="marquee">
|
|
112
|
-
<ul class="font pt">
|
|
113
|
-
<li>Monarch</li>
|
|
114
|
-
<li>Benassi</li>
|
|
115
|
-
<li>Air Max</li>
|
|
116
|
-
<li>Cortez</li>
|
|
117
|
-
<li>Jordan</li>
|
|
118
|
-
<li>Presto</li>
|
|
119
|
-
<li>Tempo</li>
|
|
120
|
-
<li>Vomero</li>
|
|
121
|
-
<li>Pegasus</li>
|
|
122
|
-
</ul>
|
|
123
|
-
</marquee-content>
|
|
124
|
-
</section>
|
|
125
|
-
|
|
126
|
-
<section class="example-6">
|
|
127
|
-
<marquee-content data-mc-duration="5" data-mc-max="992" role="marquee">
|
|
128
|
-
<ul class="font pt">
|
|
129
|
-
<li>Jordan</li>
|
|
130
|
-
</ul>
|
|
131
|
-
</marquee-content>
|
|
132
|
-
</section>
|
|
133
|
-
|
|
134
|
-
<section class="example-5">
|
|
135
|
-
<marquee-content data-mc-duration="5" data-mc-min="992" role="marquee">
|
|
136
|
-
<ul class="font pt">
|
|
137
|
-
<li>Cortez</li>
|
|
138
|
-
</ul>
|
|
139
|
-
</marquee-content>
|
|
140
|
-
</section>
|
|
141
|
-
|
|
142
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
|
|
143
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/ScrollTrigger.min.js"></script>
|
|
144
|
-
<script type="module" src="index.js"></script>
|
|
145
|
-
<script>
|
|
146
|
-
gsap.registerPlugin(ScrollTrigger);
|
|
147
|
-
MarqueeContent.registerGSAP(gsap);
|
|
148
|
-
</script>
|
|
149
|
-
</body>
|
|
150
|
-
</html>
|
package/src/utils/animation.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import clearTimeline from './clearTimeline';
|
|
2
|
-
|
|
3
|
-
function animation() {
|
|
4
|
-
if (this.timeline) {
|
|
5
|
-
clearTimeline.call(this);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
this.MM.add(this.breakpoint, () => {
|
|
9
|
-
this.timeline = this.gsap.to(this.children, {
|
|
10
|
-
duration: this.dataset.mcDuration || 20,
|
|
11
|
-
x: '-100%',
|
|
12
|
-
repeat: -1,
|
|
13
|
-
ease: 'none',
|
|
14
|
-
scrollTrigger: {
|
|
15
|
-
trigger: this,
|
|
16
|
-
start: 'top bottom',
|
|
17
|
-
end: 'bottom top',
|
|
18
|
-
toggleActions: 'resume pause resume pause',
|
|
19
|
-
onUpdate: (self) => {
|
|
20
|
-
if (this.dataset.mcDirection === 'ltr') {
|
|
21
|
-
this.timeline.timeScale(-1);
|
|
22
|
-
} else if (this.dataset.mcDirection === 'auto') {
|
|
23
|
-
this.timeline.timeScale(self.direction);
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
this.timeline.totalProgress(0.5);
|
|
30
|
-
|
|
31
|
-
return () => {
|
|
32
|
-
if (this.timeline) {
|
|
33
|
-
clearTimeline.call(this);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default animation;
|
package/src/utils/breakpoints.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function breakpoints() {
|
|
2
|
-
this.breakpoint = '';
|
|
3
|
-
|
|
4
|
-
if (this.dataset.mcMax) {
|
|
5
|
-
this.breakpoint = `(max-width: ${this.dataset.mcMax - 0.02}px)`;
|
|
6
|
-
} else if (this.dataset.mcMin) {
|
|
7
|
-
this.breakpoint = `(min-width: ${this.dataset.mcMin}px)`;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default breakpoints;
|
package/src/utils/cloning.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
function cloning() {
|
|
2
|
-
const removingClones = () => {
|
|
3
|
-
while (this.childElementCount > 1) {
|
|
4
|
-
this.removeChild(this.lastChild);
|
|
5
|
-
}
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
removingClones();
|
|
9
|
-
|
|
10
|
-
this.MM.add(this.breakpoint, () => {
|
|
11
|
-
const requiredQuantity = Math.ceil(this.scrollWidth / this.firstElementChild.clientWidth + 2);
|
|
12
|
-
|
|
13
|
-
if (this.childElementCount < requiredQuantity) {
|
|
14
|
-
const clones = Array.from({ length: requiredQuantity - 1 }, () => this.firstElementChild.cloneNode(true));
|
|
15
|
-
this.append(...clones);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return removingClones;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default cloning;
|
package/src/utils/skewed.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
function skewed() {
|
|
2
|
-
if (!this.dataset.mcSkew) return;
|
|
3
|
-
|
|
4
|
-
const abs = Math.abs(parseInt(this.dataset.mcSkew, 10));
|
|
5
|
-
const { style } = this;
|
|
6
|
-
|
|
7
|
-
this.MM.add(this.breakpoint, () => {
|
|
8
|
-
style.transformOrigin = 'center center';
|
|
9
|
-
style.transform = `skew(0deg, ${this.dataset.mcSkew}deg)`;
|
|
10
|
-
style.minHeight = `calc(${abs * 1.25}vh + ${abs * 1.25}vw)`;
|
|
11
|
-
|
|
12
|
-
return () => {
|
|
13
|
-
style.cssText = 'transform-origin: unset; transform: unset; min-height: unset;';
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default skewed;
|
package/src/utils/update.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import cloning from './cloning';
|
|
2
|
-
import animation from './animation';
|
|
3
|
-
|
|
4
|
-
function update() {
|
|
5
|
-
cancelAnimationFrame(this.af);
|
|
6
|
-
|
|
7
|
-
if (this.firstElementChild) {
|
|
8
|
-
this.af = requestAnimationFrame(() => {
|
|
9
|
-
cloning.call(this);
|
|
10
|
-
animation.call(this);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default update;
|