setLoading wern't suppose to be false...
This commit is contained in:
parent
c22e940303
commit
3a3abdebfb
2 changed files with 4 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
|||
import '../../css/video.css';
|
||||
|
||||
function Image({ src = "hallway_MMM.mp4" ,side = "middle", alt = "this is a video" }) {
|
||||
function Image({ src = "bg-hallway.png", side = "middle", alt = "this is an image", onImageLoad }) {
|
||||
const urlSource = `${import.meta.env.VITE_ASSETS_URL}/${src}`;
|
||||
|
||||
return (
|
||||
<div className={`image-container ${side}`}>
|
||||
<img src={urlSource} alt={alt}/>
|
||||
<img src={urlSource} alt={alt} onLoad={onImageLoad} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import Character from './class/character.jsx';
|
|||
|
||||
function IntroductionPage() {
|
||||
const navigate = useNavigate();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [isClickedIntroduction, setIsClickedIntroduction] = useState(false);
|
||||
const [numChar, setNumChar] = useState(1);
|
||||
const character = new Character();
|
||||
|
@ -42,7 +42,7 @@ function IntroductionPage() {
|
|||
<LoadImage
|
||||
src='bg-hallway.png'
|
||||
side={character.position(numChar)}
|
||||
onVideoReady={handleVideoReady}
|
||||
onImageLoad={handleVideoReady}
|
||||
/>
|
||||
) : (
|
||||
<PlayVideo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue