mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 20:21:21 +00:00
🎨 styles: home video
:%s
This commit is contained in:
parent
050933d4b0
commit
088ea3075b
@ -42,6 +42,7 @@
|
||||
"react-dom": "^17.0.2",
|
||||
"react-fast-marquee": "^1.1.4",
|
||||
"react-merge-refs": "^1.1.0",
|
||||
"react-player": "^2.9.0",
|
||||
"react-use-measure": "^2.0.4",
|
||||
"sass": "^1.38.0",
|
||||
"swell-js": "^4.0.0-next.0",
|
||||
|
@ -1,12 +1,13 @@
|
||||
|
||||
import { Layout } from 'src/components/common';
|
||||
import { HomeBanner, HomeCTA, HomeSubscribe } from 'src/components/modules/home';
|
||||
import { HomeBanner, HomeCTA, HomeSubscribe, HomeVideo } from 'src/components/modules/home';
|
||||
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<>
|
||||
<HomeBanner />
|
||||
<HomeVideo />
|
||||
<HomeCTA />
|
||||
<HomeSubscribe />
|
||||
</>
|
||||
|
19
src/components/common/VideoPlayer/VideoPlayer.tsx
Normal file
19
src/components/common/VideoPlayer/VideoPlayer.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
import ReactPlayer from 'react-player/lazy'
|
||||
|
||||
interface Props {
|
||||
url: string,
|
||||
controls?: boolean,
|
||||
muted?: boolean,
|
||||
}
|
||||
|
||||
const VideoPlayer = ({ url, controls, muted }: Props) => {
|
||||
return (
|
||||
<ReactPlayer
|
||||
url={url}
|
||||
controls={controls}
|
||||
muted={muted} />
|
||||
);
|
||||
};
|
||||
|
||||
export default VideoPlayer;
|
@ -14,3 +14,4 @@ export { default as Banner} from './Banner/Banner'
|
||||
export { default as Footer} from './Footer/Footer'
|
||||
export { default as MenuDropdown} from './MenuDropdown/MenuDropdown'
|
||||
export { default as NotiMessage} from './NotiMessage/NotiMessage'
|
||||
export { default as VideoPlayer} from './VideoPlayer/VideoPlayer'
|
||||
|
68
src/components/modules/home/HomeVideo/HomeVideo.module.scss
Normal file
68
src/components/modules/home/HomeVideo/HomeVideo.module.scss
Normal file
@ -0,0 +1,68 @@
|
||||
@import "../../../../styles/utilities";
|
||||
|
||||
.homeVideo {
|
||||
margin: 2rem auto 3rem;
|
||||
.top,
|
||||
.videoWrap > div {
|
||||
@apply spacing-horizontal;
|
||||
}
|
||||
@screen md {
|
||||
margin: 6.4rem auto 5.6rem;
|
||||
.top,
|
||||
.videoWrap > div {
|
||||
max-width: 60rem;
|
||||
margin: auto;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@screen lg {
|
||||
.top,
|
||||
.videoWrap > div {
|
||||
max-width: 80rem;
|
||||
}
|
||||
}
|
||||
.top {
|
||||
margin-bottom: 2rem;
|
||||
@screen md {
|
||||
@apply flex items-center;
|
||||
margin-bottom: 4rem;
|
||||
.logo {
|
||||
margin-right: 2.4rem;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.logo {
|
||||
max-width: 10rem;
|
||||
margin-bottom: 1rem;
|
||||
img {
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
.heading {
|
||||
@apply heading-2 font-heading;
|
||||
}
|
||||
}
|
||||
.videoWrap {
|
||||
@apply relative flex justify-center;
|
||||
> div {
|
||||
@apply relative;
|
||||
width: 100% !important;
|
||||
z-index: 10;
|
||||
}
|
||||
&::before {
|
||||
@apply absolute bg-primary;
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 18rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 0;
|
||||
@screen md {
|
||||
background-image: url("./assets/bg_left.svg"), url("./assets/bg_right.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: 5% 0, 95% 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
31
src/components/modules/home/HomeVideo/HomeVideo.tsx
Normal file
31
src/components/modules/home/HomeVideo/HomeVideo.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
import Image from 'next/image'
|
||||
import React from 'react'
|
||||
import s from './HomeVideo.module.scss'
|
||||
import LogoBrand from './assets/logo_maggi.png'
|
||||
import { VideoPlayer } from 'src/components/common'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
}
|
||||
|
||||
const HomeVideo = ({ }: Props) => {
|
||||
return (
|
||||
<section className={s.homeVideo}>
|
||||
<div className={s.top}>
|
||||
<div className={s.logo}>
|
||||
<Image src={LogoBrand} />
|
||||
</div>
|
||||
<h2 className={s.heading}>
|
||||
Maggi Sauce Is The Secret Weapon For Making All Your Food
|
||||
</h2>
|
||||
</div>
|
||||
<div className={s.videoWrap}>
|
||||
{/* todo: change url video */}
|
||||
<VideoPlayer url='https://www.youtube.com/watch?v=nXH23nYYM3s' controls={true} />
|
||||
</div>
|
||||
</section >
|
||||
)
|
||||
}
|
||||
|
||||
export default HomeVideo
|
19
src/components/modules/home/HomeVideo/assets/bg_left.svg
Normal file
19
src/components/modules/home/HomeVideo/assets/bg_left.svg
Normal file
@ -0,0 +1,19 @@
|
||||
<svg width="240" height="268" viewBox="0 0 240 268" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g opacity="0.6">
|
||||
<rect x="170.045" y="167.357" width="32.2656" height="16.5938" rx="4" transform="rotate(-16 170.045 167.357)" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<path d="M170.168 201.23C167.732 192.736 172.644 183.875 181.138 181.439L199.117 176.284C207.611 173.848 216.471 178.76 218.907 187.254L234.907 243.052C236.125 247.299 233.669 251.73 229.422 252.948L196.063 262.513C191.816 263.731 187.386 261.275 186.168 257.028L170.168 201.23Z" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="177.519" y="170.009" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(-16 177.519 170.009)" fill="#CDF4DD"/>
|
||||
<rect x="185.494" y="167.723" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(-16 185.494 167.723)" fill="#CDF4DD"/>
|
||||
<rect x="193.47" y="165.436" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(-16 193.47 165.436)" fill="#CDF4DD"/>
|
||||
</g>
|
||||
<g opacity="0.6">
|
||||
<path d="M36.5973 106.436L39.9701 94.6735L64.4373 101.689L60.9881 113.718C59.4878 118.951 60.973 124.584 64.8578 128.397C69.0553 132.516 70.4233 138.726 68.3451 144.228L55.6959 177.716C54.5922 180.638 51.4315 182.224 48.4292 181.363L11.314 170.721C8.31623 169.861 6.47675 166.848 7.08188 163.789L13.7174 130.242C14.9118 124.203 19.3948 119.345 25.3188 117.671C30.7696 116.131 35.036 111.881 36.5973 106.436Z" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="42.3359" y="74.5464" width="32" height="19" rx="6" transform="rotate(16 42.3359 74.5464)" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="70.6162" y="92.0181" width="4" height="32" rx="2" transform="rotate(106 70.6162 92.0181)" fill="#CDF4DD"/>
|
||||
</g>
|
||||
<g opacity="0.6">
|
||||
<path d="M186.052 83.4148L179.934 94.0117L157.891 81.2851L164.148 70.448C166.869 65.7341 166.791 59.9085 163.944 55.2694C160.868 50.2567 161.043 43.9002 164.39 39.0645L184.765 9.63163C186.543 7.06354 189.994 6.28885 192.699 7.85054L226.137 27.156C228.837 28.7153 229.893 32.0836 228.566 34.9057L214.012 65.8511C211.392 71.4217 205.867 75.0504 199.714 75.2416C194.052 75.4176 188.885 78.5093 186.052 83.4148Z" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="172.769" y="112.969" width="32" height="19" rx="6" transform="rotate(-150 172.769 112.969)" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="149.557" y="89.1743" width="4" height="32" rx="2" transform="rotate(-60 149.557 89.1743)" fill="#CDF4DD"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.4 KiB |
21
src/components/modules/home/HomeVideo/assets/bg_right.svg
Normal file
21
src/components/modules/home/HomeVideo/assets/bg_right.svg
Normal file
@ -0,0 +1,21 @@
|
||||
<svg width="237" height="252" viewBox="0 0 237 252" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g opacity="0.6">
|
||||
<rect x="196.607" y="142.667" width="32.2656" height="16.5938" rx="4" transform="rotate(16.8391 196.607 142.667)" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<path d="M178.342 171.193C180.901 162.736 189.833 157.955 198.291 160.514L216.192 165.932C224.649 168.492 229.431 177.424 226.871 185.881L210.055 241.439C208.776 245.668 204.31 248.059 200.081 246.779L166.866 236.726C162.637 235.446 160.246 230.98 161.526 226.751L178.342 171.193Z" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="201.447" y="148.949" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(16.8391 201.447 148.949)" fill="#CDF4DD"/>
|
||||
<rect x="209.389" y="151.352" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(16.8391 209.389 151.352)" fill="#CDF4DD"/>
|
||||
<rect x="217.33" y="153.756" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(16.8391 217.33 153.756)" fill="#CDF4DD"/>
|
||||
</g>
|
||||
<g opacity="0.6">
|
||||
<rect x="150.723" y="109.167" width="32.2656" height="16.5938" rx="4" transform="rotate(-150 150.723 109.167)" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<path d="M175.004 85.5494C170.586 93.202 160.8 95.824 153.147 91.4058L136.95 82.0542C129.297 77.6359 126.675 67.8505 131.094 60.1978L160.117 9.92772C162.326 6.10138 167.219 4.79038 171.045 6.99952L201.099 24.3511C204.925 26.5602 206.236 31.4529 204.027 35.2793L175.004 85.5494Z" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="147.439" y="101.949" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(-150 147.439 101.949)" fill="#CDF4DD"/>
|
||||
<rect x="140.254" y="97.8003" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(-150 140.254 97.8003)" fill="#CDF4DD"/>
|
||||
<rect x="133.068" y="93.6519" width="3.6875" height="11.9844" rx="1.84375" transform="rotate(-150 133.068 93.6519)" fill="#CDF4DD"/>
|
||||
</g>
|
||||
<g opacity="0.6">
|
||||
<path d="M32.8015 122.764L35.7266 112.563L56.9458 118.648L53.9545 129.08C52.6533 133.618 53.9413 138.504 57.3104 141.81C60.9508 145.383 62.1371 150.768 60.3348 155.54L49.6241 183.896C48.5204 186.818 45.3597 188.404 42.3573 187.543L11.5784 178.717C8.5806 177.858 6.74113 174.845 7.34625 171.786L12.9588 143.41C13.9947 138.173 17.8826 133.96 23.0201 132.508C27.7474 131.172 31.4475 127.486 32.8015 122.764Z" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="37.7793" y="95.1074" width="27.7521" height="16.4778" rx="6" transform="rotate(16 37.7793 95.1074)" stroke="#CDF4DD" stroke-width="4"/>
|
||||
<rect x="62.3047" y="110.26" width="3.46901" height="27.7521" rx="1.7345" transform="rotate(106 62.3047 110.26)" fill="#CDF4DD"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/components/modules/home/HomeVideo/assets/logo_maggi.png
Normal file
BIN
src/components/modules/home/HomeVideo/assets/logo_maggi.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -1,3 +1,4 @@
|
||||
export { default as HomeBanner } from './HomeBanner/HomeBanner'
|
||||
export { default as HomeCTA } from './HomeCTA/HomeCTA'
|
||||
export { default as HomeSubscribe } from './HomeSubscribe/HomeSubscribe'
|
||||
export { default as HomeVideo } from './HomeVideo/HomeVideo'
|
||||
|
30
yarn.lock
30
yarn.lock
@ -2292,7 +2292,7 @@ deep-extend@^0.6.0:
|
||||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
|
||||
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
|
||||
|
||||
deepmerge@4.2.2, deepmerge@^4.2.2:
|
||||
deepmerge@4.2.2, deepmerge@^4.0.0, deepmerge@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
|
||||
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
|
||||
@ -3657,6 +3657,11 @@ listr@^0.14.3:
|
||||
p-map "^2.0.0"
|
||||
rxjs "^6.3.3"
|
||||
|
||||
load-script@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/load-script/-/load-script-1.0.0.tgz#0491939e0bee5643ee494a7e3da3d2bac70c6ca4"
|
||||
integrity sha1-BJGTngvuVkPuSUp+PaPSuscMbKQ=
|
||||
|
||||
loader-utils@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7"
|
||||
@ -3878,6 +3883,11 @@ md5.js@^1.3.4:
|
||||
inherits "^2.0.1"
|
||||
safe-buffer "^5.1.2"
|
||||
|
||||
memoize-one@^5.1.1:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e"
|
||||
integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==
|
||||
|
||||
merge-stream@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
|
||||
@ -4894,7 +4904,7 @@ promise@^7.1.1:
|
||||
dependencies:
|
||||
asap "~2.0.3"
|
||||
|
||||
prop-types@15.7.2:
|
||||
prop-types@15.7.2, prop-types@^15.7.2:
|
||||
version "15.7.2"
|
||||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
|
||||
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
|
||||
@ -5029,6 +5039,11 @@ react-dom@^17.0.2:
|
||||
object-assign "^4.1.1"
|
||||
scheduler "^0.20.2"
|
||||
|
||||
react-fast-compare@^3.0.1:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
|
||||
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==
|
||||
|
||||
react-fast-marquee@^1.1.4:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/react-fast-marquee/-/react-fast-marquee-1.2.1.tgz#8a8ee91ec0cee04bcff7f1ea5c3fd5a2c4dc227d"
|
||||
@ -5049,6 +5064,17 @@ react-merge-refs@^1.1.0:
|
||||
resolved "https://registry.yarnpkg.com/react-merge-refs/-/react-merge-refs-1.1.0.tgz#73d88b892c6c68cbb7a66e0800faa374f4c38b06"
|
||||
integrity sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==
|
||||
|
||||
react-player@^2.9.0:
|
||||
version "2.9.0"
|
||||
resolved "https://registry.yarnpkg.com/react-player/-/react-player-2.9.0.tgz#ef7fe7073434087565f00ff219824e1e02c4b046"
|
||||
integrity sha512-jNUkTfMmUhwPPAktAdIqiBcVUKsFKrVGH6Ocutj6535CNfM91yrvWxHg6fvIX8Y/fjYUPoejddwh7qboNV9vGA==
|
||||
dependencies:
|
||||
deepmerge "^4.0.0"
|
||||
load-script "^1.0.0"
|
||||
memoize-one "^5.1.1"
|
||||
prop-types "^15.7.2"
|
||||
react-fast-compare "^3.0.1"
|
||||
|
||||
react-refresh@0.8.3:
|
||||
version "0.8.3"
|
||||
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f"
|
||||
|
Loading…
x
Reference in New Issue
Block a user