-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.css
154 lines (141 loc) · 3.22 KB
/
index.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
/* Hello text */
.hi {
/* Big enough to fit the header on one line */
max-width: 30em;
text-align: center;
/* Make sure it covers the moon if they overlap */
z-index: 1;
}
/* Spinning hand */
/* A sprightly spin, and then a wave */
@keyframes wave {
from {
transform: rotate(0turn);
}
15% {
transform: rotate(1turn);
}
30% {
transform: rotate(1.07turn);
}
55% {
transform: rotate(.93turn);
}
80% {
transform: rotate(1.06turn);
}
to {
transform: rotate(1turn);
}
}
.spinny-hand {
/* To enable rotating and wiggling about */
display: inline-block;
position: relative;
}
.spinny-hand:hover,
.spinny-hand:focus {
animation: wave 2s linear;
}
/* Sound Toggle */
.sound-toggle {
align-items: center;
display: flex;
justify-content: space-between;
}
.sound-toggle-label {
align-items: center;
display: flex;
justify-content: center;
background-color: #80000030;
border-radius: 100%;
cursor: pointer;
flex-shrink: 0;
height: 2rem;
width: 2rem;
margin-left: 1em;
}
#sound-toggle-button {
appearance: none;
display: none;
}
#sound-toggle-button + .sound-toggle-icon:before {
content: "🔊";
}
#sound-toggle-button:checked + .sound-toggle-icon:before {
content: "🔈";
}
/* Cross the screen at a consistent speed regardless of screen size
*
* Rather than travel a distance relative to the screen width, the cross
* is always 2000px (wayyyy off to left field on small devices). For a given
* `animation-duration` this gives a consistent pixel/second speed. The cross
* can be sped up by decreasing the `animation-duration`, and slowed down by
* increasing the `animation-duration`.
*
* `calc` doesn't handle time values well, so we can't change the speed
* by calculating the `animation-duration` based on the view width.
*/
@keyframes cross {
from {
transform: translateX(var(--owl-size));
}
to {
/* Choose a relatively large screen size as our constant so it handles large screens well. */
transform: translateX(-2000px);
}
}
/* Hiding it from within a nested div, instead of the body, avoids expanding the screen on mobile
*
* TODO: Specifying "overflow-y: visible" doesn't show owl. I have to make a div large enough to
* actually display the owl for it to appear.
*/
.owl-sprite-hider {
height: calc(var(--owl-size) + var(--main-padding));
left: 0;
overflow: hidden;
position: absolute;
top: 0;
width: 100vw;
}
.owl-sprite {
position: absolute;
right: 0;
top: var(--main-padding);
/* 2000px/13s = ~150px/second */
animation: cross 13s linear;
/* The first owl screech is exactly at around 5s.
* With the time it takes to enter the frame the owl shows up right when the screech happens.
*/
animation-delay: 4s;
}
.owl-sprite .frame {
position: absolute;
top: 0;
left: 0;
height: var(--owl-size);
width: var(--owl-size);
}
@keyframes blink1 {
from {
visibility: visible;
}
to {
visibility: hidden;
}
}
@keyframes blink2 {
from {
visibility: hidden;
}
to {
visibility: visible;
}
}
.owl-sprite .frame:nth-child(1) {
animation: blink1 .75s infinite steps(2, jump-none);
top: -37.5px;
}
.owl-sprite .frame:nth-child(2) {
animation: blink2 .75s infinite steps(2, jump-none);
}