Skip to content

Commit

Permalink
Modified the basePath of the site, alongside all of the images, fonts…
Browse files Browse the repository at this point in the history
…, and links.
  • Loading branch information
originalnicodr committed Dec 28, 2023
1 parent 15a1dbf commit 40579a7
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 58 deletions.
3 changes: 2 additions & 1 deletion components/global/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useRouter } from "next/router";
import React from "react";
import { Container } from "./container";
import CSS from 'csstype';
import { basePath } from '../../next.config';

const recapLogoStyle: CSS.Properties = {
position: 'relative',
Expand Down Expand Up @@ -41,7 +42,7 @@ export const Navigation = () => {
</Link>
</li>
<Link href="/" >
<img src="recap-nsub-logo.svg" style={ recapLogoStyle }/>
<img src={`${basePath}/recap-nsub-logo.svg`} style={ recapLogoStyle }/>
</Link>
</ul>
</div>
Expand Down
5 changes: 3 additions & 2 deletions components/home/year-cover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useRef, useEffect, useState, RefObject } from "react";
import CSS from 'csstype';
import { IShot } from "@types";
import { covers2021, covers2022, covers2023 } from "./covers-lists";
import { basePath } from '../../next.config';

const getCovers = (year: number) => {
switch(year) {
Expand Down Expand Up @@ -151,13 +152,13 @@ export function YearCover(year: number) {
function imageElement(imageURL: string, shouldDisplay: boolean) {
return (
<div className="shot-wrapper" style={{ ...coverImageStyle, position: 'absolute', opacity: shouldDisplay ? 1 : 0, transition: 'opacity 0.5s' }}>
<img src={imageURL} loading="lazy" style={coverImageStyle} />
<img src={`${basePath}/${imageURL}`} loading="lazy" style={coverImageStyle} />
</div>
);
}

return (
<a className="year-cover-container" href={year.toString()} style={coverContainerStyle}>
<a className="year-cover-container" href={`${basePath}/${year.toString()}`} style={coverContainerStyle}>
{imageElement(image1.shotUrl, imageToDisplay.current === 1)}
{imageElement(image2.shotUrl, imageToDisplay.current === 2)}
<div className="year-cover-frame" style={coverFrameStyle}></div>
Expand Down
13 changes: 13 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const path = require("path");

/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: '/framed-wrapped',
assetPrefix: '/framed-wrapped/',
reactStrictMode: true,
sassOptions: {
includePaths: [path.join('/framed-wrapped/', "styles")],
},
};

module.exports = nextConfig;
21 changes: 0 additions & 21 deletions next.config.mjs

This file was deleted.

3 changes: 2 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { AppProps } from "next/app";
import { Footer, Navigation } from "@components/global";
import Head from "next/head";
import '../public/fonts/stylesheet.css';
import { basePath } from '../next.config';

export default function App({ Component, pageProps }: AppProps) {
return (
Expand Down Expand Up @@ -33,7 +34,7 @@ export default function App({ Component, pageProps }: AppProps) {
<picture>
<img
className="absolute top-0 left-0 object-cover"
src="wrapped-images/Topography.svg"
src={`${basePath}/wrapped-images/Topography.svg`}
alt=""
style = {{zIndex: "-1", objectFit: "cover", minHeight: "200%"}}
/>
Expand Down
3 changes: 2 additions & 1 deletion pages/_year-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
LoadingSection,
} from "@components/experience-fragments";
import CSS from 'csstype';
import { basePath } from '../next.config';

import { getHofAuthors, getHofImages, getSysImages } from './api/request';
import { addProperties, normalizeData } from '../util/utils';
Expand Down Expand Up @@ -227,7 +228,7 @@ export default function WrapYear(year: number, flavourText: { intro: any; top10s
<div className="min-h-screen md:flex md:items-center load transition-all -translate-y-10 opacity-0 duration-500 mb-8">
<div className="md:grid md:grid-cols-2 md:gap-x-16">
<div className="flex flex-col justify-center">
<img src="recap-wsub-logo.svg" style={ recapLogoStyle }/>
<img src={`${basePath}/recap-wsub-logo.svg`} style={ recapLogoStyle }/>
<br />
<p>
Welcome to Framed&apos;s {year} in Review!
Expand Down
3 changes: 2 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Head from "next/head";
import React from "react";
import CSS from 'csstype';
import { basePath } from '../next.config';

import { YearCover} from "@components/home";

Expand Down Expand Up @@ -33,7 +34,7 @@ const Home = () => {
<title>A year of FRAMED</title>
</Head>

<img src="recap-wsub-logo.svg" style={ recapLogoStyle }/>
<img src={`${basePath}/recap-wsub-logo.svg`} style={ recapLogoStyle }/>

<div className='Covers wrapper' style={ coverFrameStyle }>
{ YearCover(2023) }
Expand Down
62 changes: 32 additions & 30 deletions public/fonts/stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
@font-face {
font-family: "GalanoGrotesque";
font-style: normal;
font-weight: normal;
src: url("/fonts/Galano-Grotesque/GalanoGrotesque-Bold.woff2") format("woff2");
font-display: swap;
}
/* Had to add the basePath manually since I can't import it in here. */

@font-face {
font-family: "GalanoGrotesque";
font-style: normal;
font-weight: normal;
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesque-Bold.woff2") format("woff2");
font-display: swap;
}

@font-face {
font-family: "Galano Grotesque Alt (Numbers)";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Italic.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Italic.woff") format("woff");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Italic.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Italic.woff") format("woff");
font-weight: normal;
font-style: italic;
font-display: swap;
Expand All @@ -19,8 +21,8 @@

@font-face {
font-family: "Galano Grotesque Alt (Numbers)";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Regular.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Regular.woff") format("woff");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Regular.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
Expand All @@ -30,8 +32,8 @@

@font-face {
font-family: "Galano Grotesque Alt (Numbers)";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.woff") format("woff");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-display: swap;
Expand All @@ -41,8 +43,8 @@

@font-face {
font-family: "Galano Grotesque Alt (Numbers)";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBoldItalic.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBoldItalic.woff") format("woff");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBoldItalic.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBoldItalic.woff") format("woff");
font-weight: bold;
font-style: italic;
font-display: swap;
Expand All @@ -54,8 +56,8 @@
@font-face {
font-family: "AtkinsonHyperlegible";
src: local("☞Atkinson Hyperlegible"), local("AtkinsonHyperlegible-Regular"),
url("/fonts/Atkinson-Hyperlegible/AtkinsonHyperlegible-Regular.woff2") format("woff2"),
url("/fonts/Atkinson-Hyperlegible/AtkinsonHyperlegible-Regular.woff") format("woff");
url("/framed-wrapped/fonts/Atkinson-Hyperlegible/AtkinsonHyperlegible-Regular.woff2") format("woff2"),
url("/framed-wrapped/fonts/Atkinson-Hyperlegible/AtkinsonHyperlegible-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
Expand All @@ -64,54 +66,54 @@
@font-face {
font-family: "AtkinsonHyperlegible";
src: local("☞Atkinson Hyperlegible"), local("AtkinsonHyperlegible-Bold"),
url("/fonts/Atkinson-Hyperlegible/AtkinsonHyperlegible-Bold.woff2") format("woff2"),
url("/fonts/Atkinson-Hyperlegible/AtkinsonHyperlegible-Bold.woff") format("woff");
url("/framed-wrapped/fonts/Atkinson-Hyperlegible/AtkinsonHyperlegible-Bold.woff2") format("woff2"),
url("/framed-wrapped/fonts/Atkinson-Hyperlegible/AtkinsonHyperlegible-Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Galano Grotesque Alt";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Regular.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Regular.woff") format("woff");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Regular.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Galano Grotesque Alt";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Medium.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Medium.woff") format("woff");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Medium.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Galano Grotesque Alt";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-MediumItalic.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-MediumItalic.woff") format("woff");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-MediumItalic.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-MediumItalic.woff") format("woff");
font-weight: 500;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: "Galano Grotesque Alt";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBoldItalic.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBoldItalic.woff") format("woff");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBoldItalic.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBoldItalic.woff") format("woff");
font-weight: 600;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: "Galano Grotesque Alt";
src: url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.woff2") format("woff2"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.woff") format("woff"),
url("/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.ttf") format("truetype");
src: url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.woff2") format("woff2"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.woff") format("woff"),
url("/framed-wrapped/fonts/Galano-Grotesque/GalanoGrotesqueAlt-SemiBold.ttf") format("truetype");
font-weight: 600;
font-style: normal;
font-display: swap;
Expand Down
1 change: 0 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
basePath: '/framed-wrapped',
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
Expand Down

0 comments on commit 40579a7

Please sign in to comment.