Skip to content

Commit

Permalink
fixed video play on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Funnyadd committed Aug 1, 2023
1 parent 70954c1 commit 086707e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions client/src/components/About/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Timeline from "./Timeline"
import Particles from "react-tsparticles";
import { loadTrianglesPreset } from "tsparticles-preset-triangles";
import AnimationContainer from "../animation-container";
import CountUp from 'react-countup'
import CountUp, { useCountUp } from 'react-countup'
import RevealContent from "../reveal-content";

const About = (props) => {
Expand Down Expand Up @@ -54,7 +54,7 @@ const About = (props) => {

const particlesInit = useCallback(async engine => {
await loadTrianglesPreset(engine)
}, []);
}, [])

const particleOptions = {
fullScreen: { enable: false },
Expand Down Expand Up @@ -161,6 +161,13 @@ const About = (props) => {
}
}

useCountUp({
ref: 'counter',
enableScrollSpy: true,
scrollSpyDelay: 1000,
start: 0
})

return (
<>
<AboutContainer className="container">
Expand Down Expand Up @@ -254,7 +261,7 @@ const About = (props) => {
<CounterComponent>
<CounterContainer>
<div className="valueContainer">
<CountUp className="value" start={0} delay={0.5} end={numberOfYear(c.startDate, c.endDate)} duration={5}/>
<CountUp className="value" enableScrollSpy duration={6} end={numberOfYear(c.startDate, c.endDate)}/>
</div>
<div className="symbolContainer">
{checkIf6Months(c.startDate, c.isAge)
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Hero/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Hero = (props) => {
return (
<>
<HeroContainer>
<Background autoPlay muted loop id="backgroundVideo">
<Background autoPlay muted loop playsInline id="backgroundVideo">
<source src={background_loop} type="video/mp4" />
</Background>
{/* <BackgroundThumbnail id="backgroundThumbnail" src={background_thumnail} type="png" /> */}
Expand Down

1 comment on commit 086707e

@vercel
Copy link

@vercel vercel bot commented on 086707e Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.