-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathradio.html
101 lines (97 loc) · 1.99 KB
/
radio.html
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
<style type="text/css">
@import url("https://fonts.googleapis.com/css?family=Dax:400,900");
html {
background-color: #1a1a1a;
overflow: hidden;
}
.middle {
width: 100%;
text-align: center;
/* Made by */
}
.middle h1 {
font-family: "Dax", sans-serif;
color: #fff;
}
.middle input[type="radio"] {
display: none;
}
.middle input[type="radio"]:checked + .box {
background-color: #007e90;
}
.middle input[type="radio"]:checked + .box span {
color: white;
transform: translateY(70px);
}
.middle input[type="radio"]:checked + .box span:before {
transform: translateY(0px);
opacity: 1;
}
.middle .box {
width: 200px;
height: 200px;
background-color: #fff;
transition: all 250ms ease;
will-change: transition;
display: inline-block;
text-align: center;
cursor: pointer;
position: relative;
font-family: "Dax", sans-serif;
font-weight: 900;
}
.middle .box:active {
transform: translateY(10px);
}
.middle .box span {
position: absolute;
transform: translate(0, 60px);
left: 0;
right: 0;
transition: all 300ms ease;
font-size: 1.5em;
user-select: none;
color: #007e90;
}
.middle .box span:before {
font-size: 1.2em;
font-family: FontAwesome;
display: block;
transform: translateY(-80px);
opacity: 0;
transition: all 300ms ease-in-out;
font-weight: normal;
color: white;
}
.middle p {
color: #fff;
font-family: "Dax", sans-serif;
font-weight: 400;
}
.middle p a {
text-decoration: underline;
font-weight: bold;
color: #FFF;
}
.middle p span:after {
content: '\f0e7';
font-family: FontAwesome;
color: yellow;
}
</style>
<div class="middle">
<h1>CSS Radio Button</h1>
<label>
<input type="radio" name="radio" value="" checked/>
<div class="front-end box">
<span>Front-end</span>
</div>
</label>
<label>
<input type="radio" name="radio"/>
<div class="back-end box">
<span>Back-end</span>
</div>
</label>
<p>Made <span></span> by <a href="https://github.com/gabrielferreiraa" target="_blank">@gabrielferreiraa</a></p>
</div>