-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
280 lines (245 loc) · 9.31 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Doze.studio</title>
<style>
html.lenis, html.lenis body {
height: auto;
}
.lenis.lenis-smooth {
scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
overscroll-behavior: contain;
}
.lenis.lenis-stopped {
overflow: hidden;
}
.lenis.lenis-smooth iframe {
pointer-events: none;
}
</style>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div class="w-full bg-zinc-900">
<div class="parent w-full relative h-[1000vh]">
<div class="w-full h-screen sticky top-0 left-0">
<canvas class="w-full h-screen" id="frame"></canvas>
<div class="absolute animate1 z-[2] text-white bottom-10 left-10">
<h1 class="leading-20 font-[100] text-3xl">© 2024 DOZE STD</h1>
<h1 class="text-3xl">SHAPING BRANDS - CRAFTING MOTION</h1>
</div>
<div
class="absolute animate2 flex z-[2] text-white bottom-10 w-1/2 right-10 text-right opacity-0"
>
<h1 class="leading-20 font-[100] uppercase text-6xl">
TRANSFORMING VISIONS
</h1>
<h1 class="text-xl w-1/2">
Building identity and inspiring action. Sculpting digital
experiences that resonate.
</h1>
</div>
<div
class="absolute animate3 z-[2] text-white top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center opacity-0"
>
<h1 class="leading-20 font-[100] uppercase text-7xl">
Elevating Aesthetics
</h1>
<h1 class="text-xl">
Crafting solutions and exploring new horizons. Evolving narratives
and elevating aesthetics in every project.
</h1>
</div>
<div
class="absolute z-[2] panelism text-white top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center text-6xl tracking-tighter opacity-0"
>
©panelism
<span class="line w-10 h-1 bg-white inline-block"></span>2048
</div>
<div
class="w-1/3 panel translate-x-full h-screen bg-white absolute right-0 top-0 z-[2] p-10"
>
<h3 class="panelelem text-xl font-[100]">©️ 2024 Doze.Std</h3>
<p class="panelelem mt-10 text-xl">
<b> Sculpting digital</b> <br /><br />
Transforming Visions into digital realities. Weaving stories that
captivate and innovate. Exploring new possibilities with a focus
on narrative evolution. Crafting solutions that engage and
elevate.
</p>
<button
class="panelelem border-[1px] px-3 py-2 border-[#555] font-[100] mt-6"
>
Get Reviews -
</button>
<div class="panelelem absolute bottom-10">
<h3 class="text-xl">Innovating Design</h3>
<p class="text-sm mt-3">
Connecting ideas to foster creativity. Designing impactful
experiences that resonate. Feel free to mix and match these
sections to suit your website's design needs!
</p>
<button
class="bg-black text-white px-7 text-sm mt-4 py-4 font-[100] capitalize"
>
experience
</button>
</div>
</div>
</div>
</div>
<div class="w-full p-10 bg-white footer">
<h1 class="text-7xl font-medium tracking-tighter">
® My Recent Works.
</h1>
<div class="w-[60%] headings p-3 flex flex-col gap-8 mt-24">
<h3 class="text-6xl"">
Frame-Sequence-Animation
</h3>
<h3 class="text-6xl">Printify-clone</h3>
<h3 class="text-6xl">ChokoBar-web</h3>
<h3 class="text-6xl">Elegant-Craft</h3>
<h3 class="text-6xl">Photo-Album</h3>
<h3 class="text-6xl">Image-Slider</h3>
<h3 class="text-6xl">Mahindra-thar-blog </h3>
<h3 class="text-6xl">Foody-Shop</h3>
<h3 class="text-6xl">CokaCola-clone</h3>
</div>
</div>
</div>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"
integrity="sha512-7eHRwcbYkK4d9g/6tD/mhkf++eoTHwpNM9woBxtPUBWm67zeAfFC+HrdoE2GanKeocly/VxeLvIqwvCdk7qScg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"
integrity="sha512-onMTRKJBKz8M1TnqqDuGBlowlH0ohFzMXYRNebz+yOcc5TQr/zAKsthzhuv0hiyUKEiQEQXEynnXCvNTOk50dg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script src="https://unpkg.com/[email protected]/dist/lenis.min.js"></script>
<script>
gsap.registerPlugin(ScrollTrigger);
const canvas = document.querySelector("canvas");
const context = canvas.getContext("2d");
const frames = {
currentIndex: 0,
maxIndex: 1345,
};
let imageLoaded = 0;
const images = [];
function preloadImage() {
for (let i = 1; i <= frames.maxIndex; i++) {
const imageUrl = `./awwward/frame_${i
.toString()
.padStart(4, "0")}.jpg`;
const img = new Image();
img.src = imageUrl;
img.onload = () => {
imageLoaded++;
if (imageLoaded === frames.maxIndex) {
console.log("All images Loaded");
loadImage(frames.currentIndex);
startAnimation();
}
};
images.push(img);
}
}
function loadImage(index) {
if (index >= 0 && index <= frames.maxIndex) {
const img = images[index];
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const scaleX = canvas.width / img.width;
const scaleY = canvas.height / img.height;
const scale = Math.max(scaleX, scaleY);
const newWidth = img.width * scale;
const newHeight = img.height * scale;
const offsetX = (canvas.width - newWidth) / 2;
const offsetY = (canvas.height - newHeight) / 2;
context.clearRect(0, 0, canvas.width, canvas.height);
context.imageSmoothingQuality = "high";
context.imageSmoothingEnabled = true;
context.drawImage(img, offsetX, offsetY, newWidth, newHeight);
frames.currentIndex = index;
}
}
function startAnimation() {
var tl = gsap.timeline({
scrollTrigger: {
trigger: ".parent",
start: "top top",
scrub: 2,
end: "bottom bottom",
// markers: true,
},
});
function updateFrame(index) {
return {
ease: "linear",
currentIndex: index,
onUpdate: function () {
loadImage(Math.floor(frames.currentIndex));
},
};
}
tl.to(frames, updateFrame(100), "first")
.to(".animate1", { opacity: 1 }, "first")
.to(frames, updateFrame(200), "second")
.to(".animate1", { opacity: 0 }, "second")
.to(frames, updateFrame(300), "third")
.to(".animate2", { opacity: 1 }, "third")
.to(frames, updateFrame(400), "fourth")
.to(".animate2", { opacity: 0 }, "fourth")
.to(frames, updateFrame(500), "fifth")
.to(".animate3", { opacity: 1 }, "fifth")
.to(frames, updateFrame(600), "sixth")
.to(".animate3", { opacity: 0 }, "sixth")
.to(frames, updateFrame(700), "seventh")
.to(".panel", { x: "0%", ease: "expo" }, "seventh")
.to(frames, updateFrame(700), "eighth")
.to(".panel", { x: "0%", ease: "expo" }, "eighth")
.to(frames, updateFrame(800), "ninth")
.to(".panel", { opacity: 0, ease: "linear" }, "ninth")
.to(frames, updateFrame(900), "tenth")
.to("canvas", { scale: 0.5, ease: "linear" }, "tenth")
.to(frames, updateFrame(1000), "eleventh")
.to(".panelism", { opacity: 1, ease: "expo" }, "eleventh")
.to(frames, updateFrame(1100), "eleventh")
.to(".panelism span", { width: 200, ease: "expo" }, "eleventh")
.to(frames, updateFrame(1200), "twelvth")
.to("canvas", { scale: 1, ease: "linear" }, "twelvth")
.to(frames, updateFrame(1330), "thirteenth")
.to(".panelism", { scale: 2, ease: "circ" }, "thirteenth");
}
const lenis = new Lenis()
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf)
preloadImage();
window.addEventListener("resize", function () {
loadImage(Math.floor(frames.currentIndex));
});
document.querySelectorAll(".headings h3").forEach((elem) => {
gsap.from(elem, {
scrollTrigger: {
trigger: elem,
start: "top 90%",
end: "bottom 20%",
scrub: 2,
},
opacity: 0.3,
});
});
</script>
</body>
</html>