익명
×
새 문서 만들기
여기에 문서 제목을 쓰세요:
We currently have 1,013 articles on 루리위키. Type your article name above or click on one of the titles below and start writing!



1,013Articles

모듈:샤인 포스트 Be your Idol/캐릭터 메모리: 두 판 사이의 차이

편집 요약 없음
(4767561 (토론)의 32995판 편집을 되돌림)
태그: 편집 취소
 
(같은 사용자의 중간 판 11개는 보이지 않습니다)
1번째 줄: 1번째 줄:
local p={}
local p = {}


function p.render(frame)
function p.render(f)
     local args={}
     local a, has, h = {}, false, mw.html.create('table'):addClass('wikitable'):css{
    local parent=frame:getParent()
        width = '100%',
    if parent then for k,v in pairs(parent.args) do args[k]=v end end
        ['border-collapse'] = 'collapse',
    for k,v in pairs(frame.args) do args[k]=v end
        ['table-layout'] = 'fixed',
        border = '2px solid #000', -- 전체 외곽선 굵게
        marginBottom = '20px'
    }


     local html=mw.html.create('table')
     local pnt = f:getParent()
        :addClass('wikitable')
    if pnt then for k, v in pairs(pnt.args) do a[k] = v end end
        :css{
    for k, v in pairs(f.args) do a[k] = v end
            width='100%',
            ['border-collapse']='collapse',
            ['table-layout']='fixed',
            border='none',
            ['margin-bottom']='20px'
        }


     local i,has=1,false
     for i = 1, 50 do
    while args['타입'..i] or args['이름'..i] do
         local t = a['타입' .. i] or ''
         local t=args['타입'..i] or ''
         local n = a['이름' .. i] or ''
         local n=args['이름'..i] or ''
         local g = a['게스트' .. i] or ''
         local g=args['게스트'..i] or ''
         local s = a['스텟' .. i] or ''
         local s=args['스텟'..i] or ''
         local d = a['내용' .. i] or ''
         local d=args['내용'..i] or ''


         if t~='' or n~='' then
         if t ~= '' or n ~= '' then
             has=true
             has = true
             local r=html:tag('tr')
             local r = h:tag('tr')


             r:tag('td')
            -- 1. 타입 칸 (왼쪽 파란색)
                :css{
             r:tag('td'):css{
                    ['background-color']='#3478bf',
                background = '#3478bf',
                    color='white',
                width = '20%',
                    ['font-weight']='bold',
                border = '2px solid #000' -- 테두리 굵기 통일
                    ['text-align']='center',
            }:wikitext("<div style='text-align:center;font-weight:bold;color:#fff'>" .. t .. "</div>")
                    width='20%',
                    ['border-top']='2px solid #000',
                    ['border-left']='2px solid #000'
                }
                :wikitext(t)


             if g=='' then
            -- 2. 이름 및 게스트 칸 (오른쪽)
                 r:tag('td')
             if g == '' or g:match '^%s*$' then
                    :attr('colspan','2')
                 r:tag('td'):attr('colspan', 2):css{
                    :css{
                    fontWeight = 'bold',
                        ['font-weight']='bold',
                    border = '2px solid #000', -- 테두리 굵기 통일
                        ['border-top']='2px solid #000',
                    paddingLeft = '10px'
                        ['border-right']='2px solid #000',
                }:wikitext(n)
                        ['padding-left']='10px'
                    }
                    :wikitext(n)
             else
             else
                 r:tag('td')
                 r:tag('td'):css{
                    :css{
                    fontWeight = 'bold',
                        ['font-weight']='bold',
                    width = '65%',
                        width='55%',
                    border = '2px solid #000', -- 테두리 굵기 통일
                        ['border-top']='2px solid #000',
                    paddingLeft = '10px'
                        ['padding-left']='10px'
                }:wikitext(n)
                    }
               
                    :wikitext(n)
                 r:tag('td'):css{
 
                    textAlign = 'center',
                 r:tag('td')
                    width = '15%',
                    :css{
                    border = '2px solid #000' -- 테두리 굵기 통일
                        ['text-align']='center',
                }:wikitext("<span style='color:#666;font-size:.9em'>with </span>" .. g)
                        width='25%',
                        ['border-top']='2px solid #000',
                        ['border-right']='2px solid #000'
                    }
                    :wikitext("<span style='color:#666;font-size:0.9em'>with </span>"..g)
             end
             end


             html:tag('tr'):tag('td')
             -- 3. 추가 스텟 칸
                :attr('colspan','3')
            h:tag('tr'):tag('td'):attr('colspan', 3):css{
                :css{
                background = '#f0f4f9',
                    ['background-color']='#f0f4f9',
                border = '2px solid #000', -- 테두리 굵기 통일
                    ['border-left']='2px solid #000',
                padding = '6px 12px',
                    ['border-right']='2px solid #000',
                fontSize = '.9em'
                    padding='6px 12px',
            }:wikitext("'''추가 스탯:''' " .. (s ~= '' and s or '없음'))
                    ['font-size']='0.9em'
                }
                :wikitext("'''추가 스탯:''' "..(s~='' and s or '없음'))


             local c=html:tag('tr'):tag('td')
            -- 4. 상세 내용 칸 (접기/펼치기)
                :attr('colspan','3')
             local c = h:tag('tr'):tag('td'):attr('colspan', 3):css{
                :css{
                padding = 0,
                    padding='0',
                border = '2px solid #000' -- 테두리 굵기 통일
                    ['border-left']='2px solid #000',
            }:tag('div'):addClass('mw-collapsible mw-collapsed')
                    ['border-right']='2px solid #000',
                    ['border-bottom']='2px solid #000'
                }
                :tag('div')
                :addClass('mw-collapsible mw-collapsed')


             c:tag('div')
             c:tag('div'):addClass('mw-collapsible-toggle'):css{
                :addClass('mw-collapsible-toggle')
                textAlign = 'center',
                :css{
                background = '#eee',
                    ['text-align']='center',
                fontSize = '.85em',
                    background='#eee',
                padding = '4px',
                    ['font-size']='0.85em',
                borderTop = '1px solid #ccc' -- 내부 구분선만 얇게 유지
                    padding='4px',
            }:wikitext('▼ 상세')
                    ['border-top']='1px solid #ccc'
                }
                :wikitext('▼ 상세')


             c:tag('div')
             c:tag('div'):addClass('mw-collapsible-content'):css{
                :addClass('mw-collapsible-content')
                padding = '12px',
                :css{padding='12px',background='#fff'}
                background = '#fff'
                :wikitext((d~='' and d~='-') and d or '상세 내용이 없습니다.')
            }:wikitext((d ~= '' and d ~= '-') and d or '상세 내용이 없습니다.')
         end
         end
        i=i+1
     end
     end


     if not has then
     return has and tostring(h) or "<div style='color:red;font-weight:bold'>데이터를 찾을 수 없습니다.</div>"
        return "<div style='color:red;font-weight:bold'>데이터를 찾을 수 없습니다.</div>"
    end
    return tostring(html)
