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
- 비전공자
- IOS
- MAC
- effect
- keyframes
- css3
- javascript
- 자바스크립트
- react
- 애니메이션
- ipad
- 개발자
- html5
- iOS 개발자
- CSS
- front-end
- Animation
- php
- 백엔드
- 풀스택
- xcode
- 비전공 개발자
- HTML
- iPhone
- SWIFT
- image
- hover
- button
- 프론트엔드
- jQuery
Archives
- Today
- Total
비전공자 개발일기
Lock Animation 본문
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>Lock Animation</title>
<link rel="stylesheet" href="style.css">
<script defer src="main.js"></script>
</head>
<body>
<div class="lock">
<span class="key"></span>
</div>
</body>
</html>
body {
background-color: #000;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.lock {
position: relative;
width: 50px;
height: 50px;
background-color: #000;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 5px;
border: 2px solid #fff;
transition: all .8s;
cursor: pointer;
}
.lock::after {
position: absolute;
content: ' ';
width: 30px;
height: 30px;
border-radius: 50%;
border: 5px solid #1a1a1a;
top: -25px;
left: 5px;
z-index: -1;
transition: all .8s;
}
.lock .key {
width: 16px;
height: 8px;
background-color: #1a1a1a;
margin: 10px auto 0;
border-radius: 15px;
transition: all .8s;
}
.lock::before {
position: absolute;
content: 'Lock';
text-align: center;
font-size: 8px;
font-weight: 700;
color: #fff;
letter-spacing: 2px;
left: 12.5px;
top: 5px;
}
.unlock {
border: 2px solid #00d455 !important;
}
.unlock::after {
border: 5px solid #00d455;
border-right: 5px solid transparent;
}
.unlock .key {
transform: rotate(-90deg);
background-color: #00d455;
}
.unlock::before {
content: 'Unlock';
left: 4px;
color: #00d455;
}
let lock = document.querySelector(".lock");
lock.addEventListener("click", () => {
lock.classList.toggle("unlock")
})
728x90
LIST
'Javascript' 카테고리의 다른 글
Draggable DIV (0) | 2022.05.12 |
---|---|
Animated Submit BUTTON (0) | 2022.05.10 |
Alarm Application (0) | 2022.05.02 |
3D Card (0) | 2022.04.27 |
Circle Loading Tape (0) | 2022.04.24 |