asterism-games 0.18.0 → 0.19.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +72 -0
- data/README.md +321 -3
- data/VERSION +1 -1
- data/bin/asterism-games +8 -0
- data/lib/asterism_games/ai.rb +64 -0
- data/lib/asterism_games/commentate/ai_comment.rb +633 -0
- data/lib/asterism_games/commentate/assets/TILES_LICENSE.txt +42 -0
- data/lib/asterism_games/commentate/assets/commentate.css +100 -0
- data/lib/asterism_games/commentate/assets/commentate.js +735 -0
- data/lib/asterism_games/commentate/assets/index.html +26 -0
- data/lib/asterism_games/commentate/assets/tiles_hand.bmp +0 -0
- data/lib/asterism_games/commentate/assets/tiles_river.bmp +0 -0
- data/lib/asterism_games/commentate/mahjong.rb +400 -0
- data/lib/asterism_games/commentate/mahjong_events.rb +320 -0
- data/lib/asterism_games/commentate/mahjong_phrases.rb +535 -0
- data/lib/asterism_games/commentate/mahjong_voice.yml +93 -0
- data/lib/asterism_games/commentate/server.rb +204 -0
- data/lib/asterism_games/commentate/voice.rb +394 -0
- data/lib/asterism_games/commentate/voicevox.rb +110 -0
- data/lib/asterism_games/commentate.rb +223 -0
- metadata +18 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* The commentary page (README "Commentary"): a bar of states on top, the
|
|
2
|
+
table in a canvas, the captions below (the newest at the bottom). */
|
|
3
|
+
:root {
|
|
4
|
+
--bg: #10241a;
|
|
5
|
+
--panel: #173626;
|
|
6
|
+
--text: #e8efe9;
|
|
7
|
+
--dim: #9fb5a6;
|
|
8
|
+
--accent: #ffd166;
|
|
9
|
+
--hot: #ff7b6b;
|
|
10
|
+
--line: #2c5a40;
|
|
11
|
+
--ai: #8fd3ff;
|
|
12
|
+
}
|
|
13
|
+
* { box-sizing: border-box; }
|
|
14
|
+
html, body { margin: 0; padding: 0; }
|
|
15
|
+
body {
|
|
16
|
+
background: var(--bg);
|
|
17
|
+
color: var(--text);
|
|
18
|
+
font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
min-height: 100vh;
|
|
22
|
+
}
|
|
23
|
+
body.obs { background: transparent; }
|
|
24
|
+
body.obs #bar, body.obs #keys, body.obs #hint { display: none; }
|
|
25
|
+
#bar {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
gap: 4px 14px;
|
|
29
|
+
align-items: center;
|
|
30
|
+
padding: 6px 12px;
|
|
31
|
+
background: #0b1912;
|
|
32
|
+
border-bottom: 1px solid var(--line);
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
}
|
|
35
|
+
#bar .strong { font-weight: bold; font-size: 16px; }
|
|
36
|
+
#bar .warn { color: var(--hot); }
|
|
37
|
+
#bar .on { color: var(--accent); }
|
|
38
|
+
#bar select { background: var(--panel); color: var(--text); border: 1px solid var(--line); font: inherit; }
|
|
39
|
+
#hint {
|
|
40
|
+
margin: 6px 12px 0;
|
|
41
|
+
padding: 6px 10px;
|
|
42
|
+
border: 1px dashed var(--accent);
|
|
43
|
+
color: var(--accent);
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
#hint[hidden] { display: none; }
|
|
48
|
+
#stage { padding: 8px 12px 0; overflow: hidden; }
|
|
49
|
+
#table { display: block; max-width: 100%; }
|
|
50
|
+
#captions {
|
|
51
|
+
flex: 1 1 auto;
|
|
52
|
+
min-height: 120px;
|
|
53
|
+
max-height: 34vh;
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
margin: 8px 12px;
|
|
56
|
+
padding: 6px 10px;
|
|
57
|
+
background: rgba(0, 0, 0, 0.35);
|
|
58
|
+
border: 1px solid var(--line);
|
|
59
|
+
font-size: 18px;
|
|
60
|
+
line-height: 1.45;
|
|
61
|
+
}
|
|
62
|
+
body.obs #captions { max-height: none; background: rgba(0, 0, 0, 0.55); }
|
|
63
|
+
.cap { display: flex; gap: 10px; }
|
|
64
|
+
.cap time { color: var(--dim); font-size: 13px; flex: none; padding-top: 4px; font-variant-numeric: tabular-nums; }
|
|
65
|
+
.cap.p2 span { font-weight: bold; }
|
|
66
|
+
.cap.p3 span { font-weight: bold; color: var(--accent); font-size: 21px; }
|
|
67
|
+
.cap.old span { color: var(--dim); }
|
|
68
|
+
/* The AI's one-liners: a mark before the text, a colour of their own. */
|
|
69
|
+
.cap .aimark {
|
|
70
|
+
flex: none;
|
|
71
|
+
align-self: flex-start;
|
|
72
|
+
margin-top: 3px;
|
|
73
|
+
padding: 0 5px;
|
|
74
|
+
font-size: 12px;
|
|
75
|
+
line-height: 18px;
|
|
76
|
+
color: #10241a;
|
|
77
|
+
background: var(--ai);
|
|
78
|
+
border-radius: 3px;
|
|
79
|
+
}
|
|
80
|
+
.cap.ai span { color: var(--ai); font-style: italic; }
|
|
81
|
+
.cap.ai.old span { color: var(--dim); }
|
|
82
|
+
#keys { padding: 0 12px 8px; color: var(--dim); font-size: 12px; }
|
|
83
|
+
/* The voice's credit (VOICEVOX:<character>), in the corner, on a stream too. */
|
|
84
|
+
#credit {
|
|
85
|
+
position: fixed;
|
|
86
|
+
right: 8px;
|
|
87
|
+
bottom: 6px;
|
|
88
|
+
padding: 1px 6px;
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
color: var(--dim);
|
|
91
|
+
background: rgba(0, 0, 0, 0.45);
|
|
92
|
+
border-radius: 3px;
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
}
|
|
95
|
+
#credit[hidden] { display: none; }
|
|
96
|
+
@media (max-width: 600px) {
|
|
97
|
+
#captions { font-size: 16px; }
|
|
98
|
+
.cap.p3 span { font-size: 18px; }
|
|
99
|
+
#stage, #captions, #hint { margin-left: 6px; margin-right: 6px; padding-left: 4px; padding-right: 4px; }
|
|
100
|
+
}
|