Merge commit '0eef74a799ae8df7765d39f3d807ce2adaff6ce7' into patch/6.x

This commit is contained in:
harukin-expo-dev-env
2025-08-24 04:49:08 +00:00
19 changed files with 484 additions and 383 deletions

View File

@@ -1,157 +0,0 @@
import React from "react";
import { View, Text, TouchableWithoutFeedback } from "react-native";
import dayjs from "dayjs";
import lineColorList from "../../../assets/originData/lineColorList";
export const EachStopList = ({
i,
index,
stationList,
points,
currentTrainData,
openStationACFromEachTrainInfo,
showThrew,
}) => {
if (!showThrew && i.split(",")[1] == "通過") return null;
const [station, se, time] = i.split(","); // 阿波池田,発,6:21
const Stations = stationList
.map((a) => a.filter((d) => d.StationName == station))
.reduce((newArray, e) => newArray.concat(e), []);
/*Array [
Object {
"StationName": "佐古",
"StationNumber": "T01",
},
Object {
"StationName": "佐古",
"StationNumber": "B01",
},
] */
const StationNumbers =
Stations &&
Stations.filter((d) => d.StationNumber).map((d) => d.StationNumber);
// Array [ "T01", "B01",]
const lineIDs = [];
const EachIDs = [];
StationNumbers.forEach((d) => {
const textArray = d.split("");
lineIDs.push(textArray.filter((s) => "A" < s && s < "Z").join(""));
EachIDs.push(textArray.filter((s) => "0" <= s && s <= "9").join(""));
});
// Array [ "T", "B",]
// Array [ "01", "01",]
const dates = dayjs()
.set("hour", parseInt(time.split(":")[0]))
.set("minute", parseInt(time.split(":")[1]))
.add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute");
const timeString = se == "通過" ? "" : dates.format("HH:mm").split(":");
const onClickStateText = (string) => {
if (string != "通過") return;
alert("この駅は通過駅です");
};
return (
<TouchableWithoutFeedback
onPress={() =>
openStationACFromEachTrainInfo &&
openStationACFromEachTrainInfo(station)
}
key={station}
>
<View style={{ flexDirection: "row", backgroundColor: "white" }}>
<View
style={{
width: 35,
position: "relative",
marginHorizontal: 15,
flexDirection: "row",
height: "101%",
}}
>
{lineIDs.map((lineID, index) => (
<View
style={{
backgroundColor: `${lineColorList[lineID]}${
se == "通過" ? "80" : ""
}`,
flex: 1,
}}
key={lineID}
>
<View style={{ flex: 1 }} />
<Text
style={{
color: "white",
textAlign: "center",
fontSize: 10,
fontWeight: "bold",
}}
>
{lineIDs[index]}
{"\n"}
{EachIDs[index]}
</Text>
<View style={{ flex: 1 }} />
</View>
))}
</View>
<View
style={{
padding: 8,
flexDirection: "row",
borderBottomWidth: 1,
borderBottomColor: "#f0f0f0",
flex: 1,
}}
>
<Text
style={{ fontSize: 20, color: `#000${se == "通過" ? "5" : ""}` }}
>
{station}
</Text>
<View style={{ flex: 1 }} />
<View style={{ position: "relative", width: 0 }}>
{points ? (
<Text style={{ fontSize: 20, position: "absolute", left: -60 }}>
🚊
</Text>
) : null}
</View>
{!isNaN(currentTrainData?.delay) && currentTrainData?.delay != 0 && (
<Text
style={{
fontSize: 15,
color: "black",
width: 60,
position: "absolute",
right: 120,
textAlign: "right",
textDecorationLine: "line-through",
}}
>
{time}
</Text>
)}
<Text
style={{
fontSize: 20,
color: isNaN(currentTrainData?.delay)
? "black"
: currentTrainData?.delay == 0
? "black"
: "red",
width: 60,
}}
onPress={() => onClickStateText(se)}
>
{se == "通過" ? "レ" : `${timeString[0]}:${timeString[1]}`}
</Text>
<Text style={{ fontSize: 18, width: 50 }}>
{se?.replace("発", "出発").replace("着", "到着")}
</Text>
</View>
</View>
</TouchableWithoutFeedback>
);
};

View File

