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
1 parent
7392d0f
commit 97be680
Showing
26 changed files
with
260 additions
and
15 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 @@ | ||
--- | ||
title: "SinaRun" | ||
description: "Minimalist 3D platform/racing game, available on Steam" | ||
featured: true | ||
--- | ||
|
||
Hello |
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,7 @@ | ||
--- | ||
title: "fairedesjeux.fr" | ||
description: "French website to learn how to make games" | ||
featured: true | ||
--- | ||
|
||
hello |
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,7 @@ | ||
--- | ||
title: "wiki.fairedesjeux.fr" | ||
description: "A wiki for fairedesjeux.fr" | ||
featured: true | ||
--- | ||
|
||
hello |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { BaseObject, postProcessBase } from "./shared" | ||
import { basename, dirname } from "path" | ||
|
||
interface Project extends BaseObject { | ||
type: ProjectType | ||
title: string | ||
startDate: Date | ||
endDate?: Date | ||
logo?: URL | ||
miniLogo?: URL | ||
githubRepo?: URL | ||
featured: boolean | ||
} | ||
|
||
enum ProjectType { | ||
GAME = "game", | ||
WEBSITE = "website", | ||
SOFTWARE = "software", | ||
} | ||
|
||
function postProcessProject(project: Project): Project { | ||
project = postProcessBase(project) as Project | ||
|
||
project.type = getProjectTypeFromURL(project.file.pathname) | ||
project.url = new URL(`/projects/${project.type}s/${project.slug}`, "http://localhost:3000") | ||
project.miniLogo = new URL(project.url + "/mini-logo.png") | ||
|
||
// NOTE: Workaround an Astro bug regarding dates in frontmatter, see data/articles.ts for more info | ||
if (typeof project.startDate === "string") { | ||
project.startDate = new Date(project.startDate) | ||
} | ||
|
||
if (typeof project.endDate === "string") { | ||
project.endDate = new Date(project.endDate) | ||
} | ||
|
||
return project | ||
} | ||
|
||
function getProjectTypeFromURL(path: string): ProjectType { | ||
return basename(dirname(path)).slice(0, -1) as ProjectType | ||
} | ||
|
||
export { Project, ProjectType, postProcessProject } |
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
2 changes: 1 addition & 1 deletion
2
src/pages/catalogue.json.astro → src/pages/catalogue/content.json.astro
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
Empty file.
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,56 @@ | ||
--- | ||
import BaseLayout from "$layouts/BaseLayout.astro" | ||
import { postProcessProject, Project, ProjectType } from "$data/projects" | ||
let projects = Astro.fetchContent("../../content/projects/**/*.md") | ||
projects = projects.map((project) => postProcessProject(project)) | ||
// Create an object with sub-objects corresponding to the different types of projects that exist | ||
// The cool part about this: it's 100% automated based on types and content, we'll practically never have to touch this | ||
type ProjectList = { | ||
[projectType in ProjectType]?: Project[] | ||
} | ||
const projectsPerType: ProjectList = {} | ||
Object.values(ProjectType).forEach((projectType) => { | ||
projectsPerType[projectType] = projects.filter((project) => project.type === projectType) | ||
}) | ||
// Utils | ||
function capitalizeFirstLetter(string) { | ||
return string.charAt(0).toUpperCase() + string.slice(1) | ||
} | ||
--- | ||
|
||
<BaseLayout title="Projects"> | ||
<article class="w-index mx-auto mt-4 sm:mt-6"> | ||
<h2>Projects</h2> | ||
|
||
<p> | ||
A list of my projects, it isn't necessarily exhaustive and mostly contain the projects I'm the | ||
most proud of. Additionally, projects marked with a star (🌟) are featured projects I'm even | ||
more proud of! | ||
</p> | ||
|
||
To see more projects, feel free to visit my <a href="https://github.com/Princesseuh">GitHub</a> or | ||
for games, my <a href="https://princesseuh.itch.io/">Itch.io</a> | ||
|
||
{Object.entries(projectsPerType) | ||
.filter((type) => type[1].length > 0) | ||
.map((type) => <div> | ||
<h3>{capitalizeFirstLetter(type[0]) + "s"}</h3> | ||
<div class="flex gap-4"> | ||
{type[1].map( (project) => <a href={project.url} class={project.featured ? "project-box project-featured" : "project-box"}> | ||
{project.featured && <span class="absolute right-2 top-1 w-5 h-5 fill-current" title="Featured project"> | ||
🌟 | ||
</span>} | ||
<img src={project.miniLogo} class="w-[48px] h-[48px] mr-4" /> | ||
<div> | ||
<h4 class="block font-bold m-0">{project.title}</h4> | ||
<span class="text-sm text-creative-work">{project.description}</span> | ||
</div> | ||
</a>, )} | ||
</div> | ||
</div>)} | ||
</article> | ||
</BaseLayout> |
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,49 @@ | ||
--- | ||
import BaseLayout from "$layouts/BaseLayout.astro" | ||
--- | ||
|
||
<BaseLayout> | ||
<article class="post"> | ||
<h1>Settings</h1> | ||
|
||
<p>Trying to make it feel more like home, eh?</p> | ||
|
||
<div> | ||
<input type="checkbox" id="cb--spa" /> | ||
<label for="cb--spa"> Disable SPA (page will reload) </label><br /> | ||
|
||
<input type="checkbox" id="cb--transitions" /> | ||
<label for="cb--transitions"> Disable page transitions </label><br /> | ||
|
||
<input type="checkbox" id="cb--prefetch" /> | ||
<label for="cb--prefetch"> | ||
Disable page prefetch (using <a href="https://getquick.link/">Quicklink</a>) | ||
</label><br /> | ||
</div> | ||
</article> | ||
|
||
<script> | ||
;(function () { | ||
const disableSPA = document.getElementById("cb--spa") | ||
const disableTransitions = document.getElementById("cb--transitions") | ||
const disablePrefetch = document.getElementById("cb--prefetch") | ||
disableSPA.checked = localStorage.getItem("spaDisabled") == "true" | ||
disableTransitions.disabled = disableSPA.checked | ||
disableTransitions.checked = localStorage.getItem("transitionsDisabled") == "true" | ||
disablePrefetch.checked = localStorage.getItem("prefetchDisabled") == "true" | ||
|
||
disableSPA.addEventListener("change", () => { | ||
localStorage.setItem("spaDisabled", disableSPA.checked ? "true" : "false") | ||
location.reload() | ||
}) | ||
|
||
disableTransitions.addEventListener("change", () => { | ||
localStorage.setItem("transitionsDisabled", disableTransitions.checked ? "true" : "false") | ||
}) | ||
|
||
disablePrefetch.addEventListener("change", () => { | ||
localStorage.setItem("prefetchDisabled", disablePrefetch.checked ? "true" : "false") | ||
}) | ||
})() | ||
</script> | ||
</BaseLayout> |
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
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