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



900Articles

모듈:푸른 저편의 포리듬/ 캐릭터 프로필: 두 판 사이의 차이

편집 요약 없음
편집 요약 없음
1번째 줄: 1번째 줄:
local p = {}
local p = {}
local function safe(v)
return v and mw.text.trim(v) or ""
end
local function row(label, value)
value = safe(value)
if value ~= "" then
return string.format('<tr><th style="width:30%%">%s</th><td>%s</td></tr>', label, value)
end
return ""
end
local function signatureTech(args)
local text = ""
for i = 1, 5 do
local skill = safe(args["시그니처기술" .. i])
if skill ~= "" then
text = text .. "· " .. skill .. "<br>"
end
end
return text ~= "" and text or ""
end


function p.main(frame)
function p.main(frame)
local args = frame:getParent().args
    local args = frame:getParent().args
local color = safe(args["색상"]) ~= "" and args["색상"] or "#E6E9F5"


-- 이미지 영역 (탭 방식)
    local function F(x)
local imageTabs = '<div class="profile-image-tabs">'
        return (args[x] and args[x] ~= "") and args[x] or "정보 없음"
.. '<div class="tab-buttons">'
    end
.. '<button class="tab-btn active">애니</button>'
.. '<button class="tab-btn">VN</button>'
.. '</div><div class="tab-content active">'