@@ -0,0 +1,220 @@
import React, { FC } from "react";
import { View, Text, TouchableWithoutFeedback } from "react-native";
import dayjs from "dayjs";
import lineColorList from "../../../assets/originData/lineColorList";
type seTypes = "発編" | "着編" | "通編" | "頃編" | "発" | "着" | string;
type currentTrainDataType = {
Index: number;
num: string;
delay: "入線" | number | undefined;
Pos: string;
PosNum: number;
Direction: number;
Type: string;
Line: string;
};
type props = {
i: string;
index: number;
stationList: { StationName: string; StationNumber: string }[][];
points: boolean;
currentTrainData?: currentTrainDataType;
openStationACFromEachTrainInfo?: (station: string) => void;
showThrew: boolean;
};
export const EachStopList: FC<props> = ({
i,
index,
stationList,
points,
currentTrainData,
openStationACFromEachTrainInfo,
showThrew,
}) => {
const [station, se, time] = i.split(",") as [string, seTypes, string]; // 阿波池田,発,6:21
if (!showThrew) {
if (se == "通過") return null;
if (se == "通編") return null;
}
const Stations = stationList
.map((a) => a.filter((d) => d.StationName == station))
.reduce((newArray, e) => newArray.concat(e), []);
/*Array [
Object {
"StationName": "佐古",
"StationNumber": "T01",
},
Object {
"StationName": "佐古",
"StationNumber": "B01",
},
] */
const StationNumbers =
Stations &&
Stations.filter((d) => d.StationNumber).map((d) => d.StationNumber);
const [seString, seType] = (() => {
switch (se) {
case "発":
return ["出発", "normal"];
case "着":
return ["到着", "normal"];
case "発編":
return ["出発", "community"];
case "着編":
return ["到着", "community"];
case "通編":
return ["通過", "community"];
case "頃編":
return ["頃", "community"];
default:
return [se, "normal"];
}
})();
// Array [ "T01", "B01",]
// Array [ "T", "B",]
// Array [ "01", "01",]
const textColor = `#${seType == "community" ? "44f" : "000"}${
se == "通過" || se == "通編" ? "5" : ""
}`;
return (
<TouchableWithoutFeedback
onPress={() =>
openStationACFromEachTrainInfo &&
openStationACFromEachTrainInfo(station)
}
key={station}
>
<View style={{ flexDirection: "row", backgroundColor: "#ffffffc2" }}>
<View
style={{
width: 35,
position: "relative",
marginHorizontal: 15,
flexDirection: "row",
height: "101%",
}}
>
{StationNumbers.map((stn, index) => (
<StationNumbersBox stn={stn} se={se} key={index} />
))}
</View>
<View
style={{
padding: 8,
flexDirection: "row",
borderBottomWidth: 1,
borderBottomColor: "#f0f0f0",
flex: 1,
}}
>
<Text
style={{
fontSize: 20,
color: textColor,
fontStyle: seType == "community" ? "italic" : "normal",
}}
>
{station}
</Text>
<View style={{ flex: 1 }} />
<View style={{ position: "relative", width: 0 }}>
{points && (
<Text style={{ fontSize: 20, position: "absolute", left: -60 }}>
🚊
</Text>
)}
</View>
{!!currentTrainData?.delay &&
currentTrainData?.delay != "入線" &&
currentTrainData?.delay != 0 && (
<Text
style={{
fontSize: 15,
color: textColor,
width: 60,
position: "absolute",
right: 120,
textAlign: "right",
textDecorationLine: "line-through",
fontStyle: seType == "community" ? "italic" : "normal",
}}
>
{time}
</Text>
)}
<StationTimeBox
delay={currentTrainData?.delay}
textColor={textColor}
seType={seType}
se={se}
time={time}
/>
<Text style={{ fontSize: 18, width: 50, color: textColor }}>
{seString}
</Text>
</View>
</View>
</TouchableWithoutFeedback>
);
};
const StationNumbersBox: FC<{ stn: string; se: seTypes }> = (props) => {
const { stn, se } = props;
const lineColor = lineColorList[stn.charAt(0)];
const hasThrew = se == "通過" || se == "通編" ? "80" : "";
const backgroundColor = `${lineColor}${hasThrew}`;
return (
<View style={{ backgroundColor, flex: 1 }} key={stn}>
<View style={{ flex: 1 }} />
<Text
style={{
color: "white",
textAlign: "center",
fontSize: 10,
fontWeight: "bold",
}}
>
{stn.charAt(0)}
{"\n"}
{stn.slice(1)}
</Text>
<View style={{ flex: 1 }} />
</View>
);
};
type StationTimeBoxType = {
delay: "入線" | number | undefined;
textColor: string;
seType: seTypes;
se: string;
time: string;
};
const StationTimeBox: FC<StationTimeBoxType> = (props) => {
const { delay, textColor, seType, se, time } = props;
const dates = dayjs()
.set("hour", parseInt(time.split(":")[0]))
.set("minute", parseInt(time.split(":")[1]))
.add(delay == "入線" || delay == undefined ? 0 : delay, "minute");
const timeString = se == "通過" ? "" : dates.format("HH:mm");
return (
<Text
style={{
fontSize: 20,
color:
delay != "入線" && delay != undefined
? delay != 0 && "red"
: textColor,
width: 60,
fontStyle: seType == "community" ? "italic" : "normal",
}}
>
{se == "通過" ? "レ" : timeString}
</Text>
);
};

View File

@@ -7,7 +7,7 @@ export const ScrollStickyContent = (props) => {
<View <View
style={{ style={{
alignItems: "center", alignItems: "center",
backgroundColor: "white", backgroundColor: "#ffffffc2",
flexDirection: "row", flexDirection: "row",
}} }}
> >
@@ -16,7 +16,7 @@ export const ScrollStickyContent = (props) => {
padding: 8, padding: 8,
flexDirection: "row", flexDirection: "row",
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: "#f0f0f0", borderBottomColor: "#ffffffc2",
flex: 1, flex: 1,
}} }}
> >

View File

@@ -14,24 +14,29 @@ export const ShowSpecialTrain = ({
}; };
return ( return (
<> <>
{isTrainDataNothing && trueTrainID && ( {isTrainDataNothing &&
<TouchableOpacity trueTrainID?.map((ids) => {
onPress={() => replaceSpecialTrainDetail(trueTrainID)} return (
style={{ <TouchableOpacity
padding: 10, onPress={() => replaceSpecialTrainDetail(ids)}
flexDirection: "row", style={{
borderColor: "blue", padding: 10,
borderWidth: 1, flexDirection: "row",
margin: 10, borderColor: "blue",
borderRadius: 5, borderWidth: 1,
alignItems: "center", margin: 10,
}} borderRadius: 5,
> alignItems: "center",
<Text style={{ fontSize: 18, fontWeight: "bold", color: "black" }}> }}
本来の列車情報を表示 >
</Text> <Text
</TouchableOpacity> style={{ fontSize: 18, fontWeight: "bold", color: "black" }}
)} >
本来の列車情報候補を表示:({ids})
</Text>
</TouchableOpacity>
);
})}
</> </>
); );
}; };

View File

