色統一

This commit is contained in:
harukin-expo-dev-env 2024-08-31 10:15:10 +00:00
parent 94a52936e5
commit 3745c10929
2 changed files with 5 additions and 221 deletions

View File

@ -15,7 +15,6 @@ import Sign from "../../components/駅名表/Sign";
import { TicketBox } from "../atom/TicketBox";
import { widthPercentageToDP as wp } from "react-native-responsive-screen";
import lineColorList from "../../assets/originData/lineColorList";
import { getPDFViewURL } from "../../lib/getPdfViewURL";
import { useBusAndTrainData } from "../../stateBox/useBusAndTrainData";
import { AS } from "../../storageControl";
@ -231,140 +230,6 @@ export const StationDeteilView = (props) => {
);
};
const StationName = (props) => {
const { stringData, ss } = props;
return (
<View style={ss}>
<Text style={styleSheet.下枠駅名}>{stringData.Station_JP}</Text>
<Text style={styleSheet.下枠駅名}>{stringData.Station_EN}</Text>
</View>
);
};
const NexPreStationLine = ({ currentStation, originalStationList }) => {
const [preStation, setPreStation] = useState();
const [nexStation, setNexStation] = useState();
const [lineName, setLineName] = useState();
useEffect(() => {
getPreNextStation(currentStation);
}, [currentStation]);
useEffect(() => {
if (!currentStation) return () => {};
getPreNextStation(currentStation);
}, []);
const getPreNextStation = (now) => {
const lineList = [
"予讃線(高松-松山間)[Y]",
"予讃線(松山-宇和島間)[U]",
"予讃線/愛ある伊予灘線(向井原-伊予大洲間)[S]",
"土讃線(多度津-高知間)[D]",
"土讃線(高知-窪川間)[K]",
"高徳線(高松-徳島間)[T]",
"徳島線(徳島-阿波池田間)[B]",
"鳴門線(池谷-鳴門間)[N]",
"瀬戸大橋線(児島-宇多津間)[M]",
];
let returnData;
lineList.forEach((d) => {
let cache = originalStationList[d].findIndex(
(data) => data.StationNumber == now.StationNumber
);
if (cache != -1) {
returnData = [
originalStationList[d][cache - 1],
originalStationList[d][cache + 1],
d,
];
}
});
setPreStation(returnData[0]);
setNexStation(returnData[1]);
setLineName(returnData[2]);
};
return (
<View
style={{
height: 50,
backgroundColor: lineName
? lineColorList[lineName.split("[")[1].replace("]", "")]
: "red",
flexDirection: "row",
alignContent: "center",
alignItems: "center",
}}
>
<View style={styleSheet.下枠フレーム}>
{preStation ? (
<>
<Text style={styleSheet.下枠左右マーク}></Text>
{preStation.StationNumber ? (
<View style={styleSheet.下枠駅ナンバー}>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: parseInt("10%"),
color: "white",
}}
>
{preStation.StationNumber}
</Text>
<View style={{ flex: 1 }} />
</View>
) : (
<></>
)}
<StationName
stringData={preStation}
ss={{ flex: 1, alignItems: "flex-start" }}
/>
</>
) : (
<></>
)}
</View>
<Text
style={{
fontSize: parseInt("10%"),
color: "white",
textAlign: "center",
}}
>
{lineName &&
lineName
.split("(")
.map((d, index) => (index == 1 ? "(" + d : d))
.join("\n")}
</Text>
<View style={styleSheet.下枠フレーム}>
{nexStation ? (
<>
<StationName
stringData={nexStation}
ss={{ flex: 1, alignItems: "flex-end" }}
/>
{nexStation.StationNumber ? (
<View style={styleSheet.下枠駅ナンバー}>
<View style={{ flex: 1 }} />
<Text style={{ fontSize: parseInt("15%"), color: "white" }}>
{nexStation.StationNumber}
</Text>
<View style={{ flex: 1 }} />
</View>
) : (
<></>
)}
<Text style={styleSheet.下枠左右マーク}></Text>
</>
) : (
<></>
)}
</View>
</View>
);
};
const 駅構内図 = (props) => {
const [open, setOpen] = useState(false);
@ -439,85 +304,4 @@ const Handler = () => {
return () => backHandler.remove();
}, []);
return <></>;
};
const styleSheet = {
外枠: {
width: wp("80%"),
height: (wp("80%") / 20) * 9,
borderColor: "#2E94BB",
borderWidth: 1,
backgroundColor: "white",
},
下帯: {
position: "absolute",
bottom: "0%",
left: "0%",
width: "100%",
height: "30%",
backgroundColor: "#2E94BB",
},
JRStyle: {
position: "absolute",
top: "2%",
left: "2%",
fontWeight: "bold",
fontSize: parseInt("30%"),
color: "#2E94BB",
},
stationNameAreaOverWrap: {
position: "absolute",
top: "10%",
alignContent: "center",
flexDirection: "row",
},
Station_JP: {
fontWeight: "bold",
fontSize: parseInt("40%"),
color: "#005170",
},
Station_EN: {
fontWeight: "bold",
fontSize: parseInt("15%"),
color: "#005170",
},
下帯内容: {
position: "absolute",
bottom: "0%",
height: "30%",
width: "100%",
alignItems: "center",
flexDirection: "column",
},
下枠フレーム: {
flex: 1,
flexDirection: "row",
alignContent: "center",
height: wp("10%"),
},
下枠左右マーク: {
fontWeight: "bold",
fontSize: parseInt("20%"),
color: "white",
paddingHorizontal: 10,
textAlignVertical: "center",
},
下枠駅ナンバー: {
alignContent: "center",
alignItems: "center",
width: wp("8%"),
height: wp("8%"),
margin: wp("1%"),
borderColor: "white",
borderWidth: parseInt("2%"),
borderRadius: parseInt("100%"),
},
下枠駅名: {
fontWeight: "bold",
fontSize: parseInt("15%"),
color: "white",
flex: 1,
paddingHorizontal: 0,
marginVertical: 0,
textAlignVertical: "center",
},
};
};

View File

@ -143,7 +143,7 @@ export default function Sign(props) {
<MaterialCommunityIcons
name="crosshairs-gps"
style={{ padding: 5 }}
color="#2E94BB"
color="#0099CC"
size={30}
/>
</View>
@ -169,7 +169,7 @@ const styleSheet = {
外枠: {
width: wp("80%"),
height: (wp("80%") / 20) * 9,
borderColor: "#2E94BB",
borderColor: "#0099CC",
borderWidth: 1,
backgroundColor: "white",
},
@ -179,7 +179,7 @@ const styleSheet = {
left: "0%",
width: "100%",
height: "30%",
backgroundColor: "#2E94BB",
backgroundColor: "#0099CC",
},
下帯B: {
position: "absolute",
@ -195,7 +195,7 @@ const styleSheet = {
left: "2%",
fontWeight: "bold",
fontSize: parseInt("25%"),
color: "#2E94BB",
color: "#0099CC",
},
下帯内容: {
position: "absolute",