Skip to content

Commit

Permalink
feat: inline play Hero videos
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Dec 6, 2023
1 parent aea87d0 commit e043a2e
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Core/AASdk/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const AASdk = ({ title, caption, text, link }: BaseBlock) => {
)}
</Grid>
<div className={css.videoWrapper}>
<video autoPlay muted loop className={css.video}>
<video autoPlay muted playsInline loop className={css.video}>
<source src={isSmallScreen ? '/videos/aa-sdk-mobile.webm' : '/videos/aa-sdk.webm'} type="video/webm" />
<source
src={isSmallScreen ? '/videos/aa-sdk-mobile.hevc.mp4' : '/videos/aa-sdk.hevc.mp4'}
Expand Down
15 changes: 6 additions & 9 deletions src/components/Core/Intro/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import css from './styles.module.css'
import type { BaseBlock } from '@/components/Home/types'
import { scrollToElement } from '@/lib/scrollSmooth'

const CoreIntro = ({ title, text, link, scroll }: BaseBlock & { scroll?: { title: string; target: string } }) => {
const handleClick = (e: React.MouseEvent<HTMLAnchorElement>, target: string) => {
const CoreIntro = ({ title, text, link }: BaseBlock) => {
const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {
e.preventDefault()

// TODO: move offset to CSS
scrollToElement(target, 200)
scrollToElement('#masthead', 200)
}

return (
Expand Down Expand Up @@ -42,11 +41,9 @@ const CoreIntro = ({ title, text, link, scroll }: BaseBlock & { scroll?: { title
</Button>
)}
</Grid>
{scroll && (
<a onClick={(e) => handleClick(e, scroll.target)} className={css.scroll}>
<Typography variant="caption">{scroll.title}</Typography>
</a>
)}
<a onClick={handleClick} className={css.scroll}>
<Typography variant="caption">New Whitepaper</Typography>
</a>
</Grid>
<Divider />
</Container>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Home/Intro/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const Intro = ({ title, text, buttons }: BaseBlock) => {
</Grid>
</Grid>
<div className={css.filter}>
<video autoPlay muted loop className={css.video}>
<source src="/videos/safe-logo.mp4" type="video/mp4" />
<video autoPlay muted playsInline loop className={css.video}>
<source src="/videos/Home/safe-logo.mp4" type="video/mp4" />
</video>
<div className={css.frame} />
</div>
Expand Down

0 comments on commit e043a2e

Please sign in to comment.