-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhacker.html
More file actions
118 lines (106 loc) · 2.82 KB
/
hacker.html
File metadata and controls
118 lines (106 loc) · 2.82 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bunny Message Simulator 🐇💌</title>
<style>
body {
font-family: 'Comic Sans MS', cursive, sans-serif;
background: linear-gradient(to right, #ffe6f2, #e6f7ff);
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
height: 100vh;
margin: 0;
overflow: hidden;
text-align: center;
}
h1 {
color: #ff66b2;
margin-top: 20px;
}
input {
padding: 10px;
border-radius: 10px;
border: 2px solid #ff66b2;
font-size: 16px;
margin: 10px;
}
button {
padding: 10px 20px;
border-radius: 10px;
border: none;
background-color: #39FF14;
color: black;
font-size: 16px;
cursor: pointer;
transition: transform 0.2s;
}
button:hover {
transform: scale(1.2);
}
#status {
margin-top: 20px;
font-size: 16px;
color: #3399ff;
}
.bunnyMsg {
position: absolute;
font-size: 30px;
}
</style>
</head>
<body>
<h1>Send your magical idea! 🐇✨</h1>
<input type="text" id="ideaInput" placeholder="Type your idea here...">
<button onclick="sendIdea()">Send Idea</button>
<div id="status"></div>
<script>
const screenWidth = window.innerWidth;
function sendIdea() {
const idea = document.getElementById('ideaInput').value;
if (!idea) {
document.getElementById('status').textContent = "Please type an idea first!";
return;
}
// show bunny animation
const bunny = document.createElement('div');
bunny.className = 'bunnyMsg';
bunny.textContent = '🐇💌 ' + idea;
bunny.style.left = '0px';
bunny.style.top = Math.random() * (window.innerHeight - 50) + 'px';
document.body.appendChild(bunny);
let pos = 0;
const id = setInterval(frame, 5);
function frame() {
if (pos > screenWidth) {
clearInterval(id);
bunny.remove();
document.getElementById('status').textContent = "✅ Your idea magically arrived!";
} else {
pos += 2;
bunny.style.left = pos + 'px';
}
}
// 🔹 Send the idea to your PythonAnywhere server
fetch("https://misty1223.pythonanywhere.com/ideas", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ idea: idea })
})
.then(res => res.json())
.then(data => {
console.log("Server response:", data);
})
.catch(err => {
console.error(err);
document.getElementById('status').textContent = "❌ Could not connect to server.";
});
// clear input
document.getElementById('ideaInput').value = "";
}
</script>
</body>
</html>