Merge commit '46cff473e670b95bb836e8ac70a4b46c8bfc2587' into develop

This commit is contained in:
harukin-expo-dev-env
2025-08-23 08:59:30 +00:00
3 changed files with 97 additions and 140 deletions

View File

@@ -9,6 +9,7 @@ type typeID =
| "SPCL_Normal"
| "SPCL_Rapid"
| "SPCL_EXP"
| "Party"
| "Freight"
| "Forwarding"
| "FreightForwarding"
@@ -36,6 +37,8 @@ export const getStringConfig: types = (type, id) => {
return ["臨時快速", true, false];
case "SPCL_EXP":
return ["臨時特急", true, false];
case "Party":
return ["団体臨時", true, false];
case "Freight":
return ["貨物", false, false];
case "Forwarding":

View File

@@ -5,7 +5,7 @@ type nameString =
| "SPCL"
| "Normal"
| string;
type colorString = "aqua" | "red" | "#297bff" | "white" | "pink";
type colorString = "aqua" | "red" | "#297bff" | "#ff7300ff" | "white" | "pink";
type trainTypeString =
| "快速"
| "特急"
@@ -15,6 +15,7 @@ type trainTypeString =
| "普通列車(ワンマン)"
| "臨時快速"
| "臨時特急"
| "団体臨時"
| "その他";
type trainTypeDataString = "rapid" | "express" | "normal";
type getTrainType = (d: nameString) => {
@@ -42,6 +43,8 @@ export const getTrainType: getTrainType = (nameString) => {
return { color: "#297bff", name: "臨時快速", data: "normal" };
case "SPCL_EXP":
return { color: "#297bff", name: "臨時特急", data: "normal" };
case "Party":
return { color: "#ff7300ff", name: "団体臨時", data: "normal" };
default:
return { color: "white", name: "その他", data: "normal" };
}

View File

@@ -634,39 +634,6 @@ export const injectJavascriptData: InjectJavascriptData = (
`;
const normal_train_name = `
const getJRF = num =>{
switch(num){
case "71":
return "東京(タ)→高松(タ)";
case "73":
case "75":
return "大阪(タ)→高松(タ)";
case "3079":
return "高松(タ)→伊予三島";
case "3071":
case "3077":
return "高松(タ)→新居浜";
case "3073":
return "高松(タ)→松山貨物";
case "70":
return "高松(タ)→東京(タ)";
case "74":
case "76":
return "高松(タ)→大阪(タ)";
case "3078":
return "伊予三島→高松(タ)";
case "3070":
return "新居浜→高松(タ)";
case "3076":
return "新居浜→高松(タ)";
case "3072":
return "松山貨物→高松(タ)";
case "9070":
return "臨時貨物";
default:
return undefined;
}
}
const nameReplace = (列車名データ,列番データ,行き先情報,hasProblem,isLeft) =>{
let isWanman = false;
let trainName = "";
@@ -724,15 +691,6 @@ export const injectJavascriptData: InjectJavascriptData = (
trainName = "臨時列車";
}
let JRF = true;
const JRFTemp = getJRF(列番データ);
if(JRFTemp){
trainName = JRFTemp;
JRF = false;
}
const getThrew = num =>{
switch(num){
@@ -833,30 +791,6 @@ export const injectJavascriptData: InjectJavascriptData = (
viaData = "ごめん・なはり線[快速]";
ToData = "(後免にて解結)\\n土佐山田/奈半利";
break;
case "9395D":
viaData = "[臨時]普通";
ToData = "三本松";
break;
case "9174M":
viaData = "[臨時]マリンライナー94号";
ToData = "岡山";
break;
case "9662D":
viaData = "[臨時]れんげ号";
ToData = "八幡浜";
break;
case "9665D":
viaData = "[臨時]れんげ号";
ToData = "宇和島";
break;
case "9664D":
viaData = "[臨時]わらぐろ号";
ToData = "八幡浜";
break;
case "9663D":
viaData = "[臨時]わらぐろ号";
ToData = "卯之町";
break;
default:
if(new RegExp(/^58[1-3][1,3,5,7,9][DM]$/).test(列番データ)){
viaData = "ごめん・なはり線[快速]";
@@ -882,61 +816,77 @@ export const injectJavascriptData: InjectJavascriptData = (
if(trainDataList.find(e => e.id === 列番データ) !== undefined){
const data = trainDataList.find(e => e.id === 列番データ);
//{id,trainName,viaData,ToData,TrainNumber,TrainNumberOverride,type,infoUrl,trainNumDistance,info,infogram,isEdit}
trainType = (()=>{
switch(data.type){
case "Normal":
trainTypeColor = "black";
isWanman = false;
return "普通";
case "OneMan":
trainTypeColor = "black";
isWanman = true;
return "普通";
case "Rapid":
trainTypeColor = "rgba(0, 140, 255, 1)";
isWanman = false;
return "快速";
case "OneManRapid":
trainTypeColor = "rgba(0, 140, 255, 1)";
isWanman = true;
return "快速";
case "LTDEXP":
trainTypeColor = "red";
isWanman = false;
return "特急";
case "NightLTDEXP":
trainTypeColor = "#d300b0ff";
isWanman = false;
return "寝台特急";
case "SPCL":
case "SPCL_Normal":
trainTypeColor = "#008d07ff";
isWanman = false;
return "臨時";
case "SPCL_Rapid":
trainTypeColor = "rgba(0, 81, 255, 1)";
isWanman = false;
return "臨時快速";
case "SPCL_EXP":
trainTypeColor = "#a52e2eff";
isWanman = false;
return "臨時特急";
case "Freight":
trainTypeColor = "#00869ecc";
isWanman = false;
return "貨物";
case "Forwarding":
trainTypeColor = "#727272cc";
isWanman = false;
return "回送";
case "FreightForwarding":
trainTypeColor = "#727272cc";
isWanman = false;
return "単機回送";
default:
return "";
}
})();
switch(data.type){
case "Normal":
trainTypeColor = "black";
isWanman = false;
trainType = "普通";
break;
case "OneMan":
trainTypeColor = "black";
isWanman = true;
trainType = "普通";
break;
case "Rapid":
trainTypeColor = "rgba(0, 140, 255, 1)";
isWanman = false;
trainType = "快速";
break;
case "OneManRapid":
trainTypeColor = "rgba(0, 140, 255, 1)";
isWanman = true;
trainType = "快速";
break;
case "LTDEXP":
trainTypeColor = "red";
isWanman = false;
trainType = "特急";
break;
case "NightLTDEXP":
trainTypeColor = "#d300b0ff";
isWanman = false;
trainType = "寝台特急";
break;
case "SPCL":
case "SPCL_Normal":
trainTypeColor = "#008d07ff";
isWanman = false;
trainType = "臨時";
break;
case "SPCL_Rapid":
trainTypeColor = "rgba(0, 81, 255, 1)";
isWanman = false;
trainType = "臨時快速";
break;
case "SPCL_EXP":
trainTypeColor = "#a52e2eff";
isWanman = false;
trainType = "臨時特急";
break;
case "Party":
trainTypeColor = "#ff7300ff";
isWanman = false;
trainType = "団体臨時";
break;
case "Freight":
trainTypeColor = "#00869ecc";
isWanman = false;
trainType = "貨物";
break;
case "Forwarding":
trainTypeColor = "#727272cc";
isWanman = false;
trainType = "回送";
break;
case "FreightForwarding":
trainTypeColor = "#727272cc";
isWanman = false;
trainType = "単機回送";
break;
default:
break;
}
isEdit = data.isEdit;
isSeason = data.isSeason;
if(data.trainName != ""){
@@ -1003,7 +953,7 @@ 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', "<div style='width:100%;display:flex;flex:1;flex-direction:"+(isLeft ? "column-reverse" : "column") + ";'>"+( isEdit ? "<div style='position:absolute;"+ (isLeft ? "right" : "left") + ":0;"+ (isLeft ? "bottom" : "top") + ":0;background-color:#00b8bb;border-radius:15px;padding:0px;padding-left:4px;padding-right:4px;'><i class='fa-solid fa-user-group fa-sm' style='color:white;width:100%;height:100%;'></i></div>" : isSeason ? "<div style='position:absolute;"+ (isLeft ? "right" : "left") + ":0;"+ (isLeft ? "bottom" : "top") + ":0;background-color:#00b8bb;border-radius:15px;padding:0px;padding-left:4px;padding-right:4px;'><i class='fa-solid fa-calendar fa-sm' style='color:white;width:100%;height:100%;'></i></div>" : "")+"<p style='font-size:6px;padding:0;color:black;text-align:center;'>" + (TrainNumberOverride ? TrainNumberOverride : TrainNumber) + "</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 + ";border-radius:"+(isLeft ? "4px 4px 0 0" : "0 0 4px 4px")+";'><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', "<div style='width:100%;display:flex;flex:1;flex-direction:"+(isLeft ? "column-reverse" : "column") + ";'>" + ( isEdit ? "<div style='position:absolute;"+ (isLeft ? "right" : "left") + ":0;"+ (isLeft ? "bottom" : "top") + ":0;background-color:#00b8bb;border-radius:15px;padding:0px;padding-left:4px;padding-right:4px;'><i class='fa-solid fa-user-group fa-sm' style='color:white;width:100%;height:100%;'></i></div>" : isSeason ? "<div style='position:absolute;"+ (isLeft ? "right" : "left") + ":0;"+ (isLeft ? "bottom" : "top") + ":0;background-color:#00b8bb;border-radius:15px;padding:0px;padding-left:4px;padding-right:4px;'><i class='fa-solid fa-calendar fa-sm' style='color:white;width:100%;height:100%;'></i></div>" : "") + "<p style='font-size:6px;padding:0;color:black;text-align:center;'>" + (TrainNumberOverride ? TrainNumberOverride : TrainNumber) + "</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 + ";border-radius:"+(isLeft ? "4px 4px 0 0" : "0 0 4px 4px")+";'><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;'>" + (TrainNumberOverride ? TrainNumberOverride : TrainNumber) + "</p></div>");
@@ -1018,49 +968,65 @@ export const injectJavascriptData: InjectJavascriptData = (
const setNewTrainItem = (element,hasProblem,type)=>{
var 列番データ = element.getAttribute('offclick').split('"')[1];
const JRFTemp = getJRF(列番データ);
if(trainDataList.find(e => e.id === 列番データ) !== undefined){
const data = trainDataList.find(e => e.id === 列番データ);
switch (data.type) {
case "Normal":
element.style.borderColor = "black";
element.style.backgroundColor = '#ffffffcc';
break;
case "OneMan":
element.style.borderColor = "black";
element.style.backgroundColor = '#ffffffcc';
break;
case "Rapid":
element.style.borderColor = "rgba(0, 140, 255, 1)";
element.style.backgroundColor = '#ffffffcc';
break;
case "OneManRapid":
element.style.borderColor = "rgba(0, 140, 255, 1)";
element.style.backgroundColor = '#ffffffcc';
break;
case "LTDEXP":
element.style.borderColor = "red";
element.style.backgroundColor = '#ffffffcc';
break;
case "NightLTDEXP":
element.style.borderColor = "#d300b0ff";
element.style.backgroundColor = '#ffffffcc';
break;
case "SPCL":
case "SPCL_Normal":
element.style.borderColor = "#008d07ff";
element.style.backgroundColor = '#ffffffcc';
break;
case "SPCL_Rapid":
element.style.borderColor = "rgba(0, 81, 255, 1)";
element.style.borderColor = "#0051ffff";
element.style.backgroundColor = '#ffffffcc';
break;
case "SPCL_EXP":
element.style.borderColor = "#a52e2eff";
element.style.backgroundColor = '#ffffffcc';
break;
case "Party":
element.style.borderColor = "#ff7300ff";
element.style.backgroundColor = '#ffd0a9ff';
break;
case "Freight":
element.style.borderColor = "#00869ecc";
element.style.backgroundColor = '#c7c7c7cc';
break;
case "Forwarding":
element.style.borderColor = "#727272cc";
element.style.backgroundColor = '#c7c7c7cc';
break;
case "FreightForwarding":
element.style.borderColor = "#727272cc";
element.style.backgroundColor = '#c7c7c7cc';
break;
default:
element.style.borderColor = 'black';
element.style.backgroundColor = '#ffffffcc';
break;
}
}else{
@@ -1068,8 +1034,6 @@ const setNewTrainItem = (element,hasProblem,type)=>{
element.style.borderColor = '#ff0000ff';
}else if(element.getAttribute('offclick').includes("rapid")){
element.style.borderColor = '#008cffff';
}else if(JRFTemp){
element.style.borderColor = '#00869ecc';
}else{
element.style.borderColor = 'black';
}
@@ -1077,19 +1041,6 @@ const setNewTrainItem = (element,hasProblem,type)=>{
element.style.borderWidth = '2px';
element.style.borderStyle = 'solid';
element.style.borderRadius = '10%';
switch(true){
case 列番データ.indexOf("H") != -1:
case 列番データ.indexOf("R") != -1:
case 列番データ.indexOf("E") != -1:
case 列番データ.indexOf("A") != -1:
case 列番データ.indexOf("B") != -1:
case !!JRFTemp:
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 10px rgba(255, 0, 0, 0.9)';
}else{