行き先の裏に駅の路線カラーを設定
This commit is contained in:
parent
b143e4251d
commit
c98407527b
@ -30,6 +30,10 @@ export const injectJavascriptData: InjectJavascriptData = (
|
||||
|
||||
// 上部ヘッダーの取り扱い、自動再読み込み、setStringsの実行
|
||||
const bootData = `
|
||||
let stationList = {};
|
||||
fetch("https://n8n.haruk.in/webhook/jr-shikoku-station-list").then((response) => response.json()).then((data) => {
|
||||
stationList = data;
|
||||
});
|
||||
let trainDataList = [];
|
||||
fetch("https://n8n.haruk.in/webhook/jr-shikoku-position-custom-datalist").then((response) => response.json()).then((data) => {
|
||||
trainDataList = data[0].data;
|
||||
@ -1275,11 +1279,27 @@ export const injectJavascriptData: InjectJavascriptData = (
|
||||
const returnText2 = (ToData ? ToData+"行 " : ToData)+ TrainNumber;
|
||||
行き先情報.innerText = "";
|
||||
${uiSetting === "tokyo" ? `
|
||||
let stationIDs = [];
|
||||
let stationLines = [];
|
||||
Object.keys(stationList).forEach((key) => {
|
||||
const data = stationList[key].find(e => e.Station_JP === ToData )?.StationNumber;
|
||||
if(data){
|
||||
stationIDs.push(data);
|
||||
stationLines.push(key);
|
||||
}
|
||||
});
|
||||
let getColors = [];
|
||||
if(stationLines.length === 0){
|
||||
getColors = ["#000"];
|
||||
}else{
|
||||
getColors = stationLines.map(e => GetLineBarColor(e));
|
||||
}
|
||||
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;'>" + viaData + "</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:10px;font-weight:bold;padding:0;color:black;text-align:center;'>" + (ToData ? ToData + "行 " : ToData) + "</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', "<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>");
|
||||
|
Loading…
Reference in New Issue
Block a user