Skip to content

Commit

Permalink
Merge pull request #340 from reedu-reengineering-education/feat/zeitg…
Browse files Browse the repository at this point in the history
…eisty-theme

Add zeitgeisty theme
  • Loading branch information
felixerdy authored Sep 19, 2023
2 parents a6c93e7 + ed8f1ca commit 393df52
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 3 deletions.
3 changes: 2 additions & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ const i18nMiddleware = (req: NextRequest) => {
if (
req.nextUrl.pathname.indexOf('icon') > -1 ||
req.nextUrl.pathname.indexOf('chrome') > -1 ||
req.nextUrl.pathname.indexOf('api') > -1
req.nextUrl.pathname.indexOf('api') > -1 ||
req.nextUrl.pathname.indexOf('static') > -1
) {
return NextResponse.next()
}
Expand Down
11 changes: 11 additions & 0 deletions prisma/seed/data/themes.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
"button_color": "#38383a",
"background_color": "white"
},
{
"name": "Zeitgeisty",
"shadow_color": "rgba(56,56.58, 0.9)",
"border": "3px solid #38383a",
"box_shadow": "none",
"border_radius": "0px",
"text_color": "#38383a",
"button_color": "#38383a",
"background_color": "white",
"fontFamily": "Albertsthal Typewriter"
},
{
"name": "Funky",
"shadow_color": "rgba(237, 130, 222, 0.9)",
Expand Down
Binary file added public/static/fonts/AlbertsthalTypewriter.ttf
Binary file not shown.
8 changes: 7 additions & 1 deletion src/components/Viewer/ContentTypes/TitleContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ interface TitleContentProps extends React.HTMLAttributes<HTMLFormElement> {
}

export function TitleContent({ content }: TitleContentProps) {
return <div>{content.content && <h1>{content.content}</h1>}</div>
return (
<div>
{content.content && (
<h1 className="enable-theme-font">{content.content}</h1>
)}
</div>
)
}
2 changes: 1 addition & 1 deletion src/components/Viewer/StoryOverviewContols.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function StoryOverviewControls({ slug, page, story, tags }: Props) {
{story && (
<div className="flex max-w-fit flex-col">
<div className="bg-gray flex flex-row gap-2">
<h3 className="max-w-[500px]">{story?.name}</h3>
<h3 className="enable-theme-font max-w-[500px]">{story?.name}</h3>
</div>

{page == 'start' && (
Expand Down
6 changes: 6 additions & 0 deletions src/helper/applyTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export function applyTheme(theme: any) {
theme[key],
)
break
case 'fontFamily':
document.documentElement.style.setProperty(
'--font-family',
theme[key],
)
break
}
})
}
Expand Down
4 changes: 4 additions & 0 deletions src/styles/elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ html {
box-shadow: var(--boxshadow);
color: var(--text-color);
background-color: var(--background-color);

.enable-theme-font {
font-family: var(--font-family);
}
}

.re-basic-box-no-shadow {
Expand Down
5 changes: 5 additions & 0 deletions src/styles/typo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ p {
line-height: 1.5rem; // text-base
color: var(--text-color);
}

@font-face {
font-family: 'Albertsthal Typewriter';
src: url('/static/fonts/AlbertsthalTypewriter.ttf') format('truetype');
}

1 comment on commit 393df52

@vercel
Copy link

@vercel vercel bot commented on 393df52 Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mapstories-2-0 – ./

mapstories-2-0-pvp-map.vercel.app
mapstories-2-0.vercel.app
mapstories-2-0-git-main-pvp-map.vercel.app

Please sign in to comment.