-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
341 lines (320 loc) · 7.48 KB
/
index.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
import { HTMLClip, loadPlugin, CSSEffect } from "@donkeyclip/motorcortex";
import Player from "@donkeyclip/motorcortex-player";
import TitlesPlugin from "../dist/motorcortex-animetitles.esm";
const Titles = loadPlugin(TitlesPlugin);
const clip = new HTMLClip({
css: `
body{
background-color : white;
}
.container{
position: relative;
background:linear-gradient(141deg, #ccc 25%, #eee 40%, #ddd 55%);
height:100%;
display: flex;
justify-content: space-around;
align-items: center;
flex-direction: column;
}
.row{
display: flex;
justify-content: space-around;
align-items: center;
}
.cel{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
position: absolute;
}
.full{
display: flex;
justify-content: center;
align-items: center;
}
`,
html: `
<div class="container">
<div class="row" >
<div class="cel"> <div class="textreveal full"></div> </div>
<div class="cel"> <div class="rotatedtextreveal full"></div> </div>
<div class="cel"> <div class="rollingtext full"></div> </div>
<div class="cel"><div class="svgborder full"></div> </div>
<div class="cel"> <div class="rotatedline full"></div> </div>
<div class="cel"> <div class="rotatedlinereveal full"></div> </div>
<div class="cel"><div class="svgdraw full"></div> </div>
<div class="cel"><div class="circle full"></div> </div>
<div class="cel"><div class="logobox full"></div> </div>
<div class="cel"><div class="textwriting full"></div> </div>
<div class="cel"><div class="rightopacity full"></div> </div>
<div class="cel"><div class="letterscale full"></div> </div>
<div class="cel"><div class="circulartext full"></div> </div>
</div>
</div>
`,
fonts: [
{
type: `google-font`,
src: `https://fonts.googleapis.com/css2?family=Rubik+Mono+One&display=swap`,
},
{
type: `google-font`,
src: `https://fonts.googleapis.com/css2?family=Righteous&display=swap`,
},
{
type: "google-font",
src: "https://fonts.googleapis.com/css2?family=Commissioner:wght@100;200;300;400;500;600;700;800;900&display=swap",
},
],
host: document.getElementById("clip"),
containerParams: {
width: "1280px",
height: "720px",
},
});
const rolinText = new Titles.RollingText(
{
width: 450,
size: "XL",
lineColor: "#ff0000",
textColor: "#000",
subTitle1: "The",
subTitle2: "MotorCortex Team",
subTitle3: "Presents",
stopOnLast: false,
delayEnd: 1000,
fontFamily: "Commissioner",
},
{
selector: ".rollingtext",
}
);
const rotatedlinereveal = new Titles.RotatedLineReveal(
{
width: 800,
size: "M",
lineColor: "#ff0000",
textColor: "#000",
title: "Animetitles",
subtitle: "MC Plugin",
leftEnd: 100,
stopOnLast: false,
fontFamily: "Commissioner",
},
{
selector: ".rotatedlinereveal",
}
);
const rotatedline = new Titles.RotatedLine(
{
width: 400,
size: "XL",
lineColor: "#ff0000",
textColor: "#000",
subTitle1: "Minimal",
subTitle2: "Elegant",
subTitle3: "Modern",
title: "Title",
stopOnLast: false,
fontFamily: "Commissioner",
},
{
selector: ".rotatedline",
}
);
const svgborder = new Titles.SvgBorder(
{
size: "L",
lineColor: "#ff0000",
textColor: "#000",
subTitle: "Developed by",
slogan: "-KMB-",
title: "MotorCortex Team",
stopOnLast: false,
fontFamily: "Commissioner",
borderGap: 300,
},
{
selector: ".svgborder",
}
);
const circle = new Titles.Circle(
{
fontSize: 70,
circleColor: "#ff0000",
textColor: "#000",
title: "ANIMATED",
subTitle: "TITLES",
stopOnLast: false,
fontFamily: "Righteous",
width: 500,
},
{
selector: ".circle",
}
);
const logobox = new Titles.LogoBox(
{
size: 2,
textColor: "#fff",
bgColor: "#000",
subTitle1: "TYPOGRAPHY",
subTitle2: "ANIMATION",
subTitle3: "BY",
width: 200,
stopOnLast: false,
fontFamily: "Commissioner",
logoUrl:
"https://donkeyclip.github.io/motorcortex-animetitles/demo/assets/logo.png",
},
{
selector: ".logobox",
}
);
const RightOpacity = new Titles.RightOpacity(
{
width: 1000,
height: 250,
text: "RightOpacity",
color: "#0000",
fontSize: 100,
stroke: true,
strokeSize: 2,
strokeColor: "rebeccapurple",
fontFamily: "Rubik Mono One",
exitTime: 1000,
},
{
duration: 3000,
selector: ".rightopacity",
}
);
const rightopacityOpacity = new CSSEffect(
{
animatedAttrs: {
opacity: 1,
},
initialValues: {
opacity: 0,
},
},
{
duration: 1,
selector: ".rightopacity",
}
);
const LetterScale = new Titles.LetterScale(
{
width: 900,
height: 900,
color: "rebeccapurple",
text: "LetterScale",
fontSize: 100,
stroke: false,
strokeSize: 2,
strokeColor: "rebeccapurple",
fontFamily: "Righteous",
},
{
selector: ".letterscale",
}
);
const LetterScaleOpacity = new CSSEffect(
{
animatedAttrs: {
opacity: 1,
},
initialValues: {
opacity: 0,
},
},
{
duration: 1,
selector: ".letterscale",
}
);
const LetterScaleOpacityBack = new CSSEffect(
{
animatedAttrs: {
opacity: 0,
},
},
{
duration: 1,
selector: ".letterscale",
}
);
const CircularText = new Titles.CircularText(
{
width: 500,
height: 500,
color: "#ff0000",
text: "CircularText - AnimeTitles - MotorCortex - Plugin -",
fontSize: 10,
viewBox: 100,
path: 38,
fill: "#ff000000",
fontFamily: "Righteous",
},
{
selector: ".circulartext",
repeats: 2,
}
);
const CircularTextOpacity = new CSSEffect(
{
animatedAttrs: {
opacity: 1,
},
initialValues: {
opacity: 0,
},
},
{
duration: 1,
selector: ".circulartext",
}
);
const TextRevealIncident = new Titles.TextReveal(
{
text: "Reveal Incident",
width: 500,
color: "black",
fontFamily: "Righteous",
fontSize: 40,
stagger: "0, 300,0.5,linear,omni",
exit: "bottom",
textTransform: "none",
},
{ duration: 2000, selector: ".textreveal" }
);
const RotatedTextRevealIncident = new Titles.RotatedTextReveal(
{
text: "Rotated Reveal Incident",
width: 600,
color: "black",
fontFamily: "Righteous",
fontSize: 40,
stagger: "0, 300",
exitTime: 1000,
textTransform: "none",
},
{ duration: 2000, selector: ".rotatedtextreveal" }
);
clip.addIncident(TextRevealIncident, 0);
clip.addIncident(RotatedTextRevealIncident, clip.calculatedDuration);
clip.addIncident(rolinText, clip.calculatedDuration);
clip.addIncident(rotatedlinereveal, clip.calculatedDuration);
clip.addIncident(svgborder, clip.calculatedDuration);
clip.addIncident(rotatedline, clip.calculatedDuration);
clip.addIncident(circle, clip.calculatedDuration);
clip.addIncident(logobox, clip.calculatedDuration);
clip.addIncident(rightopacityOpacity, clip.calculatedDuration);
clip.addIncident(RightOpacity, clip.calculatedDuration);
clip.addIncident(LetterScaleOpacity, clip.calculatedDuration);
clip.addIncident(LetterScale, clip.calculatedDuration);
clip.addIncident(LetterScaleOpacityBack, clip.calculatedDuration);
clip.addIncident(CircularTextOpacity, clip.calculatedDuration);
clip.addIncident(CircularText, clip.calculatedDuration);
new Player({ clip });