停止中表示を改良

This commit is contained in:
harukin-expo-dev-env 2025-03-29 14:55:59 +00:00
parent 4744d5f4e0
commit 2b9553a45b

View File

@ -47,12 +47,8 @@ export const injectJavascriptData: InjectJavascriptData = (
// 左か右かを判定してアイコンを設置する
const trainIcon = `
const setStationIcon = (setIconElem,img,hasProblem) =>{
if(setIconElem.getAttribute("style").includes("left")){
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:left;height:20px; background-color: "+(hasProblem ? 'black' : 'white')+";'>");
}
else{
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:right;height:20px; background-color: "+(hasProblem ? 'black' : 'white')+";'>");
}
const position = setIconElem.getAttribute("style").includes("left");
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:"+(position ? 'left' : 'right')+";height:20px;'>");
setIconElem.remove();
}
const setTrainIcon = (,e,hasProblem) =>{
@ -1263,8 +1259,9 @@ export const injectJavascriptData: InjectJavascriptData = (
const returnText1 = (isWanman ? "ワンマン " : "") + trainName + viaData;
const returnText2 = (ToData ? ToData+"行 " : ToData)+ TrainNumber;
.innerText = "";
.insertAdjacentHTML('beforebegin', "<p style='font-size:10px;font-weight:bold;padding:0;color:" + (hasProblem ? "red" : "black") + ";background-color:"+ (hasProblem ? "black" : "unset") +";'>" + returnText1 + (hasProblem ? "\[停止中\]" : "") + "</p>");
.insertAdjacentHTML('beforebegin', "<div style='display:inline-flex;flex-direction:row;'><p style='font-size:10px;font-weight: bold;padding:0;color:" + (hasProblem ? "red" : "black") + ";background-color:"+ (hasProblem ? "black" : "unset") +";'>" + (ToData ? ToData + "行 " : ToData) + "</p><p style='font-size:10px;padding:0;color:" + (hasProblem ? "red" : "black") + ";background-color:"+ (hasProblem ? "black" : "unset") +";'>" + TrainNumber + (JRF ? "":"レ") + "</p></div>");
.insertAdjacentHTML('beforebegin', "<p style='font-size:10px;font-weight:bold;padding:0;color: black;'>" + returnText1 + "</p>");
.insertAdjacentHTML('beforebegin', "<div style='display:inline-flex;flex-direction:row;'><p style='font-size:10px;font-weight: bold;padding:0;color:black;'>" + (ToData ? ToData + "行 " : ToData) + "</p><p style='font-size:10px;padding:0;color:black;'>" + TrainNumber + (JRF ? "":"レ") + "</p></div>");
.insertAdjacentHTML('beforebegin', "<p style='font-size:10px;font-weight:bold;padding:0;color: "+(hasProblem ? "red":"black")+";'>" + (hasProblem ? "‼️停止中‼️" : "") + "</p>");
}
`;