Skip to content

Commit

Permalink
Overhauled content structure
Browse files Browse the repository at this point in the history
  • Loading branch information
keeganlenz001 committed Oct 3, 2023
1 parent 2e55107 commit 621aafc
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 103 deletions.
14 changes: 7 additions & 7 deletions src/components/home_page/content.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { useEffect } from "react";
import {Link} from "react-router-dom";
import Projects from "./content/projects";
import Projects_Content from "../../content/projects_content";

function Content() {
let content_list: any[] = [];

for (let i = 0; i < Projects.length; i += 3) {
const image: string = Projects[i];
const title: string = Projects[i + 1];
const descritpion: string = Projects[i + 2];
const path: string = "/" + title.replace(/\s/g, "-");
for (let i = 0; i < Projects_Content.length; i++) {
const path: string = "/" + Projects_Content[i][1][1].replace(/\s/g, "-");

const image: string = Projects_Content[i][0][0];
const title: string = Projects_Content[i][0][1];
const descritpion: string = Projects_Content[i][0][1];

content_list.push(
<div className="content-card">
Expand Down
7 changes: 0 additions & 7 deletions src/components/home_page/content/projects.tsx

This file was deleted.

44 changes: 16 additions & 28 deletions src/components/project_page/content.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
import Project1 from "./content/project1";
import Project2 from "./content/project2";
import Project3 from "./content/project3";

// import Projects_Array from "./content/projects_array";
import Projects_Content from "../../content/projects_content";

function Content() {
let url: string = window.location.pathname;
// console.log(url);
console.log(url);

let content: string[] = [];
switch (url) {
case "/Project-Title-1":
content = Project1
break;
case "/Project-Title-2":
content = Project2
break;
case "/Project-Title-3":
content = Project3
break;
for (let i = 0; i < Projects_Content.length; i++) {
if ("/" + Projects_Content[i][1][1].replace(/\s/g, "-") == url) {
content = Projects_Content[i][1];
}
}

// let content = null;
// for (let i = 0; i < Projects_Array.length; i++) {
// if ("/" + Projects_Array[i][1].replace(/\s/g, "-") === projectId) {
// content = Projects_Array[i];
// break;
// }
// }

// let content: string[] = Project1;
let title: string = "";
let youtube: string = "";
let image: string = "";
Expand All @@ -46,19 +28,25 @@ function Content() {
case "Y":
youtube = content[i + 1];
content_list.push(
<iframe width="840" height="630" src={youtube}></iframe>
<div className="youtube-container">
<iframe src={youtube}></iframe>
</div>
)
break;
case "I":
image = content[i + 1];
content_list.push(
<img width="840" height="630" src={image}></img>
<div className="image-container">
<img src={image}></img>
</div>
);
break;
case "P":
paragraph = content[i + 1];
content_list.push(
<p>{paragraph}</p>
<div className="text-container">
<p>{paragraph}</p>
</div>
);
break;
}
Expand Down
10 changes: 0 additions & 10 deletions src/components/project_page/content/project1.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions src/components/project_page/content/project2.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions src/components/project_page/content/project3.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/project_page/content/project_paths.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/project_page/content/projects_array.tsx

This file was deleted.

File renamed without changes
68 changes: 68 additions & 0 deletions src/content/projects_content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// This is where all website project content updates should be made

// Array of all project content
const Projects_Content = [
// First Project
[
// Fist Project Card
[
// Card Image
"src/content/assets/demo_img.png",
// Card Title
"Project Title 1",
// Card Paragraph
"Short Description 1"
],

// First Project Page
[
// T = title
// Y = youtube link (don't forget embed)
// I = image
// P = paragraph
"T", "Project 1 Title",
"Y", "https://www.youtube.com/embed/tgbNymZ7vqY",
"P", "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"I", "src/content/assets/demo_img.png",
"P", "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.",
"P", "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."
]
],

[
[
"src/content/assets/demo_img.png",
"Project Title 2",
"Short Description 2: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
],

[
"T", "Project 2 Title",
"Y", "https://www.youtube.com/embed/tgbNymZ7vqY",
"P", "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"I", "src/content/assets/demo_img.png",
"P", "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.",
"P", "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."
]
],

[
[
"src/content/assets/demo_img.png",
"Project Title 3",
"Short Description 3: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
],

[
"T", "Project 3 Title",
"I", "src/content/assets/demo_img.png",
"Y", "https://www.youtube.com/embed/tgbNymZ7vqY",
"P", "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"I", "src/content/assets/demo_img.png",
"P", "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.",
"P", "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."
]
]
];

export default Projects_Content;
4 changes: 2 additions & 2 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ $max-width: 1230px;

iframe{
border: none;
width: 66%;
aspect-ratio: 4/3;
width: 80%;
aspect-ratio: 16/9;
}
}

Expand Down
9 changes: 6 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import Project from "./pages/project"
import About from "./pages/about";
import Contact from "./pages/contact";
import Navigation_Bar from "./components/nav_bar";
import Project_Paths from "./components/project_page/content/project_paths";
import Projects_Content from "./content/projects_content";

function App() {
// let project_path: string = "";
let project_routes: any[] = [];
for (let i = 0; i < Project_Paths.length; i++) {
for (let i = 0; i < Projects_Content.length; i++) {
// project_path = "/:" + Projects_Content[i][1][1].replace(/\s/g, "-"); // Replace spaces with dashes for url
project_routes.push (
<Route path={Project_Paths[i]} element={<Project></Project>}></Route>
// Project_Content[i][1][1] gets first element after descriptor from project page (should probably be a title)
<Route path={`/:${Projects_Content[i][1][1].replace(/\s/g, "-")}`} element={<Project></Project>}></Route>
)
}

Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
base: "/Club-Website",
base: "/", // Why are we changing this?
plugins: [react()],
})

0 comments on commit 621aafc

Please sign in to comment.