-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday34.html
More file actions
96 lines (81 loc) · 2.59 KB
/
day34.html
File metadata and controls
96 lines (81 loc) · 2.59 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DAY 34 | CSS CHALLENGE</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
main {
display: grid;
place-items: center;
min-height: 100vh;
}
.frame {
width: 400px;
height: 400px;
border-radius: 1rem;
box-shadow: 1px 2px 10px 0px rgba(0, 0, 0, 0.3);
background: #9B59B6;
color: #fff;
position: relative;
}
.logo {
position: absolute;
top: 160px;
left: 165px;
}
.logo.white svg {
fill: #fff;
}
.logo.purple svg {
fill: #9B59B6;
}
.logo.small {
transform: scale(0);
transition: all 0.5s ease-in;
}
.logo.normal {
transform: scale(1);
transition: all 0.5s ease-out 0.3s;
}
.logo.big {
transform: scale(10);
transition: all 0.5s ease-in;
}
</style>
</head>
<body>
<main>
<div class="frame">
<div class="logo white normal">
<svg width="70px" height="80px" viewBox="0 0 70 80">
<path
d="M-4.67739102e-15,21.1739614 L-5.32907052e-15,20 L34.6410162,0 L69.2820323,20 L69.2820323,21.1739614 C65.1281093,26.3215737 62.6410162,32.870341 62.6410162,40 C62.6410162,47.129659 65.1281093,53.6784263 69.2820323,58.8260386 L69.2820323,60 L34.6410162,80 L1.687539e-14,60 L1.62237105e-14,58.8260386 C4.15392303,53.6784263 6.64101615,47.129659 6.64101615,40 C6.64101615,32.870341 4.15392303,26.3215737 2.88213897e-13,21.1739614 Z">
</path>
</svg>
</div>
<div class="logo purple small">
<svg width="70px" height="80px" viewBox="0 0 70 80">
<path
d="M-4.67739102e-15,21.1739614 L-5.32907052e-15,20 L34.6410162,0 L69.2820323,20 L69.2820323,21.1739614 C65.1281093,26.3215737 62.6410162,32.870341 62.6410162,40 C62.6410162,47.129659 65.1281093,53.6784263 69.2820323,58.8260386 L69.2820323,60 L34.6410162,80 L1.687539e-14,60 L1.62237105e-14,58.8260386 C4.15392303,53.6784263 6.64101615,47.129659 6.64101615,40 C6.64101615,32.870341 4.15392303,26.3215737 2.88213897e-13,21.1739614 Z">
</path>
</svg>
</div>
</div>
</main>
<script>
document.querySelector(".frame").addEventListener("click", () => {
toggleClass('.white', "normal", "big")
toggleClass('.purple', "normal", "small")
})
function toggleClass(elClass, ...cls) {
cls.map(c => document.querySelector(elClass).classList.toggle(c))
}
</script>
</body>
</html>