mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-29 03:59:54 +02:00
Add video modal on homepage
This commit is contained in:
@@ -1,21 +1,85 @@
|
|||||||
|
import { useState } from 'react';
|
||||||
|
import { Modal } from './Modal.tsx';
|
||||||
|
import { PartyPopper } from 'lucide-react';
|
||||||
|
|
||||||
type FeatureAnnouncementProps = {};
|
type FeatureAnnouncementProps = {};
|
||||||
|
|
||||||
export function FeatureAnnouncement(props: FeatureAnnouncementProps) {
|
export function FeatureAnnouncement(props: FeatureAnnouncementProps) {
|
||||||
return (
|
const [isPlaying, setIsPlaying] = useState(false);
|
||||||
<a
|
|
||||||
className="rounded-md border border-dashed border-purple-600 px-3 py-1.5 text-purple-400 transition-colors hover:border-purple-400 hover:text-purple-200"
|
const videoModal = (
|
||||||
href="https://www.youtube.com/watch?v=9lS3slfJ0x0"
|
<Modal
|
||||||
target='_blank'
|
onClose={() => setIsPlaying(false)}
|
||||||
|
bodyClassName={'h-auto overflow-hidden'}
|
||||||
|
wrapperClassName={'md:max-w-3xl lg:max-w-4xl xl:max-w-5xl'}
|
||||||
>
|
>
|
||||||
<span className="relative -top-[1px] mr-1 text-xs font-semibold uppercase text-white">
|
<div className="text-balance bg-gradient-to-r from-gray-100 px-4 py-2 md:py-3 text-left text-sm lg:text-base">
|
||||||
New
|
<span
|
||||||
</span>{' '}
|
className="relative -top-px mr-1.5 rounded bg-blue-300 px-1.5 py-0.5 text-xs font-semibold uppercase text-gray-800"
|
||||||
<span className={'hidden sm:inline'}>
|
style={{ lineHeight: '1.5' }}
|
||||||
Practice your skills with projects
|
>
|
||||||
</span>
|
New
|
||||||
<span className={'inline text-sm sm:hidden'}>
|
</span>
|
||||||
Build projects to skill up
|
Projects are live on the{' '}
|
||||||
</span>
|
<a
|
||||||
</a>
|
href={'/backend/projects'}
|
||||||
|
className="font-medium text-blue-500 underline underline-offset-2"
|
||||||
|
>
|
||||||
|
backend roadmap
|
||||||
|
</a>
|
||||||
|
<span className={'hidden md:inline'}>
|
||||||
|
{' '}
|
||||||
|
and are coming soon on the others{' '}
|
||||||
|
</span>
|
||||||
|
<PartyPopper
|
||||||
|
className="relative -top-[3px] ml-2 md:ml-1 inline-block w-5 h-5 md:w-6 md:h-6 text-blue-500"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="iframe-container"
|
||||||
|
style={{
|
||||||
|
position: 'relative',
|
||||||
|
paddingBottom: '56.25%',
|
||||||
|
height: 0,
|
||||||
|
overflow: 'hidden',
|
||||||
|
width: '300%',
|
||||||
|
left: '-100%',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/*https://www.youtube.com/embed/?playsinline=1&disablekb=1&&iv_load_policy=3&cc_load_policy=0&controls=0&rel=0&autoplay=1&mute=1&origin=https%3A%2F%2Fytch.xyz&widgetid=1*/}
|
||||||
|
<iframe
|
||||||
|
src="https://www.youtube.com/embed/9lS3slfJ0x0?start=31&autoplay=1&disablekb=1&rel=0&cc_load_policy=0&controls=0&rel=0&autoplay=1&origin=https%3A%2F%2Froadmap.sh&widgetid=1&showinfo=0"
|
||||||
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||||
|
allowFullScreen
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{isPlaying && videoModal}
|
||||||
|
<button
|
||||||
|
className="rounded-md border border-dashed border-purple-600 px-3 py-1.5 text-purple-400 transition-colors hover:border-purple-400 hover:text-purple-200"
|
||||||
|
onClick={() => setIsPlaying(true)}
|
||||||
|
>
|
||||||
|
<span className="relative -top-[1px] mr-1 text-xs font-semibold uppercase text-white">
|
||||||
|
New
|
||||||
|
</span>{' '}
|
||||||
|
<span className={'hidden sm:inline'}>
|
||||||
|
Practice your skills with projects
|
||||||
|
</span>
|
||||||
|
<span className={'inline text-sm sm:hidden'}>
|
||||||
|
Build projects to skill up
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@ import { FeatureAnnouncement } from "../FeatureAnnouncement";
|
|||||||
id='hero-text'
|
id='hero-text'
|
||||||
>
|
>
|
||||||
<p class='-mt-4 mb-7 sm:-mt-10 sm:mb-4'>
|
<p class='-mt-4 mb-7 sm:-mt-10 sm:mb-4'>
|
||||||
<FeatureAnnouncement />
|
<FeatureAnnouncement client:load />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h1
|
<h1
|
||||||
|
Reference in New Issue
Block a user