-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
398 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
- title: "Ream: Contract management made simple" | ||
content: | | ||
Built on top of our in-house contract management solution, **Ream** | ||
offers an all-in-one platform to your small-business contracting needs. | ||
Draft, review, send, and sign your most used documents all in one | ||
easy-to-use platform. | ||
link: https://reamdocs.com | ||
button: Learn more | ||
image: '/img/projects/ream.png' | ||
- title: Daily Doublet | ||
content: | | ||
**The Daily Doublet** is a modern twist on a classic word puzzle invented | ||
by Lewis Carroll in 1877. Also known as word-links, or laddergrams, | ||
this game challenges you to transform one word into another by changing | ||
just one letter at a time. New puzzle every day! | ||
link: https://dailydoublet.com | ||
button: Play now | ||
image: '/img/projects/dailydoublet.png' | ||
- title: 🌹 beautyshot | ||
content: | | ||
**beautyshot** is a simple screenshot beautifier. Quickly style and | ||
resize your screenshots for sharing to X (nee twitter), LinkedIn, | ||
youtube, instagram, and more. | ||
link: https://shot.beauty/ | ||
button: Try it out | ||
image: '/img/projects/beautyshot.png' | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import clsx from "clsx"; | ||
import styles from "styles/components/Carousel.module.scss"; | ||
import { EmblaCarouselType } from "embla-carousel"; | ||
|
||
import { EmblaOptionsType } from "embla-carousel"; | ||
import useEmblaCarousel from "embla-carousel-react"; | ||
import { ReactNode, useCallback, useEffect, useState } from "react"; | ||
import { Button } from "./Button"; | ||
import { MarkdownContent } from "./MarkdownContent"; | ||
import { ChevronLeft } from "lucide-react"; | ||
|
||
type PropType = { | ||
slides: ReactNode[]; | ||
options?: EmblaOptionsType; | ||
}; | ||
|
||
type UsePrevNextButtonsType = { | ||
prevBtnDisabled: boolean; | ||
nextBtnDisabled: boolean; | ||
onPrevButtonClick: () => void; | ||
onNextButtonClick: () => void; | ||
}; | ||
|
||
export const usePrevNextButtons = ( | ||
emblaApi: EmblaCarouselType | undefined, | ||
): UsePrevNextButtonsType => { | ||
const [prevBtnDisabled, setPrevBtnDisabled] = useState(true); | ||
const [nextBtnDisabled, setNextBtnDisabled] = useState(true); | ||
|
||
const onPrevButtonClick = useCallback(() => { | ||
if (!emblaApi) return; | ||
emblaApi.scrollPrev(); | ||
}, [emblaApi]); | ||
|
||
const onNextButtonClick = useCallback(() => { | ||
if (!emblaApi) return; | ||
emblaApi.scrollNext(); | ||
}, [emblaApi]); | ||
|
||
const onSelect = useCallback((emblaApi: EmblaCarouselType) => { | ||
setPrevBtnDisabled(!emblaApi.canScrollPrev()); | ||
setNextBtnDisabled(!emblaApi.canScrollNext()); | ||
}, []); | ||
|
||
useEffect(() => { | ||
if (!emblaApi) return; | ||
|
||
onSelect(emblaApi); | ||
emblaApi.on("reInit", onSelect).on("select", onSelect); | ||
}, [emblaApi, onSelect]); | ||
|
||
return { | ||
prevBtnDisabled, | ||
nextBtnDisabled, | ||
onPrevButtonClick, | ||
onNextButtonClick, | ||
}; | ||
}; | ||
|
||
export const Carousel: React.FC<PropType> = ({ slides = [], options }) => { | ||
const [emblaRef, emblaApi] = useEmblaCarousel(options); | ||
|
||
const { | ||
prevBtnDisabled, | ||
nextBtnDisabled, | ||
onPrevButtonClick, | ||
onNextButtonClick, | ||
} = usePrevNextButtons(emblaApi); | ||
|
||
return ( | ||
<section className={styles.carousel}> | ||
<div className={clsx(styles.carousel__viewport)} ref={emblaRef}> | ||
<div className={clsx(styles.carousel__container)}> | ||
{slides.map((slide, idx) => ( | ||
<div className={clsx(styles.carousel__slide)} key={idx}> | ||
{slide} | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
|
||
<div className={clsx(styles.carousel__controls)}> | ||
<div className={clsx(styles.carousel__buttons)}> | ||
<Button variant="secondary" onClick={onPrevButtonClick} disabled={prevBtnDisabled}> | ||
Prev | ||
</Button> | ||
<Button variant="secondary" onClick={onNextButtonClick} disabled={nextBtnDisabled}> | ||
Next | ||
</Button> | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import clsx from "clsx"; | ||
import styles from "styles/components/ProjectSlide.module.scss"; | ||
import { Button } from "./Button"; | ||
import { ChevronRight } from "lucide-react"; | ||
|
||
type ProjectSlideProps = { | ||
title: string; | ||
image: string; | ||
link: string; | ||
button: string; | ||
content: React.ReactNode; | ||
className?: string; | ||
}; | ||
|
||
export const ProjectSlide: React.FC<ProjectSlideProps> = ({ | ||
title, | ||
content, | ||
image, | ||
button, | ||
link, | ||
className, | ||
}) => { | ||
return ( | ||
<div className={clsx(styles.project_slide, className)}> | ||
<img src={image} alt={title} className={styles.project_slide__image} /> | ||
|
||
<div className={clsx(styles.project_slide__content)}> | ||
<header className={styles.project_slide__header}> | ||
<h2 className={styles.project_slide__title}>{title}</h2> | ||
</header> | ||
|
||
<div className="typography">{content}</div> | ||
|
||
{button && link && ( | ||
<footer> | ||
<Button EndIcon={ChevronRight} target="_blank" href={link}> | ||
{button} | ||
</Button> | ||
</footer> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.