forked from tinkerhub/useless_project_temp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.html
More file actions
141 lines (121 loc) · 3.2 KB
/
chat.html
File metadata and controls
141 lines (121 loc) · 3.2 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Zombie Chat</title>
<link rel="stylesheet" href="style.css" />
<style>
body {
font-family: 'Chewy', cursive;
background-color: #2e2e2e;
color: #fff;
margin: 0;
padding: 0;
}
nav {
background-color: #4b4b4b;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
nav .logo {
font-size: 1.8rem;
color: #ff6e7f;
}
.chat-container {
max-width: 600px;
margin: 50px auto;
background: #3a3a3a;
border-radius: 10px;
padding: 20px;
box-shadow: 0 0 15px #111;
}
.chat-box {
height: 300px;
overflow-y: auto;
background: #2b2b2b;
border-radius: 10px;
padding: 10px;
margin-bottom: 10px;
}
.chat-message {
margin-bottom: 10px;
}
.chat-message.user {
text-align: right;
color: #a1f0dc;
}
.chat-message.zombie {
text-align: left;
color: #f7a8a8;
}
.input-box {
display: flex;
gap: 10px;
}
.input-box input {
flex: 1;
padding: 10px;
border: none;
border-radius: 5px;
font-family: 'Chewy', cursive;
}
.input-box button {
padding: 10px 20px;
background: #ff6e7f;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-family: 'Chewy', cursive;
}
.input-box button:hover {
background: #ff4b5c;
}
</style>
</head>
<body>
<nav>
<div class="logo">Zombie Chat</div>
<a href="index.html" style="color:white; text-decoration:none;">🏠 Home</a>
</nav>
<div class="chat-container">
<div class="chat-box" id="chatBox">
<div class="chat-message zombie">🧟♂️ Grr... Tell me about your worst date...</div>
</div>
<div class="input-box">
<input type="text" id="userInput" placeholder="Ask something creepy..." />
<button onclick="sendMessage()">Send</button>
</div>
</div>
<script>
function sendMessage() {
const input = document.getElementById('userInput');
const message = input.value.trim();
if (!message) return;
const chatBox = document.getElementById('chatBox');
// User message
const userMsg = document.createElement('div');
userMsg.className = 'chat-message user';
userMsg.textContent = message;
chatBox.appendChild(userMsg);
// Zombie response (random & fun)
const responses = [
"Brains... also, ew, that’s too much info.",
"Sounds like a date with a vampire. I prefer rot walks.",
"That’s romantic... in a decomposed kind of way.",
"Hmm... I'd swipe left. Dead serious.",
"My zombie heart beats... once every hour... for you."
];
const zombieReply = responses[Math.floor(Math.random() * responses.length)];
const botMsg = document.createElement('div');
botMsg.className = 'chat-message zombie';
botMsg.textContent = "🧟 " + zombieReply;
chatBox.appendChild(botMsg);
chatBox.scrollTop = chatBox.scrollHeight;
input.value = '';
}
</script>
</body>
</html>