用户:RedDragon/Test2:修订间差异
来自Rizline中文维基
更多操作
小 |
小 |
||
| 第173行: | 第173行: | ||
function parseStylesFromWikitext(wikitext) { | function parseStylesFromWikitext(wikitext) { | ||
var styles = {} | |||
var color1Match = wikitext.match(/\|color1\s*=\s*([^\n}]+)/) | |||
var color3Match = wikitext.match(/\|color3\s*=\s*([^\n}]+)/) | |||
var color4Match = wikitext.match(/\|color4\s*=\s*([^\n}]+)/) | |||
if (color1Match) styles. | var textcolor1Match = wikitext.match(/\|textcolor1\s*=\s*([^\n}]+)/) | ||
if (color3Match) styles. | var textcolor3Match = wikitext.match(/\|textcolor3\s*=\s*([^\n}]+)/) | ||
if (color4Match) styles. | var textcolor4Match = wikitext.match(/\|textcolor4\s*=\s*([^\n}]+)/) | ||
if (color1Match) styles.titleBg = color1Match[1].trim() | |||
if (color3Match) styles.headerBg = color3Match[1].trim() | |||
if (color4Match) styles.labelBg = color4Match[1].trim() | |||
if (textcolor1Match) styles.titleColor = textcolor1Match[1].trim() | |||
if (textcolor3Match) styles.headerColor = textcolor3Match[1].trim() | |||
if (textcolor4Match) styles.labelColor = textcolor4Match[1].trim() | |||
return styles | return styles | ||
| 第186行: | 第194行: | ||
function updateSongInfo(song, data) { | function updateSongInfo(song, data) { | ||
document.querySelector('.infobox-title th'). | var titleElement = document.querySelector('.infobox-title th') | ||
document. | var headerElement = document.querySelector('.infobox-header th') | ||
var labelElements = document.querySelectorAll('.infobox-label') | |||
titleElement.textContent = song.title | |||
titleElement.style.background = data.titleBg || '#94E1FF' | |||
titleElement.style.color = data.titleColor || '#000000' | |||
headerElement.style.background = data.headerBg || '#A3E5FF' | |||
headerElement.style.color = data.headerColor || '#000000' | |||
for (var i = 0; i < labelElements.length; i++) { | for (var i = 0; i < labelElements.length; i++) { | ||
labelElements[i].style.background = data. | labelElements[i].style.background = data.labelBg || '#B2E9FE' | ||
labelElements[i].style.color = data.labelColor || '#000000' | |||
} | } | ||
2025年10月22日 (三) 13:52的版本
| 曲目 | |
|---|---|
|
|
|
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
神秘的随机挑战!
Ver.1.3
{{Infobox
|name = 随机挑战
|title = 曲目
|titlestyle = background:#ccc
|image = [[File:插画图标.png|100px]]
|imagestyle =
|headerstyle = background:#ccf
|labelstyle = background:#ddf
|header1 = 限制
|label2 = 难度
|data2 = a
|label3 = 流速
|data3 = b
|label4 = MOD
|data4 = c
|label5 = 其他
|data5 = d
|data5 = d
}}
User:RedDragon/Test User:RedDragon/Test1 User:RedDragon/Test2