Compare commits
6 Commits
master
...
feature/ap
Author | SHA1 | Date | |
---|---|---|---|
|
5ec8081a84 | ||
|
7e67ac198d | ||
|
d2800f4d51 | ||
|
fd90b82a0e | ||
|
673cb6eecf | ||
|
fef3367599 |
BIN
assets/素材.png
Normal file
BIN
assets/素材.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
BIN
assets/素材2.png
Normal file
BIN
assets/素材2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 83 KiB |
BIN
assets/素材3.png
Normal file
BIN
assets/素材3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
@ -12,6 +12,7 @@ import {
|
|||||||
widthPercentageToDP as wp,
|
widthPercentageToDP as wp,
|
||||||
heightPercentageToDP as hp,
|
heightPercentageToDP as hp,
|
||||||
} from "react-native-responsive-screen";
|
} from "react-native-responsive-screen";
|
||||||
|
import AutoHeightImage from "react-native-auto-height-image";
|
||||||
import LottieView from "lottie-react-native";
|
import LottieView from "lottie-react-native";
|
||||||
import { useInterval } from "../../lib/useInterval";
|
import { useInterval } from "../../lib/useInterval";
|
||||||
import { AS } from "../../storageControl";
|
import { AS } from "../../storageControl";
|
||||||
@ -57,6 +58,29 @@ export default function Sign(props) {
|
|||||||
setNexPrePosition(0);
|
setNexPrePosition(0);
|
||||||
getPreNextStation(currentStation[0]);
|
getPreNextStation(currentStation[0]);
|
||||||
}, [currentStation]);
|
}, [currentStation]);
|
||||||
|
const [smileUrl, setSmileUrl] = useState(undefined);
|
||||||
|
useEffect(() => {
|
||||||
|
const smile = currentStation[0].JrHpUrl.replace("/index.html", "/");
|
||||||
|
const stationSplit = smile.split("/");
|
||||||
|
const smileName = stationSplit[stationSplit.length - 2];
|
||||||
|
if (smileName == "takamatsu") {
|
||||||
|
setSmileUrl(smile + "/images/illustration.png");
|
||||||
|
} else if (smileName == "iyomishima") {
|
||||||
|
setSmileUrl(smile + "/images/iyo-mishima_smile.png");
|
||||||
|
} else if (smileName == "iyosaijo") {
|
||||||
|
setSmileUrl(smile + "/images/iyo-saijo_smile.png");
|
||||||
|
} else if (smileName == "nyugawa") {
|
||||||
|
setSmileUrl(smile + "/images/newgawa_smile.png");
|
||||||
|
} else if (smileName == "iyohojo") {
|
||||||
|
setSmileUrl(smile + "/images/iyo-hojo_smile.png");
|
||||||
|
} else if (smileName == "iyozu") {
|
||||||
|
setSmileUrl(smile + "/images/iyo-ozu_smile.png");
|
||||||
|
} else if (smileName == "oboke") {
|
||||||
|
setSmileUrl(smile + "/images/ooboke_smile.png");
|
||||||
|
} else {
|
||||||
|
setSmileUrl(smile + "images/" + smileName + "_smile.png");
|
||||||
|
}
|
||||||
|
}, [currentStation]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!currentStation[nexPrePosition]) return () => {};
|
if (!currentStation[nexPrePosition]) return () => {};
|
||||||
@ -92,10 +116,18 @@ export default function Sign(props) {
|
|||||||
const lottieRef = useRef();
|
const lottieRef = useRef();
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity style={styleSheet.外枠} onPress={oP}>
|
<TouchableOpacity style={styleSheet.外枠} onPress={oP}>
|
||||||
|
<AutoHeightImage
|
||||||
|
source={{
|
||||||
|
uri: smileUrl,
|
||||||
|
}}
|
||||||
|
resizeMode="contain"
|
||||||
|
width={wp("30%")}
|
||||||
|
style={{ position: "absolute", bottom: "30%" }}
|
||||||
|
/>
|
||||||
<StationNumberMaker currentStation={currentStation} />
|
<StationNumberMaker currentStation={currentStation} />
|
||||||
<StationNameArea currentStation={currentStation} />
|
<StationNameArea currentStation={currentStation} />
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={{ position: "absolute", right: -15, top: -20 }}
|
style={{ position: "absolute", right: -15, top: -13 }}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (testButtonStatus) {
|
if (testButtonStatus) {
|
||||||
const otherData = favoriteStation.filter((d) => {
|
const otherData = favoriteStation.filter((d) => {
|
||||||
@ -118,7 +150,7 @@ export default function Sign(props) {
|
|||||||
setTestButtonStatus(!testButtonStatus);
|
setTestButtonStatus(!testButtonStatus);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LottieDelayView
|
<LottieDelayViews
|
||||||
progress={testButtonStatus ? 1 : 0}
|
progress={testButtonStatus ? 1 : 0}
|
||||||
speed={1.4}
|
speed={1.4}
|
||||||
style={{ width: 80, height: 80 }}
|
style={{ width: 80, height: 80 }}
|
||||||
@ -137,6 +169,26 @@ export default function Sign(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LottieDelayViews = ({
|
||||||
|
progress,
|
||||||
|
speed,
|
||||||
|
style,
|
||||||
|
source,
|
||||||
|
lottieRef,
|
||||||
|
loop,
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<AutoHeightImage
|
||||||
|
source={
|
||||||
|
progress == 0
|
||||||
|
? require("../../assets/素材2.png")
|
||||||
|
: require("../../assets/素材3.png")
|
||||||
|
}
|
||||||
|
resizeMode="contain"
|
||||||
|
width={style.width}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
const LottieDelayView = ({
|
const LottieDelayView = ({
|
||||||
progress,
|
progress,
|
||||||
speed,
|
speed,
|
||||||
|
@ -461,6 +461,9 @@ break;
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//2023AP
|
||||||
|
setStationIcon(element.getElementsByTagName("img")[0],'https://nexcloud.haruk.in/s/4zcJWFmiAq3iqPS/preview');
|
||||||
`
|
`
|
||||||
: ``;
|
: ``;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user