if safe(args["이미지_애니"]) ~= "" then
    return string.format([[
imageTabs = imageTabs .. string.format('[[파일:%s|250px]]', args["이미지_애니"])
<div class="profile-container" style="border:2px solid %s; padding:10px;">
else
imageTabs = imageTabs .. "이미지 없음"
end


imageTabs = imageTabs .. '</div><div class="tab-content">'
    <div class="profile-left">
        <div class="tab-buttons">
            <button class="tab-btn active">애니</button>
            <button class="tab-btn">VN</button>
        </div>


if safe(args["이미지_VN"]) ~= "" then
        <div class="profile-image-tabs">
imageTabs = imageTabs .. string.format('[[파일:%s|250px]]', args["이미지_VN"])
            <div class="tab-content active">
else
                %s
imageTabs = imageTabs .. "이미지 없음"
            </div>
end
            <div class="tab-content">
                %s
            </div>
        </div>
    </div>


imageTabs = imageTabs .. '</div></div>'
    <div class="profile-right">
        <h2>%s</h2>
        <span>%s / %s</span>


-- 정보 테이블
        <table class="profile-table">
local info = '<table class="wikitable" style="width:100%; background:' .. color .. '; font-size:14px;">'
            <tr><th>성별</th><td>%s</td></tr>
.. '<tr><th colspan="2" style="text-align:center; font-size:20px;">'
            <tr><th>나이</th><td>애니: %s / VN: %s</td></tr>
.. safe(args["이름"]) .. '<br><span style="font-size:13px; opacity:0.6;">'
            <tr><th>생일</th><td>%s</td></tr>
.. safe(args["이름_일어"]) .. ' / ' .. safe(args["이름_영어"]) .. '</span></th></tr>'
            <tr><th>신장</th><td>%s</td></tr>
            <tr><th>체중</th><td>%s</td></tr>
            <tr><th>머리색</th><td>%s</td></tr>
            <tr><th>눈색</th><td>%s</td></tr>
        </table>
    </div>
</div>


info = info
<style>
.. '<tr><th colspan="2" style="text-align:center; background:#ccc;">기본 정보</th></tr>'
.profile-container{display:flex; gap:10px;}
.. row("성별", args["성별"])
.profile-left{width:250px; text-align:center;}
.. row("나이", (safe(args["나이_VN"]) ~= "" or safe(args["나이_애니"]) ~= "") and ("VN: " .. safe(args["나이_VN"]) .. " / Anime: " .. safe(args["나이_애니"])) or "")
.profile-right{flex:1;}
.. row("생일", args["생일"])
.. row("신장", args["신장"])
.. row("체중", args["체중"])
.. row("머리색", args["머리색"])
.. row("눈색", args["눈색"])
 
info = info
.. '<tr><th colspan="2" style="text-align:center; background:#ccc;">FC 프로필</th></tr>'
.. row("포지션", args["포지션"])
.. row("소속 팀", args["소속_팀"])
.. row("시그니처 기술", signatureTech(args))
 
info = info
.. '<tr><th colspan="2" style="text-align:center; background:#ccc;">개인 정보</th></tr>'
.. row("학교", args["학교"])
.. row("거주지", args["거주지"])
.. row("취미", args["취미"])
.. row("좋아하는 음식", args["좋아하는음식"])


info = info
.. '<tr><th colspan="2" style="text-align:center; background:#ccc;">성우</th></tr>'
.. row("일본어", args["성우_JP"])
.. row("영어", args["성우_EN"])
info = info
.. '<tr><th colspan="2" style="text-align:center; background:#ccc;">데뷔</th></tr>'
.. row("애니", args["애니_데뷔"])
.. row("게임(VN)", args["게임_데뷔"])
.. row("만화", args["만화_데뷔"])
.. "</table>"
-- 구조: 데스크톱= 좌이미지+우정보 / 모바일= 이미지 위 → 정보 아래
local container = '<div class="profile-container">' .. imageTabs .. info .. "</div>"
-- CSS 삽입
container = container .. [[
<style>
.profile-container{
display:flex;
gap:10px;
align-items:flex-start;
}
@media(max-width:720px){
.profile-container{flex-direction:column; text-align:center;}
}
.profile-image-tabs{width:250px;}
.tab-buttons{display:flex; gap:5px; margin-bottom:5px;}
.tab-buttons{display:flex; gap:5px; margin-bottom:5px;}
.tab-btn{flex:1; padding:5px; cursor:pointer; background:#ddd; border:none;}
.tab-btn{flex:1; padding:5px; cursor:pointer; background:#ddd; border:none;}
.tab-btn.active{background:#999; font-weight:bold;}
.tab-btn.active{background:#999; font-weight:bold;}
.tab-content{display:none;}
.tab-content{display:none;}
.tab-content.active{display:block;}
.tab-content.active{display:block;}
@media(max-width:720px){
    .profile-container{flex-direction:column;}
    .profile-left{width:100%;}
}
</style>
</style>
<script>
<script>
document.addEventListener("DOMContentLoaded", function(){
document.addEventListener("DOMContentLoaded", function(){
const buttons = document.querySelectorAll(".tab-btn");
    const buttons = document.querySelectorAll(".tab-btn");
const tabs = document.querySelectorAll(".tab-content");
    const tabs = document.querySelectorAll(".tab-content");
buttons.forEach((btn,i)=>{
 
btn.onclick=function(){
    buttons.forEach((btn,i)=>{
buttons.forEach(b=>b.classList.remove("active"));
        btn.onclick=function(){
tabs.forEach(t=>t.classList.remove("active"));
            buttons.forEach(b=>b.classList.remove("active"));
btn.classList.add("active");
            tabs.forEach(t=>t.classList.remove("active"));
tabs[i].classList.add("active");
            btn.classList.add("active");
}
            tabs[i].classList.add("active");
})
        }
    });
});
});
</script>
</script>
]]
]],
 
args["색상"] or "black",
return container
args["이미지_애니"] and ("[[파일:"..args["이미지_애니"].."|200px]]") or "이미지 없음",
args["이미지_VN"] and ("[[파일:"..args["이미지_VN"].."|200px]]") or "이미지 없음",
F("이름"), F("이름_일어"), F("이름_영어"),
F("성별"), F("나이_애니"), F("나이_VN"),
F("생일"), F("신장"), F("체중"),
F("머리색"), F("눈색")
)
end
end


return p
return p

2025년 12월 5일 (금) 03:16 판

이 모듈에 대한 설명문서는 모듈:푸른 저편의 포리듬/ 캐릭터 프로필/설명문서에서 만들 수 있습니다

local p = {}

function p.main(frame)
    local args = frame:getParent().args

    local function F(x)
        return (args[x] and args[x] ~= "") and args[x] or "정보 없음"
    end

    return string.format([[
<div class="profile-container" style="border:2px solid %s; padding:10px;">

    <div class="profile-left">
        <div class="tab-buttons">
            <button class="tab-btn active">애니</button>
            <button class="tab-btn">VN</button>
        </div>

        <div class="profile-image-tabs">
            <div class="tab-content active">
                %s
            </div>
            <div class="tab-content">
                %s
            </div>
        </div>
    </div>

    <div class="profile-right">
        <h2>%s</h2>
        <span>%s / %s</span>

        <table class="profile-table">
            <tr><th>성별</th><td>%s</td></tr>
            <tr><th>나이</th><td>애니: %s / VN: %s</td></tr>
            <tr><th>생일</th><td>%s</td></tr>
            <tr><th>신장</th><td>%s</td></tr>
            <tr><th>체중</th><td>%s</td></tr>
            <tr><th>머리색</th><td>%s</td></tr>
            <tr><th>눈색</th><td>%s</td></tr>
        </table>
    </div>
</div>

<style>
.profile-container{display:flex; gap:10px;}
.profile-left{width:250px; text-align:center;}
.profile-right{flex:1;}

.tab-buttons{display:flex; gap:5px; margin-bottom:5px;}
.tab-btn{flex:1; padding:5px; cursor:pointer; background:#ddd; border:none;}
.tab-btn.active{background:#999; font-weight:bold;}

.tab-content{display:none;}
.tab-content.active{display:block;}

@media(max-width:720px){
    .profile-container{flex-direction:column;}
    .profile-left{width:100%;}
}
</style>

<script>
document.addEventListener("DOMContentLoaded", function(){
    const buttons = document.querySelectorAll(".tab-btn");
    const tabs = document.querySelectorAll(".tab-content");

    buttons.forEach((btn,i)=>{
        btn.onclick=function(){
            buttons.forEach(b=>b.classList.remove("active"));
            tabs.forEach(t=>t.classList.remove("active"));
            btn.classList.add("active");
            tabs[i].classList.add("active");
        }
    });
});
</script>
]], 
args["색상"] or "black",
args["이미지_애니"] and ("[[파일:"..args["이미지_애니"].."|200px]]") or "이미지 없음",
args["이미지_VN"] and ("[[파일:"..args["이미지_VN"].."|200px]]") or "이미지 없음",
F("이름"), F("이름_일어"), F("이름_영어"),
F("성별"), F("나이_애니"), F("나이_VN"),
F("생일"), F("신장"), F("체중"),
F("머리색"), F("눈색")
)
end

return p