Coding Free Books | Python | AI
28.5K subscribers
252 photos
1 video
640 files
200 links
Best Channel for Programmers and Hackers
All in one channel to learn
👇
1. Python
2. Ethical Hacking
3. Java
4. App development
5. Machine learning
6. Data structures
7. Algorithms

Promotions: @coderfun
Download Telegram
Moving Login Button Project (Troll Form 😂)

If the user enters an incorrect password, the "Login" button moves away!

<html>
<head>
<style>
.container {
text-align: center;
margin-top: 50px;
}
.btn {
position: relative;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
</style>
<script>
function moveButton() {
let password = document.getElementById("password").value;
let button = document.getElementById("btn");

if (password !== "legend") {
let x = Math.random() * (window.innerWidth - 100);
let y = Math.random() * (window.innerHeight - 100);
button.style.position = "absolute";
button.style.left = x + "px";
button.style.top = y + "px";
}
}
</script>
</head>
<body>
<div class="container">
<h2>Enter Password</h2>
<input type="password" id="password" placeholder="Type something..." oninput="moveButton()">
<br><br>
<button id="btn" class="btn" onclick="alert('You got lucky!')">Login</button>
</div>
</body>
</html>

How It Works?

If the user types anything other than "legend", the login button starts running away from the cursor.

If the correct password is entered, the button stays in place.

Web Development Best Resources

ENJOY LEARNING 👍👍

#webdev
2🔥1