forked from devarshishimpi/stonecss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (26 loc) · 1.07 KB
/
index.js
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
32
33
34
35
36
// ripple effect on get early access button
function createRipple(event) {
const button = event.currentTarget;
const circle = document.createElement("span");
const diameter = Math.max(button.clientWidth, button.clientHeight);
const radius = diameter / 2;
circle.style.width = circle.style.height = `${diameter}px`;
circle.style.left = `${event.clientX - button.offsetLeft - radius}px`;
circle.style.top = `${event.clientY - button.offsetTop - radius}px`;
circle.classList.add("ripple");
const ripple = button.getElementsByClassName("ripple")[0];
if (ripple) {
ripple.remove();
}
button.appendChild(circle);
}
const buttons = document.getElementsByTagName("button");
for (const button of buttons) {
button.addEventListener("click", createRipple);
}
// displaying the recaptcha when the user clicks on the input field
const emailInput = document.getElementById('emailInput');
const recaptcha = document.getElementById('recaptcha');
emailInput.addEventListener('click' , ()=>{
recaptcha.classList.toggle('show');
})