-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathparallax_effect.css
More file actions
124 lines (111 loc) · 2.98 KB
/
Copy pathparallax_effect.css
File metadata and controls
124 lines (111 loc) · 2.98 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
@import url(https://fonts.googleapis.com/css?family=Montserrat);
html, body {
overflow: hidden;
margin: 0;
padding: 0;
}
.background {
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
overflow: hidden;
will-change: transform;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
height: 130vh;
position: fixed;
width: 100%;
transform: translateY(30vh);
transition: all 1.2s cubic-bezier(0.22, 0.44, 0, 1);
}
.background:before {
content: "";
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.3);
}
.background:first-child {
background-image: url(https://images.pexels.com/photos/1105666/pexels-photo-1105666.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
transform: translateY(-15vh);
}
.background:first-child .content-wrapper {
transform: translateY(15vh);
}
.background:nth-child(2) {
background-image: url(https://images.pexels.com/photos/1938358/pexels-photo-1938358.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940;)
}
.background:nth-child(3) {
background-image: url(https://i.postimg.cc/TY0xQ41T/photo-1433840496881-cbd845929862.jpg);
}
.background:nth-child(4) {
background-image: url(https://images.pexels.com/photos/242236/pexels-photo-242236.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
}
.background:nth-child(5) {
background-image: url(https://images.pexels.com/photos/242236/pexels-photo-242236.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
}
.background:nth-child(6) {
background-image: url(https://images.pexels.com/photos/242236/pexels-photo-242236.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
}
/* Set stacking context of slides */
.background:nth-child(1) {
z-index: 6;
}
.background:nth-child(2) {
z-index: 5;
}
.background:nth-child(3) {
z-index: 4;
}
.background:nth-child(4) {
z-index: 3;
}
.background:nth-child(5) {
z-index: 2;
}
.background:nth-child(6) {
z-index: 1;
}
.content-wrapper {
height: 100vh;
color: #fff;
font-family: Montserrat;
text-transform: uppercase;
transform: translateY(40vh);
will-change: transform;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
transition: all 1.7s cubic-bezier(0.22, 0.44, 0, 1);
}
.content-title {
font-size: 12vh;
line-height: 1.4;
}
.background.up-scroll {
transform: translate3d(0, -15vh, 0);
}
.background.up-scroll .content-wrapper {
transform: translateY(15vh);
}
.background.up-scroll + .background {
transform: translate3d(0, 30vh, 0);
}
.background.up-scroll + .background .content-wrapper {
transform: translateY(30vh);
}
.background.down-scroll {
transform: translate3d(0, -130vh, 0);
}
.background.down-scroll .content-wrapper {
transform: translateY(40vh);
}
.background.down-scroll + .background:not(.down-scroll) {
transform: translate3d(0, -15vh, 0);
}
.background.down-scroll + .background:not(.down-scroll) .content-wrapper {
transform: translateY(15vh);
}