forked from jessekorzan/voice-visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.scss
156 lines (146 loc) · 3.12 KB
/
styles.scss
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
@import url('https://fonts.googleapis.com/css?family=Roboto:700');
$font : "Roboto", sans-serif;
$black: #201c26;
$white: #ffffff;
$spacer: 44px;
// VOICE UI visualization prototype
// copyright 2017 jesse korzan
//
// skip to the essential parts class="voice-coder"
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
background: darken($black, 5%);
color: $white;
font-family: sans-serif;
font-size: 16px;
}
main {
position: relative;
width: 800px;
margin: 0 auto;
display: grid;
align-items: center ;
height: 100vh;
section {
position: relative;
background: $black;
padding: $spacer;
white-space: 100%;
height: 600px;
width: 800px;
}
}
section {
text-align: center;
h1 {
font-size: 68px;
margin: $spacer 0 $spacer;
font-family: $font;
font-weight: 700;
color: lighten(lime, 65%);
text-shadow: 0px 0px 72px rgba(lime, 0.65);
span {
margin: 0 8px;
}
}
p {
font-size: 12px;
text-transform: uppercase;
a {
color: $white;
text-decoration: none;
opacity: 0.1;
}
}
}
// ESSENTIAL PARTS
// the main wrapper for the visualization
.voice-coder {
position: relative;
height: 65%;
display: grid;
grid-template-columns: repeat(45, 4px);
grid-template-rows: 100%;
grid-gap: 14px;
justify-content: center;
align-items: center;
overflow: hidden;
// the color bars
span {
position: relative;
z-index: 2;
width: 100%;
height: 2px;
background: linear-gradient( darken($black, 0%) 5%, purple, cyan, lime, cyan, purple, darken($black, 0%) 85%);
animation: bounce-001;
animation-iteration-count: infinite;
animation-timing-function: ease-in;
animation-duration: 900ms;
// stagger the animations
@for $b from 1 through 45 {
&:nth-child(#{$b}) {
animation-delay: #{(($b) * (50))}ms;
}
}
// change up the animations
&:nth-child(2n) {
animation-name: bounce-002;
animation-timing-function: ease-out;
}
&:nth-child(3n) {
animation-name: bounce-003;
animation-timing-function: linear;
}
}
// make it more "digital" looking
&:after {
position: absolute;
z-index: 3;
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0.25;
background: url("overlay.png") no-repeat 50% 50%;
}
}
// CSS animations for the <span/> color bars
@keyframes bounce-001 {
0% {
height: 100%;
}
50% {
height: 50%;
}
100% {
height: 100%;
}
}
@keyframes bounce-002 {
0% {
height: 100%;
}
80% {
height: 30%;
}
100% {
height: 100%;
}
}
@keyframes bounce-003 {
0% {
height: 80%;
}
30% {
height: 20%;
}
100% {
height: 80%;
}
}