Skip to content

Commit

Permalink
show only 4 pics per cf for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
hyansuper committed May 14, 2024
1 parent abeb118 commit 1d85391
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
</style><body></body><script>
str_fmt=(template,args)=>Object.entries(args).reduce((result, [arg, val]) => result.replace(`$\{${arg}}`, `${val}`),template);
make_asset_url=(ver,name)=>str_fmt(new URLSearchParams(location.search).get('asset_fmt')??'https://gitee.com/r-cute/xdial_cf_gallery/releases/download/${ver}/${name}.bin',{ver:ver,name:name});
prev_num=4;
multi_lang();
ls_img=(name,num)=>[...range(num)].map(i=>`<img src="assets/${name}/${i}.png" />`).join('');
ver="1.0.0";
range=x=>Array(x).keys();
(
ml('h1')(['Clock face gallery','自选表盘'])
+j2h({'<>':'div','[]':split,html:[{'<>':'h2',html:[ml('span'),x=>ml('button',{onclick:`navigator.clipboard.writeText("${make_asset_url(ver,x[2])}");alert(selang("Copied to clipboard/已复制"))`})(['copy URL','复制链接'])]},{'<>':'div',html:x=>[...range(parseInt(x[3]))].map(i=>`<img src="assets/${x[2]}/${i}.png" />`).join('')}]}).batch([
+j2h({'<>':'div','[]':split,html:[{'<>':'h2',html:[ml('span'),x=>ml('button',{onclick:`navigator.clipboard.writeText("${make_asset_url(ver,x[2])}");alert(selang("Copied to clipboard/已复制"))`})(['copy URL','复制链接'])]},{'<>':'div',html:x=>ls_img(x[2],prev_num)+(x[3]<=prev_num?'':ml('a',{href:'#',onclick:`this.parentNode.innerHTML=ls_img("${x[2]}",${x[3]})`})(['more','更多']))}]}).batch([
'Pokemon/宝可梦/pokemon/8',
'iKun/iKun/ikun/7',
'Paris Olympics/巴黎奥运/paris_olympics/10',
Expand Down

0 comments on commit 1d85391

Please sign in to comment.