-
Gallery slide reveal animation
HTML
CSS
JavaScript
Welcome Back
Sign in to continue
Username
Password
Sign In
Forgot Password?
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; } body { height: 100vh; background: #0a0a0a; display: flex; overflow: hidden; transition: 0.6s; } /* LIGHT MODE */ body.light-on { background: radial-gradient(circle at 30% 30%, #fff3b0, #d6b85a); } /* LAYOUT */ .left { width: 50%; position: relative; } .right { width: 50%; display: flex; align-items: center; justify-content: center; transform: translateX(100%); opacity: 0; transition: 0.8s cubic-bezier(.25,.8,.25,1); } body.light-on .right { transform: translateX(0); opacity: 1; } /* BULB POSITION */ .bulb-position { position: absolute; top: 0; left: 50%; transform: translateX(-50%); } /* SWING LAYER */ .bulb-swing { transform-origin: top center; } /* WIRE */ .wire { width: 2px; height: 180px; background: linear-gradient(#777, #333); margin: auto; } /* BULB GLASS */ .bulb { width: 70px; height: 90px; border-radius: 50% 50% 45% 45%; margin: auto; position: relative; cursor: pointer; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), rgba(255,255,255,0.05)); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.2); transition: 0.4s; } /* METAL HOLDER */ .bulb::before { content: ""; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 32px; height: 22px; border-radius: 6px; background: linear-gradient(#888, #444); } /* FILAMENT */ .filament { position: absolute; top: 35%; left: 50%; width: 20px; height: 30px; transform: translateX(-50%); border: 2px solid #ffcc66; border-radius: 10px; opacity: 0.4; transition: 0.4s; } /* GLOW */ .glow { width: 320px; height: 320px; background: radial-gradient(circle, rgba(255,240,150,0.5), transparent 70%); margin: auto; margin-top: -60px; opacity: 0; transition: 0.5s; filter: blur(10px); } /* LIGHT ON */ body.light-on .bulb { background: radial-gradient(circle at center, #fff6c0, #ffd54f); box-shadow: 0 0 30px #ffd54f, 0 0 80px #ffec99, 0 0 140px rgba(255, 220, 100, 0.6); } body.light-on .filament { opacity: 1; box-shadow: 0 0 10px #ffcc66; } body.light-on .glow { opacity: 1; } /* SWING */ @keyframes swing { 0% { transform: rotate(10deg); } 50% { transform: rotate(-10deg); } 100% { transform: rotate(10deg); } } .bulb-swing.animate { animation: swing 1.5s ease-in-out; } /* ================= LOGIN UI ================= */ .card { width: 360px; padding: 40px 30px; border-radius: 25px; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(25px); box-shadow: 0 25px 60px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.2); color: #222; text-align: center; position: relative; overflow: hidden; } /* shine */ .card::before { content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 60%); transform: rotate(25deg); } .card h2 { margin-bottom: 5px; } .subtitle { font-size: 13px; margin-bottom: 25px; opacity: 0.7; } /* INPUT */ .input-group { position: relative; margin-bottom: 20px; } .input-group input { width: 100%; padding: 14px; border-radius: 12px; border: none; outline: none; background: rgba(255,255,255,0.3); font-size: 14px; } /* FLOAT LABEL */ .input-group label { position: absolute; left: 14px; top: 14px; font-size: 14px; color: #555; pointer-events: none; transition: 0.3s; } .input-group input:focus + label, .input-group input:valid + label { top: -8px; left: 10px; font-size: 11px; background: #fff; padding: 2px 6px; border-radius: 6px; } /* FOCUS */ .input-group input:focus { box-shadow: 0 0 0 2px rgba(255, 200, 0, 0.6); } /* BUTTON */ .login-btn { width: 100%; padding: 14px; border-radius: 12px; border: none; background: linear-gradient(135deg, #ffcc00, #ffaa00); font-weight: 600; cursor: pointer; transition: 0.3s; } .login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(255,170,0,0.4); } /* EXTRA */ .extra { margin-top: 15px; font-size: 12px; opacity: 0.7; cursor: pointer; }
const bulb = document.getElementById("bulb"); const swing = document.getElementById("swing"); bulb.addEventListener("click", () => { document.body.classList.toggle("light-on"); // restart swing animation swing.classList.remove("animate"); void swing.offsetWidth; swing.classList.add("animate"); });
Live Preview