导航喇叭/奖杯/登录换成像素图标,人气榜用像素金币
This commit is contained in:
1 parent
c2496658cd
commit
9650684695
6 files changed
+59
-9
No files matched your search
+1
-1
@@ -493,7 +493,7 @@ func TestFullFlow(t *testing.T) {
|
||||
st, body, _ = c2.get("/qianyuwing")
|
||||
must(t, strings.Contains(body, `class="pf coinN">2<`) && strings.Contains(body, `class="coinN">2</b><small>钢镚<`) && strings.Contains(body, "今天丢过了"), "钢镚计数展示")
|
||||
st, body, _ = c.get("/rank")
|
||||
must(t, st == 200 && strings.Contains(body, "人气榜") && strings.Contains(body, "🪙 2"), "人气榜")
|
||||
must(t, st == 200 && strings.Contains(body, "人气榜") && strings.Contains(body, "px-coin") && strings.Contains(body, "> 2<"), "人气榜")
|
||||
|
||||
// ⑦ 登录制 + 直接转账 → 自报 → 站长确认 → 屏蔽留言 / 屏蔽此人 / 回复
|
||||
st, body, _ = c.post("/login", url.Values{"slug": {"qianyuwing"}, "password": {"wrong"}})
|
||||
|
||||
+11
-6
@@ -34,11 +34,15 @@ a{color:var(--blue)}
|
||||
.langsel{display:inline-flex;align-items:center;flex:none;position:relative;cursor:pointer}.langsel select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px}
|
||||
.langcur{display:inline-flex;align-items:center;gap:2px;font-family:var(--pf);font-size:14px;line-height:1;color:var(--ink);background:#fff;border:2px solid var(--ink);box-shadow:2px 2px 0 var(--ink);padding:5px 6px;min-width:34px;justify-content:center}
|
||||
.langcur i{font-style:normal;font-size:9px;opacity:.6}
|
||||
.sfx{background:none;border:0;font-size:18px;line-height:1;padding:8px 6px;cursor:pointer;min-width:36px;min-height:36px;opacity:.85;flex:none}.sfx.off{opacity:.45}
|
||||
.sfx{background:none;border:0;line-height:0;padding:8px 4px;cursor:pointer;min-width:34px;min-height:36px;display:inline-flex;align-items:center;justify-content:center;flex:none}
|
||||
.px-spk .spk-x{display:none}.sfx.off .spk-w1,.sfx.off .spk-w2{display:none}.sfx.off .spk-x{display:inline}
|
||||
.sfx.idle .spk-w2{opacity:.25}
|
||||
.navlogin{display:inline-flex;align-items:center;gap:5px}.px-key{flex:none}
|
||||
.navrank{display:inline-flex;align-items:center;gap:5px}.px-trophy{flex:none}
|
||||
.sfx.idle{animation:sfxnudge 1.2s ease-in-out infinite}@keyframes sfxnudge{0%,100%{transform:scale(1)}50%{transform:scale(1.18)}}@media(prefers-reduced-motion:reduce){.sfx.idle{animation:none}}
|
||||
.nav>*{flex:none}.nav .brand{flex:0 1 auto;min-width:0}.nav .brand span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
@media(max-width:430px){.nav{gap:4px}.nav .brand{font-size:20px;margin-right:2px}.nav .brand .px-coin{display:none}.sfx{min-width:28px;padding:6px 2px;font-size:16px}.nav a.link{padding:8px 5px;font-size:15px}.nav a.pill{padding:6px 10px;font-size:15px}
|
||||
.nav a.navrank span{display:none}.nav a.navrank::before{content:"🏆";font-size:16px}}
|
||||
.nav a.navrank span{display:none}.nav .navlogin .lbl{display:none}}
|
||||
.brand{display:flex;align-items:center;gap:8px;font-size:24px;line-height:1;color:var(--ink);text-decoration:none;white-space:nowrap;margin-right:6px}
|
||||
.brand .px-coin{width:28px;height:28px;flex:none}
|
||||
.nav .sp{flex:1}
|
||||
@@ -155,6 +159,7 @@ textarea{resize:vertical;min-height:70px}
|
||||
.name>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
.name a{color:inherit;text-decoration:none}
|
||||
.sub{font-size:13px;color:var(--muted);margin-top:1px}
|
||||
.amtv .px-coin{width:14px;height:14px;vertical-align:-2px}
|
||||
.amtv{white-space:nowrap;font-size:18px}
|
||||
.feed .item{flex-wrap:wrap}
|
||||
.bubble{flex-basis:100%;margin:8px 0 0 46px;background:#fff;border:3px solid var(--ink);padding:6px 10px;font-size:14px;line-height:1.6;word-break:break-word;position:relative;box-shadow:2px 2px 0 var(--ink)}
|
||||
@@ -255,9 +260,9 @@ footer a{color:var(--muted)}
|
||||
<a class="brand" href="{{.HomePath}}"{{if ne .HomePath "/"}} title="{{T "回到刚才看的碗"}}"{{end}}>{{template "coin"}}<span>{{T .SiteTitle}}</span></a>
|
||||
<span class="sp"></span>
|
||||
<label class="langsel" title="Language / 语言"><span class="langcur" aria-hidden="true">{{.LangShort}}<i>▾</i></span><select onchange="location.href='/lang?to='+encodeURIComponent(this.value)" aria-label="Language">{{range .Langs}}<option value="{{.Code}}"{{if eq .Code $.Lang}} selected{{end}}>{{.Name}}</option>{{end}}</select></label>
|
||||
<button class="sfx" id="sfxBtn" type="button" aria-label="{{T "声音开关"}}" title="{{T "声音"}}">🔊</button>
|
||||
<a class="link navrank" href="/rank" aria-label="{{T "排行榜"}}" title="{{T "排行榜"}}"><span>{{T "排行榜"}}</span></a>
|
||||
{{if .Me}}<a class="link" href="/manage">{{T "我的后台"}}</a>{{else}}<a class="link" href="/login"><span class="hide-sm">{{T "站长"}}</span>{{T "登录"}}</a>{{end}}
|
||||
<button class="sfx" id="sfxBtn" type="button" aria-label="{{T "声音开关"}}" title="{{T "声音"}}">{{template "spk"}}</button>
|
||||
<a class="link navrank" href="/rank" aria-label="{{T "排行榜"}}" title="{{T "排行榜"}}">{{template "trophy"}}<span>{{T "排行榜"}}</span></a>
|
||||
{{if .Me}}<a class="link" href="/manage">{{T "我的后台"}}</a>{{else}}<a class="link navlogin" href="/login">{{template "keyicon"}}<span class="hide-sm">{{T "站长"}}</span><span class="lbl">{{T "登录"}}</span></a>{{end}}
|
||||
{{if .Me}}<a class="pill px" href="/{{.Me.Slug}}">{{T "我的站"}}</a>{{else if .SubsitesEnabled}}<a class="pill px" href="/new">{{T "开通要饭站"}}</a>{{end}}
|
||||
</nav>
|
||||
<div class="ticker" aria-hidden="true"><div class="ticker-in"><span>{{T "🙏 行行好,赏口饭吃"}}</span><span>{{T "🪙 一毛也是爱"}}</span><span>{{T "💸 投币就上榜"}}</span><span>{{T "📜 留一句话刻功德簿"}}</span><span>{{T "🏚 发条推就能开自己的要饭站"}}</span><span>{{T "👾 赛博丐帮,人人有碗"}}</span><span>{{T "🙏 行行好,赏口饭吃"}}</span><span>{{T "🪙 一毛也是爱"}}</span><span>{{T "💸 投币就上榜"}}</span><span>{{T "📜 留一句话刻功德簿"}}</span><span>{{T "🏚 发条推就能开自己的要饭站"}}</span><span>{{T "👾 赛博丐帮,人人有碗"}}</span></div></div>
|
||||
@@ -315,7 +320,7 @@ window.sfx=(function(){var ctx,on=true,C=window.AudioContext||window.webkitAudio
|
||||
var b=document.getElementById('sfxBtn');if(!b)return;
|
||||
// 三态:🔊 在放 / 🔈 开着但还没放(浏览器拦了自动播放,点一下就放)/ 🔇 静音
|
||||
var hasBgm=!!document.getElementById('bgm'); // 没放音乐文件时只有音效,喇叭只有开/关两态
|
||||
paint=function(){var p=on&&(!hasBgm||playingNow());b.textContent=!on?'🔇':(p?'🔊':'🔈');b.classList.toggle('off',!on);b.classList.toggle('idle',on&&!p);b.title=!on?{{T "声音:关"}}:(p?{{T "声音:开(点击静音)"}}:{{T "点一下开始播放"}})};paint();
|
||||
paint=function(){var p=on&&(!hasBgm||playingNow());b.classList.toggle('off',!on);b.classList.toggle('idle',on&&!p);b.title=!on?{{T "声音:关"}}:(p?{{T "声音:开(点击静音)"}}:{{T "点一下开始播放"}})};paint();
|
||||
b.addEventListener('click',function(){if(on&&!playingNow()){loadBgm();startBgm();return}S.toggle()})});
|
||||
document.addEventListener('click',function(ev){var b=ev.target.closest('.btn,.tab,.amt-btn,.copy,.pill,.toggle button,.link');if(!b||b.disabled)return;ac();if(b.id!=='coinbtn')S.click()},true);
|
||||
return S})();
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
<div class="rank{{if lt $n 3}} m{{end}}">{{rankBadge $n}}</div>
|
||||
{{if $s.AvatarURL}}<img class="av img" src="{{$s.AvatarURL}}" alt="">{{else}}<div class="av sq">{{$s.Avatar}}</div>{{end}}
|
||||
<div class="body"><div class="name"><span><a href="{{$s.Path}}">{{$s.Name}}</a></span>{{if eq $s.ID $.Me}}<span class="me">{{T "就是我"}}</span>{{end}}</div><div class="sub">{{if $s.Title}}{{T $s.Title}} · {{end}}{{(level $s.Exp).Title}} · {{$s.Donors}} {{T "位施主 · 钢镚"}} {{$s.Coins}}</div></div>
|
||||
<div class="amtv num{{if ne $.By "coins"}} accent{{end}}">{{if eq $.By "coins"}}🪙 {{$s.Coins}}{{else}}{{fmtAmt $s.TotalE8}}{{end}}</div>
|
||||
<div class="amtv num{{if ne $.By "coins"}} accent{{end}}">{{if eq $.By "coins"}}{{template "coin"}} {{$s.Coins}}{{else}}{{fmtAmt $s.TotalE8}}{{end}}</div>
|
||||
</li>{{end}}
|
||||
</ul>{{else}}<div class="empty"><div class="ico">🏚</div>{{T "还没有人上榜"}}</div>{{end}}{{end}}
|
||||
{{define "scripts"}}<script>
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@
|
||||
<div class="rank{{if lt $i 3}} m{{end}}">{{rankBadge $i}}</div>
|
||||
{{if $s.AvatarURL}}<img class="av img" src="{{$s.AvatarURL}}" alt="">{{else}}<div class="av sq">{{$s.Avatar}}</div>{{end}}
|
||||
<div class="body"><div class="name"><span><a href="{{$s.Path}}">{{$s.Name}}</a></span>{{if eq $s.ID $.Me}}<span class="me">{{T "就是我"}}</span>{{else if eq $s.ID $.Here}}<span class="me here">{{T "本站"}}</span>{{end}}</div><div class="sub">{{if $s.Title}}{{T $s.Title}} · {{end}}{{(level $s.Exp).Title}} · {{$s.Donors}} {{T "位施主 · 钢镚"}} {{$s.Coins}}</div></div>
|
||||
<div class="amtv num{{if ne $.By "coins"}} accent{{end}}">{{if eq $.By "coins"}}🪙 {{$s.Coins}}{{else}}{{fmtAmt $s.TotalE8}}{{end}}</div>
|
||||
<div class="amtv num{{if ne $.By "coins"}} accent{{end}}">{{if eq $.By "coins"}}{{template "coin"}} {{$s.Coins}}{{else}}{{fmtAmt $s.TotalE8}}{{end}}</div>
|
||||
</li>{{end}}
|
||||
</ul>{{else}}<div class="empty"><div class="ico">🏚</div>{{T "还没有人上榜"}}</div>{{end}}{{end}}
|
||||
{{define "scripts"}}<script>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{{define "sprite"}}<svg class="sprite" viewBox="0 0 24 33" width="96" height="132" shape-rendering="crispEdges" aria-label="端着碗的赛博乞丐" role="img"><g class="body"><rect x="8" y="0" width="1" height="1" fill="#1e1e2e"/><rect x="10" y="0" width="3" height="1" fill="#1e1e2e"/><rect x="14" y="0" width="1" height="1" fill="#1e1e2e"/><rect x="7" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="8" y="1" width="1" height="1" fill="#3b2a1e"/><rect x="9" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="10" y="1" width="3" height="1" fill="#3b2a1e"/><rect x="13" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="14" y="1" width="1" height="1" fill="#3b2a1e"/><rect x="15" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="6" y="2" width="1" height="1" fill="#1e1e2e"/><rect x="7" y="2" width="9" height="1" fill="#3b2a1e"/><rect x="16" y="2" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="6" y="3" width="11" height="1" fill="#3b2a1e"/><rect x="17" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="6" y="4" width="11" height="1" fill="#3b2a1e"/><rect x="17" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="6" y="5" width="1" height="1" fill="#3b2a1e"/><rect x="7" y="5" width="9" height="1" fill="#f7c9a3"/><rect x="16" y="5" width="1" height="1" fill="#3b2a1e"/><rect x="17" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="6" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="6" width="1" height="1" fill="#3b2a1e"/><rect x="6" y="6" width="11" height="1" fill="#f7c9a3"/><rect x="17" y="6" width="1" height="1" fill="#3b2a1e"/><rect x="18" y="6" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="7" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="7" width="13" height="1" fill="#f7c9a3"/><rect x="18" y="7" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="8" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="8" width="13" height="1" fill="#f7c9a3"/><rect x="18" y="8" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="9" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="9" width="13" height="1" fill="#f7c9a3"/><rect x="18" y="9" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="10" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="10" width="13" height="1" fill="#f7c9a3"/><rect x="18" y="10" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="11" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="11" width="13" height="1" fill="#f7c9a3"/><rect x="18" y="11" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="12" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="12" width="5" height="1" fill="#f7c9a3"/><rect x="10" y="12" width="2" height="1" fill="#c0392b"/><rect x="12" y="12" width="6" height="1" fill="#f7c9a3"/><rect x="18" y="12" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="13" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="13" width="4" height="1" fill="#f7c9a3"/><rect x="9" y="13" width="1" height="1" fill="#c0392b"/><rect x="10" y="13" width="2" height="1" fill="#f7c9a3"/><rect x="12" y="13" width="1" height="1" fill="#c0392b"/><rect x="13" y="13" width="5" height="1" fill="#f7c9a3"/><rect x="18" y="13" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="14" width="1" height="1" fill="#1e1e2e"/><rect x="6" y="14" width="11" height="1" fill="#f7c9a3"/><rect x="17" y="14" width="1" height="1" fill="#1e1e2e"/><rect x="6" y="15" width="3" height="1" fill="#1e1e2e"/><rect x="9" y="15" width="4" height="1" fill="#f7c9a3"/><rect x="13" y="15" width="3" height="1" fill="#1e1e2e"/><rect x="5" y="16" width="1" height="1" fill="#1e1e2e"/><rect x="6" y="16" width="4" height="1" fill="#a86f3d"/><rect x="10" y="16" width="1" height="1" fill="#1e1e2e"/><rect x="11" y="16" width="2" height="1" fill="#f7c9a3"/><rect x="13" y="16" width="1" height="1" fill="#1e1e2e"/><rect x="14" y="16" width="4" height="1" fill="#a86f3d"/><rect x="18" y="16" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="17" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="17" width="6" height="1" fill="#a86f3d"/><rect x="11" y="17" width="2" height="1" fill="#1e1e2e"/><rect x="13" y="17" width="6" height="1" fill="#a86f3d"/><rect x="19" y="17" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="18" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="18" width="14" height="1" fill="#a86f3d"/><rect x="19" y="18" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="19" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="19" width="1" height="1" fill="#a86f3d"/><rect x="6" y="19" width="2" height="1" fill="#f2c14e"/><rect x="8" y="19" width="11" height="1" fill="#a86f3d"/><rect x="19" y="19" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="20" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="20" width="1" height="1" fill="#a86f3d"/><rect x="6" y="20" width="1" height="1" fill="#f2c14e"/><rect x="18" y="20" width="2" height="1" fill="#a86fLine truncated
|
||||
{{define "coin"}}<svg class="px-coin" viewBox="0 0 8 8" width="16" height="16" shape-rendering="crispEdges" aria-hidden="true"><rect x="2" y="0" width="4" height="1" fill="#1e1e2e"/><rect x="1" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="2" y="1" width="4" height="1" fill="#ffcc00"/><rect x="6" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="0" y="2" width="1" height="1" fill="#1e1e2e"/><rect x="1" y="2" width="1" height="1" fill="#ffcc00"/><rect x="2" y="2" width="1" height="1" fill="#ffffff"/><rect x="3" y="2" width="4" height="1" fill="#ffcc00"/><rect x="7" y="2" width="1" height="1" fill="#1e1e2e"/><rect x="0" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="1" y="3" width="2" height="1" fill="#ffcc00"/><rect x="3" y="3" width="2" height="1" fill="#1e1e2e"/><rect x="5" y="3" width="2" height="1" fill="#ffcc00"/><rect x="7" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="0" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="1" y="4" width="2" height="1" fill="#ffcc00"/><rect x="3" y="4" width="2" height="1" fill="#1e1e2e"/><rect x="5" y="4" width="2" height="1" fill="#ffcc00"/><rect x="7" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="0" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="1" y="5" width="4" height="1" fill="#ffcc00"/><rect x="5" y="5" width="1" height="1" fill="#e09a00"/><rect x="6" y="5" width="1" height="1" fill="#ffcc00"/><rect x="7" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="1" y="6" width="1" height="1" fill="#1e1e2e"/><rect x="2" y="6" width="1" height="1" fill="#ffcc00"/><rect x="3" y="6" width="2" height="1" fill="#e09a00"/><rect x="5" y="6" width="1" height="1" fill="#ffcc00"/><rect x="6" y="6" width="1" height="1" fill="#1e1e2e"/><rect x="2" y="7" width="4" height="1" fill="#1e1e2e"/></svg>{{end}}
|
||||
{{define "bowlicon"}}<svg class="px-bowl" viewBox="0 0 16 7" width="32" height="14" shape-rendering="crispEdges" aria-hidden="true"><rect x="4" y="0" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="0" width="1" height="1" fill="#ffcc00"/><rect x="6" y="0" width="1" height="1" fill="#1e1e2e"/><rect x="8" y="0" width="1" height="1" fill="#1e1e2e"/><rect x="9" y="0" width="1" height="1" fill="#ffcc00"/><rect x="10" y="0" width="1" height="1" fill="#1e1e2e"/><rect x="3" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="1" width="1" height="1" fill="#ffcc00"/><rect x="5" y="1" width="1" height="1" fill="#e09a00"/><rect x="6" y="1" width="1" height="1" fill="#ffcc00"/><rect x="7" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="8" y="1" width="1" height="1" fill="#ffcc00"/><rect x="9" y="1" width="1" height="1" fill="#e09a00"/><rect x="10" y="1" width="1" height="1" fill="#ffcc00"/><rect x="11" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="0" y="2" width="16" height="1" fill="#1e1e2e"/><rect x="0" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="1" y="3" width="14" height="1" fill="#ece7d8"/><rect x="15" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="1" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="2" y="4" width="1" height="1" fill="#b9b3a3"/><rect x="3" y="4" width="10" height="1" fill="#ece7d8"/><rect x="13" y="4" width="1" height="1" fill="#b9b3a3"/><rect x="14" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="2" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="3" y="5" width="10" height="1" fill="#b9b3a3"/><rect x="13" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="3" y="6" width="10" height="1" fill="#1e1e2e"/></svg>{{end}}
|
||||
{{define "spk"}}<svg class="px-spk" viewBox="0 0 12 10" width="20" height="17" shape-rendering="crispEdges" aria-hidden="true"><g class="spk-body"><rect x="6" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="5" y="2" width="2" height="1" fill="#1e1e2e"/><rect x="2" y="3" width="5" height="1" fill="#1e1e2e"/><rect x="2" y="4" width="5" height="1" fill="#1e1e2e"/><rect x="2" y="5" width="5" height="1" fill="#1e1e2e"/><rect x="2" y="6" width="5" height="1" fill="#1e1e2e"/><rect x="5" y="7" width="2" height="1" fill="#1e1e2e"/><rect x="6" y="8" width="1" height="1" fill="#1e1e2e"/></g><g class="spk-w1"><rect x="8" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="8" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="8" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="8" y="6" width="1" height="1" fill="#1e1e2e"/><rect x="10" y="2" width="1" height="1" fill="#1e1e2e"/><rect x="10" y="7" width="1" height="1" fill="#1e1e2e"/></g><g class="spk-w2"><rect x="10" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="10" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="10" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="10" y="6" width="1" height="1" fill="#1e1e2e"/></g><g class="spk-x"><rect x="8" y="3" width="1" height="1" fill="#c0392b"/><rect x="10" y="3" width="1" height="1" fill="#c0392b"/><rect x="9" y="4" width="1" height="1" fill="#c0392b"/><rect x="8" y="5" width="1" height="1" fill="#c0392b"/><rect x="10" y="5" width="1" height="1" fill="#c0392b"/></g></svg>{{end}}
|
||||
{{define "trophy"}}<svg class="px-trophy" viewBox="0 0 10 9" width="18" height="16" shape-rendering="crispEdges" aria-hidden="true"><rect x="2" y="0" width="6" height="1" fill="#1e1e2e"/><rect x="1" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="2" y="1" width="6" height="1" fill="#ffcc00"/><rect x="8" y="1" width="1" height="1" fill="#1e1e2e"/><rect x="0" y="2" width="2" height="1" fill="#1e1e2e"/><rect x="2" y="2" width="6" height="1" fill="#ffcc00"/><rect x="8" y="2" width="2" height="1" fill="#1e1e2e"/><rect x="0" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="2" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="3" y="3" width="4" height="1" fill="#ffcc00"/><rect x="7" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="9" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="0" y="4" width="2" height="1" fill="#1e1e2e"/><rect x="3" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="4" width="2" height="1" fill="#ffcc00"/><rect x="6" y="4" width="1" height="1" fill="#1e1e2e"/><rect x="8" y="4" width="2" height="1" fill="#1e1e2e"/><rect x="3" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="5" width="2" height="1" fill="#ffcc00"/><rect x="6" y="5" width="1" height="1" fill="#1e1e2e"/><rect x="4" y="6" width="2" height="1" fill="#1e1e2e"/><rect x="3" y="7" width="4" height="1" fill="#1e1e2e"/><rect x="2" y="8" width="6" height="1" fill="#1e1e2e"/></svg>{{end}}
|
||||
{{define "keyicon"}}<svg class="px-key" viewBox="0 0 12 5" width="19" height="8" shape-rendering="crispEdges" aria-hidden="true"><rect x="2" y="0" width="4" height="1" fill="#1e1e2e"/><rect x="1" y="1" width="2" height="1" fill="#1e1e2e"/><rect x="5" y="1" width="2" height="1" fill="#1e1e2e"/><rect x="1" y="2" width="2" height="1" fill="#1e1e2e"/><rect x="5" y="2" width="7" height="1" fill="#1e1e2e"/><rect x="1" y="3" width="2" height="1" fill="#1e1e2e"/><rect x="5" y="3" width="2" height="1" fill="#1e1e2e"/><rect x="8" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="10" y="3" width="1" height="1" fill="#1e1e2e"/><rect x="2" y="4" width="4" height="1" fill="#1e1e2e"/></svg>{{end}}
|
||||
@@ -75,6 +75,43 @@ BOWLICON = [
|
||||
"..KDDDDDDDDDDK..",
|
||||
"...KKKKKKKKKK...",
|
||||
]
|
||||
# 喇叭:分层(body / wave / x),CSS 按开关状态显示声波或叉
|
||||
SPEAKER = [
|
||||
"............",
|
||||
"......K.....",
|
||||
".....KK.....",
|
||||
"..KKKKK.....",
|
||||
"..KKKKK.....",
|
||||
"..KKKKK.....",
|
||||
"..KKKKK.....",
|
||||
".....KK.....",
|
||||
"......K.....",
|
||||
"............",
|
||||
]
|
||||
SPK_WAVE = {3: {8: "K"}, 4: {8: "K"}, 5: {8: "K"}, 6: {8: "K"},
|
||||
2: {10: "K"}, 7: {10: "K"}}
|
||||
SPK_WAVE2 = {3: {10: "K"}, 4: {10: "K"}, 5: {10: "K"}, 6: {10: "K"}}
|
||||
SPK_X = {3: {8: "M", 10: "M"}, 4: {9: "M"}, 5: {8: "M", 10: "M"}}
|
||||
# 奖杯(排行榜)
|
||||
TROPHY = [
|
||||
"..KKKKKK..",
|
||||
".KYYYYYYK.",
|
||||
"KKYYYYYYKK",
|
||||
"K.KYYYYK.K",
|
||||
"KK.KYYK.KK",
|
||||
"...KYYK...",
|
||||
"....KK....",
|
||||
"...KKKK...",
|
||||
"..KKKKKK..",
|
||||
]
|
||||
# 钥匙(登录)
|
||||
KEY = [
|
||||
"..KKKK......",
|
||||
".KK..KK.....",
|
||||
".KK..KKKKKKK",
|
||||
".KK..KK.K.K.",
|
||||
"..KKKK......",
|
||||
]
|
||||
|
||||
|
||||
def rects(grid, skip=".", only=None, override=None):
|
||||
@@ -114,6 +151,11 @@ def main():
|
||||
'<g class="body">%s</g><g class="eyes">%s</g><g class="tear">%s</g><g class="bowl">%s</g></svg>{{end}}' % (h, h * 4, body, layer(EYES), layer(TEAR), bowl))
|
||||
print('{{define "coin"}}<svg class="px-coin" viewBox="0 0 8 8" width="16" height="16" shape-rendering="crispEdges" aria-hidden="true">%s</svg>{{end}}' % rects(COIN))
|
||||
print('{{define "bowlicon"}}<svg class="px-bowl" viewBox="0 0 16 7" width="32" height="14" shape-rendering="crispEdges" aria-hidden="true">%s</svg>{{end}}' % rects(BOWLICON))
|
||||
print('{{define "spk"}}<svg class="px-spk" viewBox="0 0 12 10" width="20" height="17" shape-rendering="crispEdges" aria-hidden="true">'
|
||||
'<g class="spk-body">%s</g><g class="spk-w1">%s</g><g class="spk-w2">%s</g><g class="spk-x">%s</g></svg>{{end}}'
|
||||
% (rects(SPEAKER), layer(SPK_WAVE), layer(SPK_WAVE2), layer(SPK_X)))
|
||||
print('{{define "trophy"}}<svg class="px-trophy" viewBox="0 0 10 9" width="18" height="16" shape-rendering="crispEdges" aria-hidden="true">%s</svg>{{end}}' % rects(TROPHY))
|
||||
print('{{define "keyicon"}}<svg class="px-key" viewBox="0 0 12 5" width="19" height="8" shape-rendering="crispEdges" aria-hidden="true">%s</svg>{{end}}' % rects(KEY))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user