-
Notifications
You must be signed in to change notification settings - Fork 2
/
style.css
121 lines (121 loc) · 2.88 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
/* -------------------------------------------------------------- */
/* Root Styling */
:root {
--hue: 200;
--saturation: 50%;
--foreground-color: hsl(var(--hue), var(--saturation), 75%);
--background-color: hsl(var(--hue), var(--saturation), 20%);
}
/* -------------------------------------------------------------- */
/* Body */
body {
margin: 0%;
padding: 0%;
box-sizing: border-box;
}
/* -------------------------------------------------------------- */
/* Container */
.container {
position: relative;
height: 100vh;
width: 100vw;
overflow: hidden;
background: hsl(var(--hue), var(--saturation), 20%);
z-index: 0;
box-sizing: border-box;
transition: all 0.5s linear;
}
/* -------------------------------------------------------------- */
/* Score Card */
.scoreCard {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: 5rem;
font-weight: bold;
color: var(--foreground-color);
position: absolute;
top: 50vh;
left: 50vw;
transform: translate(-50%, -50%);
z-index: 1;
opacity: 0.1;
-webkit-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
.scoreCard > * {
padding: 0 0.85rem;
}
.scoreCard > :first-child {
border-bottom: 0.4rem solid var(--foreground-color);
}
/* -------------------------------------------------------------- */
/* Ball */
.ball {
-webkit-user-select: none;
user-select: none;
-webkit-user-drag: none;
--ball-x-position: 50;
--ball-y-position: 50;
position: absolute;
background-color: var(--foreground-color);
left: calc(var(--ball-x-position) * 1vw);
top: calc(var(--ball-y-position) * 1vh);
border-radius: 50%;
transform: translate(-50%, -50%);
width: 2.5vh;
height: 2.5vh;
z-index: 2;
animation: pulse 0.5s linear infinite alternate;
overflow: hidden;
}
/* Ball Pulse Animation */
@keyframes pulse {
0% {
background-color: rgb(33, 170, 204);
}
100% {
background-color: rgb(0, 255, 255);
}
}
/* -------------------------------------------------------------- */
/* Paddle */
.paddle {
-webkit-user-select: none;
user-select: none;
-webkit-user-drag: none;
--paddle-position: 42;
position: absolute;
left: calc(var(--paddle-position) * 1vw);
background-color: var(--foreground-color);
/* transform: translateX(-50%); */
width: 14vw;
height: 20px;
border-radius: 50px;
z-index: 2;
font-size: 1rem;
text-align: center;
color: var(--background-color);
font-weight: bolder;
font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
"Lucida Sans", Arial, sans-serif;
transition: all 0.03s linear;
display: flex;
justify-content: center;
align-items: center;
}
.top {
top: 0vw;
}
.bottom {
bottom: 0.1vw;
}
/* -------------------------------------------------------------- */
/* Media Query */
@media screen and (max-width: 400px) {
.paddle {
width: 80px;
}
}