|
|
| (未显示同一用户的19个中间版本) |
| 第1行: |
第1行: |
| <includeonly><html><script> | | <includeonly><span |
| (function(){
| | class="background-theme" |
| var bg = document.body;
| | data-bg-image="{{filepath:{{{背景|}}}|nowiki}}" |
| if (bg) {
| | data-bg-opacity="{{{透明度|0.5}}}" |
| {{#if:{{{image|}}}
| | data-bg-blur="{{{模糊度|6}}}" |
| |bg.style.backgroundImage = 'url({{{image}}})';
| | data-bg-radius="{{{圆角|12}}}" |
| bg.style.backgroundSize = '{{{size|cover}}}';
| | data-bg-title="{{{标题颜色|#FFFFFF}}}" |
| bg.style.backgroundPosition = '{{{position|center}}}';
| | aria-hidden="true" |
| bg.style.backgroundRepeat = '{{{repeat|no-repeat}}}';
| | ></span></includeonly> |
| }} | |
| {{#if:{{{color|}}}
| |
| |bg.style.backgroundColor = '{{{color}}}';
| |
| }} | |
| }
| |
| })();
| |
| </script></html></includeonly><noinclude>
| |
| <nowiki>
| |
| ; 用法
| |
| : {{Background|image=图片URL|color=背景色}}
| |
| | |
| ; 背景图片
| |
| : {{Background|image=https://example.com/bg.jpg}}
| |
| | |
| ; 纯色背景
| |
| : {{Background|color=#0d1117}}
| |
| | |
| ; 参数
| |
| : image — 背景图片URL
| |
| : color — 背景颜色(#十六进制/rgb/关键词)
| |
| : size — 图片尺寸,默认 cover
| |
| : position — 图片位置,默认 center
| |
| : repeat — 是否重复,默认 no-repeat
| |
| | |
| ; 注意
| |
| : 模板直接修改页面 body 背景,刷新即可恢复。
| |
| </nowiki>
| |
| </noinclude>
| |