JSFiddle - React, Tailwind, and code Playground
by moonheart
HTML
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>俄罗斯方块</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: #0a0a2e;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: 'Segoe UI', Arial, sans-serif;
overflow: hidden;
}
.game-wrapper {
display: flex;
gap: 24px;
align-items: flex-start;
}
.side-panel {
display: flex;
flex-direction: column;
gap: 16px;
min-width: 140px;
}
.panel-box {
background: rgba(255,255,255,0.05);
border: 2px solid rgba(255,255,255,0.1);
border-radius: 12px;
padding: 16px;
text-align: center;
}
.panel-box h3 {
color: #888;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 8px;
}
.panel-box .value {
color: #fff;
font-size: 24px;
font-weight: bold;
}
#next-canvas {
display: block;
margin: 0 auto;
}
.game-board-container {
position: relative;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 0 60px rgba(100, 100, 255, 0.15), inset 0 0 60px rgba(0,0,0,0.3);
}
#game-canvas {
display: block;
background: #0f0f3a;
}
.overlay {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: rgba(0,0,0,0.75);
z-index: 10;
backdrop-filter: blur(4px);
}
.overlay.hidden { display: none; }
.overlay h2 {
color: #fff;
font-size: 36px;
margin-bottom: 8px;
text-shadow: 0 0 20px rgba(150,150,255,0.8);
}
.overlay p {
color: #aaa;
font-size: 14px;
margin-bottom: 24px;
}
.btn {
padding: 12px 36px;
...