HTML _CSS
Growing Smiley Face Effects
HiroDaegu
2022. 9. 12. 00:32
728x90
SMALL
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GROWING SMILEY FACE EFFECTS</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
<label>
<input type="radio" name="pink">
<div class="face"></div>
</label>
<label>
<input type="radio" name="green">
<div class="face"></div>
</label>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
gap: 4px;
min-height: 100vh;
background-color: #222;
overflow: hidden;
}
:root {
--clr1: #FF0087;
--clr2: #01FF5F;
}
label {
position: relative;
width: 150px;
height: 150px;
}
label input {
appearance: none;
}
label .face {
position: absolute;
inset: 0;
background-color: #333;
border-radius: 50%;
cursor: pointer;
mix-blend-mode: lighten;
transition: .5s;
}
label input:checked ~ .face {
background: var(--clr1);
z-index: 1000;
filter: drop-shadow(0 0 50px var(--clr1)) drop-shadow(0 0 100px var(--clr1)) drop-shadow(0 0 150px var(--clr1));
}
label:nth-child(even) input:checked ~ .face {
background: var(--clr2);
z-index: 1000;
filter: drop-shadow(0 0 50px var(--clr2)) drop-shadow(0 0 100px var(--clr2)) drop-shadow(0 0 150px var(--clr2));
}
label .face::before {
content: '';
position: absolute;
top: 60px;
left: 45px;
width: 15px;
height: 15px;
background-color: #111;
opacity: .5;
border-radius: 50%;
box-shadow: 45px 0 0 #111;
}
label .face::after {
content: '';
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 45px;
width: 40px;
height: 8px;
border-radius: 8px;
background-color: #111;
opacity: .5;
transition: .5s;
}
label input:checked ~ .face::after {
width: 40px;
height: 20px;
border-radius: 0;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
transform: translate(-50%, 10px);
}
728x90
LIST