blob: 66400592bcb8e23e599610e3e802e92ca30893b7 (
plain) (
blame)
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
|
/* Global */
:root {
--focus-color: forestgreen;
}
html, body {
height: 100%;
margin: 0;
}
body {
font: 21px sans-serif;
}
form {
width: 100%;
}
/* Styling of simple elements */
#content {
height: 100%;
max-width: 20em;
margin-left: auto;
margin-right: auto;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
#title {
font-size: 2em;
font-weight: bold;
}
#content input {
border: 0;
border-bottom: 1px solid grey;
padding: 0.4em;
padding-left: 0;
width: 100%;
box-sizing: border-box;
font-size: inherit;
margin-bottom: 0.5em;
}
#content #submit-btn {
border: 2px solid black;
border-radius: 0.4em;
box-sizing: border-box;
width: 100%;
margin-top: 0.5em;
font-size: 0.8em;
padding: 0.3em;
}
input:focus, button:focus {
outline: 0;
}
#content hr {
width: 100%;
border: 1px solid black;
box-sizing: border-box;
}
/* Where the magic happens */
#submit-btn {
transition: 0.2s;
background-color: black;
color: white;
text-align: center;
}
#submit-btn:hover {
cursor: pointer;
border-color: var(--focus-color) !important;
color: var(--focus-color);
background-color: white;
}
#submit-btn:active {
transition: 0s;
transform: scale(0.9);
}
.input-selection {
position: relative;
margin-top: 0.7em;
}
.input-selection label {
transition: 0.2s;
width: inherit;
height: inherit;
position: absolute;
margin-top: 0.4em;
scale: 1em;
color: grey;
left: 0;
}
.input-selection input::-webkit-input-placeholder {
/* Don't show the placeholder when the label is on top */
opacity: 0;
}
.input-selection:hover > label,
.input-selection > input:not(:placeholder-shown) + label,
.input-selection > input:focus + label {
/* When hovering, typing or having typed something in an input,
* make the label smaller, color it and then move it up
*/
font-size: 0.7em;
color: var(--focus-color);
transform: translate(0, -1.2em);
}
.input-selection:hover > input::-webkit-input-placeholder,
.input-selection > input:focus::-webkit-input-placeholder {
opacity: 1;
}
.input-selection:hover > input,
.input-selection > input:focus {
border-color: var(--focus-color) !important;
caret-color: var(--focus-color);
border-width: 2px !important;
margin-top: -1px !important;
}
|