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 |
Tags
- javascript
- hover
- keyframes
- CSS
- IOS
- 프론트엔드
- SWIFT
- iPhone
- 풀스택
- Animation
- react
- 애니메이션
- effect
- image
- 자바스크립트
- ipad
- 비전공자
- front-end
- css3
- 비전공 개발자
- button
- 백엔드
- HTML
- php
- 개발자
- jQuery
- html5
- iOS 개발자
- MAC
- xcode
Archives
- Today
- Total
비전공자 개발일기
Lamp On Off 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>LAMP ON OFF ANIMATION</title>
<link rel="stylesheet" href="style.css">
<script defer src="main.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.js' integrity='sha512-n/4gHW3atM3QqRcbCn6ewmpxcLAHGaDjpEBu4xZd47N0W2oQ+6q7oc3PXstrJYXcbNU1OHdQ1T7pAP+gi5Yu8g==' crossorigin='anonymous'></script>
</head>
<body>
<div class="lamp js-turnoff-btn">
<div class="lamp-item lamp-top"></div>
<div class="lamp-item lamp-middle"></div>
<div class="lamp-item lamp-bottom"></div>
<div class="lamp-item lamp-light open"></div>
</div>
</body>
</html>
body {
background-color: #2598EB;
}
.lamp-item {
position: absolute;
left: 0;
right: 0;
margin: 0 auto;
}
.lamp-top {
background-color: #2D2D2D;
width: 10px;
height: 100px;
top: 0;
}
.lamp-middle {
background-color: #2D2D2D;
border-radius: 50px 50px 0 0;
width: 50px;
height: 30px;
top: 100px;
}
.lamp-bottom {
background-color: #2D2D2D;
border-radius: 100px 100px 0 0;
width: 150px;
height: 80px;
top: 120px;
cursor: pointer;
}
.lamp-light.open {
background-color: #FFF;
clip-path: polygon(40% 0, 60% 0, 80% 100%, 20% 100%);
width: 700px;
height: 450px;
position: absolute;
top: 200px;
}
$("body").on("click", '.js-turnoff-btn', function() {
$(".lamp-light").toggleClass('open');
})
728x90
LIST
'HTML _CSS' 카테고리의 다른 글
Emoji Animation (0) | 2022.06.12 |
---|---|
Heartbeat Loading Animation (0) | 2022.06.11 |
CSS Simple Animation (0) | 2022.06.08 |
GROWING LEON APPLE ICON (0) | 2022.06.06 |
To Do List by Pure CSS (0) | 2022.06.05 |