-
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.
static site for github pages...in progress
- Loading branch information
Showing
24 changed files
with
477 additions
and
396 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
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,11 @@ | ||
|
||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { ContentJson } from './types'; | ||
|
||
|
||
export async function getContent(): Promise<ContentJson> { | ||
const jsonPath = path.join(process.cwd(), "app", "data", "content.json"); | ||
const jsonContent = fs.readFileSync(jsonPath, "utf8"); | ||
return JSON.parse(jsonContent) as ContentJson; | ||
} |
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,14 @@ | ||
export default function imageLoader({ | ||
src, | ||
width, | ||
quality, | ||
}: { | ||
src: string | ||
width: number | ||
quality?: number | ||
}) { | ||
const params = ['f_auto', 'c_limit', `w_${width}`, `q_${quality || 'auto'}`] | ||
return `https://res.cloudinary.com/demo/image/upload/${params.join( | ||
',' | ||
)}${src}` | ||
} |
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,23 @@ | ||
// import { DreyfusLevel, Subtopic, SubtopicBlock } from './types'; | ||
|
||
|
||
// export function isSubtopicBlock(item: Subtopic | SubtopicBlock): item is SubtopicBlock { | ||
// return (item as SubtopicBlock).iconList !== undefined; | ||
// } | ||
|
||
|
||
// /** | ||
// * Converts string to DreyfusLevel enum | ||
// * If input invalid, returns undefined | ||
// */ | ||
// export function drefusLevelFromString(levelStr?: string): DreyfusLevel | undefined { | ||
// if (!levelStr) return undefined; | ||
|
||
// const enumKeys = Object.keys(DreyfusLevel).filter(k => isNaN(Number(k))); | ||
// const matchedKey = enumKeys.find(key => key.toLowerCase() === levelStr.toLowerCase()); | ||
// if (!matchedKey) return undefined; | ||
|
||
// const numericValue = DreyfusLevel[matchedKey as keyof typeof DreyfusLevel]; | ||
// return typeof numericValue === 'number' ? numericValue : undefined; | ||
// } | ||
|
This file was deleted.
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
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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
'use client'; | ||
// 'use client'; | ||
|
||
import { useState } from 'react'; | ||
// import { useState } from 'react'; | ||
|
||
export function useCarousel(totalSlides: number, initialIndex: number = 0) { | ||
const [currentIndex, setCurrentIndex] = useState(initialIndex); | ||
// export function useCarousel(totalSlides: number, initialIndex: number = 0) { | ||
// const [currentIndex, setCurrentIndex] = useState(initialIndex); | ||
|
||
const handlePrev = () => { | ||
setCurrentIndex((prevIndex) => | ||
prevIndex === 0 ? totalSlides - 1 : prevIndex - 1 | ||
); | ||
}; | ||
// const handlePrev = () => { | ||
// setCurrentIndex((prevIndex) => | ||
// prevIndex === 0 ? totalSlides - 1 : prevIndex - 1 | ||
// ); | ||
// }; | ||
|
||
const handleNext = () => { | ||
setCurrentIndex((prevIndex) => | ||
prevIndex === totalSlides - 1 ? 0 : prevIndex + 1 | ||
); | ||
}; | ||
// const handleNext = () => { | ||
// setCurrentIndex((prevIndex) => | ||
// prevIndex === totalSlides - 1 ? 0 : prevIndex + 1 | ||
// ); | ||
// }; | ||
|
||
return { | ||
currentIndex, | ||
handlePrev, | ||
handleNext, | ||
}; | ||
} | ||
// return { | ||
// currentIndex, | ||
// handlePrev, | ||
// handleNext, | ||
// }; | ||
// } | ||
|
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
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
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 |
---|---|---|
@@ -1,34 +1,33 @@ | ||
'use client'; | ||
// 'use client'; | ||
|
||
import React, { ReactNode } from 'react'; | ||
import CarouselUI from './CarouselUI'; | ||
import { useCarousel } from '../../state/hooks'; | ||
import Slide from './Slide'; | ||
// import React, { ReactNode } from 'react'; | ||
// import CarouselUI from './CarouselUI'; | ||
// import Slide from './Slide'; | ||
|
||
interface CarouselProps { | ||
children: ReactNode[]; | ||
className?: string; | ||
} | ||
// interface CarouselProps { | ||
// children: ReactNode[]; | ||
// className?: string; | ||
// } | ||
|
||
interface CarouselComponent extends React.FC<CarouselProps> { | ||
Slide: typeof Slide; | ||
} | ||
// interface CarouselComponent extends React.FC<CarouselProps> { | ||
// Slide: typeof Slide; | ||
// } | ||
|
||
const Carousel: CarouselComponent = ({ children, className = '' }) => { | ||
const totalSlides = React.Children.count(children); | ||
const { currentIndex, handlePrev, handleNext } = useCarousel(totalSlides); | ||
// const Carousel: CarouselComponent = ({ children, className = '' }) => { | ||
// const totalSlides = React.Children.count(children); | ||
// const { currentIndex, handlePrev, handleNext } = useCarousel(totalSlides); | ||
|
||
return ( | ||
<CarouselUI | ||
className={className} | ||
currentIndex={currentIndex} | ||
onPrev={handlePrev} | ||
onNext={handleNext} | ||
> | ||
{children} | ||
</CarouselUI> | ||
) | ||
} | ||
// return ( | ||
// <CarouselUI | ||
// className={className} | ||
// currentIndex={currentIndex} | ||
// onPrev={handlePrev} | ||
// onNext={handleNext} | ||
// > | ||
// {children} | ||
// </CarouselUI> | ||
// ) | ||
// } | ||
|
||
Carousel.Slide = Slide; | ||
export default Carousel; | ||
// Carousel.Slide = Slide; | ||
// export default Carousel; |
Oops, something went wrong.