Spaces:
Running
Running
| <html lang="fa" dir="rtl"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Dark Glass Chat - Login</title> | |
| <!-- Import Vazirmatn font for Persian typography --> | |
| <link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css" rel="stylesheet" type="text/css" /> | |
| <!-- Import FontAwesome for Icons --> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| :root { | |
| --primary-bg: #0f172a; | |
| --glass-bg: rgba(255, 255, 255, 0.05); | |
| --glass-border: rgba(255, 255, 255, 0.1); | |
| --glass-highlight: rgba(255, 255, 255, 0.15); | |
| --text-main: #f8fafc; | |
| --text-muted: #94a3b8; | |
| --accent-color: #818cf8; /* Soft Indigo/Pastel */ | |
| --accent-hover: #6366f1; | |
| --gradient-1: #4f46e5; | |
| --gradient-2: #ec4899; | |
| --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); | |
| --transition-speed: 0.6s; | |
| } | |
| * { | |
| box-sizing: border-box; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| body { | |
| font-family: 'Vazirmatn', sans-serif; | |
| background: var(--primary-bg); | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| justify-content: center; | |
| min-height: 100vh; | |
| overflow: hidden; /* Prevent scroll bars during animation */ | |
| position: relative; | |
| } | |
| /* Background blobs for atmosphere */ | |
| .bg-blob { | |
| position: absolute; | |
| border-radius: 50%; | |
| filter: blur(80px); | |
| z-index: -1; | |
| opacity: 0.4; | |
| animation: float 10s infinite ease-in-out; | |
| } | |
| .blob-1 { | |
| width: 300px; | |
| height: 300px; | |
| background: var(--gradient-1); | |
| top: -50px; | |
| left: -50px; | |
| } | |
| .blob-2 { | |
| width: 250px; | |
| height: 250px; | |
| background: var(--gradient-2); | |
| bottom: -50px; | |
| right: -50px; | |
| animation-delay: -5s; | |
| } | |
| @keyframes float { | |
| 0%, 100% { transform: translate(0, 0); } | |
| 50% { transform: translate(20px, 30px); } | |
| } | |
| /* --- Header Section --- */ | |
| .app-header { | |
| position: absolute; | |
| top: 20px; | |
| width: 100%; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| padding: 0 40px; | |
| z-index: 10; | |
| } | |
| .brand { | |
| font-size: 1.2rem; | |
| font-weight: 700; | |
| color: var(--text-main); | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| text-shadow: 0 0 10px rgba(255,255,255,0.3); | |
| } | |
| .brand i { | |
| color: var(--accent-color); | |
| } | |
| .anycoder-link { | |
| font-size: 0.85rem; | |
| color: var(--text-muted); | |
| text-decoration: none; | |
| transition: color 0.3s; | |
| background: rgba(255,255,255,0.03); | |
| padding: 5px 12px; | |
| border-radius: 20px; | |
| border: 1px solid var(--glass-border); | |
| } | |
| .anycoder-link:hover { | |
| color: var(--accent-color); | |
| border-color: var(--accent-color); | |
| } | |
| /* --- Main Container (Glass Card) --- */ | |
| .container { | |
| background: var(--glass-bg); | |
| border-radius: 20px; | |
| box-shadow: var(--shadow); | |
| position: relative; | |
| overflow: hidden; | |
| width: 850px; | |
| max-width: 100%; | |
| min-height: 550px; | |
| backdrop-filter: blur(20px); | |
| -webkit-backdrop-filter: blur(20px); | |
| border: 1px solid var(--glass-border); | |
| } | |
| /* Form Layout Logic */ | |
| .form-container { | |
| position: absolute; | |
| top: 0; | |
| height: 100%; | |
| transition: all var(--transition-speed) ease-in-out; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| justify-content: center; | |
| padding: 0 50px; | |
| text-align: center; | |
| } | |
| /* Login Panel (Default) */ | |
| .sign-in-container { | |
| left: 0; | |
| width: 50%; | |
| z-index: 2; | |
| } | |
| /* Register Panel (Hidden initially) */ | |
| .sign-up-container { | |
| left: 0; | |
| width: 50%; | |
| opacity: 0; | |
| z-index: 1; | |
| } | |
| /* Animation State: Active (Panel Switch) */ | |
| .container.right-panel-active .sign-in-container { | |
| transform: translateX(100%); | |
| opacity: 0; | |
| z-index: 1; | |
| } | |
| .container.right-panel-active .sign-up-container { | |
| transform: translateX(100%); | |
| opacity: 1; | |
| z-index: 5; | |
| animation: show var(--transition-speed); | |
| } | |
| @keyframes show { | |
| 0%, 49.99% { opacity: 0; z-index: 1; } | |
| 50%, 100% { opacity: 1; z-index: 5; } | |
| } | |
| /* --- Overlay & Animation --- */ | |
| .overlay-container { | |
| position: absolute; | |
| top: 0; | |
| left: 50%; | |
| width: 50%; | |
| height: 100%; | |
| overflow: hidden; | |
| transition: transform var(--transition-speed) ease-in-out; | |
| z-index: 100; | |
| } | |
| .container.right-panel-active .overlay-container { | |
| transform: translateX(-100%); | |
| } | |
| .overlay { | |
| background: linear-gradient(to right, var(--gradient-2), var(--gradient-1)); | |
| background-repeat: no-repeat; | |
| background-size: cover; | |
| background-position: 0 0; | |
| color: #ffffff; | |
| position: relative; | |
| left: -100%; | |
| height: 100%; | |
| width: 200%; | |
| transform: translateX(0); | |
| transition: transform var(--transition-speed) ease-in-out; | |
| } | |
| .container.right-panel-active .overlay { | |
| transform: translateX(50%); | |
| } | |
| .overlay-panel { | |
| position: absolute; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| flex-direction: column; | |
| padding: 0 40px; | |
| text-align: center; | |
| top: 0; | |
| height: 100%; | |
| width: 50%; | |
| transform: translateX(0); | |
| transition: transform var(--transition-speed) ease-in-out; | |
| } | |
| .overlay-left { | |
| transform: translateX(-20%); | |
| } | |
| .container.right-panel-active .overlay-left { | |
| transform: translateX(0); | |
| } | |
| .overlay-right { | |
| right: 0; | |
| transform: translateX(0); | |
| } | |
| .container.right-panel-active .overlay-right { | |
| transform: translateX(20%); | |
| } | |
| /* --- Typography & Elements --- */ | |
| h1 { | |
| font-weight: 800; | |
| margin-bottom: 10px; | |
| color: var(--text-main); | |
| } | |
| p { | |
| font-size: 0.9rem; | |
| font-weight: 400; | |
| line-height: 1.5; | |
| letter-spacing: 0.5px; | |
| margin: 20px 0 30px; | |
| color: var(--text-muted); | |
| } | |
| .overlay p { | |
| color: rgba(255, 255, 255, 0.9); | |
| font-size: 1rem; | |
| } | |
| span { | |
| font-size: 0.8rem; | |
| color: var(--text-muted); | |
| margin-bottom: 15px; | |
| } | |
| /* Social Icons (Optional decorative) */ | |
| .social-container { | |
| margin: 15px 0; | |
| } | |
| .social-container a { | |
| border: 1px solid var(--glass-border); | |
| border-radius: 50%; | |
| display: inline-flex; | |
| justify-content: center; | |
| align-items: center; | |
| margin: 0 5px; | |
| height: 40px; | |
| width: 40px; | |
| color: var(--text-main); | |
| text-decoration: none; | |
| transition: all 0.3s ease; | |
| background: var(--glass-highlight); | |
| } | |
| .social-container a:hover { | |
| background: var(--accent-color); | |
| border-color: var(--accent-color); | |
| transform: translateY(-3px); | |
| } | |
| /* Inputs */ | |
| .input-group { | |
| position: relative; | |
| width: 100%; | |
| margin: 8px 0; | |
| } | |
| input { | |
| background-color: rgba(255, 255, 255, 0.05); | |
| border: 1px solid var(--glass-border); | |
| padding: 12px 15px; | |
| padding-right: 40px; /* Space for icon */ | |
| width: 100%; | |
| border-radius: 8px; | |
| outline: none; | |
| color: var(--text-main); | |
| font-family: 'Vazirmatn', sans-serif; | |
| transition: all 0.3s; | |
| } | |
| input:focus { | |
| background-color: rgba(255, 255, 255, 0.1); | |
| border-color: var(--accent-color); | |
| box-shadow: 0 0 10px rgba(129, 140, 248, 0.2); | |
| } | |
| .input-icon { | |
| position: absolute; | |
| right: 12px; | |
| top: 50%; | |
| transform: translateY(-50%); | |
| color: var(--text-muted); | |
| font-size: 0.9rem; | |
| transition: color 0.3s; | |
| } | |
| input:focus + .input-icon { | |
| color: var(--accent-color); | |
| } | |
| /* Buttons */ | |
| button.action-btn { | |
| border-radius: 8px; | |
| border: 1px solid transparent; | |
| background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2)); | |
| color: #ffffff; | |
| font-size: 0.9rem; | |
| font-weight: 700; | |
| padding: 12px 45px; | |
| letter-spacing: 0.5px; | |
| text-transform: uppercase; | |
| transition: transform 80ms ease-in, box-shadow 0.3s; | |
| cursor: pointer; | |
| margin-top: 15px; | |
| font-family: 'Vazirmatn', sans-serif; | |
| } | |
| button.action-btn:hover { | |
| box-shadow: 0 0 15px rgba(236, 72, 153, 0.4); | |
| transform: translateY(-2px); | |
| } | |
| button.action-btn:active { | |
| transform: scale(0.95); | |
| } | |
| button.ghost { | |
| background: transparent; | |
| border-color: #ffffff; | |
| border-radius: 8px; | |
| color: #ffffff; | |
| font-size: 0.9rem; | |
| font-weight: 700; | |
| padding: 12px 45px; | |
| letter-spacing: 0.5px; | |
| text-transform: uppercase; | |
| cursor: pointer; | |
| transition: all 0.3s; | |
| font-family: 'Vazirmatn', sans-serif; | |
| } | |
| button.ghost:hover { | |
| background: rgba(255, 255, 255, 0.2); | |
| } | |
| a.forgot-pass { | |
| color: var(--text-muted); | |
| font-size: 0.8rem; | |
| text-decoration: none; | |
| margin: 15px 0; | |
| border-bottom: 1px dashed transparent; | |
| } | |
| a.forgot-pass:hover { | |
| color: var(--accent-color); | |
| border-bottom-color: var(--accent-color); | |
| } | |
| /* --- Toast Notification --- */ | |
| .toast-container { | |
| position: fixed; | |
| top: 80px; | |
| left: 50%; | |
| transform: translateX(-50%); | |
| z-index: 1000; | |
| pointer-events: none; | |
| } | |
| .toast { | |
| background: rgba(15, 23, 42, 0.9); | |
| backdrop-filter: blur(10px); | |
| color: var(--text-main); | |
| padding: 12px 24px; | |
| border-radius: 8px; | |
| margin-bottom: 10px; | |
| box-shadow: 0 4px 12px rgba(0,0,0,0.3); | |
| border: 1px solid var(--glass-border); | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| opacity: 0; | |
| transform: translateY(-20px); | |
| transition: all 0.3s ease; | |
| } | |
| .toast.show { | |
| opacity: 1; | |
| transform: translateY(0); | |
| } | |
| .toast i { | |
| color: var(--accent-color); | |
| } | |
| /* --- Responsive Design --- */ | |
| @media (max-width: 768px) { | |
| .container { | |
| width: 100%; | |
| min-height: 600px; | |
| border-radius: 0; | |
| border: none; | |
| } | |
| .form-container { | |
| width: 100%; | |
| padding: 0 20px; | |
| } | |
| /* On mobile, we hide the overlay and just use simple visibility toggles or transitions */ | |
| .overlay-container { | |
| display: none; | |
| } | |
| .sign-in-container, .sign-up-container { | |
| position: relative; | |
| width: 100%; | |
| height: auto; | |
| padding: 40px 20px; | |
| opacity: 1; | |
| z-index: 1; | |
| transform: none ; | |
| } | |
| .sign-up-container { | |
| display: none; | |
| } | |
| .mobile-toggle { | |
| display: block; | |
| margin-top: 20px; | |
| color: var(--accent-color); | |
| cursor: pointer; | |
| font-size: 0.9rem; | |
| text-decoration: underline; | |
| } | |
| /* Logic for mobile visibility handled by JS classes */ | |
| .container.mobile-register-mode .sign-in-container { | |
| display: none; | |
| } | |
| .container.mobile-register-mode .sign-up-container { | |
| display: flex; | |
| } | |
| .app-header { | |
| padding: 0 20px; | |
| } | |
| } | |
| @media (min-width: 769px) { | |
| .mobile-toggle { | |
| display: none; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <!-- Background Decoration --> | |
| <div class="bg-blob blob-1"></div> | |
| <div class="bg-blob blob-2"></div> | |
| <!-- Header --> | |
| <header class="app-header"> | |
| <div class="brand"> | |
| <i class="fa-solid fa-paper-plane"></i> | |
| <span>ChatGlass</span> | |
| </div> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link"> | |
| Built with anycoder | |
| </a> | |
| </header> | |
| <!-- Main Container --> | |
| <main class="container" id="container"> | |
| <!-- Register Form Panel --> | |
| <div class="form-container sign-up-container"> | |
| <form id="registerForm"> | |
| <h1>ثبتنام</h1> | |
| <div class="social-container"> | |
| <a href="#" class="social"><i class="fab fa-google"></i></a> | |
| <a href="#" class="social"><i class="fab fa-github"></i></a> | |
| </div> | |
| <span>یا از ایمیل خود برای ثبت نام استفاده کنید</span> | |
| <div class="input-group"> | |
| <input type="text" placeholder="نام کامل" required /> | |
| <i class="fa-solid fa-user input-icon"></i> | |
| </div> | |
| <div class="input-group"> | |
| <input type="email" placeholder="ایمیل" required /> | |
| <i class="fa-solid fa-envelope input-icon"></i> | |
| </div> | |
| <div class="input-group"> | |
| <input type="password" placeholder="رمز عبور" required /> | |
| <i class="fa-solid fa-lock input-icon"></i> | |
| </div> | |
| <button type="submit" class="action-btn">ثبتنام</button> | |
| <div class="mobile-toggle" id="toLoginMobile">قبلاً ثبتنام کردهاید؟ ورود</div> | |
| </form> | |
| </div> | |
| <!-- Login Form Panel --> | |
| <div class="form-container sign-in-container"> | |
| <form id="loginForm"> | |
| <h1>ورود</h1> | |
| <div class="social-container"> | |
| <a href="#" class="social"><i class="fab fa-google"></i></a> | |
| <a href="#" class="social"><i class="fab fa-github"></i></a> | |
| </div> | |
| <span>یا از حساب کاربری خود استفاده کنید</span> | |
| <div class="input-group"> | |
| <input type="email" placeholder="ایمیل" required /> | |
| <i class="fa-solid fa-envelope input-icon"></i> | |
| </div> | |
| <div class="input-group"> | |
| <input type="password" placeholder="رمز عبور" required /> | |
| <i class="fa-solid fa-lock input-icon"></i> | |
| </div> | |
| <a href="#" class="forgot-pass">رمز عبور خود را فراموش کردهاید؟</a> | |
| <button type="submit" class="action-btn">ورود</button> | |
| <div class="mobile-toggle" id="toRegisterMobile">حساب ندارید؟ ثبتنام</div> | |
| </form> | |
| </div> | |
| <!-- Overlay Container (Sliding Panel) --> | |
| <div class="overlay-container"> | |
| <div class="overlay"> | |
| <!-- Left Panel (Visible when in Register mode) --> | |
| <div class="overlay-panel overlay-left"> | |
| <h1>خوش آمدید!</h1> | |
| <p>اگر قبلاً حساب کاربری ساختهاید، لطفاً وارد شوید تا با دوستان خود گفتگو کنید.</p> | |
| <button class="ghost" id="signIn">ورود</button> | |
| </div> | |
| <!-- Right Panel (Visible when in Login mode) --> | |
| <div class="overlay-panel overlay-right"> | |
| <h1>سلام دوست من!</h1> | |
| <p>اطلاعات شخصی خود را وارد کنید و سفر خود را در دنیای چت شروع کنید.</p> | |
| <button class="ghost" id="signUp">ثبتنام</button> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <!-- Toast Notification Container --> | |
| <div class="toast-container" id="toastContainer"></div> | |
| <script> | |
| // DOM Elements | |
| const container = document.getElementById('container'); | |
| const signUpBtn = document.getElementById('signUp'); | |
| const signInBtn = document.getElementById('signIn'); | |
| const toLoginMobile = document.getElementById('toLoginMobile'); | |
| const toRegisterMobile = document.getElementById('toRegisterMobile'); | |
| const loginForm = document.getElementById('loginForm'); | |
| const registerForm = document.getElementById('registerForm'); | |
| // Desktop Switch Logic | |
| signUpBtn.addEventListener('click', () => { | |
| container.classList.add("right-panel-active"); | |
| }); | |
| signInBtn.addEventListener('click', () => { | |
| container.classList.remove("right-panel-active"); | |
| }); | |
| // Mobile Switch Logic | |
| toRegisterMobile.addEventListener('click', () => { | |
| container.classList.add("mobile-register-mode"); | |
| }); | |
| toLoginMobile.addEventListener('click', () => { | |
| container.classList.remove("mobile-register-mode"); | |
| }); | |
| // Form Handling with Toast Notification | |
| function showToast(message, type = 'success') { | |
| const toastContainer = document.getElementById('toastContainer'); | |
| const toast = document.createElement('div'); | |
| toast.className = 'toast'; | |
| const icon = type === 'success' ? '<i class="fa-solid fa-check-circle"></i>' : '<i class="fa-solid fa-exclamation-circle"></i>'; | |
| toast.innerHTML = `${icon} <span>${message}</span>`; | |
| toastContainer.appendChild(toast); | |
| // Trigger animation | |
| setTimeout(() => toast.classList.add('show'), 100); | |
| // Remove after 3 seconds | |
| setTimeout(() => { | |
| toast.classList.remove('show'); | |
| setTimeout(() => toast.remove(), 300); | |
| }, 3000); | |
| } | |
| loginForm.addEventListener('submit', (e) => { | |
| e.preventDefault(); | |
| // Simulate login process | |
| const email = loginForm.querySelector('input[type="email"]').value; | |
| showToast(`خوش آمدید! شما با ایمیل ${email} وارد شدید.`); | |
| }); | |
| registerForm.addEventListener('submit', (e) => { | |
| e.preventDefault(); | |
| // Simulate registration process | |
| showToast('ثبتنام با موفقیت انجام شد. خوش آمدید!'); | |
| // Switch to login after a short delay for better UX | |
| setTimeout(() => { | |
| if (window.innerWidth > 768) { | |
| container.classList.remove("right-panel-active"); | |
| } else { | |
| container.classList.remove("mobile-register-mode"); | |
| } | |
| }, 1500); | |
| }); | |
| // Add subtle input animation focus effect via JS (optional enhancement) | |
| const inputs = document.querySelectorAll('input'); | |
| inputs.forEach(input => { | |
| input.addEventListener('focus', () => { | |
| input.parentElement.style.transform = 'scale(1.02)'; | |
| input.parentElement.style.transition = 'transform 0.3s ease'; | |
| }); | |
| input.addEventListener('blur', () => { | |
| input.parentElement.style.transform = 'scale(1)'; | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |