@wsl233/dsh-gomoku 0.3.5 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ui/gomoku.css CHANGED
@@ -654,6 +654,10 @@
654
654
  border-top: 1px dashed #f2e4d4;
655
655
  }
656
656
 
657
+ .gk-levels[hidden] {
658
+ display: none;
659
+ }
660
+
657
661
  .gk-levels-label {
658
662
  margin-right: 2px;
659
663
  color: #9b8e80;
@@ -752,7 +756,7 @@
752
756
  justify-content: center;
753
757
  gap: 5px 6px;
754
758
  padding: 8px 10px;
755
- width: min(520px, calc(100% - 16px));
759
+ width: min(560px, calc(100% - 16px));
756
760
  border: 1px solid rgba(249, 115, 22, 0.22);
757
761
  border-radius: 14px;
758
762
  background: rgba(255, 255, 255, 0.96);
@@ -768,7 +772,7 @@
768
772
  }
769
773
 
770
774
  .gk-app.is-panel-narrow .gk-review-chart {
771
- height: 38px;
775
+ height: 88px;
772
776
  }
773
777
 
774
778
  .gk-reviewbar[hidden] {
@@ -829,15 +833,44 @@
829
833
  .gk-review-chart {
830
834
  grid-area: chart;
831
835
  width: 100%;
832
- height: 46px;
836
+ height: 112px;
833
837
  border-radius: 8px;
834
- background: #fffaf4;
838
+ background: #ffffff;
835
839
  border: 1px solid #f4e6d5;
840
+ cursor: crosshair;
841
+ }
842
+
843
+ .gk-review-tip {
844
+ position: absolute;
845
+ z-index: 2;
846
+ display: flex;
847
+ flex-direction: column;
848
+ gap: 1px;
849
+ padding: 4px 7px;
850
+ border: 1px solid #f1dcc4;
851
+ border-radius: 8px;
852
+ background: #ffffff;
853
+ box-shadow: 0 4px 12px rgba(120, 72, 20, 0.14);
854
+ color: #8a6a4e;
855
+ font-size: 10px;
856
+ line-height: 1.3;
857
+ white-space: nowrap;
858
+ pointer-events: none;
859
+ }
860
+
861
+ .gk-review-tip strong {
862
+ color: #431407;
863
+ font-size: 11px;
864
+ font-weight: 600;
865
+ }
866
+
867
+ .gk-review-tip[hidden] {
868
+ display: none;
836
869
  }
837
870
 
838
871
  @media (max-width: 760px) {
839
872
  .gk-review-chart {
840
- height: 38px;
873
+ height: 88px;
841
874
  }
842
875
  }
843
876
 
@@ -1598,3 +1631,90 @@
1598
1631
  transition-duration: 0.001ms !important;
1599
1632
  }
1600
1633
  }
1634
+
1635
+ /* --- 联机与品牌图标(0.3.9) --- */
1636
+ .gk-brand-mark {
1637
+ background: transparent;
1638
+ color: #3b2a1c;
1639
+ border-radius: 0;
1640
+ box-shadow: none;
1641
+ }
1642
+
1643
+ .gk-brand-mark::before,
1644
+ .gk-brand-mark::after {
1645
+ display: none !important;
1646
+ }
1647
+
1648
+ .gk-brand-mark svg {
1649
+ width: 34px;
1650
+ height: 34px;
1651
+ display: block;
1652
+ }
1653
+
1654
+ .gk-avatar-glyph svg {
1655
+ width: 32px;
1656
+ height: 32px;
1657
+ display: block;
1658
+ }
1659
+
1660
+ .gk-menu-thumb svg {
1661
+ width: 22px;
1662
+ height: 22px;
1663
+ display: block;
1664
+ }
1665
+
1666
+ .gk-tool[hidden],
1667
+ .gk-lan-hint-toggle[hidden],
1668
+ .gk-lan-host-only[hidden] {
1669
+ display: none !important;
1670
+ }
1671
+
1672
+ .gk-player.is-static {
1673
+ cursor: default;
1674
+ }
1675
+
1676
+ .gk-player.is-host {
1677
+ cursor: pointer;
1678
+ }
1679
+
1680
+ .gk-lan-hint-toggle {
1681
+ margin-top: 14px;
1682
+ display: flex;
1683
+ align-items: center;
1684
+ gap: 8px;
1685
+ padding: 9px 10px;
1686
+ border: 1px solid #f4e3d2;
1687
+ border-radius: 10px;
1688
+ background: #fffaf5;
1689
+ color: #6b5541;
1690
+ font-size: 11.5px;
1691
+ line-height: 1.4;
1692
+ cursor: pointer;
1693
+ }
1694
+
1695
+ .gk-lan-hint-toggle input {
1696
+ width: 15px;
1697
+ height: 15px;
1698
+ accent-color: #f97316;
1699
+ flex: 0 0 auto;
1700
+ }
1701
+
1702
+ .gk-lan-request-dialog {
1703
+ width: min(392px, 100%);
1704
+ }
1705
+
1706
+ .gk-lan-request-dialog p {
1707
+ color: #6b5541;
1708
+ font-size: 12.5px;
1709
+ }
1710
+ .gk-btn.is-danger {
1711
+ border-color: #fdba74;
1712
+ background: #fff7ed;
1713
+ color: #c2410c;
1714
+ }
1715
+
1716
+ .gk-btn.is-danger:hover {
1717
+ border-color: #fb923c;
1718
+ background: #ffedd5;
1719
+ color: #9a3412;
1720
+ }
package/ui/lan.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="color-scheme" content="light">
7
7
  <title>五子棋 · 局域网加入</title>
8
- <link rel="stylesheet" href="/ui/gomoku.css?v=0.2.0-27">
8
+ <link rel="stylesheet" href="/ui/gomoku.css?v=0.2.0-32">
9
9
  <style>
10
10
  html, body { margin: 0; min-height: 100%; background: #ffffff; }
11
11
  body { min-height: 100vh; }
@@ -18,21 +18,97 @@
18
18
  font: 500 12px/1.7 "Segoe UI", "Microsoft YaHei", sans-serif;
19
19
  text-align: center;
20
20
  }
21
+ .gk-join {
22
+ min-height: 100vh;
23
+ display: grid;
24
+ place-items: center;
25
+ padding: 24px;
26
+ box-sizing: border-box;
27
+ background: #fffaf5;
28
+ }
29
+ .gk-join-card {
30
+ width: min(380px, 100%);
31
+ padding: 28px 26px;
32
+ border: 1px solid #f4e3d2;
33
+ border-radius: 24px;
34
+ background: #fff;
35
+ box-shadow: 0 18px 48px rgba(126, 86, 48, 0.12);
36
+ font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
37
+ color: #3b2a1c;
38
+ }
39
+ .gk-join-card h1 { margin: 0 0 8px; font-size: 22px; }
40
+ .gk-join-card p { margin: 0 0 20px; color: #8a6a4a; font-size: 13px; line-height: 1.7; }
41
+ .gk-join-card input {
42
+ width: 100%;
43
+ box-sizing: border-box;
44
+ height: 44px;
45
+ border: 1.5px solid #f0d9c2;
46
+ border-radius: 12px;
47
+ padding: 0 14px;
48
+ font: 600 18px/1 "Segoe UI", "Microsoft YaHei", sans-serif;
49
+ letter-spacing: 0.18em;
50
+ color: #3b2a1c;
51
+ outline: none;
52
+ }
53
+ .gk-join-card input:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12); }
54
+ .gk-join-card button {
55
+ width: 100%;
56
+ height: 44px;
57
+ margin-top: 14px;
58
+ border: 0;
59
+ border-radius: 12px;
60
+ background: #f97316;
61
+ color: #fff;
62
+ font: 700 15px/1 "Segoe UI", "Microsoft YaHei", sans-serif;
63
+ cursor: pointer;
64
+ }
65
+ .gk-join-card button:hover { background: #ea580c; }
66
+ .gk-join-error { min-height: 20px; margin: 10px 0 0; color: #c2410c; font-size: 12px; }
21
67
  </style>
22
68
  </head>
23
69
  <body>
24
70
  <div id="app"></div>
71
+ <div class="gk-join" id="join" hidden>
72
+ <form class="gk-join-card" id="join-form">
73
+ <h1>加入五子棋房间</h1>
74
+ <p>请输入房主提供的 4 位房间号,或直接打开带房间号的完整链接。</p>
75
+ <input id="join-room" inputmode="numeric" maxlength="4" pattern="[0-9]{4}" placeholder="例如 4821" autocomplete="off" aria-label="四位房间号">
76
+ <button type="submit">加入房间</button>
77
+ <div class="gk-join-error" id="join-error" role="alert"></div>
78
+ </form>
79
+ </div>
25
80
  <div class="gk-lan-note">你已通过局域网加入对局。关掉本页即离开房间。</div>
26
81
 
27
82
  <script src="/ui/engine/board.js"></script>
28
83
  <script src="/ui/engine/evaluate.js"></script>
29
84
  <script src="/ui/engine/ai.js"></script>
30
- <script src="/ui/gomoku-ui.js?v=0.2.0-27"></script>
85
+ <script src="/ui/gomoku-ui.js?v=0.2.0-32"></script>
31
86
  <script>
32
87
  (function () {
33
88
  var params = new URLSearchParams(window.location.search);
34
89
  var room = params.get('room') || '';
35
90
  var host = params.get('host') === '1';
91
+ if (!/^\d{4}$/.test(room)) {
92
+ document.getElementById('app').hidden = true;
93
+ document.querySelector('.gk-lan-note').hidden = true;
94
+ var join = document.getElementById('join');
95
+ var form = document.getElementById('join-form');
96
+ var input = document.getElementById('join-room');
97
+ var error = document.getElementById('join-error');
98
+ join.hidden = false;
99
+ input.focus();
100
+ form.addEventListener('submit', function (event) {
101
+ event.preventDefault();
102
+ var value = String(input.value || '').replace(/\s+/g, '');
103
+ if (!/^\d{4}$/.test(value)) {
104
+ error.textContent = '房间号应为 4 位数字。';
105
+ input.focus();
106
+ return;
107
+ }
108
+ window.location.search = '?room=' + encodeURIComponent(value);
109
+ });
110
+ return;
111
+ }
36
112
  window.DshGomokuUI.mount(document.getElementById('app'), {
37
113
  demo: false,
38
114
  preview: false,