Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>ViralMedia – Social Media Hub</title>
- <style>
- :root {
- --gradient: linear-gradient(135deg, #f59e0b, #f97316, #ec4899);
- --bg: #fff7ed;
- --card: #fff0e5;
- --text: #4b1c06;
- }
- body {
- margin: 0;
- padding: 0;
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
- background: var(--bg);
- color: var(--text);
- display: flex;
- flex-direction: column;
- align-items: center;
- min-height: 100vh;
- padding: 40px 20px;
- position: relative;
- }
- #logo {
- font-size: 36px;
- font-weight: bold;
- background: var(--gradient);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- margin-bottom: 10px;
- }
- h1 {
- margin: 10px 0;
- font-size: 24px;
- }
- form {
- background: var(--card);
- border-radius: 20px;
- padding: 30px 25px;
- width: 100%;
- max-width: 340px;
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
- margin-top: 20px;
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- input, textarea {
- padding: 12px;
- border: none;
- border-radius: 12px;
- font-size: 15px;
- background: #fff;
- color: #333;
- box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
- resize: vertical;
- }
- button {
- padding: 12px;
- border: none;
- border-radius: 30px;
- font-size: 15px;
- font-weight: bold;
- color: white;
- background: var(--gradient);
- cursor: pointer;
- transition: all 0.3s ease;
- }
- button:hover {
- opacity: 0.9;
- }
- .hidden {
- display: none;
- }
- #showForgotBtn {
- background: none;
- color: #d97706;
- border: none;
- text-decoration: underline;
- font-size: 14px;
- margin-top: 10px;
- cursor: pointer;
- max-width: 340px;
- }
- .tagline {
- font-size: 14px;
- margin-bottom: 20px;
- color: #6b3704;
- user-select: none;
- }
- /* Tabs */
- #homePage {
- width: 100%;
- max-width: 600px;
- margin-top: 40px;
- }
- .tabs {
- display: flex;
- justify-content: space-around;
- background: var(--gradient);
- border-radius: 30px;
- padding: 12px;
- margin-bottom: 20px;
- color: white;
- font-weight: bold;
- user-select: none;
- }
- .tab-button {
- cursor: pointer;
- padding: 8px 16px;
- border-radius: 20px;
- transition: background 0.2s ease;
- }
- .tab-button.active {
- background-color: rgba(255,255,255,0.2);
- }
- .tab-content {
- background: var(--card);
- border-radius: 20px;
- padding: 20px;
- box-shadow: 0 4px 12px rgba(0,0,0,0.1);
- }
- /* Profile */
- #profileTab img {
- border-radius: 50%;
- width: 100px;
- height: 100px;
- object-fit: cover;
- }
- #profileTab h3 {
- margin: 0;
- }
- #profileTab small {
- color: #6b3704;
- }
- /* Watermark */
- #watermark {
- position: fixed;
- bottom: 8px;
- left: 50%;
- transform: translateX(-50%);
- font-size: 14px;
- color: rgba(108, 48, 4, 0.3);
- pointer-events: none;
- user-select: none;
- font-weight: 600;
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
- letter-spacing: 1.2px;
- z-index: 1000;
- }
- </style>
- </head>
- <body>
- <div id="logo">ViralMedia</div>
- <div class="tagline">Create, Connect, and Go Viral 🚀</div>
- <h1>Signup</h1>
- <form id="signupForm">
- <input type="email" id="signupEmail" placeholder="Email" required />
- <input type="text" id="signupUsername" placeholder="Username" required />
- <input type="password" id="signupPassword" placeholder="Password" required />
- <button type="submit">Create Account</button>
- </form>
- <h1 class="hidden" id="loginHeader">Login</h1>
- <form id="loginForm" class="hidden">
- <input type="text" id="loginIdentifier" placeholder="Email or Username" required />
- <input type="password" id="loginPassword" placeholder="Password" required />
- <button type="submit">Login</button>
- </form>
- <h1 class="hidden" id="forgotHeader">Forgot Password</h1>
- <form id="forgotForm" class="hidden">
- <input type="email" id="forgotEmail" placeholder="Enter your email" required />
- <button type="submit">Send Reset Link</button>
- </form>
- <button id="showForgotBtn" class="hidden">Forgot Password?</button>
- <!-- HOME PAGE -->
- <div id="homePage" class="hidden">
- <div class="tabs">
- <div class="tab-button active" data-tab="online">Online Media</div>
- <div class="tab-button" data-tab="offline">Offline Media</div>
- <div class="tab-button" data-tab="profile">Profile</div>
- </div>
- <div class="tab-content" id="onlineTab">
- <h2>📺 Online Media</h2>
- <p>Watch or upload videos, stream content, and go viral!</p>
- <button id="uploadMediaBtn" style="
- margin-top: 15px;
- padding: 12px;
- background: #ec4899;
- color: white;
- border: none;
- border-radius: 20px;
- font-weight: bold;
- cursor: pointer;
- width: 100%;
- max-width: 200px;
- ">Upload New Media</button>
- </div>
- <div class="tab-content hidden" id="offlineTab">
- <h2>📁 Offline Media</h2>
- <p>Manage your saved files, drafts, and media library.</p>
- <p style="margin-top: 20px; font-style: italic;">No offline media yet. Upload videos or files to see them here.</p>
- </div>
- <div class="tab-content hidden" id="profileTab">
- <div style="display:flex; align-items:center; gap: 15px; margin-bottom: 15px;">
- <img id="profileAvatarImg" src="https://via.placeholder.com/100?text=Avatar" alt="Avatar"/>
- <div>
- <h3 id="profileUsername">Your Username</h3>
- <small id="profileEmail">Your Email</small>
- </div>
- </div>
- <form id="profileForm" style="display:flex; flex-direction: column; gap: 10px;">
- <label for="profileBio">Bio:</label>
- <textarea id="profileBio" rows="3" placeholder="Write something about yourself..."></textarea>
- <label for="avatarUpload">Upload Avatar:</label>
- <input type="file" id="avatarUpload" accept="image/*" />
- <button type="submit">Save Profile</button>
- </form>
- </div>
- </div>
- <div id="watermark">@eggStudioz</div>
- <script>
- // Stored user data
- let savedEmail = "";
- let savedUsername = "";
- let savedPassword = "";
- let savedProfile = { bio: '', avatar: '' };
- // DOM elements
- const signupForm = document.getElementById('signupForm');
- const loginForm = document.getElementById('loginForm');
- const forgotForm = document.getElementById('forgotForm');
- const showForgotBtn = document.getElementById('showForgotBtn');
- const loginHeader = document.getElementById('loginHeader');
- const forgotHeader = document.getElementById('forgotHeader');
- const homePage = document.getElementById('homePage');
- const tabButtons = document.querySelectorAll('.tab-button');
- const tabs = {
- online: document.getElementById('onlineTab'),
- offline: document.getElementById('offlineTab'),
- profile: document.getElementById('profileTab')
- };
- const profileUsernameElem = document.getElementById('profileUsername');
- const profileEmailElem = document.getElementById('profileEmail');
- const profileBioElem = document.getElementById('profileBio');
- const profileAvatarImg = document.getElementById('profileAvatarImg');
- const avatarUpload = document.getElementById('avatarUpload');
- const profileForm = document.getElementById('profileForm');
- const uploadMediaBtn = document.getElementById('uploadMediaBtn');
- // Load stored user from localStorage
- const storedUser = JSON.parse(localStorage.getItem('viralmedia_user'));
- if (storedUser) {
- savedEmail = storedUser.email;
- savedUsername = storedUser.username;
- savedPassword = storedUser.password;
- savedProfile = storedUser.profile || { bio: '', avatar: '' };
- signupForm.classList.add('hidden');
- loginForm.classList.remove('hidden');
- loginHeader.classList.remove('hidden');
- showForgotBtn.classList.remove('hidden');
- }
- function saveUserData() {
- localStorage.setItem('viralmedia_user', JSON.stringify({
- email: savedEmail,
- username: savedUsername,
- password: savedPassword,
- profile: savedProfile
- }));
- }
- function updateProfileUI() {
- profileUsernameElem.textContent = savedUsername || "Your Username";
- profileEmailElem.textContent = savedEmail || "Your Email";
- profileBioElem.value = savedProfile.bio || '';
- if (savedProfile.avatar) {
- profileAvatarImg.src = savedProfile.avatar;
- } else {
- profileAvatarImg.src = 'https://via.placeholder.com/100?text=Avatar';
- }
- }
- // Signup
- signupForm.addEventListener('submit', e => {
- e.preventDefault();
- savedEmail = document.getElementById('signupEmail').value.trim().toLowerCase();
- savedUsername = document.getElementById('signupUsername').value.trim();
- savedPassword = document.getElementById('signupPassword').value;
- saveUserData();
- alert('Signup successful! You can now login.');
- signupForm.classList.add('hidden');
- loginForm.classList.remove('hidden');
- loginHeader.classList.remove('hidden');
- showForgotBtn.classList.remove('hidden');
- });
- // Login
- loginForm.addEventListener('submit', e => {
- e.preventDefault();
- const identifier = document.getElementById('loginIdentifier').value.trim().toLowerCase();
- const pass = document.getElementById('loginPassword').value;
- if ((identifier === savedEmail || identifier === savedUsername.toLowerCase()) && pass === savedPassword) {
- loginForm.classList.add('hidden');
- loginHeader.classList.add('hidden');
- showForgotBtn.classList.add('hidden');
- homePage.classList.remove('hidden');
- updateProfileUI();
- } else {
- alert('Invalid credentials');
- }
- });
- // Forgot Password
- showForgotBtn.addEventListener('click', () => {
- loginForm.classList.add('hidden');
- loginHeader.classList.add('hidden');
- showForgotBtn.classList.add('hidden');
- forgotForm.classList.remove('hidden');
- forgotHeader.classList.remove('hidden');
- });
- forgotForm.addEventListener('submit', e => {
- e.preventDefault();
- const email = document.getElementById('forgotEmail').value.trim().toLowerCase();
- if (email === savedEmail) {
- alert('Check your email!');
- } else {
- alert('Email not found!');
- }
- forgotForm.classList.add('hidden');
- forgotHeader.classList.add('hidden');
- loginForm.classList.remove('hidden');
- loginHeader.classList.remove('hidden');
- showForgotBtn.classList.remove('hidden');
- });
- // Tabs logic
- tabButtons.forEach(btn => {
- btn.addEventListener('click', () => {
- tabButtons.forEach(b => b.classList.remove('active'));
- btn.classList.add('active');
- const target = btn.getAttribute('data-tab');
- for (const key in tabs) {
- if (key === target) {
- tabs[key].classList.remove('hidden');
- } else {
- tabs[key].classList.add('hidden');
- }
- }
- });
- });
- // Profile form submit (bio update)
- profileForm.addEventListener('submit', e => {
- e.preventDefault();
- savedProfile.bio = profileBioElem.value.trim();
- alert('Profile saved!');
- saveUserData();
- });
- // Avatar upload handling
- avatarUpload.addEventListener('change', () => {
- const file = avatarUpload.files[0];
- if (file) {
- const reader = new FileReader();
- reader.onload = e => {
- savedProfile.avatar = e.target.result;
- updateProfileUI();
- saveUserData();
- };
- reader.readAsDataURL(file);
- }
- });
- // Upload media placeholder
- uploadMediaBtn.addEventListener('click', () => {
- alert('Media upload coming soon!');
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment