mirror of
https://github.com/milk-net/milk-net.github.io.git
synced 2025-04-19 05:33:40 -05:00
Delete board directory
This commit is contained in:
parent
68d788dac2
commit
24d8f5adbc
3 changed files with 0 additions and 182 deletions
|
@ -1,29 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>MilkBoard</title>
|
|
||||||
<link id="favicon" rel="icon" href="/assets/img/milk.png" type="image/x-icon">
|
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<h1>MilkBoard</h1>
|
|
||||||
<div id="user-info">
|
|
||||||
<p>Welcome, <span id="username"></span></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form id="post-form">
|
|
||||||
<textarea id="post-content" placeholder="Yap here..." required></textarea>
|
|
||||||
<button type="submit">Post</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div id="posts-section">
|
|
||||||
<!-- Posts will appear here -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="script.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,76 +0,0 @@
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
|
||||||
const BACKEND_URL = 'https://milk.servemp3.com/board-backend/'; // Replace with your actual URL
|
|
||||||
|
|
||||||
function generateRandomUsername() {
|
|
||||||
const randomNum = Math.floor(Math.random() * 1000);
|
|
||||||
return `milkenjoyer[${randomNum.toString().padStart(3, '0')}]`;
|
|
||||||
}
|
|
||||||
|
|
||||||
let username = localStorage.getItem('username');
|
|
||||||
if (!username) {
|
|
||||||
username = generateRandomUsername(); // Temporary
|
|
||||||
}
|
|
||||||
document.getElementById('username').innerText = username;
|
|
||||||
|
|
||||||
function renderPosts(posts) {
|
|
||||||
const postsSection = document.getElementById('posts-section');
|
|
||||||
postsSection.innerHTML = '';
|
|
||||||
posts.forEach(post => {
|
|
||||||
const postDiv = document.createElement('div');
|
|
||||||
postDiv.classList.add('post');
|
|
||||||
|
|
||||||
const postUsername = document.createElement('p');
|
|
||||||
postUsername.classList.add('username');
|
|
||||||
postUsername.innerText = post.username;
|
|
||||||
|
|
||||||
const postContent = document.createElement('p');
|
|
||||||
postContent.classList.add('content');
|
|
||||||
postContent.innerText = post.content;
|
|
||||||
|
|
||||||
postDiv.appendChild(postUsername);
|
|
||||||
postDiv.appendChild(postContent);
|
|
||||||
postsSection.appendChild(postDiv);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadPosts() {
|
|
||||||
fetch(`${BACKEND_URL}/posts`)
|
|
||||||
.then(res => res.json())
|
|
||||||
.then(data => renderPosts(data))
|
|
||||||
.catch(err => console.error('Failed to load posts', err));
|
|
||||||
}
|
|
||||||
|
|
||||||
loadPosts();
|
|
||||||
|
|
||||||
const postForm = document.getElementById('post-form');
|
|
||||||
const postContent = document.getElementById('post-content');
|
|
||||||
|
|
||||||
postForm.addEventListener('submit', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
const content = postContent.value.trim();
|
|
||||||
if (!content) return;
|
|
||||||
|
|
||||||
const newPost = {
|
|
||||||
username,
|
|
||||||
content,
|
|
||||||
timestamp: new Date().toISOString()
|
|
||||||
};
|
|
||||||
|
|
||||||
fetch(`${BACKEND_URL}/posts`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
body: JSON.stringify(newPost)
|
|
||||||
})
|
|
||||||
.then(res => res.json())
|
|
||||||
.then(() => {
|
|
||||||
if (!localStorage.getItem('username')) {
|
|
||||||
localStorage.setItem('username', username);
|
|
||||||
}
|
|
||||||
loadPosts();
|
|
||||||
postContent.value = '';
|
|
||||||
})
|
|
||||||
.catch(err => console.error('Failed to post', err));
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,77 +0,0 @@
|
||||||
body {
|
|
||||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
background: linear-gradient(to right, black, #1e3a8a); /* Black to Blue gradient */
|
|
||||||
color: white; /* Set text color to white */
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
width: 80%;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 20px;
|
|
||||||
background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black background */
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
#user-info {
|
|
||||||
text-align: right;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
#post-form {
|
|
||||||
margin-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#post-content {
|
|
||||||
width: 80%;
|
|
||||||
height: 100px;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
background-color: #333;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
padding: 10px 20px;
|
|
||||||
background-color: #4CAF50;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover {
|
|
||||||
background-color: #45a049;
|
|
||||||
}
|
|
||||||
|
|
||||||
#posts-section {
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post {
|
|
||||||
padding: 10px;
|
|
||||||
border-bottom: 1px solid #444;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent background for posts */
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post .username {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post .content {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue