Spaces:
Running

let-talk / index.html
olasiyantoyint's picture
Update index.html
b7c8dfe verified
Raw History Blame Contribute Delete
1.92 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Let Talk</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
font-family: Arial;
background: #0f0f0f;
color: white;
}
header {
background: #ff1a1a;
padding: 15px;
text-align: center;
font-size: 24px;
font-weight: bold;
}
.container {
padding: 20px;
}
.post-box {
background: #1c1c1c;
padding: 15px;
border-radius: 10px;
margin-bottom: 20px;
}
input, textarea {
width: 100%;
padding: 10px;
margin-top: 10px;
border-radius: 5px;
border: none;
}
button {
margin-top: 10px;
padding: 10px;
background: #ff1a1a;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.post {
background: #262626;
padding: 10px;
border-radius: 8px;
margin-top: 10px;
}
</style>
</head>
<body>
<header>🔥 Let Talk</header>
<div class="container">
<div class="post-box">
<h3>Create Post</h3>
<input type="text" id="username" placeholder="Your name">
<textarea id="content" placeholder="What's on your mind?"></textarea>
<button onclick="addPost()">Post</button>
</div>
<div id="feed"></div>
</div>
<script>
function addPost() {
const username = document.getElementById("username").value;
const content = document.getElementById("content").value;
if (!username || !content) {
alert("Fill all fields!");
return;
}
const post = document.createElement("div");
post.className = "post";
post.innerHTML = "<b>" + username + "</b><p>" + content + "</p>";
document.getElementById("feed").prepend(post);
document.getElementById("content").value = "";
}
</script>
</body>
</html>