整理
This commit is contained in:
parent
ca4b9e7c2d
commit
8d10fbf998
@ -73,7 +73,8 @@ export const injectJavascriptData: InjectJavascriptData = (
|
||||
const trainIcon = `
|
||||
const setStationIcon = (setIconElem,img,hasProblem) =>{
|
||||
const position = setIconElem.getAttribute("style").includes("left");
|
||||
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:"+(position ? 'left' : 'right')+";height:22px;margin: 2px;'>");
|
||||
const marginData = ${uiSetting === "tokyo" ? `"5px"`: `"2px"`}
|
||||
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:"+(position ? 'left' : 'right')+";height:22px;margin: "+marginData+";'>");
|
||||
setIconElem.remove();
|
||||
}
|
||||
|
||||
@ -1052,7 +1053,7 @@ export const injectJavascriptData: InjectJavascriptData = (
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
const nameReplace = (列車名データ,列番データ,行き先情報,hasProblem) =>{
|
||||
const nameReplace = (列車名データ,列番データ,行き先情報,hasProblem,isLeft) =>{
|
||||
let isWanman = false;
|
||||
let trainName = "";
|
||||
let trainType = "";
|
||||
@ -1344,14 +1345,9 @@ export const injectJavascriptData: InjectJavascriptData = (
|
||||
}
|
||||
|
||||
const gradient = getColors.length > 1 ? "linear-gradient(130deg, " + getColors[0] + " 0%, "+ getColors[0]+"50%, "+ getColors[1]+"50%, " + getColors[1] + " 100%)" : getColors[0];
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:6px;padding:0;color:black;text-align:center;'>" + TrainNumber + (JRF ? "":"レ") + "</p>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:8px;font-weight:bold;padding:0;color: black;text-align:center;'>" + (isWanman ? "ワンマン " : "") + "</p>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:6px;font-weight:bold;padding:0;color: black;text-align:center;border-bottom-style:solid;border-bottom-width: "+(!!yosan2Color ? "2px" : "0px")+";border-color:" + yosan2Color + "'>" + viaData + "</p>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:8px;font-weight:bold;padding:0;color: black;text-align:center;'>" + trainName + "</p>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<div style='width:100%;background:" + gradient + ";'><p style='font-size:10px;font-weight:bold;padding:0;margin:0;color:white;align-items:center;align-content:center;text-align:center;text-shadow:1px 1px 0px #00000030, -1px -1px 0px #00000030,-1px 1px 0px #00000030, 1px -1px 0px #00000030,1px 0px 0px #00000030, -1px 0px 0px #00000030,0px 1px 0px #00000030, 0px -1px 0px #00000030;'>" + (ToData ? ToData + "行" : ToData) + "</p></div>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<div style='width:100%;background:" + trainTypeColor + ";'><p style='font-size:10px;font-weight:bold;font-style:italic;padding:0;color: white;text-align:center;'>" + trainType + "</p></div>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:8px;font-weight:bold;padding:0;text-align:center;color: "+(hasProblem ? "red":"black")+";'>" + (hasProblem ? "‼️停止中‼️" : "") + "</p>");
|
||||
`: `
|
||||
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<div style='width:100%;display:flex;flex:1;flex-direction:"+(isLeft ? "column-reverse" : "column") + ";'><p style='font-size:6px;padding:0;color:black;text-align:center;'>" + TrainNumber + (JRF ? "":"レ") + "</p><div style='flex:1;'></div><p style='font-size:8px;font-weight:bold;padding:0;color: black;text-align:center;'>" + (isWanman ? "ワンマン " : "") + "</p><p style='font-size:6px;font-weight:bold;padding:0;color: black;text-align:center;border-style:solid;border-width: "+(!!yosan2Color ? "2px" : "0px")+";border-color:" + yosan2Color + "'>" + viaData + "</p><p style='font-size:8px;font-weight:bold;padding:0;color: black;text-align:center;'>" + trainName + "</p><div style='width:100%;background:" + gradient + ";'><p style='font-size:10px;font-weight:bold;padding:0;margin:0;color:white;align-items:center;align-content:center;text-align:center;text-shadow:1px 1px 0px #00000030, -1px -1px 0px #00000030,-1px 1px 0px #00000030, 1px -1px 0px #00000030,1px 0px 0px #00000030, -1px 0px 0px #00000030,0px 1px 0px #00000030, 0px -1px 0px #00000030;'>" + (ToData ? ToData + "行" : ToData) + "</p></div><div style='width:100%;background:" + trainTypeColor + ";'><p style='font-size:10px;font-weight:bold;font-style:italic;padding:0;color: white;text-align:center;'>" + trainType + "</p></div><p style='font-size:8px;font-weight:bold;padding:0;text-align:center;color: "+(hasProblem ? "red":"black")+";'>" + (hasProblem ? "‼️停止中‼️" : "") + "</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>");
|
||||
@ -1373,7 +1369,7 @@ const setNewTrainItem = (element,hasProblem)=>{
|
||||
}else if(JRFTemp){
|
||||
element.style.borderColor = 'rgba(0, 134, 158, 0.8)';
|
||||
}else{
|
||||
element.style.borderColor = 'white';
|
||||
element.style.borderColor = 'black';
|
||||
}
|
||||
element.style.borderWidth = '2px';
|
||||
element.style.borderStyle = 'solid';
|
||||
@ -1486,6 +1482,9 @@ const setStrings = () =>{
|
||||
|
||||
var 行き先情報 = element.getElementsByTagName("p")[0];
|
||||
${uiSetting === "tokyo" ? `
|
||||
element.querySelector("img").insertAdjacentHTML('beforebegin',"<div style='flex:1;'></div>");
|
||||
element.querySelector("img").insertAdjacentHTML('afterend',"<div style='flex:1;'></div>");
|
||||
element.querySelector("img").style.padding = '5px';
|
||||
element.style.position = 'relative';
|
||||
if(element.getElementsByTagName("p")[1] != undefined){
|
||||
element.getElementsByTagName("p")[1].innerText = element.getElementsByTagName("p")[1].innerText.replace("(","").replace(")","");
|
||||
@ -1506,6 +1505,7 @@ const setStrings = () =>{
|
||||
element.getElementsByTagName("p")[1].style.top = '0px';
|
||||
}
|
||||
}`: ``}
|
||||
const isLeft = element.getAttribute("style").includes("left");
|
||||
var 列番データ = element.getAttribute('offclick').split('"')[1];
|
||||
var 列車名データ = element.getAttribute('offclick').split('"')[3];
|
||||
const trainData = trainPositionDatas.filter(e=>!(e.Pos && e.Pos.includes("予告窓"))).find(e => e.TrainNum == 列番データ);
|
||||
@ -1530,7 +1530,7 @@ const setStrings = () =>{
|
||||
}
|
||||
}
|
||||
` : ""}
|
||||
nameReplace(列車名データ,列番データ,行き先情報,hasProblem);
|
||||
nameReplace(列車名データ,列番データ,行き先情報,hasProblem,isLeft);
|
||||
${uiSetting === "tokyo" ? `setNewTrainItem(element,hasProblem);`: ``}
|
||||
}
|
||||
try{
|
||||
|
Loading…
Reference in New Issue
Block a user