Skip to content

Commit 7df8e59

Browse files
committed
add parallax website
1 parent 368227b commit 7df8e59

File tree

4 files changed

+45
-12
lines changed

4 files changed

+45
-12
lines changed

99-parallax website/index.html

+3-11
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,9 @@ <h4>yayavar</h4>
1717
</nav>
1818
<div class="container">
1919
<h2 class="main-title">Explore.</h2>
20-
<img
21-
src="https://i.ibb.co/dK5zQgY/background.png"
22-
class="background"
23-
alt=""
24-
/>
25-
<img src="https://i.ibb.co/gwtNKDz/man.png" class="man" alt="" />
26-
<img
27-
src="https://i.ibb.co/XJrwv0M/foreground.png"
28-
class="foreground"
29-
alt=""
30-
/>
20+
<img src="https://i.ibb.co/rsp6RFJ/bg1.png" class="background" alt="" />
21+
<img src="https://i.ibb.co/237VsHs/girl1.png" class="girl" alt="" />
22+
<img src="https://i.ibb.co/BKtjhV2/rock1.png" class="rock" alt="" />
3123
</div>
3224
<div class="content">
3325
<div class="content-images">

99-parallax website/script.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
let controller = new ScrollMagic.Controller();
2+
let timeline = new TimelineMax();
3+
4+
timeline
5+
.to(".rock", 10, { y: -300 })
6+
.to(".girl", 10, { y: -200 }, "-=10")
7+
.fromTo(".background", { y: -50 }, { y: 0, duration: 10 }, "-=10")
8+
.to(".content", 10, { top: "0%" }, "-=10")
9+
.fromTo(".content-images", { opacity: 0 }, { opacity: 1, duration: 3 })
10+
.fromTo(".text", { opacity: 0 }, { opacity: 1, duration: 3 });
11+
12+
let scene = new ScrollMagic.Scene({
13+
triggerElement: "section",
14+
duration: "300%",
15+
triggerHook: 0,
16+
})
17+
.setTween(timeline)
18+
.setPin("section")
19+
.addTo(controller);

99-parallax website/style.css

+22
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,25 @@ nav {
5656
padding: 2rem 20rem;
5757
font-size: 1.1rem;
5858
}
59+
60+
@media (max-width: 768px) {
61+
nav,
62+
.text {
63+
padding: 2rem;
64+
font-size: 1rem;
65+
text-align: center;
66+
}
67+
68+
.main-title {
69+
font-size: 3rem;
70+
}
71+
72+
.content-images {
73+
flex-direction: column;
74+
}
75+
76+
.content-images img {
77+
max-width: 100%;
78+
padding: 2rem 0 0.25rem;
79+
}
80+
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
| 96 | [Cloud Hosting Service](https://github.com/solygambas/html-css-fifty-projects/tree/master/96-cloud%20hosting%20service) | [Live Demo](https://codepen.io/solygambas/full/oNBrXYr) |
105105
| 97 | [Terminal Style Landing Page](https://github.com/solygambas/html-css-fifty-projects/tree/master/97-terminal%20style%20landing%20page) | [Live Demo](https://codepen.io/solygambas/full/BaWvXLG) |
106106
| 98 | [Magazine Layout](https://github.com/solygambas/html-css-fifty-projects/tree/master/98-magazine%20layout) | [Live Demo](https://codepen.io/solygambas/full/OJpGMyj) |
107-
| 99 | [Parallax Website](https://github.com/solygambas/html-css-fifty-projects/tree/master/99-parallax%20website) | [Live Demo](#) |
107+
| 99 | [Parallax Website](https://github.com/solygambas/html-css-fifty-projects/tree/master/99-parallax%20website) | [Live Demo](https://codepen.io/solygambas/full/poeBdPr) |
108108

109109
This repository is mostly based on 2 courses by Brad Traversy (2020):
110110

0 commit comments

Comments
 (0)