From 0c10bcc339ac69e5d7c993a3a3d072b57dcf5a51 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Fri, 18 Jul 2025 15:18:33 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=9E=8BCSS=E3=81=AE=E5=BD=A2?= =?UTF-8?q?=E6=85=8B=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/webViewInjectjavascript.ts | 101 +++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index 9ac40b7..088bd84 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -1421,57 +1421,70 @@ const setStrings = () =>{ try { const elements = document.querySelectorAll('#disp > div > div > div[onclick]'); const setNewTrainItemUI = ()=>{ - const elementBaseBase = document.querySelectorAll('[id^="stationBlock"]'); - elementBaseBase.forEach(e=>{ //それぞれの駅ブロック横一列 + const aaa = (x2,pos) => { + x2.style.display = 'flex'; + x2.style.flexDirection = 'row'; + if(pos == "right"){ + x2.style.alignItems = 'flex-start'; + x2.style.justifyContent = 'flex-start'; + }else if(pos == "left"){ + x2.style.alignItems = 'flex-end'; + x2.style.justifyContent = 'flex-end'; + } + x2.style.flexWrap = 'wrap'; + x2.style.width = '100%'; + x2.style.height = "100%"; + + } + const aaa2 = (x2) => { + x2.style.display = 'flex'; + x2.style.flexDirection = 'row'; + x2.style.alignItems = 'center'; + x2.style.justifyContent = 'center'; + x2.style.flexWrap = 'wrap'; + x2.style.width = '100%'; + x2.style.height = "unset"; + const x3 = x2.querySelectorAll(":scope > div"); + x3.forEach(i=>{ + i.style.position = "unset"; + i.style.display = "flex"; + i.style.flexDirection = "column"; + i.style.flex = "1"; + i.style.backgroundColor = "#00000000"; + i.querySelectorAll(":scope > *").forEach(j=>{ + j.style.width = "100%"; + j.style.textAlign = "center"; + j.style.margin = "5px"; + j.style.padding = "5px"; + }); + }); + } + const layoutBase = (e)=>{ e.style.display = 'flex'; e.style.height = "unset"; e.style.flexDirection = 'row'; - //e.style.alignItems = "left"; e.style.justifyContent = 'center'; - const x = e.querySelectorAll(':scope > div');//配下のdiv要素を選択 - //x[0] 登りブロック x[2] 下りブロック x[1] 駅ブロック - const aaa = (x2,pos) => { - x2.style.display = 'flex'; - x2.style.flexDirection = 'row'; - if(pos == "right"){ - x2.style.alignItems = 'flex-start'; - x2.style.justifyContent = 'flex-start'; - }else if(pos == "left"){ - x2.style.alignItems = 'flex-end'; - x2.style.justifyContent = 'flex-end'; - } - x2.style.flexWrap = 'wrap'; - x2.style.width = '100%'; - x2.style.height = "100%"; - - } - const aaa2 = (x2) => { - x2.style.display = 'flex'; - x2.style.flexDirection = 'row'; - x2.style.alignItems = 'center'; - x2.style.justifyContent = 'center'; - x2.style.flexWrap = 'wrap'; - x2.style.width = '100%'; - x2.style.height = "unset"; - const x3 = x2.querySelectorAll(":scope > div"); - x3.forEach(i=>{ - i.style.position = "unset"; - i.style.display = "flex"; - i.style.flexDirection = "column"; - i.style.flex = "1"; - i.style.backgroundColor = "#00000000"; - i.querySelectorAll(":scope > *").forEach(j=>{ - j.style.width = "100%"; - j.style.textAlign = "center"; - j.style.margin = "5px"; - j.style.padding = "5px"; - }); - }); - } + } + const elementBaseBase = document.querySelectorAll('[id^="stationBlock"]'); + const elementNotBase = document.querySelectorAll('#disp > [id*="~"]'); + elementNotBase.forEach(e=>{ + layoutBase(e); + const x = e.querySelectorAll(':scope > [id^="Up"], :scope > [id^="Id"], :scope > [id^="Down"]');//配下のdiv要素を選択 + aaa(x[0],"left"); + aaa2(x[1]); + aaa(x[2],"right"); + const upTrainCrossBarElement = e.querySelector(':scope > [id="upTrainCrossBar"]'); + if (upTrainCrossBarElement) { + upTrainCrossBarElement.style.left = '0px'; + } + }); + elementBaseBase.forEach(e=>{ //それぞれの駅ブロック横一列 + layoutBase(e); + const x = e.querySelectorAll(':scope > div');//配下のdiv要素を選択 + //x[0] 登りブロック x[2] 下りブロック x[1] 駅ブロック aaa(x[0],"left"); aaa2(x[1]); aaa(x[2],"right"); - }); }