打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

用户:RedDragon/Test2:修订间差异

来自Rizline中文维基
RedDragon
RedDragon留言 | 贡献 (按钮)
RedDragon
RedDragon留言 | 贡献 (解决了文字棍木的问题)
第173行: 第173行:


     function parseStylesFromWikitext(wikitext) {
     function parseStylesFromWikitext(wikitext) {
         const styles = {}
         var styles = {}
         const color1Match = wikitext.match(/\|color1\s*=\s*([^\n}]+)/)
         var color1Match = wikitext.match(/\|color1\s*=\s*([^\n}]+)/)
         const color3Match = wikitext.match(/\|color3\s*=\s*([^\n}]+)/)
         var color3Match = wikitext.match(/\|color3\s*=\s*([^\n}]+)/)
         const color4Match = wikitext.match(/\|color4\s*=\s*([^\n}]+)/)
         var color4Match = wikitext.match(/\|color4\s*=\s*([^\n}]+)/)


         if (color1Match) styles.title = color1Match[1].trim()
        var textcolor1Match = wikitext.match(/\|textcolor1\s*=\s*([^\n}]+)/)
         if (color3Match) styles.header = color3Match[1].trim()
        var textcolor3Match = wikitext.match(/\|textcolor3\s*=\s*([^\n}]+)/)
         if (color4Match) styles.label = color4Match[1].trim()
        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').textContent = song.title
         var titleElement = document.querySelector('.infobox-title th')
         document.querySelector('.infobox-title th').style.background = data.titleStyle
        var headerElement = document.querySelector('.infobox-header th')
         document.querySelector('.infobox-header th').style.background = data.headerStyle
         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'


        var labelElements = document.querySelectorAll('.infobox-label')
         for (var i = 0; i < labelElements.length; i++) {
         for (var i = 0; i < labelElements.length; i++) {
             labelElements[i].style.background = data.labelStyle
             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