ymo2017 commited on
Commit
edeb8ec
·
verified ·
1 Parent(s): 20b672e

界面贴图: 菜单横幅+5张卡片图, 5款游戏加背景纹理层

Browse files
art/bg-breakout.webp ADDED
art/bg-down100-cave.webp ADDED
art/bg-pinball.webp ADDED
art/bg-shooter.webp ADDED
art/bg-tetris.webp ADDED
art/card-breakout.webp ADDED
art/card-down100.webp ADDED
art/card-pinball.webp ADDED
art/card-shooter.webp ADDED
art/card-tetris.webp ADDED
art/hero.webp ADDED
down100.html CHANGED
The diff for this file is too large to render. See raw diff
 
index.html CHANGED
@@ -17,7 +17,10 @@
17
  .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,340px));gap:22px;justify-content:center;width:100%;max-width:760px}
18
  .card{display:block;text-decoration:none;color:var(--ink);border:1px solid var(--line);background:var(--panel);padding:0;transition:transform .12s,border-color .12s,box-shadow .12s}
19
  .card:hover,.card:focus-visible{transform:translateY(-3px);border-color:var(--cyan);box-shadow:0 12px 34px rgba(0,0,0,.55),0 0 0 1px rgba(66,215,231,.35);outline:none}
20
- .art{height:150px;display:grid;place-items:center;font-size:64px;background:linear-gradient(160deg,#0a1826,#050b14);border-bottom:1px solid var(--line)}
 
 
 
21
  .body{padding:18px}
22
  .body h2{margin:0 0 6px;font-size:19px;letter-spacing:.06em;color:#fff}
23
  .body p{margin:0 0 12px;color:var(--muted);font-size:12px;line-height:1.7}
@@ -34,9 +37,10 @@
34
  <h1>街机游戏合集</h1>
35
  <p class="sub">打开即玩 · 无需安装</p>
36
  </header>
 
37
  <main class="grid">
38
  <a class="card" href="down100.html">
39
- <div class="art">🧑‍🚀</div>
40
  <div class="body">
41
  <h2>是男人就下100层 · 宽屏版</h2>
42
  <p>操纵宇航员一路向下,躲开钉刺、踩稳平台,挑战 100 层深井。电脑宽屏版。</p>
@@ -45,7 +49,7 @@
45
  </div>
46
  </a>
47
  <a class="card" href="space-pinball.html">
48
- <div class="art">🪐</div>
49
  <div class="body">
50
  <h2>宇宙弹球</h2>
51
  <p>星云主题的弹球台:霓虹挡板、行星保险杠,三条命,看看你能拿多少分。</p>
@@ -54,7 +58,7 @@
54
  </div>
55
  </a>
56
  <a class="card" href="neon-breakout.html">
57
- <div class="art">🧱</div>
58
  <div class="body">
59
  <h2>霓虹打砖块</h2>
60
  <p>经典打砖块霓虹重制:多血砖块、加长/减速/多球道具、连击加分,一关比一关快。</p>
@@ -63,7 +67,7 @@
63
  </div>
64
  </a>
65
  <a class="card" href="tetris.html">
66
- <div class="art">🟪</div>
67
  <div class="body">
68
  <h2>俄罗斯方块</h2>
69
  <p>标准规则:7-bag 发牌、幽灵块、暂存、连击 Tetris 加成,看看你能到几级。</p>
@@ -72,7 +76,7 @@
72
  </div>
73
  </a>
74
  <a class="card" href="star-shooter.html">
75
- <div class="art">🚀</div>
76
  <div class="body">
77
  <h2>星际射击</h2>
78
  <p>纵版太空射击:自动开火专注走位,波次递增,每 5 波一只精英怪等你挑战。</p>
 
17
  .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,340px));gap:22px;justify-content:center;width:100%;max-width:760px}
18
  .card{display:block;text-decoration:none;color:var(--ink);border:1px solid var(--line);background:var(--panel);padding:0;transition:transform .12s,border-color .12s,box-shadow .12s}
19
  .card:hover,.card:focus-visible{transform:translateY(-3px);border-color:var(--cyan);box-shadow:0 12px 34px rgba(0,0,0,.55),0 0 0 1px rgba(66,215,231,.35);outline:none}
