UNPKG

@mathiscode/password-leak

Version:

A library to check for compromised passwords

349 lines (297 loc) 6.29 kB
:root { --primary-color: #6366f1; --danger-color: #ef4444; --success-color: #22c55e; --background-color: #f8fafc; --card-background: #ffffff; --text-color: #1e293b; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; background-color: var(--background-color); color: var(--text-color); line-height: 1.5; min-height: 100vh; display: flex; align-items: center; justify-content: center; } .container { padding: 1.5rem; width: 100%; max-width: 480px; } .card { background: var(--card-background); padding: 2rem; border-radius: 1rem; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); } h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-color); } .description { color: #64748b; margin-bottom: 1.5rem; } .input-group { position: relative; margin-bottom: 1.5rem; } input { width: 100%; padding: 0.75rem 1rem; padding-right: 3rem; border: 2px solid #e2e8f0; border-radius: 0.5rem; font-size: 1rem; transition: all 0.2s; } input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); } .visibility-toggle { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 0.25rem; } .check-button { width: 100%; padding: 0.75rem 1.5rem; background-color: var(--primary-color); color: white; border: none; border-radius: 0.5rem; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s; position: relative; } .check-button:hover { background-color: #4f46e5; } .check-button:disabled { opacity: 0.7; cursor: not-allowed; } .spinner { display: none; width: 1.25rem; height: 1.25rem; border: 2px solid #ffffff; border-top-color: transparent; border-radius: 50%; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); animation: spin 1s linear infinite; } @keyframes spin { to { transform: translateY(-50%) rotate(360deg); } } .result { margin-top: 1.5rem; padding: 1rem; border-radius: 0.5rem; display: none; align-items: center; gap: 0.75rem; text-align: left; } .result.danger { background-color: #fef2f2; border: 1px solid #fee2e2; color: var(--danger-color); display: flex; } .result.success { background-color: #f0fdf4; border: 1px solid #dcfce7; color: var(--success-color); display: flex; } .result-icon { font-size: 1.5rem; } .result-text { font-size: 0.875rem; font-weight: 500; } @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } .result.animate { animation: fadeIn 0.3s ease-out; } .password-strength-bar { width: 100%; height: 1rem; margin-top: 1.5rem; background: #eee; border-radius: 4px; overflow: hidden; } .password-strength-bar-fill { height: 100%; width: 0%; border-radius: 4px; transition: all 0.3s ease; } .password-strength-bar-fill.weak { width: 25%; background: #ef4444; } .password-strength-bar-fill.fair { width: 50%; background: #f97316; } .password-strength-bar-fill.good { width: 75%; background: #f97316; } .password-strength-bar-fill.strong { width: 100%; background: #22c55e; } footer { margin-top: 2rem; text-align: center; color: #666; font-size: 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; } footer a { font-weight: 700; color: #666; transition: color 0.2s ease; } footer a:hover { color: #333; } .github-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 6px; background: #f5f5f5; transition: background 0.2s ease; } .github-link:hover { background: #eee; } .github-icon { color: #333; } .npm-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 6px; background: #f5f5f5; transition: background 0.2s ease; } .npm-link:hover { background: #eee; } .npm-icon { color: #333; } .info-link { font-size: 0.85rem; text-decoration: underline; opacity: 0.8; } .info-link:hover { opacity: 1; } #confetti { pointer-events: none } .warning-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1000; animation: pulse 1s ease-in-out infinite; background: rgba(255, 0, 0, 0.1); } .warning-light { position: absolute; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(255,0,0,0.8) 0%, rgba(255,0,0,0) 70%); animation: rotate 2s linear infinite; } .warning-light:nth-child(1) { top: 0; left: 0; animation-delay: 0s; } .warning-light:nth-child(2) { top: 0; right: 0; animation-delay: 0.5s; } .warning-light:nth-child(3) { bottom: 0; left: 0; animation-delay: 1s; } .warning-light:nth-child(4) { bottom: 0; right: 0; animation-delay: 1.5s; } @keyframes pulse { 0% { background: rgba(255, 0, 0, 0.1); } 50% { background: rgba(255, 0, 0, 0.2); } 100% { background: rgba(255, 0, 0, 0.1); } } @keyframes rotate { 0% { transform: scale(0.8); opacity: 0.8; } 50% { transform: scale(1.2); opacity: 0.5; } 100% { transform: scale(0.8); opacity: 0.8; } } .warning-overlay.fade-out { animation: fadeOut 0.5s forwards; } @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } } .result.danger { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; } @keyframes shake { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 40%, 60% { transform: translate3d(4px, 0, 0); } }