Skip to content

Commit 8e6d35a

Browse files
authored
Create script.js
1 parent 85c974c commit 8e6d35a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

DateGuarantee/script.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
function redirectToCongrats() {
2+
window.location.href = 'congrats.html';
3+
}
4+
5+
function moveNoButton() {
6+
const button = document.getElementById('noBtn');
7+
const maxX = window.innerWidth - button.offsetWidth;
8+
const maxY = window.innerHeight - button.offsetHeight;
9+
10+
const newX = Math.floor(Math.random() * maxX);
11+
const newY = Math.floor(Math.random() * maxY);
12+
13+
button.style.position = 'absolute';
14+
button.style.left = `${newX}px`;
15+
button.style.top = `${newY}px`;
16+
}

0 commit comments

Comments
 (0)