<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>VoidForum</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: Arial, sans-serif;
            background-color: #121212;
            color: #bbb;
            overflow: hidden;
            margin: 0;
        }
        h1 {
            font-size: 3rem;
            color: #E74C3C;
            text-align: center;
            text-transform: uppercase;
            margin-top: 100px;
            animation: neonAnimation 1.5s infinite alternate;
        }
        h2 {
            color: #E74C3C;
            text-align: center;
            margin-top: 50px;
        }
        .neon {
            color: #E74C3C;
            font-size: 1.5rem;
            text-align: center;
            text-shadow: 0 0 5px #E74C3C, 0 0 10px #E74C3C, 0 0 15px #E74C3C, 0 0 20px #E74C3C;
        }
        .button {
            background-color: transparent;
            border: 2px solid #E74C3C;
            color: #E74C3C;
            padding: 15px 30px;
            text-transform: uppercase;
            border-radius: 5px;
            font-weight: bold;
            cursor: pointer;
            margin-top: 20px;
            transition: 0.3s;
            animation: neonButton 2s infinite alternate;
        }
        .button:hover {
            background-color: #E74C3C;
            color: #fff;
        }
        @keyframes neonButton {
            0% { box-shadow: 0 0 5px #E74C3C, 0 0 10px #E74C3C, 0 0 15px #E74C3C; }
            100% { box-shadow: 0 0 20px #E74C3C, 0 0 30px #E74C3C, 0 0 40px #E74C3C; }
        }
        @keyframes neonAnimation {
            0% { text-shadow: 0 0 5px #E74C3C, 0 0 10px #E74C3C, 0 0 15px #E74C3C, 0 0 20px #E74C3C; }
            100% { text-shadow: 0 0 15px #E74C3C, 0 0 30px #E74C3C, 0 0 50px #E74C3C, 0 0 100px #E74C3C; }
        }
        .posts-container {
            padding: 20px;
            margin-top: 30px;
            background-color: #222;
            border-radius: 8px;
        }
        .post {
            background-color: #333;
            margin-bottom: 20px;
            padding: 15px;
            border-left: 5px solid #E74C3C;
            border-radius: 4px;
        }
        .response {
            background-color: #444;
            margin-top: 10px;
            padding: 10px;
            border-left: 5px solid #3498DB;
        }
        .response-input {
            background-color: #555;
            border: 1px solid #444;
            color: #fff;
            padding: 10px;
            width: 80%;
            margin-bottom: 10px;
            border-radius: 5px;
        }
        footer {
            text-align: center;
            font-size: 1rem;
            margin-top: 50px;
        }
        .account-profile {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 1rem;
        }
        .account-profile span {
            color: #E74C3C;
        }
        .admin-controls {
            display: none;
        }
        .admin-active .admin-controls {
            display: block;
            color: #E74C3C;
            margin-top: 50px;
            text-align: center;
        }
        .background {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: url('background.gif') no-repeat center center fixed;
            background-size: cover;
            z-index: -1;
        }
        .post-form {
            display: none;
            background-color: #333;
            padding: 20px;
            margin-top: 20px;
            border-radius: 8px;
        }
        .post-form input, .post-form textarea {
            width: 100%;
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        .post-form button {
            padding: 10px 20px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        .post-form button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>

<div class="background"></div>

<h1>VoidForum</h1>
<div class="neon">Welcome to the Forum</div>

<div style="text-align: center;">
    <button class="button" id="askButton">Ask Something</button>
    <button class="button" id="viewButton">View Posts</button>
</div>

<div class="account-profile">
    <span id="usernameDisplay">Welcome, Guest</span><br>
    <button id="loginButton" class="button">Login as Admin</button>
</div>

<div class="post-form" id="postForm">
    <h2>Post a Question</h2>
    <form id="postFormElement">
        <input type="text" id="username" placeholder="Enter your username" required><br>
        <textarea id="message" placeholder="Write your message" required></textarea><br>
        <button type="submit">Post Message</button>
    </form>
</div>
<div>
<p>made by expose121</p>
</div>
<div class="posts-container" id="postsContainer">
    <h2>Forum Posts</h2>
</div>

<div class="admin-controls" id="adminControls">
    <h2>Admin Controls</h2>
    <button id="clearPosts" class="button">Clear All Posts</button>
</div>

<footer>&copy; 2025 VoidForum. All Rights Reserved.</footer>

<script>
    const postsContainer = document.getElementById('postsContainer');
    const postForm = document.getElementById('postForm');
    const askButton = document.getElementById('askButton');
    const viewButton = document.getElementById('viewButton');
    const loginButton = document.getElementById('loginButton');
    const usernameDisplay = document.getElementById('usernameDisplay');
    const postFormElement = document.getElementById('postFormElement');
    const adminControls = document.getElementById('adminControls');
    const clearPostsButton = document.getElementById('clearPosts');

    let isAdmin = false;
    let posts = JSON.parse(localStorage.getItem('posts')) || [];

    function renderPosts() {
        postsContainer.innerHTML = '<h2>Forum Posts</h2>';
        posts.forEach((post, index) => {
            const postDiv = document.createElement('div');
            postDiv.classList.add('post');
            postDiv.innerHTML = `
                <strong>${post.username}</strong> says:
                <p>${post.message}</p>
                ${isAdmin ? `<button class="button" onclick="deletePost(${index})">Delete Post</button>` : ''}
            `;
            postsContainer.appendChild(postDiv);
        });
    }

    function deletePost(index) {
        posts.splice(index, 1);
        localStorage.setItem('posts', JSON.stringify(posts));
        renderPosts();
    }

    function loginAsAdmin() {
        const password = prompt('Enter admin password:');
        if (password === 'theasp121') {
            isAdmin = true;
            usernameDisplay.innerText = 'Welcome, Admin';
            loginButton.style.display = 'none';
            adminControls.classList.add('admin-active');
        } else {
            alert('Incorrect password');
        }
    }

    function handlePostSubmit(event) {
        event.preventDefault();
        const username = document.getElementById('username').value;
        const message = document.getElementById('message').value;

        posts.push({ username, message });
        localStorage.setItem('posts', JSON.stringify(posts));
        renderPosts();
        postForm.style.display = 'none';
    }

    askButton.addEventListener('click', () => {
        postForm.style.display = 'block';
    });

    viewButton.addEventListener('click', renderPosts);

    loginButton.addEventListener('click', loginAsAdmin);

    postFormElement.addEventListener('submit', handlePostSubmit);

    clearPostsButton.addEventListener('click', () => {
        posts = [];
        localStorage.setItem('posts', JSON.stringify(posts));
        renderPosts();
    });

    renderPosts();
</script>

</body>
</html>
