aboutsummaryrefslogtreecommitdiff
path: root/public/register.css
blob: eef7490d73f88eceab41c8810d66d7674e722b2d (plain)
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
.check-popup {
	transition-property: margin, box-shadow;
	transition-duration: .3s;
	background-color: var(--bg-alt);
	position: relative;
	margin-bottom: 16px;
	border-radius: 8px;
	box-shadow: 0px 8px 32px -16px #0004;
}

.check-popup::before {
	transition: opacity .3s;
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	background-color: var(--bg-alt);
	width: 16px;
	height: 16px;
	transform: translate(-50%, -50%) rotate(-45deg);
}

.requirements {
	display: grid;
	list-style: none;
}

.requirements .requirement {
	transition-property: opacity;
	transition-duration: .3s;
	opacity: calc(100% - 50% * var(--done));
	--done: 0;
}

.requirements .requirement .inner {
	position: relative;
}

.requirements .requirement .inner::before {
	content: "- ";
	position: absolute;
	left: -0.5em;
	transform: translateX(-100%);
}

.requirements .requirement .inner::after {
	transition-property: width;
	transition-duration: .3s;
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: calc(100% * var(--done));
	background-color: currentColor;
	height: 2px;
}

.requirements.len-3 .requirement.len-3,
.requirements.nosymbol .requirement.nosymbol,
.requirements.nospace .requirement.nospace,
.requirements.valid .requirement.valid,
.requirements.len-8 .requirement.len-8,
.requirements.digit-2 .requirement.digit-2,
.requirements.symbol-2 .requirement.symbol-2,
.requirements.has-uppercase .requirement.has-uppercase,
.requirements.has-lowercase .requirement.has-lowercase
{ --done: 1; }

#username-requirements { --requirement-count: 3; }
#email-requirements { --requirement-count: 1; }
#password-requirements { --requirement-count: 5; }
.check-popup .requirements {
	--requirement-count: 0; /* TODO: this should dynamically change */
	transition-property: margin, opacity, grid-template-rows;
	transition-duration: .3s;
	grid-template-rows: repeat(var(--requirement-count), 1fr);
	overflow: hidden;
}

.check-popup .requirements .requirement {
	min-height: 0;
}

.check-popup.all .requirements {
	margin: 0;
	opacity: 0;
	grid-template-rows: repeat(var(--requirement-count), 0fr);
}
.check-popup.all {
	margin: 0;
	box-shadow: none;
}
.check-popup.all::before { opacity: 0; }