-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.html
More file actions
106 lines (98 loc) · 2.68 KB
/
start.html
File metadata and controls
106 lines (98 loc) · 2.68 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://codepen.io/GreenSock/pen/xxmzBrw.css">
<!-- <link rel="stylesheet" href="style.css"> -->
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.wrapper,
.content {
position: relative;
width: 100%;
z-index: 1;
}
.content {
overflow-x: hidden;
}
.content .section {
width: 100%;
height: 100vh;
}
.content .section.hero {
background-image: url(https://images.unsplash.com/photo-1589848315097-ba7b903cc1cc?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
.image-container {
width: 100%;
height: 100vh;
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 2;
perspective: 500px;
overflow: hidden;
}
.image-container img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center center;
}
</style>
<!-- <script defer src="main.js"></script> -->
<title>Scrolling Website to Imagination</title>
</head>
<body>
<div class="wrapper">
<div class="content">
<section class="section hero"></section>
<section class="section gradient-purple"></section>
<section class="section gradient-blue"></section>
</div>
<div class="image-container">
<img src="https://assets-global.website-files.com/63ec206c5542613e2e5aa784/643312a6bc4ac122fc4e3afa_main%20home.webp" alt="image">
</div>
</div>
</body>
<script>
console.clear();
gsap.registerPlugin(ScrollTrigger);
window.addEventListener("load", () => {
gsap
.timeline({
scrollTrigger: {
trigger: ".wrapper",
start: "top top",
end: "+=150%",
pin: true,
scrub: true,
markers: true
}
})
.to("img", {
scale: 2,
z: 350,
transformOrigin: "center center",
ease: "power1.inOut"
})
.to(
".section.hero",
{
scale: 1.1,
transformOrigin: "center center",
ease: "power1.inOut"
},
"<"
);
});
</script>
</html>