-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnina.css
106 lines (80 loc) · 2.02 KB
/
nina.css
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
@import "bourbon";
$farColor: #ffe4c7;
$nearColor: darken(cyan,30%);
$layer: 7; //make sure it is +1 the ammount of layer divs in the html
$perspective: 1;
.bg {
position:absolute;
height:100%;
width:100%;
top:0px;
z-index:0;
background-color:$farColor;
}
.layer {
position:fixed;
top:0px;
margin:auto;
width:100%;
z-index:100;
min-height:400px;
top: 0; left: 0; right: 0; bottom: 0;
background-position: top center;
background-repeat: no-repeat;
}
.parallax {
height: 100vh;
overflow-x: hidden;
overflow-y: scroll;
perspective: #{$perspective + px};
}
.parallax-group {
position: relative;
height: 100vh;
transform-style: preserve-3d;
}
@for $i from 1 to $layer {
.parallax-group div:nth-child(#{$i}) {
//figure out best mixing math, this isn't true to the starting colors, doesnt scale that well
$mixedColor: mix($nearColor, $farColor, $i*15);
$randOffset: random(300)+px;
$zDepth: ($layer - $i)/0.5;
background-color:$farColor;
margin-top:#{300*($i+1) + px};
background-color:$mixedColor;
transform: translateZ(#{-($zDepth) + px}) scale(#{1 + (-($zDepth) * -1) / $perspective});
&:before {
content:"";
width:100%;
height:200px;
position:absolute;
bottom:100%;
left:0;
background-image: linear-gradient(135deg, transparent 66%, $mixedColor 66.01%),
linear-gradient(45deg, $mixedColor 34%, transparent 34.01%);
background-position: $randOffset 0px;
background-size: 200px 100%;
background-repeat:repeat-x;
}
}
} //loop over
///Demo specific styling
.content {
position:relative;
background-color:transparent;
font-family:"Arial";
letter-spacing:10px;
text-transform:uppercase;
line-height:40px;
z-index:10;
width:100%;
font-size:15px;
text-align:center;
color:white;
margin-top:1000px;
$zDepth: (1)/0.5;
transform: translateZ(#{-($zDepth) + px}) scale(#{1 + (-($zDepth) * -1) / $perspective});
}
.fill {
height:80%; //?
}