デザインを修正
This commit is contained in:
parent
ed6f00f3fd
commit
8e7ccba5cc
@ -54,7 +54,7 @@ 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;'>");
|
||||
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:"+(position ? 'left' : 'right')+";height:22px;margin: 2px;'>");
|
||||
setIconElem.remove();
|
||||
}
|
||||
|
||||
@ -1041,6 +1041,15 @@ export const injectJavascriptData: InjectJavascriptData = (
|
||||
else if(列番データ.indexOf("R") != -1){
|
||||
trainName = "回送";
|
||||
}
|
||||
else if(列番データ.indexOf("E") != -1){
|
||||
trainName = "回送";
|
||||
}
|
||||
else if(列番データ.indexOf("A") != -1){
|
||||
trainName = "回送";
|
||||
}
|
||||
else if(列番データ.indexOf("B") != -1){
|
||||
trainName = "回送";
|
||||
}
|
||||
else if(列番データ.indexOf("S") != -1){
|
||||
trainName = "臨時列車";
|
||||
}
|
||||
@ -1251,8 +1260,10 @@ export const injectJavascriptData: InjectJavascriptData = (
|
||||
行き先情報.innerText = "";
|
||||
${uiSetting === "tokyo" ? `
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:10px;font-weight:bold;padding:0;color:black;text-align:center;'>" + (ToData ? ToData + "行 " : ToData) + "</p>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:8px;font-weight:bold;padding:0;color: black;text-align:center;'>" + returnText1 + "</p>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:8px;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:8px;font-weight:bold;padding:0;color: black;text-align:center;'>" + trainName + "</p>");
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:6px;font-weight:bold;padding:0;color: black;text-align:center;'>" + viaData + "</p>");
|
||||
行き先情報.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;text-align:center;color: "+(hasProblem ? "red":"black")+";'>" + (hasProblem ? "‼️停止中‼️" : "") + "</p>");
|
||||
`: `
|
||||
行き先情報.insertAdjacentHTML('beforebegin', "<p style='font-size:10px;font-weight:bold;padding:0;color: black;'>" + returnText1 + "</p>");
|
||||
@ -1266,13 +1277,35 @@ export const injectJavascriptData: InjectJavascriptData = (
|
||||
`
|
||||
|
||||
|
||||
const setNewTrainItem = (element)=>{
|
||||
element.style.borderColor = 'white';
|
||||
const setNewTrainItem = (element,hasProblem)=>{
|
||||
if(element.getAttribute('offclick').includes("express")){
|
||||
element.style.borderColor = 'rgba(255, 0, 0, 1)';
|
||||
}else if(element.getAttribute('offclick').includes("rapid")){
|
||||
element.style.borderColor = 'rgba(0, 140, 255, 1)';
|
||||
}else {
|
||||
element.style.borderColor = 'white';
|
||||
}
|
||||
element.style.borderWidth = '2px';
|
||||
element.style.borderStyle = 'solid';
|
||||
element.style.borderRadius = '10%';
|
||||
element.style.backgroundColor = 'rgba(255, 255, 255, 0.8)';
|
||||
element.style.boxShadow = '0 0 4px rgba(0, 0, 0, 0.2)';
|
||||
var 列番データ = element.getAttribute('offclick').split('"')[1];
|
||||
switch(true){
|
||||
case 列番データ.indexOf("H") != -1:
|
||||
case 列番データ.indexOf("R") != -1:
|
||||
case 列番データ.indexOf("E") != -1:
|
||||
case 列番データ.indexOf("A") != -1:
|
||||
case 列番データ.indexOf("B") != -1:
|
||||
element.style.backgroundColor = 'rgba(199, 199, 199, 0.8)';
|
||||
break;
|
||||
default:
|
||||
element.style.backgroundColor = 'rgba(255, 255, 255, 0.8)';
|
||||
break;
|
||||
}
|
||||
if(hasProblem){
|
||||
element.style.boxShadow = '0 0 6px rgba(255, 0, 0, 0.77)';
|
||||
}else{
|
||||
element.style.boxShadow = '0 0 4px rgba(0, 0, 0, 0.2)';
|
||||
}
|
||||
element.style.margin = '2px';
|
||||
element.style.display = 'flex';
|
||||
element.style.alignItems = 'center';
|
||||
@ -1287,12 +1320,12 @@ const setNewTrainItem = (element)=>{
|
||||
element.addEventListener('touchend', () => element.style.transform = 'scale(1)');
|
||||
if(element.getAttribute("style").includes("left")){
|
||||
// borderを使って五角形を生成 下り
|
||||
element.style.borderRadius = '20% 20% 80% 80%';
|
||||
element.style.borderRadius = '10% 10% 40% 40%';
|
||||
element.style.flexDirection = 'column-reverse';
|
||||
}
|
||||
else if(element.getAttribute("style").includes("right")){
|
||||
// borderを使って五角形を生成 上り
|
||||
element.style.borderRadius = '80% 80% 20% 20%';
|
||||
element.style.borderRadius = '40% 40% 10% 10%';
|
||||
element.style.flexDirection = 'column';
|
||||
}
|
||||
|
||||
@ -1387,7 +1420,7 @@ const setStrings = () =>{
|
||||
}
|
||||
` : ""}
|
||||
nameReplace(列車名データ,列番データ,行き先情報,hasProblem);
|
||||
${uiSetting === "tokyo" ? `setNewTrainItem(element);`: ``}
|
||||
${uiSetting === "tokyo" ? `setNewTrainItem(element,hasProblem);`: ``}
|
||||
}
|
||||
try{
|
||||
for(let d of document.getElementById('disp').childNodes){
|
||||
|
Loading…
Reference in New Issue
Block a user