250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- xcode
- ipad
- iPhone
- image
- SWIFT
- hover
- php
- iOS 개발자
- MAC
- keyframes
- Animation
- 백엔드
- effect
- HTML
- 비전공자
- 풀스택
- IOS
- 프론트엔드
- 개발자
- button
- CSS
- css3
- html5
- 애니메이션
- front-end
- 비전공 개발자
- 자바스크립트
- react
- jQuery
- javascript
Archives
- Today
- Total
비전공자 개발일기
Checkbox Custom 본문
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>CUSTOM CHECKBOX</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<label>
<input type="checkbox">
<span></span>
<text>OFF</text>
<text>ON</text>
</label>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(#555, #292929);
}
label {
position: relative;
width: 300px;
height: 150px;
background-color: #3E3E3E;
box-shadow: 0 0 0 4px #303030;
border-radius: 75px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
label input {
appearance: none;
}
label span {
position: absolute;
left: 0;
width: 175px;
height: 150px;
background: url(Coffee_01.png);
background-size: auto 150px;
background-repeat: no-repeat;
transition: 1.5s;
transform: rotate(-180deg);
transform-origin: 75px;
}
label input:checked ~ span {
left: 150px;
background: url(Coffee_02.png);
background-size: auto 150px;
background-repeat: no-repeat;
transform: rotate(360deg);
}
label text {
position: absolute;
left: -100px;
font-family: consolas;
color: #FFF;
font-size: 3em;
filter: drop-shadow(0 0 15px #FFF) drop-shadow(0 0 35px #FFF);
transition: 1.5s;
}
label input:checked ~ text {
color: #8F8F8F;
filter: none;
}
label text:last-child {
position: absolute;
left: initial;
right: -100px;
color: #FFF;
filter: none;
}
label input:checked ~ text:last-child {
color: #FFF;
filter: drop-shadow(0 0 15px #FFF) drop-shadow(0 0 35px #FFF);
}
728x90
LIST
'HTML _CSS' 카테고리의 다른 글
Emotion Animation (0) | 2022.09.01 |
---|---|
CSS Animated Swipe (0) | 2022.08.31 |
Lock Mobile Screen Shot (0) | 2022.08.29 |
Lamp Animation (0) | 2022.08.27 |
3D Animated Stairs (0) | 2022.08.23 |