Built with anycoder
分数 0
目标 30
❤️❤️❤️
难度 入门

太空打字

在输入框中输入字母消灭单词!

  • 选中难度:入门 / 初级 / 进阶
  • 目标:达到目标分数即可通关
  • 生命:3条,错字或漏字会扣生命
=== assets/css/styles.css === :root{ --bg: #0b1020; --bg-2: #141a33; --primary: #7c3aed; --primary-2: #8b5cf6; --accent: #22d3ee; --good: #10b981; --bad: #ef4444; --text: #e5e7eb; --muted: #9ca3af; --card: #1f2937; --shadow: rgba(0,0,0,.35); --radius: 14px; } * { box-sizing: border-box; } html, body { height: 100%; } body { margin: 0; background: radial-gradient(1200px 800px at 20% 10%, #1a1f3d, transparent), radial-gradient(900px 700px at 80% 20%, #132042, transparent), var(--bg); color: var(--text); font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255,255,255,0.06); } .brand { color: #93c5fd; text-decoration: none; font-weight: 700; padding: 6px 10px; border-radius: 8px; transition: background .2s ease; } .brand:hover { background: rgba(147,197,253,.15); } .controls { display: flex; gap: 8px; } .control-btn { background: var(--card); color: var(--text); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 8px 10px; cursor: pointer; transition: transform .08s ease, background .2s ease; } .control-btn:hover { background: #243244; } .control-btn:active { transform: scale(0.98); } .main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-height: calc(100vh - 80px); } .hud { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; background: rgba(31,41,55,0.6); padding: 12px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 10px 30px var(--shadow); } .hud-left, .hud-right { display: flex; align-items: center; gap: 16px; } .hud-center { display: flex; justify-content: center; } .stat, .difficulty { display: flex; gap: 6px; align-items: center; background: rgba(255,255,255,0.06); padding: 6px 10px; border-radius: 10px; } .label { color: var(--muted); font-weight: 600; } .value { color: var(--text); font-weight: 800; } .progress { width: min(60vw, 420px); height: 14px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,0.06); } .progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .2s linear; } .hearts { font-size: 20px; } .game-area { position: relative; background: linear-gradient(180deg, rgba(20,26,51,0.7), rgba(11,16,32,0.8)); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 20px 40px var(--shadow); min-height: min(58vh, 520px); overflow: hidden; } /* subtle stars */ .game-area::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.6), transparent), radial-gradient(1.5px 1.5px at 80% 60%, rgba(255,255,255,0.5), transparent), radial-gradient(1.2px 1.2px at 50% 80%, rgba(255,255,255,0.4), transparent), radial-gradient(1.5px 1.5px at 10% 70%, rgba(255,255,255,0.5), transparent), radial-gradient(2px 2px at 60% 20%, rgba(255,255,255,0.6), transparent); pointer-events: none; } .instructions { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); } .instructions h1 { margin: 0 0 6px 0; color: var(--text); font-size: 32px; letter-spacing: 1px; } .word { position: absolute; top: -60px; left: 0; padding: 6px 10px; font-weight: 800; font-size: clamp(18px, 2.5vw, 24px); color: #111827; background: linear-gradient(180deg, #fef3c7, #fde68a); border: 2px solid #f59e0b; border-radius: 10px; box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 -2px 0 rgba(0,0,0,0.1); transform: translate3d(0, 0, 0); will-change: transform; user-select: none; white-space: nowrap; } .word::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none; background: radial-gradient(50% 60% at 50% 10%, rgba(255,255,255,.35), transparent); } .word.matching { background: linear-gradient(180deg, #bbf7d0, #86efac); border-color: var(--good); transform: scale(1.05); } .word.target { animation: pulse 1.2s infinite; outline: 2px dashed rgba(16,185,129,.6); outline-offset: 2px; } @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129, 0.6); } 70% { box-shadow: 0 0 0 10px rgba(16,185,129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129, 0); } } .word.cleared { background: linear-gradient(180deg, #dbeafe, #93c5fd); border-color: var(--accent); animation: pop .25s ease forwards; } @keyframes pop { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.3) translateY(-10px); opacity: 0; } } .input-bar { display: flex; justify-content: center; padding-bottom: 8px; } #typeInput { width: min(600px, 90vw); padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.15); background: rgba(31,41,55,0.9); color: var(--text); font-size: 18px; font-weight: 700; outline: none; transition: border-color .2s ease, box-shadow .2s ease; } #typeInput:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(139,92,246,0.25); } .overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.55); z-index: 50; padding: 16px; } .overlay.hidden { display: none; } .modal { width: min(520px, 92vw); background: var(--card); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 18px; box-shadow: 0 30px 60px var(--shadow); } .modal h2 { margin: 0 0 8px 0; } .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; } .primary, .secondary, .diff-btn { padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-weight: 700; } .primary { background: linear-gradient(90deg, var(--primary), var(--primary-2)); color: white; } .secondary { background: transparent; color: var(--text); border-color: rgba(255,255,255,0.2); } .diff-btn { width: 100%; margin: 6px 0; background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid rgba(255,255,255,0.12); } .diff-btn:hover { background: rgba(255,255,255,0.12); } .difficulty-picker { margin-top: 8px; } .help-content { color: var(--muted); }