Skip to content

Commit 9d71381

Browse files
committed
Efeito Hover Ripple
1 parent 1309b13 commit 9d71381

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

16 - efeito hover ripple/efeito.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
var btn = document.querySelector(".button");
3+
4+
btn.onmousemove = function(e){
5+
var x = e.pageX - btn.offsetLeft;
6+
var y = e.pageY - btn.offsetTop;
7+
8+
btn.style.setProperty('--eixoX', x + 'px')
9+
btn.style.setProperty('--eixoY', y + 'px')
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link rel="stylesheet" href="style.css">
7+
<title>Efeito Ripple</title>
8+
</head>
9+
<body>
10+
11+
<a href="#" class="button"><span>Inscreva-se</span></a>
12+
13+
<script src="efeito.js"></script>
14+
</body>
15+
</html>

16 - efeito hover ripple/style.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
*{
3+
margin: 0;
4+
padding: 0;
5+
box-sizing: border-box;
6+
font-family: 'Outfit',sans-serif;
7+
}
8+
9+
body{
10+
height: 100vh;
11+
display: flex;
12+
align-items: center;
13+
justify-content: center;
14+
}
15+
16+
.button{
17+
padding: 60px 100px;
18+
background-color: #282828;
19+
color: #fff;
20+
border-radius: 120px;
21+
text-decoration: none;
22+
position: relative;
23+
overflow: hidden;
24+
}
25+
26+
.button span{
27+
font-size: 30px;
28+
position: relative;
29+
z-index: 999999;
30+
}
31+
32+
.button::before{
33+
content: '';
34+
background-color: #fe6600;
35+
width: 0;
36+
height: 0;
37+
position: absolute;
38+
top: var(--eixoY);
39+
left: var(--eixoX);
40+
border-radius: 50%;
41+
transform: translate(-50%,-50%);
42+
transition: width .5s, height .5s;
43+
}
44+
45+
.button:hover::before{
46+
width: 1000px;
47+
height: 1000px;
48+
}

0 commit comments

Comments
 (0)