Skip to content

Commit acdb84d

Browse files
committed
修改样式
1 parent 12d06d8 commit acdb84d

3 files changed

Lines changed: 36 additions & 15 deletions

File tree

source/_posts/2026/03/使用打表法计算麻将向听数.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ $$s=2\times(4-m)-\max(d,4-m)-q$$
8282

8383
{% note primary %}
8484

85-
将九索视为雀头:$m = 1,\ d=2,\ q=1,\ s=2\times 3-2-1=3$
86-
将九索视为刻搭:$m = 1,\ d=3,\ q=0,\ s=2\times 3-3-0=3$
85+
将九索视为雀头:
86+
$m = 1,\ d=2,\ q=1,\ s=2\times 3-2-1=3$
87+
将九索视为刻搭:
88+
$m = 1,\ d=3,\ q=0,\ s=2\times 3-3-0=3$
8789

8890
向听数为3
8991
{% endnote %}
@@ -92,10 +94,14 @@ $$s=2\times(4-m)-\max(d,4-m)-q$$
9294

9395
{% note primary %}
9496

95-
将五饼视为雀头:$m = 1,\ d=2,\ q=1,\ s=2\times 3-2-1=3$
96-
将五饼视为刻搭:$m = 1,\ d=3,\ q=0,\ s=2\times 3-3-0=3$
97-
将六饼视为雀头,五六饼视为顺搭:$m = 0,\ d=3,\ q=1,\ s=2\times 4-3-1=4$
98-
将六饼视为雀头,五饼视为刻搭:$m = 0,\ d=3,\ q=1,\ s=2\times 4-3-1=4$
97+
将五饼视为雀头:
98+
$m = 1,\ d=2,\ q=1,\ s=2\times 3-2-1=3$
99+
将五饼视为刻搭:
100+
$m = 1,\ d=3,\ q=0,\ s=2\times 3-3-0=3$
101+
将六饼视为雀头,五六饼视为顺搭:
102+
$m = 0,\ d=3,\ q=1,\ s=2\times 4-3-1=4$
103+
将六饼视为雀头,五饼视为刻搭:
104+
$m = 0,\ d=3,\ q=1,\ s=2\times 4-3-1=4$
99105

100106
向听数为3
101107
{% endnote %}
@@ -104,7 +110,8 @@ $$s=2\times(4-m)-\max(d,4-m)-q$$
104110

105111
{% note primary %}
106112

107-
将一万视为雀头:$m = 1,\ d=4,\ q=1,\ s=2\times 3-3-1=2$
113+
将一万视为雀头:
114+
$m = 1,\ d=4,\ q=1,\ s=2\times 3-3-1=2$
108115

109116
向听数为2
110117
{% endnote %}

themes/butterfly/scripts/tag/mahjong.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function renderMahjong (tilesStr) {
112112
if (i !== called.length - 1) parts.push(BLANK)
113113
}
114114

115-
return `<span class=\"mahjong-wrap\">${parts.join('')}</span>`
115+
return `<div class=\"mahjong-wrap\"><div class=\"mahjong-inner\">${parts.join('')}</div></div>`
116116
}
117117

118118
const mahjongTag = (args) => {

themes/butterfly/source/css/_custom/mahjong.css

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,41 @@
66
*/
77

88
:root {
9-
--mahjong-size: 40px;
9+
--mahjong-size: 56px;
1010
--mahjong-gap: 3px;
11+
/* container width bounds */
12+
--mahjong-min-width: 240px; /* 最小容器宽度 */
13+
--mahjong-max-width: 960px; /* 最大容器宽度 */
14+
/* tile size will scale between min and max based on viewport
15+
within the container width bounds */
16+
--mahjong-size: clamp(32px, calc(2.6vw + 8px), 56px);
1117
}
1218

1319
.mahjong-wrap {
1420
display: flex;
15-
width: 100%;
16-
justify-content: center; /* center the whole tile group horizontally */
17-
flex-wrap: wrap; /* only wrap when container is too small */
21+
width: 100%; /* full width so centering works */
22+
justify-content: center; /* center inner container horizontally */
23+
margin: 20px 0;
24+
}
25+
26+
.mahjong-inner {
27+
/* constrained inner container that actually holds tiles */
28+
width: clamp(var(--mahjong-min-width), 100%, var(--mahjong-max-width));
29+
max-width: var(--mahjong-max-width);
30+
display: flex;
1831
gap: var(--mahjong-gap);
32+
justify-content: center;
33+
flex-wrap: wrap; /* wrap only when tiles overflow inner width */
1934
align-items: center;
2035
line-height: 0; /* avoid extra inline-gap from img descenders */
21-
margin: 20px 0;
2236
}
2337

2438
.mahjong-wrap img {
2539
display: block;
2640
}
2741

2842
.mahjong-tile {
29-
max-height: var(--mahjong-size);
43+
height: var(--mahjong-size);
3044
width: auto; /* preserve aspect ratio */
3145
max-width: 100%;
3246
object-fit: contain;
@@ -42,5 +56,5 @@
4256

4357
/* responsive: shrink tiles when container narrower */
4458
@media (max-width: 480px) {
45-
:root { --mahjong-size: 32px; }
59+
:root { --mahjong-size: 32px; --mahjong-gap: 1px;}
4660
}

0 commit comments

Comments
 (0)