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 | 31 |
Tags
- button
- jQuery
- SWIFT
- php
- hover
- MAC
- image
- CSS
- iPhone
- 풀스택
- react
- 비전공자
- html5
- ipad
- 비전공 개발자
- xcode
- 자바스크립트
- 프론트엔드
- front-end
- effect
- javascript
- IOS
- Animation
- 애니메이션
- css3
- HTML
- iOS 개발자
- 개발자
- 백엔드
- keyframes
Archives
- Today
- Total
비전공자 개발일기
Corner Text Parallax Effects 본문
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>Corner Text Parallax Effects</title>
<link rel="stylesheet" href="style.css" />
<script defer src="main.js"></script>
</head>
<body>
<section>
<div class="skew1">
<h2 class="layer">Corner Text</h2>
</div>
<div class="textBox">
<div class="skew2">
<h2 class="layer">Corner Text</h2>
</div>
</div>
</section>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
position: relative;
}
section {
width: 100%;
height: 100vh;
background-color: #222;
overflow: hidden;
}
section .textBox {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #333;
clip-path: polygon(0 0, 50% 0, 50% 100%, 0% 100%);
}
.skew1 h2, .textBox .skew2 h2 {
position: absolute;
width: 100%;
text-align: center;
font-size: 12em;
line-height: 1em;
color: #0488F5;
cursor: pointer;
}
.skew1 h2 {
opacity: .6;
}
.skew1 {
top: 50px;
transform: skewY(20deg);
}
.skew2 {
top: 50px;
transform: skewY(340deg);
}
document.addEventListener("mousemove", parallaxText);
function parallaxText(e) {
this.querySelectorAll(".layer").forEach((layer) => {
let x = (window.innerWidth - e.pageX * 2) / 2;
layer.style.transform = `translateX(${x}px)`;
});
}
728x90
LIST
'HTML _CSS' 카테고리의 다른 글
Text Animation & BG (0) | 2022.09.25 |
---|---|
Slide Sign In & Up (0) | 2022.09.20 |
Gradient Circle Text (0) | 2022.09.15 |
Christmas Tree (0) | 2022.09.13 |
Growing Smiley Face Effects (0) | 2022.09.12 |