-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
214 lines (184 loc) · 4.34 KB
/
style.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
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
body {
background-color: #000;
color: #fff;
font-family: 'Helvetice Neue', sans-serif;
font-size: 24px;
font-weight: bold;
line-height: 1.5;
/* padding linked to screen size */
padding: 5vh 3vw;
/* body tag by default is only as tall as its content */
/* 100vh expandss the element to the full page */
min-height: 100vh;
/* flexbox to stack boxes side by side in a long row */
display: flex;
/* stack boxes on top of each other */
flex-direction: column;
/* each div container spaced evenly, first item on the start line, last item on the end line */
justify-content: space-between;
}
.title {
text-align: center;
}
.middle {
/* bookmarking this as a default for potentially styling other items inside of these elements using an absolute position */
position: relative;
}
.videos,
.top,
.indicators {
display: grid;
place-items: center;
}
.videos {
/* responsive design */
width: 100%;
padding-left: 24px;
padding-right: 24px;
}
/* use the input selector to style */
input {
/* this styling makes the input element look like its part of the page */
background-color: transparent;
border: none;
padding: 0;
outline: none;
text-align: center;
color: #fff;
}
.visible {
opacity: 1;
transform: scale(1) rotate(0deg);
}
.visible:nth-of-type(2n) {
transform: scale(1) rotate(5deg);
}
.visible:nth-of-type(3n) {
transform: scale(1) rotate(-5deg);
}
.visible:nth-of-type(4n) {
transform: scale(1) rotate(7deg);
}
.search-input {
width: 100%;
text-align: center;
font-size: 72px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
/* we subtract the element's padding from 100 and this gives us a total of 94vw */
width: 94vw;
line-height: 1;
height: 88px;
}
.search-clear {
cursor: pointer;
}
input {
padding: 0;
background: none;
border: none;
color: #fff;
outline: none;
}
/* styles placeholder text of placeholder*/
.search-input::placeholder {
color: #323232;
}
.title,
.search-clear {
grid-area: 1 / 1;
}
/* hide svg's (x button and spinner) and display only when utilising search */
.search-clear,
.spinner {
/* change opacity to fade-in once search is utilised */
transition: opacity 0.5s ease;
opacity: 0;
/* this stops mouse interactivity */
/* pointer-events: none; */
}
.search-clear {
/* pointer hand will appear */
cursor: pointer;
position: relative;
/* to uze z index, need to have a position property of absolute, relative, or fixed*/
z-index: 2;
}
.title {
position: relative;
/* so that our close button is on top of our title */
z-index: 1;
transition: opacity 0.5s ease;
}
.videos,
.middle,
.grid {
display: grid;
place-items: center;
}
.video {
/* tweet from benjamin de cock */
/* the below grid area tells each child to take up full width and height of our grid */
grid-area: 1 / 1;
background-color: #000;
display: block;
/* square shaped gifs / mp4s */
max-width: 480px;
max-height: 480px;
box-shadow: 0 0 40px 0px rgba(0, 0, 0, 0.68);
opacity: 0;
transform: scale(0) rotate(0deg);
transition: all 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
outline: 1px solid transparent;
/* responsive design */
width: 100%;
}
.search-input,
.videos,
.full-area {
grid-area: 1/1;
}
.top {
display: grid;
grid-area: 1/1;
}
.indicators,
.top {
text-align: center;
position: relative;
}
/* we are creating the search hint transition that we've started in our js */
.search-hint,
.spinner {
grid-area: 1/1;
}
.spinner,
.search-hint,
.search-clear {
opacity: 0;
color: rgba(255, 255, 255, 0.5);
transition: all .2s ease;
}
.loading .spinner,
.show-hint .search-hint,
.has-results .search-clear {
opacity: 1;
}
.show-hint.loading .search-hint,
.has-results .title {
opacity: 0;
pointer-events: none;
}
.spinner {
max-width: 24px;
}
@media (max-width: 480px) {
body {
font-size: 18px;
}
.search-input {
font-size: 32px;
}
}