From 24d8f5adbc0e63954ecb5bf4fd412904e66bdbd9 Mon Sep 17 00:00:00 2001 From: Voxel Date: Tue, 15 Apr 2025 19:09:03 -0400 Subject: [PATCH] Delete board directory --- board/index.html | 29 ------------------ board/script.js | 76 ----------------------------------------------- board/style.css | 77 ------------------------------------------------ 3 files changed, 182 deletions(-) delete mode 100644 board/index.html delete mode 100644 board/script.js delete mode 100644 board/style.css diff --git a/board/index.html b/board/index.html deleted file mode 100644 index a07933c..0000000 --- a/board/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - MilkBoard - - - - -
-

MilkBoard

-
-

Welcome,

-
- -
- - -
- -
- -
-
- - - - diff --git a/board/script.js b/board/script.js deleted file mode 100644 index 6477ba2..0000000 --- a/board/script.js +++ /dev/null @@ -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)); - }); -}); diff --git a/board/style.css b/board/style.css deleted file mode 100644 index a30bf27..0000000 --- a/board/style.css +++ /dev/null @@ -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; -}