20
+ .art{height:170px;overflow:hidden;border-bottom:1px solid var(--line);background:#050b14}
21
+ .art img{width:100%;height:100%;object-fit:cover;display:block}
22
+ .hero{width:100%;max-width:760px;margin:0 0 30px;border:1px solid var(--line);overflow:hidden}
23
+ .hero img{width:100%;display:block}
24
  .body{padding:18px}
25
  .body h2{margin:0 0 6px;font-size:19px;letter-spacing:.06em;color:#fff}
26
  .body p{margin:0 0 12px;color:var(--muted);font-size:12px;line-height:1.7}
 
37
  <h1>街机游戏合集</h1>
38
  <p class="sub">打开即玩 · 无需安装</p>
39
  </header>
40
+ <div class="hero"><img src="art/hero.webp" alt="霓虹街机合集"></div>
41
  <main class="grid">
42
  <a class="card" href="down100.html">
43
+ <div class="art"><img src="art/card-down100.webp" alt="是男人就下100层"></div>
44
  <div class="body">
45
  <h2>是男人就下100层 · 宽屏版</h2>
46
  <p>操纵宇航员一路向下,躲开钉刺、踩稳平台,挑战 100 层深井。电脑宽屏版。</p>
 
49
  </div>
50
  </a>
51
  <a class="card" href="space-pinball.html">
52
+ <div class="art"><img src="art/card-pinball.webp" alt="宇宙弹球"></div>
53
  <div class="body">
54
  <h2>宇宙弹球</h2>
55
  <p>星云主题的弹球台:霓虹挡板、行星保险杠,三条命,看看你能拿多少分。</p>
 
58
  </div>
59
  </a>
60
  <a class="card" href="neon-breakout.html">
61
+ <div class="art"><img src="art/card-breakout.webp" alt="霓虹打砖块"></div>
62
  <div class="body">
63
  <h2>霓虹打砖块</h2>
64
  <p>经典打砖块霓虹重制:多血砖块、加长/减速/多球道具、连击加分,一关比一关快。</p>
 
67
  </div>
68
  </a>
69
  <a class="card" href="tetris.html">
70
+ <div class="art"><img src="art/card-tetris.webp" alt="俄罗斯方块"></div>
71
  <div class="body">
72
  <h2>俄罗斯方块</h2>
73
  <p>标准规则:7-bag 发牌、幽灵块、暂存、连击 Tetris 加成,看看你能到几级。</p>
 
76
  </div>
77
  </a>
78
  <a class="card" href="star-shooter.html">
79
+ <div class="art"><img src="art/card-shooter.webp" alt="星际射击"></div>
80
  <div class="body">
81
  <h2>星际射击</h2>
82
  <p>纵版太空射击:自动开火专注走位,波次递增,每 5 波一只精英怪等你挑战。</p>
neon-breakout.html CHANGED
@@ -23,6 +23,7 @@
23
  "use strict";
24
  /* ============ 霓虹打砖块 · 单文件零外部资源 ============ */
25
  const W=960,H=600;
 
26
  const cv=document.getElementById('cv'),ctx=cv.getContext('2d');
27
 
28
  /* ---------- 音频(首次按键/点击后初始化) ---------- */
@@ -324,6 +325,7 @@ function drawBackground(){
324
  const g=ctx.createLinearGradient(0,0,0,H);
325
  g.addColorStop(0,'#060a16'); g.addColorStop(0.6,'#04060d'); g.addColorStop(1,'#080512');
326
  ctx.fillStyle=g; ctx.fillRect(0,0,W,H);
 
327
  // 星空
328
  ctx.save();
329
  for(let i=0;i<70;i++){
 
23
  "use strict";
24
  /* ============ 霓虹打砖块 · 单文件零外部资源 ============ */
25
  const W=960,H=600;
26
+ const bgTex=new Image();bgTex.src='art/bg-breakout.webp';
27
  const cv=document.getElementById('cv'),ctx=cv.getContext('2d');
28
 
29
  /* ---------- 音频(首次按键/点击后初始化) ---------- */
 
325
  const g=ctx.createLinearGradient(0,0,0,H);
326
  g.addColorStop(0,'#060a16'); g.addColorStop(0.6,'#04060d'); g.addColorStop(1,'#080512');
327
  ctx.fillStyle=g; ctx.fillRect(0,0,W,H);
328
+ if(bgTex.complete&&bgTex.naturalWidth){const sc=Math.max(W/bgTex.naturalWidth,H/bgTex.naturalHeight),dw=bgTex.naturalWidth*sc,dh=bgTex.naturalHeight*sc;ctx.globalAlpha=.85;ctx.drawImage(bgTex,(W-dw)/2,(H-dh)/2,dw,dh);ctx.globalAlpha=1;}
329
  // 星空
330
  ctx.save();
331
  for(let i=0;i<70;i++){
space-pinball.html CHANGED
The diff for this file is too large to render. See raw diff
 
star-shooter.html CHANGED
@@ -29,6 +29,7 @@
29
  音效全部 Web Audio 合成。
30
  ============================================================ */
31
  const W = 540, H = 800;
 
32
  const cv = document.getElementById('cv');
33
  const ctx = cv.getContext('2d');
34
 
@@ -579,6 +580,14 @@ function draw() {
579
  // 背景
580
  ctx.fillStyle = '#030711';
581
  ctx.fillRect(-20, -20, W + 40, H + 40);
 
 
 
 
 
 
 
 
582
  for (const L of starLayers) {
583
  ctx.fillStyle = L.c;
584
  for (const s of L.stars) {
 
29
  音效全部 Web Audio 合成。
30
  ============================================================ */
31
  const W = 540, H = 800;
32
+ const nebula = new Image(); nebula.src = 'art/bg-shooter.webp';
33
  const cv = document.getElementById('cv');
34
  const ctx = cv.getContext('2d');
35
 
 
580
  // 背景
581
  ctx.fillStyle = '#030711';
582
  ctx.fillRect(-20, -20, W + 40, H + 40);
583
+ if (nebula.complete && nebula.naturalWidth) {
584
+ const sc = Math.max(W / nebula.naturalWidth, H / nebula.naturalHeight),
585
+ dw = nebula.naturalWidth * sc, dh = nebula.naturalHeight * sc;
586
+ const oy = -((elapsed * 12) % dh);
587
+ ctx.globalAlpha = .55;
588
+ for (let yy = oy; yy < H; yy += dh) ctx.drawImage(nebula, (W - dw) / 2, yy, dw, dh);
589
+ ctx.globalAlpha = 1;
590
+ }
591
  for (const L of starLayers) {
592
  ctx.fillStyle = L.c;
593
  for (const s of L.stars) {
tetris.html CHANGED
@@ -401,8 +401,10 @@ function panelText(label,value,x,y,big){
401
  ctx.fillStyle='#eef7fc'; ctx.font=(big?'26px':'20px')+' "PingFang SC","Microsoft YaHei",monospace';
402
  ctx.fillText(String(value),x,y+(big?30:26));
403
  }
 
404
  function draw(now){
405
  ctx.drawImage(bgC,0,0);
 
406
  /* ---- 井 ---- */
407
  ctx.save();
408
  ctx.shadowColor='rgba(34,230,255,.45)'; ctx.shadowBlur=24;
 
401
  ctx.fillStyle='#eef7fc'; ctx.font=(big?'26px':'20px')+' "PingFang SC","Microsoft YaHei",monospace';
402
  ctx.fillText(String(value),x,y+(big?30:26));
403
  }
404
+ const bgTex=new Image();bgTex.src='art/bg-tetris.webp';
405
  function draw(now){
406
  ctx.drawImage(bgC,0,0);
407
+ if(bgTex.complete&&bgTex.naturalWidth){const sc=Math.max(740/bgTex.naturalWidth,600/bgTex.naturalHeight),dw=bgTex.naturalWidth*sc,dh=bgTex.naturalHeight*sc;ctx.globalAlpha=.8;ctx.drawImage(bgTex,(740-dw)/2,(600-dh)/2,dw,dh);ctx.globalAlpha=1;}
408
  /* ---- 井 ---- */
409
  ctx.save();
410
  ctx.shadowColor='rgba(34,230,255,.45)'; ctx.shadowBlur=24;