일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- html
- scroll
- 스크롤
- css
- 이벤트리스너
- addEventListener
- insertAdjacentHTML
- swiperjs
- localstorage
- NodeList
- width
- scrollevent
- Animation
- mousemove
- JavaScript
- Hover
- 반복문
- getBoundingClientRect
- classList
- For
- forEach
- input
- 애니메이션
- swiper
- NAV
- 확장성
- pointermove
- scrollY
- React
- Sticky
- Today
- Total
목록mousemove (3)
ZeroToHunnit Coding
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/k1rA6/btsEvXo0KS6/nTdo9vg8poUWseKoJPS4nk/img.gif)
위와 같이 마우스의 움직임에 따라 전체적인 페이지가 같이 움직이는 ui를 만들어보았다. HTML CSS * { overflow: hidden; margin: 0; padding: 0; } html,body{ background-color: #333; } .section { width: 100vw; height: 100vh; } .inner { position: absolute; background-color: #333; height: 2560px; } .rows { display: flex; align-items: center; justify-content: center; width: 100%; } .link { width: 400px; height: 600px; background-color: #ddd..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/nkfQw/btsCUX5tdQI/C2ljYaao8V4OdgbwllXlNK/img.gif)
위의 사진처럼 카드에 마우스 커서가 올라가면 커서따라 3d느낌으로 위로 솟는 느낌으로 만들어봤다. HTML CSS .box{ width: 511px; height: 321px; margin-top: 300px; margin-left: 500px; transition: all 0.1s; position: relative; } .photo{ width: 100%; height: 100%; background-image: url(card.png); } 박스에 크기를 정하고 photo는 background로 이미지를 넣어주었다. JAVASCRIPT document.querySelector('.box').addEventListener('mousemove', function(e){ let rotateY = -50/..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/TZeg3/btsCALerGFp/OlevPuk9ArKXs28ATmSvv1/img.gif)
마우스 커서 자체를 변경해서 새로운 느낌을 줄 수 있지만 다른 요소를 마우스 커서에 따라다니게 하면 더 관심을 살 수 있을 것이다. HTML 그냥 큰 div안에 point-cursur라는 저 따라다니는 것을 만들어 주었다. CSS .point{ width: 100vw; height: 200vh; position: relative; } .point-cursor{ width: 300px; height: 300px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: radial-gradient(#abc574, #674bca); filter: blur(20px); border-radius: 50%; tran..