end
end


return p
return p

2026년 3월 5일 (목) 04:31 기준 최신판

교류 #1
반짝이는 이미테이션
추가 스탯: 없음
▼ 상세
상세 내용이 없습니다.
교류 #2
이상의 아이돌
추가 스탯: 없음
▼ 상세
상세 내용이 없습니다.

사용 예시

숫자를 늘리면 무한히 늘어납니다

{{#invoke:샤인 포스트 Be your Idol/캐릭터 메모리|render
|타입1 = 
|이름1 = 
|게스트1 =
|스텟1
|내용1 = 

|타입2 = 
|이름2 = 
|게스트2 = 
|스텟2=
|내용2 = 
}}

local p = {}

function p.render(f)
    local a, has, h = {}, false, mw.html.create('table'):addClass('wikitable'):css{
        width = '100%',
        ['border-collapse'] = 'collapse',
        ['table-layout'] = 'fixed',
        border = '2px solid #000', -- 전체 외곽선 굵게
        marginBottom = '20px'
    }

    local pnt = f:getParent()
    if pnt then for k, v in pairs(pnt.args) do a[k] = v end end
    for k, v in pairs(f.args) do a[k] = v end

    for i = 1, 50 do
        local t = a['타입' .. i] or ''
        local n = a['이름' .. i] or ''
        local g = a['게스트' .. i] or ''
        local s = a['스텟' .. i] or ''
        local d = a['내용' .. i] or ''

        if t ~= '' or n ~= '' then
            has = true
            local r = h:tag('tr')

            -- 1. 타입 칸 (왼쪽 파란색)
            r:tag('td'):css{
                background = '#3478bf',
                width = '20%',
                border = '2px solid #000' -- 테두리 굵기 통일
            }:wikitext("<div style='text-align:center;font-weight:bold;color:#fff'>" .. t .. "</div>")

            -- 2. 이름 및 게스트 칸 (오른쪽)
            if g == '' or g:match '^%s*$' then
                r:tag('td'):attr('colspan', 2):css{
                    fontWeight = 'bold',
                    border = '2px solid #000', -- 테두리 굵기 통일
                    paddingLeft = '10px'
                }:wikitext(n)
            else
                r:tag('td'):css{
                    fontWeight = 'bold',
                    width = '65%',
                    border = '2px solid #000', -- 테두리 굵기 통일
                    paddingLeft = '10px'
                }:wikitext(n)
                
                r:tag('td'):css{
                    textAlign = 'center',
                    width = '15%',
                    border = '2px solid #000' -- 테두리 굵기 통일
                }:wikitext("<span style='color:#666;font-size:.9em'>with </span>" .. g)
            end

            -- 3. 추가 스텟 칸
            h:tag('tr'):tag('td'):attr('colspan', 3):css{
                background = '#f0f4f9',
                border = '2px solid #000', -- 테두리 굵기 통일
                padding = '6px 12px',
                fontSize = '.9em'
            }:wikitext("'''추가 스탯:''' " .. (s ~= '' and s or '없음'))

            -- 4. 상세 내용 칸 (접기/펼치기)
            local c = h:tag('tr'):tag('td'):attr('colspan', 3):css{
                padding = 0,
                border = '2px solid #000' -- 테두리 굵기 통일
            }:tag('div'):addClass('mw-collapsible mw-collapsed')

            c:tag('div'):addClass('mw-collapsible-toggle'):css{
                textAlign = 'center',
                background = '#eee',
                fontSize = '.85em',
                padding = '4px',
                borderTop = '1px solid #ccc' -- 내부 구분선만 얇게 유지
            }:wikitext('▼ 상세')

            c:tag('div'):addClass('mw-collapsible-content'):css{
                padding = '12px',
                background = '#fff'
            }:wikitext((d ~= '' and d ~= '-') and d or '상세 내용이 없습니다.')
        end
    end

    return has and tostring(h) or "<div style='color:red;font-weight:bold'>데이터를 찾을 수 없습니다.</div>"
end

return p