@@ -78,11 +78,15 @@ export const TrainDataView = ({
const [trainNumber, setTrainNumber] = useState(currentTrainData?.num); const [trainNumber, setTrainNumber] = useState(currentTrainData?.num);
useEffect(() => { useEffect(() => {
const { const { TrainNumberOverride } = customTrainDataDetector(
TrainNumberOverride, currentTrainData?.num,
} = customTrainDataDetector(currentTrainData?.num, allCustomTrainData); allCustomTrainData
if (!TrainNumberOverride) return; );
setTrainNumber(TrainNumberOverride); if (TrainNumberOverride) {
setTrainNumber(TrainNumberOverride);
}else{
setTrainNumber(currentTrainData?.num);
}
}, [currentTrainData?.num, allCustomTrainData]); }, [currentTrainData?.num, allCustomTrainData]);
// 投稿システム関係 // 投稿システム関係
// Dialog表示関係 // Dialog表示関係

View File

@@ -197,15 +197,15 @@ export const EachTrainInfoCore = ({
const scrollHandlers = actionSheetRef const scrollHandlers = actionSheetRef
? useScrollHandlers("scrollview-1", actionSheetRef) ? useScrollHandlers("scrollview-1", actionSheetRef)
: null; : null;
const [trueTrainID, setTrueTrainID] = useState(); const [trueTrainID, setTrueTrainID] = useState([]);
useEffect(() => { useEffect(() => {
if (!data.trainNum) return; if (!data.trainNum) return;
const TD = trainList[data.trainNum]; const TD = trainList[data.trainNum];
setHeadStation([]); setHeadStation([]);
setTailStation([]); setTailStation([]);
if (!TD) { if (!TD) {
const specialTrainActualID = searchSpecialTrain(data.trainNum, trainList); const specialTrainActualIDs = searchSpecialTrain(data.trainNum, trainList);
setTrueTrainID(specialTrainActualID || undefined); setTrueTrainID(specialTrainActualIDs || []);
setTrainData([]); setTrainData([]);
return; return;
} }
@@ -392,6 +392,7 @@ export const EachTrainInfoCore = ({
containerProps={{ containerProps={{
style: { style: {
maxHeight: isLandscape ? height - 94 : (height / 100) * 70, maxHeight: isLandscape ? height - 94 : (height / 100) * 70,
backgroundColor:getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" ? "#777777ff" :"white"
}, },
}} }}
shortHeader={ shortHeader={
@@ -422,6 +423,7 @@ export const EachTrainInfoCore = ({
/> />
} }
> >
{getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" &&<Text style={{backgroundColor:"#ffffffc2",fontWeight:"bold"}}>この列車には乗車できません</Text>}
{headStation.length != 0 && {headStation.length != 0 &&
headStation.map((i, index) => headStation.map((i, index) =>
showHeadStation.findIndex((d) => d == index) == -1 ? ( showHeadStation.findIndex((d) => d == index) == -1 ? (
@@ -441,6 +443,7 @@ export const EachTrainInfoCore = ({
borderRadius: 5, borderRadius: 5,
alignItems: "center", alignItems: "center",
}} }}
key={i.station + "-head"}
> >
<Text <Text
style={{ fontSize: 18, fontWeight: "bold", color: "black" }} style={{ fontSize: 18, fontWeight: "bold", color: "black" }}
@@ -469,10 +472,10 @@ export const EachTrainInfoCore = ({
borderWidth: 1, borderWidth: 1,
margin: 10, margin: 10,
borderRadius: 5, borderRadius: 5,
alignItems: "center", alignItems: "center", backgroundColor:"#ffffffc2"
}} }}
> >
<Text style={{ fontSize: 18, fontWeight: "bold", color: "black" }}> <Text style={{ fontSize: 18, fontWeight: "bold", color: "black",}}>
Twitterで検索 Twitterで検索
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
@@ -490,10 +493,12 @@ export const EachTrainInfoCore = ({
currentTrainData, currentTrainData,
openStationACFromEachTrainInfo, openStationACFromEachTrainInfo,
showThrew, showThrew,
key: i + "-stop"
}} }}
/> />
) )
)} )}
<Text style={{backgroundColor:"#ffffffc2"}}>時刻が斜体,青色になっている時刻はコミュニティで追加されている独自データです</Text>
{tailStation.length != 0 && {tailStation.length != 0 &&
tailStation.map(({ station, dia }, index) => tailStation.map(({ station, dia }, index) =>
showTailStation.findIndex((d) => d == index) == -1 ? ( showTailStation.findIndex((d) => d == index) == -1 ? (
@@ -534,6 +539,7 @@ export const EachTrainInfoCore = ({
flexDirection: "row", flexDirection: "row",
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: "#f0f0f0", borderBottomColor: "#f0f0f0",
backgroundColor:"#ffffffc2",
flex: 1, flex: 1,
}} }}
> >

View File

@@ -11,7 +11,7 @@ import { useTrainMenu } from "@/stateBox/useTrainMenu";
import { useAllTrainDiagram } from "@/stateBox/useAllTrainDiagram"; import { useAllTrainDiagram } from "@/stateBox/useAllTrainDiagram";
import { useNotification } from "@/stateBox/useNotifications"; import { useNotification } from "@/stateBox/useNotifications";
import { getStringConfig } from "@/lib/getStringConfig"; import { getStringConfig } from "@/lib/getStringConfig";
import { FontAwesome } from "@expo/vector-icons"; import { FontAwesome, MaterialCommunityIcons } from "@expo/vector-icons";
import { getPDFViewURL } from "@/lib/getPdfViewURL"; import { getPDFViewURL } from "@/lib/getPdfViewURL";
type Props = { type Props = {
@@ -133,12 +133,18 @@ export const HeaderText: FC<Props> = ({
> >
<TrainIconStatus {...{ data, navigate, from }} /> <TrainIconStatus {...{ data, navigate, from }} />
<TouchableOpacity <TouchableOpacity
style={{ borderRadius: 5, flexDirection: "row", alignItems: "center" }} style={{
onLongPress={() => { borderRadius: 5,
if (!updatePermission) return; flexDirection: "row",
const uri = `https://jr-shikoku-data-post-system.pages.dev?trainNum=${trainNum}&token=${expoPushToken}`; alignItems: "center",
navigate("generalWebView", { uri, useExitButton: false }); ...(trainInfoUrl
SheetManager.hide("EachTrainInfo"); ? {
borderWidth: 0,
borderBottomWidth: 1,
borderStyle: "solid",
borderColor: "white",
}
: {}),
}} }}
onPress={() => { onPress={() => {
if (!trainInfoUrl) return; if (!trainInfoUrl) return;
@@ -148,7 +154,7 @@ export const HeaderText: FC<Props> = ({
navigate("generalWebView", { uri, useExitButton: true }); navigate("generalWebView", { uri, useExitButton: true });
SheetManager.hide("EachTrainInfo"); SheetManager.hide("EachTrainInfo");
}} }}
disabled={!(!!updatePermission || !!trainInfoUrl)} disabled={!trainInfoUrl}
> >
<Text <Text
style={{ style={{
@@ -162,8 +168,15 @@ export const HeaderText: FC<Props> = ({
{typeName} {typeName}
</Text> </Text>
{isOneMan && <OneManText />} {isOneMan && <OneManText />}
<Text style={textConfig}>{trainName}</Text> <Text style={{...textConfig,...trainName.length >10 ?{fontSize:14}:{} }}>{trainName}</Text>
<InfogramText infogram={infogram} /> <InfogramText infogram={infogram} />
{/* {trainInfoUrl && (
<MaterialCommunityIcons
name={"open-in-new"}
color="white"
size={15}
/>
)} */}
</TouchableOpacity> </TouchableOpacity>
{isEdit && ( {isEdit && (
<FontAwesome <FontAwesome
@@ -182,11 +195,21 @@ export const HeaderText: FC<Props> = ({
)} )}
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
<Text style={textConfig}> <TouchableOpacity
{showHeadStation.map((d) => `${headStation[d].id} + `)} onLongPress={() => {
{trainNum} if (!updatePermission) return;
{showTailStation.map((d) => ` + ${tailStation[d].id}`)} const uri = `https://jr-shikoku-data-post-system.pages.dev?trainNum=${trainNum}&token=${expoPushToken}`;
</Text> navigate("generalWebView", { uri, useExitButton: false });
SheetManager.hide("EachTrainInfo");
}}
disabled={!updatePermission}
>
<Text style={textConfig}>
{showHeadStation.map((d) => `${headStation[d].id} + `)}
{trainNum}
{showTailStation.map((d) => ` + ${tailStation[d].id}`)}
</Text>
</TouchableOpacity>
<TrainViewIcon {...{ data, navigate, from }} /> <TrainViewIcon {...{ data, navigate, from }} />
</View> </View>

View File

@@ -111,13 +111,13 @@ export const TrainIconStatus: FC<Props> = ({ data, navigate, from }) => {
{move ? ( {move ? (
<Image <Image
source={{ uri: trainIcon }} source={{ uri: trainIcon }}
style={{ height: 34, width: 30, marginRight: 5 }} style={{ height: 30, width: 24, marginRight: 5 }}
resizeMethod="scale" resizeMethod="resize"
/> />
) : ( ) : (
<Ionicons <Ionicons
{...anpanmanStatus} {...anpanmanStatus}
size={30} size={24}
style={{ marginRight: 5 }} style={{ marginRight: 5 }}
/> />
)} )}

View File

@@ -1,10 +1,14 @@
import React, { useRef } from "react"; import React, { FC, useRef } from "react";
import { View, Platform } from "react-native"; import { View, Platform } from "react-native";
import ActionSheet from "react-native-actions-sheet"; import ActionSheet from "react-native-actions-sheet";
import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useSafeAreaInsets } from "react-native-safe-area-context";
import { SpecialTrainInfoBox } from "../Menu/SpecialTrainInfoBox"; import { SpecialTrainInfoBox } from "../Menu/SpecialTrainInfoBox";
export const SpecialTrainInfo = ({ payload }) => {
type props = {
payload: { navigate: (screen: string, params?: object) => void };
};
export const SpecialTrainInfo: FC<props> = ({ payload }) => {
const { navigate } = payload; const { navigate } = payload;
const actionSheetRef = useRef(null); const actionSheetRef = useRef(null);
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();

View File

@@ -159,7 +159,7 @@ export const DynamicHeaderScrollView = (props) => {
ref={scrollHandlers.ref} ref={scrollHandlers.ref}
onLayout={scrollHandlers.onLayout} onLayout={scrollHandlers.onLayout}
scrollEventThrottle={scrollHandlers.scrollEventThrottle} scrollEventThrottle={scrollHandlers.scrollEventThrottle}
style={{ backgroundColor: "white", zIndex: 0 }} style={{ zIndex: 0 }}
stickyHeaderIndices={[1]} stickyHeaderIndices={[1]}
onScroll={onScroll} onScroll={onScroll}
> >

View File

@@ -1,4 +1,4 @@
import { FC, useEffect, useLayoutEffect, useState } from "react"; import { FC, useLayoutEffect, useState } from "react";
import { View, Text, TouchableOpacity } from "react-native"; import { View, Text, TouchableOpacity } from "react-native";
import { getPDFViewURL } from "@/lib/getPdfViewURL"; import { getPDFViewURL } from "@/lib/getPdfViewURL";
import { ScrollView, SheetManager } from "react-native-actions-sheet"; import { ScrollView, SheetManager } from "react-native-actions-sheet";
@@ -6,20 +6,27 @@ import { ScrollView, SheetManager } from "react-native-actions-sheet";
type props = { type props = {
navigate: (screen: string, params?: object) => void; navigate: (screen: string, params?: object) => void;
}; };
type specialDataType = { address: string; text: string; description: string };
export const SpecialTrainInfoBox: FC<props> = ({ navigate }) => { export const SpecialTrainInfoBox: FC<props> = ({ navigate }) => {
const [specialData, setSpecialData] = useState([]); const [specialData, setSpecialData] = useState<specialDataType[]>([]);
useLayoutEffect(() => { useLayoutEffect(() => {
fetch("https://n8n.haruk.in/webhook/sptrainfo") fetch("https://n8n.haruk.in/webhook/sptrainfo")
.then((res) => res.json()) .then((res) => res.json())
.then((data) => setSpecialData(data.data)) .then((data) => setSpecialData(data.data))
.catch((err) => console.log(err)); .catch((err) => console.log(err));
}, []); }, []);
const onPressItem: (d: specialDataType) => void = (d) => {
navigate("howto", {
info: getPDFViewURL("https://www.jr-shikoku.co.jp" + d.address),
goTo: "menu",
});
SheetManager.hide("SpecialTrainInfo");
};
return ( return (
<View <View style={{ backgroundColor: "#0099CC" }}>
style={{
backgroundColor: "#0099CC",
}}
>
<View style={{ flexDirection: "row", alignItems: "center" }}> <View style={{ flexDirection: "row", alignItems: "center" }}>
<Text <Text
style={{ style={{
@@ -33,20 +40,10 @@ export const SpecialTrainInfoBox: FC<props> = ({ navigate }) => {
</Text> </Text>
</View> </View>
<ScrollView <ScrollView style={{ backgroundColor: "white" }}>
style={{
backgroundColor: "white",
}}
>
{specialData.map((d) => ( {specialData.map((d) => (
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => onPressItem(d)}
navigate("howto", {
info: getPDFViewURL("https://www.jr-shikoku.co.jp" + d.address),
goTo: "menu",
});
SheetManager.hide("SpecialTrainInfo");
}}
onLongPress={() => alert(d.description)} onLongPress={() => alert(d.description)}
key={d.address} key={d.address}
style={{ style={{

View File

@@ -17,7 +17,7 @@ import { SwitchArea } from "../atom/SwitchArea";
import { useNotification } from "../../stateBox/useNotifications"; import { useNotification } from "../../stateBox/useNotifications";
import { SheetHeaderItem } from "@/components/atom/SheetHeaderItem"; import { SheetHeaderItem } from "@/components/atom/SheetHeaderItem";
const versionCode = "6.1.5"; // Update this version code as needed const versionCode = "6.1.6"; // Update this version code as needed
export const SettingTopPage = ({ export const SettingTopPage = ({
testNFC, testNFC,

View File

@@ -24,6 +24,7 @@ type Props = {
train: string; train: string;
lastStation: string; lastStation: string;
time: string; time: string;
isThrough?: boolean;
}; };
trainIDSwitch: boolean; trainIDSwitch: boolean;
trainDescriptionSwitch: boolean; trainDescriptionSwitch: boolean;
@@ -100,7 +101,19 @@ export const EachData: FC<Props> = (props) => {
return customTrainData; return customTrainData;
} }
}; };
const [train, setTrain] = useState(getTrainDataFromCurrentTrain(d.train)); const [train, setTrain] = useState<{
ToData: string;
TrainNumber: string;
id: string;
img: string;
isWanman: boolean;
trainName: string;
trainNumDistance: number;
type:string;
viaData:string;
info?:string;
uwasa?:string;
}>(getTrainDataFromCurrentTrain(d.train));
useEffect(() => { useEffect(() => {
setTrain(getTrainDataFromCurrentTrain(d.train)); setTrain(getTrainDataFromCurrentTrain(d.train));
}, [currentTrain, d.train, trainDescriptionSwitch]); }, [currentTrain, d.train, trainDescriptionSwitch]);
@@ -114,7 +127,6 @@ export const EachData: FC<Props> = (props) => {
station.Station_JP station.Station_JP
)}`; )}`;
// 投稿システム関係 // 投稿システム関係
// Dialog表示関係 // Dialog表示関係
const [dialog, setDialog] = useState(false); const [dialog, setDialog] = useState(false);
@@ -130,7 +142,6 @@ export const EachData: FC<Props> = (props) => {
const [posInput, setPosInput] = useState<string>(""); const [posInput, setPosInput] = useState<string>("");
const [descInput, setDescInput] = useState<string>(""); const [descInput, setDescInput] = useState<string>("");
const [isShow, setIsShow] = useState(true); const [isShow, setIsShow] = useState(true);
const [isDepartureNow, setIsDepartureNow] = useState(false); const [isDepartureNow, setIsDepartureNow] = useState(false);
useEffect(() => { useEffect(() => {
@@ -199,18 +210,20 @@ export const EachData: FC<Props> = (props) => {
trainID={d.train} trainID={d.train}
type={train.type} type={train.type}
/> />
<LastStation lastStation={d.lastStation} /> <LastStation lastStation={d.lastStation} ToData={train.ToData} />
<DependTime time={d.time} /> <DependTime time={d.time} />
<StatusAndDelay trainDelayStatus={trainDelayStatus} /> <StatusAndDelay trainDelayStatus={trainDelayStatus} />
</TouchableOpacity> </TouchableOpacity>
{!!isDepartureNow && ( {!!isDepartureNow && (
<Description <Description
info={ info={
d.lastStation == "当駅止" d.isThrough
? "通過列車にご注意ください"
: d.lastStation == "当駅止"
? "この列車は当駅止です。間もなく到着します。" ? "この列車は当駅止です。間もなく到着します。"
: "列車の出発時刻です。" : "列車の出発時刻です。"
} }
key={d.train + "-description"} key={d.train + "-isDepartureNow"}
/> />
)} )}
{trainDescriptionSwitch && ( {trainDescriptionSwitch && (
@@ -226,7 +239,6 @@ export const EachData: FC<Props> = (props) => {
setPosNum={setPosNum} setPosNum={setPosNum}
setLine={setLine} setLine={setLine}
setStationNum={setStationNum} setStationNum={setStationNum}
//編集機能関係 //編集機能関係
setLineInput={setLineInput} setLineInput={setLineInput}
setPosInput={setPosInput} setPosInput={setPosInput}
@@ -237,6 +249,9 @@ export const EachData: FC<Props> = (props) => {
{trainDescriptionSwitch && !!train.info && ( {trainDescriptionSwitch && !!train.info && (
<Description info={train.info} key={d.train + "-description"} /> <Description info={train.info} key={d.train + "-description"} />
)} )}
{trainDescriptionSwitch && !!train.uwasa && (
<Description info={train.uwasa} key={d.train + "-uwasa"} />
)}
</> </>
); );
}; };

View File

@@ -3,18 +3,20 @@ import { Text, View } from "react-native";
type Props = { type Props = {
lastStation: string; lastStation: string;
ToData: string;
}; };
export const LastStation: FC<Props> = ({ lastStation }) => { export const LastStation: FC<Props> = ({ lastStation, ToData }) => {
const isEdit = ToData === "" ? false : ToData !== lastStation;
return ( return (
<View style={{ flex: 4, flexDirection: "row" }}> <View style={{ flex: 4, flexDirection: "row" }}>
<Text <Text
style={{ style={{
fontSize: lastStation.length > 4 ? parseInt("12%") : parseInt("16%"), fontSize: lastStation.length > 4 ? parseInt("12%") : parseInt("16%"),
color: "white", color: isEdit? "#ffd16fff":"white",
fontWeight: "bold", fontWeight: "bold",
}} }}
> >
{lastStation} {isEdit ? ToData : lastStation}
</Text> </Text>
</View> </View>
); );

View File

@@ -110,15 +110,29 @@ export default function LED_vision(props) {
.map((trainNum) => { .map((trainNum) => {
let trainData = {}; let trainData = {};
stationDiagram[trainNum].split("#").forEach((data) => { stationDiagram[trainNum].split("#").forEach((data) => {
if(trainNum == 74){
console.log(data);
}
if (data.match("着")) { if (data.match("着")) {
trainData.lastStation = data.split(",着,")[0]; trainData.lastStation = data.split(",着,")[0];
} }
if (data.match("着編")) {
trainData.lastStation = data.split(",着編,")[0];
}
if (data.split(",")[0] === station.Station_JP) { if (data.split(",")[0] === station.Station_JP) {
if (data.match(",発,")) { if (data.match(",発,")) {
trainData.time = data.split(",発,")[1]; trainData.time = data.split(",発,")[1];
} else if (data.match(",,")) { }else if (data.match(",発編,")) {
trainData.time = data.split(",発編,")[1];
} else if (data.match(",通編,")) {
trainData.time = data.split(",通編,")[1];
trainData.isThrough = true;
} else if (data.match(",着,")) {
trainData.time = data.split(",着,")[1]; trainData.time = data.split(",着,")[1];
trainData.lastStation = "当駅止"; trainData.lastStation = "当駅止";
}else if (data.match(",着編,")) {
trainData.time = data.split(",着編,")[1];
trainData.lastStation = "当駅止";
} }
} }
}); });
@@ -126,6 +140,7 @@ export default function LED_vision(props) {
train: trainNum, train: trainNum,
time: trainData.time, time: trainData.time,
lastStation: trainData.lastStation, lastStation: trainData.lastStation,
isThrough: trainData.isThrough,
}; };
}) })
.filter((d) => d.time); .filter((d) => d.time);
@@ -148,7 +163,6 @@ export default function LED_vision(props) {
const timeFiltering = (d) => { const timeFiltering = (d) => {
const baseTime = 2; const baseTime = 2;
if (currentTrain.filter((t) => t.num == d.train).length == 0) { if (currentTrain.filter((t) => t.num == d.train).length == 0) {
const date = dayjs(); const date = dayjs();
const trainTime = date const trainTime = date

View File

@@ -8,8 +8,9 @@ export const searchSpecialTrain = (trainNum: string, trainList: any[]) => {
} }
return false; return false;
}; };
if (search("D")) return searchBase + "D"; const returnBase = [];
if (search("M")) return searchBase + "M"; if (search("D")) returnBase.push(searchBase + "D");
if (search("M")) returnBase.push(searchBase + "M");
//増結いしづちの場合 //増結いしづちの場合
const baseStr = trainNum const baseStr = trainNum
@@ -21,6 +22,7 @@ export const searchSpecialTrain = (trainNum: string, trainList: any[]) => {
if (9000 < baseNum && baseNum < 9047) { if (9000 < baseNum && baseNum < 9047) {
//いしづちの1001M-1046Mが9000番台になっている場合に発動 //いしづちの1001M-1046Mが9000番台になっている場合に発動
const TD = trainList[`${baseNum - 8000}M`]; const TD = trainList[`${baseNum - 8000}M`];
if (TD) return `${baseNum - 8000}M`; if (TD) returnBase.push(`${baseNum - 8000}M`);
} }
return returnBase;
}; };

View File

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

View File

@@ -5,7 +5,7 @@ type nameString =
| "SPCL" | "SPCL"
| "Normal" | "Normal"
| string; | string;
type colorString = "aqua" | "red" | "#297bff" | "white" | "pink"; type colorString = "aqua" | "red" | "#297bff" | "#ff7300ff" | "#00869ecc" | "#727272cc" | "white" | "pink";
type trainTypeString = type trainTypeString =
| "快速" | "快速"
| "特急" | "特急"
@@ -15,8 +15,12 @@ type trainTypeString =
| "普通列車(ワンマン)" | "普通列車(ワンマン)"
| "臨時快速" | "臨時快速"
| "臨時特急" | "臨時特急"
| "団体臨時"
| "貨物"
| "回送"
| "単機回送"
| "その他"; | "その他";
type trainTypeDataString = "rapid" | "express" | "normal"; type trainTypeDataString = "rapid" | "express" | "normal" | "notService";
type getTrainType = (d: nameString) => { type getTrainType = (d: nameString) => {
color: colorString; color: colorString;
name: trainTypeString; name: trainTypeString;
@@ -42,6 +46,14 @@ export const getTrainType: getTrainType = (nameString) => {
return { color: "#297bff", name: "臨時快速", data: "normal" }; return { color: "#297bff", name: "臨時快速", data: "normal" };
case "SPCL_EXP": case "SPCL_EXP":
return { color: "#297bff", name: "臨時特急", data: "normal" }; return { color: "#297bff", name: "臨時特急", data: "normal" };
case "Party":
return { color: "#ff7300ff", name: "団体臨時", data: "normal" };
case "Freight":
return { color: "#00869ecc", name: "貨物", data: "notService" };
case "Forwarding":
return { color: "#727272cc", name: "回送", data: "notService" };
case "FreightForwarding":
return { color: "#727272cc", name: "単機回送", data: "notService" };
default: default:
return { color: "white", name: "その他", data: "normal" }; return { color: "white", name: "その他", data: "normal" };
} }

View File

@@ -634,39 +634,6 @@ export const injectJavascriptData: InjectJavascriptData = (
`; `;
const normal_train_name = ` 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) =>{ const nameReplace = (列車名データ,列番データ,行き先情報,hasProblem,isLeft) =>{
let isWanman = false; let isWanman = false;
let trainName = ""; let trainName = "";
@@ -724,15 +691,6 @@ export const injectJavascriptData: InjectJavascriptData = (
trainName = "臨時列車"; trainName = "臨時列車";
} }
let JRF = true;
const JRFTemp = getJRF(列番データ);
if(JRFTemp){
trainName = JRFTemp;
JRF = false;
}
const getThrew = num =>{ const getThrew = num =>{
switch(num){ switch(num){
@@ -833,30 +791,6 @@ export const injectJavascriptData: InjectJavascriptData = (
viaData = "ごめん・なはり線[快速]"; viaData = "ごめん・なはり線[快速]";
ToData = "(後免にて解結)\\n土佐山田/奈半利"; ToData = "(後免にて解結)\\n土佐山田/奈半利";
break; 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: default:
if(new RegExp(/^58[1-3][1,3,5,7,9][DM]$/).test(列番データ)){ if(new RegExp(/^58[1-3][1,3,5,7,9][DM]$/).test(列番データ)){
viaData = "ごめん・なはり線[快速]"; viaData = "ごめん・なはり線[快速]";
@@ -882,61 +816,77 @@ export const injectJavascriptData: InjectJavascriptData = (
if(trainDataList.find(e => e.id === 列番データ) !== undefined){ if(trainDataList.find(e => e.id === 列番データ) !== undefined){
const data = trainDataList.find(e => e.id === 列番データ); const data = trainDataList.find(e => e.id === 列番データ);
//{id,trainName,viaData,ToData,TrainNumber,TrainNumberOverride,type,infoUrl,trainNumDistance,info,infogram,isEdit} //{id,trainName,viaData,ToData,TrainNumber,TrainNumberOverride,type,infoUrl,trainNumDistance,info,infogram,isEdit}
trainType = (()=>{
switch(data.type){ switch(data.type){
case "Normal": case "Normal":
trainTypeColor = "black"; trainTypeColor = "black";
isWanman = false; isWanman = false;
return "普通"; trainType = "普通";
case "OneMan": break;
trainTypeColor = "black"; case "OneMan":
isWanman = true; trainTypeColor = "black";
return "普通"; isWanman = true;
case "Rapid": trainType = "普通";
trainTypeColor = "rgba(0, 140, 255, 1)"; break;
isWanman = false; case "Rapid":
return "快速"; trainTypeColor = "rgba(0, 140, 255, 1)";
case "OneManRapid": isWanman = false;
trainTypeColor = "rgba(0, 140, 255, 1)"; trainType = "快速";
isWanman = true; break;
return "快速"; case "OneManRapid":
case "LTDEXP": trainTypeColor = "rgba(0, 140, 255, 1)";
trainTypeColor = "red"; isWanman = true;
isWanman = false; trainType = "快速";
return "特急"; break;
case "NightLTDEXP": case "LTDEXP":
trainTypeColor = "#d300b0ff"; trainTypeColor = "red";
isWanman = false; isWanman = false;
return "寝台特急"; trainType = "特急";
case "SPCL": break;
case "SPCL_Normal": case "NightLTDEXP":
trainTypeColor = "#008d07ff"; trainTypeColor = "#d300b0ff";
isWanman = false; isWanman = false;
return "臨時"; trainType = "寝台特急";
case "SPCL_Rapid": break;
trainTypeColor = "rgba(0, 81, 255, 1)"; case "SPCL":
isWanman = false; case "SPCL_Normal":
return "臨時快速"; trainTypeColor = "#008d07ff";
case "SPCL_EXP": isWanman = false;
trainTypeColor = "#a52e2eff"; trainType = "臨時";
isWanman = false; break;
return "臨時特急"; case "SPCL_Rapid":
case "Freight": trainTypeColor = "rgba(0, 81, 255, 1)";
trainTypeColor = "#00869ecc"; isWanman = false;
isWanman = false; trainType = "臨時快速";
return "貨物"; break;
case "Forwarding": case "SPCL_EXP":
trainTypeColor = "#727272cc"; trainTypeColor = "#a52e2eff";
isWanman = false; isWanman = false;
return "回送"; trainType = "臨時特急";
case "FreightForwarding": break;
trainTypeColor = "#727272cc"; case "Party":
isWanman = false; trainTypeColor = "#ff7300ff";
return "単機回送"; isWanman = false;
default: trainType = "団体臨時";
return ""; 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; isEdit = data.isEdit;
isSeason = data.isSeason; isSeason = data.isSeason;
if(data.trainName != ""){ 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]; 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', "<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>"); 行き先情報.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)=>{ const setNewTrainItem = (element,hasProblem,type)=>{
var 列番データ = element.getAttribute('offclick').split('"')[1]; var 列番データ = element.getAttribute('offclick').split('"')[1];
const JRFTemp = getJRF(列番データ);
if(trainDataList.find(e => e.id === 列番データ) !== undefined){ if(trainDataList.find(e => e.id === 列番データ) !== undefined){
const data = trainDataList.find(e => e.id === 列番データ); const data = trainDataList.find(e => e.id === 列番データ);
switch (data.type) { switch (data.type) {
case "Normal": case "Normal":
element.style.borderColor = "black"; element.style.borderColor = "black";
element.style.backgroundColor = '#ffffffcc';
break; break;
case "OneMan": case "OneMan":
element.style.borderColor = "black"; element.style.borderColor = "black";
element.style.backgroundColor = '#ffffffcc';
break; break;
case "Rapid": case "Rapid":
element.style.borderColor = "rgba(0, 140, 255, 1)"; element.style.borderColor = "rgba(0, 140, 255, 1)";
element.style.backgroundColor = '#ffffffcc';
break; break;
case "OneManRapid": case "OneManRapid":
element.style.borderColor = "rgba(0, 140, 255, 1)"; element.style.borderColor = "rgba(0, 140, 255, 1)";
element.style.backgroundColor = '#ffffffcc';
break; break;
case "LTDEXP": case "LTDEXP":
element.style.borderColor = "red"; element.style.borderColor = "red";
element.style.backgroundColor = '#ffffffcc';
break; break;
case "NightLTDEXP": case "NightLTDEXP":
element.style.borderColor = "#d300b0ff"; element.style.borderColor = "#d300b0ff";
element.style.backgroundColor = '#ffffffcc';
break; break;
case "SPCL": case "SPCL":
case "SPCL_Normal": case "SPCL_Normal":
element.style.borderColor = "#008d07ff"; element.style.borderColor = "#008d07ff";
element.style.backgroundColor = '#ffffffcc';
break; break;
case "SPCL_Rapid": case "SPCL_Rapid":
element.style.borderColor = "rgba(0, 81, 255, 1)"; element.style.borderColor = "#0051ffff";
element.style.backgroundColor = '#ffffffcc';
break; break;
case "SPCL_EXP": case "SPCL_EXP":
element.style.borderColor = "#a52e2eff"; element.style.borderColor = "#a52e2eff";
element.style.backgroundColor = '#ffffffcc';
break;
case "Party":
element.style.borderColor = "#ff7300ff";
element.style.backgroundColor = '#ffd0a9ff';
break; break;
case "Freight": case "Freight":
element.style.borderColor = "#00869ecc"; element.style.borderColor = "#00869ecc";
element.style.backgroundColor = '#c7c7c7cc';
break; break;
case "Forwarding": case "Forwarding":
element.style.borderColor = "#727272cc"; element.style.borderColor = "#727272cc";
element.style.backgroundColor = '#c7c7c7cc';
break; break;
case "FreightForwarding": case "FreightForwarding":
element.style.borderColor = "#727272cc"; element.style.borderColor = "#727272cc";
element.style.backgroundColor = '#c7c7c7cc';
break; break;
default: default:
element.style.borderColor = 'black'; element.style.borderColor = 'black';
element.style.backgroundColor = '#ffffffcc';
break; break;
} }
}else{ }else{
@@ -1068,8 +1034,6 @@ const setNewTrainItem = (element,hasProblem,type)=>{
element.style.borderColor = '#ff0000ff'; element.style.borderColor = '#ff0000ff';
}else if(element.getAttribute('offclick').includes("rapid")){ }else if(element.getAttribute('offclick').includes("rapid")){
element.style.borderColor = '#008cffff'; element.style.borderColor = '#008cffff';
}else if(JRFTemp){
element.style.borderColor = '#00869ecc';
}else{ }else{
element.style.borderColor = 'black'; element.style.borderColor = 'black';
} }
@@ -1077,19 +1041,6 @@ const setNewTrainItem = (element,hasProblem,type)=>{
element.style.borderWidth = '2px'; element.style.borderWidth = '2px';
element.style.borderStyle = 'solid'; element.style.borderStyle = 'solid';
element.style.borderRadius = '10%'; 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){ if(hasProblem){
element.style.boxShadow = '0 0 10px rgba(255, 0, 0, 0.9)'; element.style.boxShadow = '0 0 10px rgba(255, 0, 0, 0.9)';
}else{ }else{