LLWiki正在建设中,欢迎加入我们!
“Widget:游戏主界面”的版本间差异
跳转到导航
跳转到搜索
小 |
小 |
||
第1行: | 第1行: | ||
<noinclude>{{doc|content=请使用[[:category:导航模板|导航模板]]调用。}}</noinclude><includeonly><!--{if !isset($wgWidgetStartScreen) || !$wgWidgetStartScreen}--><!--{assign var="wgWidgetStartScreen" value=true scope="global"}--><script> |
<noinclude>{{doc|content=请使用[[:category:导航模板|导航模板]]调用。}}[[category:混合小部件]]</noinclude><includeonly><!--{if !isset($wgWidgetStartScreen) || !$wgWidgetStartScreen}--><!--{assign var="wgWidgetStartScreen" value=true scope="global"}--><script defer src='/zh?title=</includeonly><noinclude><p>JavaScript脚本:[[</noinclude>User:Bhsd/widget/nav.js<noinclude>]]</p></noinclude><includeonly>&action=raw&ctype=text/javascript'></script><style> |
||
//</includeonly>JavaScript脚本:<pre lang="js"> |
|||
window.addEventListener('load', function () { |
|||
var ele = document.querySelector('.start-screen'), |
|||
parent = document.querySelector('#mw-content-text .mw-parser-output'); |
|||
ele.querySelectorAll('a[href]').forEach(function(e) { |
|||
var href = decodeURIComponent(e.href), |
|||
section = /#/.test(href), |
|||
pagename = section ? href.match('^(?:https:)?(?:\/\/llwiki\.org)?/zh/(.*)#')[1] : href.match('^(?:https:)?(?:\/\/llwiki\.org)?/zh/(.*)$')[1]; |
|||
if (pagename == mw.config.get('wgPageName')) { |
|||
e.href = section ? href.match(/#.*$/)[0] : 'javascript:void(0)'; |
|||
} |
|||
}); |
|||
if (mw.config.get('skin') == 'minerva') { |
|||
ele.querySelectorAll( '.lazy-image-placeholder' ).forEach(function(e) { |
|||
let img = document.createElement('img'); |
|||
img.src = e.dataset.src; |
|||
e.replaceWith(img); |
|||
}); |
|||
parent.appendChild(ele); |
|||
ele.scrollLeft = (ele.scrollWidth - ele.clientWidth) / 2; |
|||
} |
|||
}); |
|||
//</pre> |
|||
<includeonly> |
|||
</script><style> |
|||
/* </includeonly>CSS样式表:<pre lang="css"> */ |
/* </includeonly>CSS样式表:<pre lang="css"> */ |
||
.start-screen { |
.start-screen { |
2020年11月29日 (日) 00:25的版本
JavaScript脚本:User:Bhsd/widget/nav.js
CSS样式表:
*/
.start-screen {
text-align: center;
position: sticky;
bottom: 3px;
white-space: nowrap;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
scroll-snap-type: x mandatory;
}
.start-screen a {
scroll-snap-align: start;
}
.start-screen table {
display: inline-table;
margin: 0;
width: auto !important;
}
/*