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
- 비전공 개발자
- 프론트엔드
- php
- hover
- keyframes
- react
- css3
- 풀스택
- 자바스크립트
- effect
- iOS 개발자
- 백엔드
- CSS
- button
- 개발자
- SWIFT
- jQuery
- ipad
- xcode
- HTML
- html5
- javascript
- IOS
- 비전공자
- image
- MAC
- front-end
- Animation
- iPhone
- 애니메이션
Archives
- Today
- Total
비전공자 개발일기
Circle Scroll 본문
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>SCROLL CIRCLE</title>
<link rel="stylesheet" href="style.css">
<script defer src="main.js"></script>
</head>
<body>
<section>
<div class="sec sec1"><h2>Magic</h2></div>
<div class="sec sec2"><h2>Magic</h2></div>
<h2>Magic</h2>
</section>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 200vh;
}
section {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: #333;
}
section .sec {
position: absolute;
width: 100%;
height: 100%;
z-index: 10;
}
section .sec.sec1 {
background-color: #B0FF54;
clip-path: circle(200px at 0 0);
}
section .sec.sec2 {
background-color: #03A6F4;
clip-path: circle(200px at 100% 100%);
}
section h2 {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 100%;
text-align: center;
color: #FFF;
font-size: 18em;
}
section .sec.sec1 h2 {
color: transparent;
-webkit-text-stroke: 5px #333;
}
section .sec.sec2 h2 {
color: #333;
-webkit-text-stroke: 5px #FFF;
}
let sec1 = document.querySelector(".sec1");
let sec2 = document.querySelector(".sec2");
window.addEventListener("scroll", function () {
let val = window.scrollY;
sec1.style.clipPath = `circle(${val * 1.15}px at 0 0)`;
sec2.style.clipPath = `circle(${val * 0.85}px at 100% 100%)`;
});
728x90
LIST
'HTML _CSS' 카테고리의 다른 글
Filter Gallery (0) | 2022.11.07 |
---|---|
Typing Effect (0) | 2022.11.06 |
Hidden Search Bar (0) | 2022.11.02 |
Halloween Banner (0) | 2022.11.01 |
Credit card (0) | 2022.10.30 |