react init

This commit is contained in:
Zoey 2024-01-14 09:02:42 +01:00
parent f5d83163eb
commit ba6b25934a
45 changed files with 18560 additions and 933 deletions

23
.gitignore vendored Normal file
View file

@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

70
README.md Normal file
View file

@ -0,0 +1,70 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
The page will reload when you make changes.\
You may also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

View file

@ -1,52 +0,0 @@
@import url('https://fonts.googleapis.com/css2?family=Sarabun&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Sarabun', sans-serif;
font-weight: 400;
display: flex;
flex-direction: column;
align-items: center;
background-color: black;
color: lightpink;
padding-top: 6%;
padding-bottom: 3.5%;
}
/* Centered Content */
.headercontent {
text-align: center;
align-self: flex;
flex-grow: 1;
overflow-y: auto;
height: 100%;
width: 100%
}
.headercontent h1 {
padding-top: 10px;
font-size: 48px;
}
.headercontent h4 {
margin-bottom: 60px;
}
.headercontent p {
margin-bottom: 30px;
}
.TTClogo {
margin-top: 20px;
width: 250px;
margin-bottom: 10px;
}
.ShieldsDiscord {
margin-bottom: 20px;
}

View file

@ -1,20 +0,0 @@
@import url('https://fonts.googleapis.com/css2?family=Sarabun&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Sarabun', sans-serif;
font-weight: 400;
display: flex;
flex-direction: column;
align-items: center;
background-color: black;
color: lightpink;
padding-top: 6%;
padding-bottom: 3.5%;
}

View file

@ -1,29 +0,0 @@
@import url('https://fonts.googleapis.com/css2?family=Sarabun&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Sarabun', sans-serif;
font-weight: 400;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: black;
color: lightpink;
overflow: hidden;
margin: 0;
}
/* Centered Content */
.centered-content {
text-align: center;
}
#blahaj {
opacity: 0;
}

View file

@ -1,249 +0,0 @@
/* Header */
:root {
--background-color-dark: #111111;
--background-color-light: rgb(255, 224, 229);
--article-bg-dark: #161616;
--article-bg-light:#d3adb3;
--color-dark: lightpink;
--color-light: #111111;
--color-button-dark: rgb(160, 61, 76);
--color-buton-light: #333;
--color-button-hover-light: rgb(160, 61, 76);
--color-button-hover-dark: #333;
--color-bg-body-dark: black;
--color-bg-body-light: lightpink;
--color-body-light: lightpink;
--color-body-dark: black;
}
header {
background-color: var(--background-color-dark);
color: var(--color-light);
padding: 5px;
text-align: left;
position: fixed;
width: 100%;
top: 0;
left: 0;
}
/* Footer */
footer {
background-color: #111111;
color: lightpink;
padding: 5px;
text-align: center;
position: fixed;
width: 100%;
bottom: 0;
left: 0;
}
/* Add the following styles for the popup */
.image-popup {
position: relative;
display: inline-block;
max-width: 300px;
width: min-content;
}
.popup-content {
display: none;
position: absolute;
top: 100%;
left: 0;
width: min-content;
background-color: #1d1d1d;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
z-index: 1;
border-radius: 5px;
}
.image-popup:hover .popup-content {
display: flex;
}
.popup-content img {
width: 40px;
height: auto;
margin-right: 10px;
box-sizing: border-box;
transition: transform 0.1s ease-in-out;
}
.popup-content img:last-child {
margin-right: 0;
}
/* Add the following style to remove margin on the last child */
.popup-content > :last-child {
margin-right: 0;
}
.popup-content img:hover {
transform: scale(1.1); /* Add a slight scale effect on hover */
}
/* Navigation in Header*/
nav.top-nav ul {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
align-items: center; /* Align items vertically in the center */
}
nav.top-nav a {
text-decoration: none;
color: inherit;
padding: 10px 15px; /* Adjust padding for better spacing */
transition: color 0.3s; /* Add a smooth transition for color change */
}
nav.top-nav li {
margin: 0 15px;
border-right: 2px solid rgb(0, 0, 0); /* Add a right border to create a separator */
padding-right: 15px; /* Adjust padding for better spacing */
}
/* Style the last li to remove the border */
nav.top-nav li:last-child {
border-right: none;
}
/* Change text color on hover */
nav.top-nav a:hover {
color: rgb(255, 246, 247); /* Change to the desired hover color */
}
/* Navigation in Footer */
nav.bottom-nav ul {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center; /* Center the items horizontally */
align-items: center; /* Align items vertically in the center */
}
nav.bottom-nav li {
margin: 0 15px;
}
/* Navigation links in Footer */
nav.bottom-nav a {
text-decoration: none;
color: inherit;
padding: 10px 15px; /* Adjust padding for better spacing */
transition: color 0.3s; /* Add a smooth transition for color change */
}
/* Change text color on hover */
nav.bottom-nav a:hover {
color: inherit; /* Change to the desired hover color */
}
.toggle-button {
display: flex;
align-items: center;
justify-content: center;
background-color: #333;
color: inherit;
width: 40px;
height: 40px;
padding: 10px 20px;
border-color: #11111100;
border-radius: 5px;
cursor: pointer;
}
.toggle-button img {
transform: scale(.08);
}
input[type="checkbox"] {
display: none;
}
/*ARTICLES*/
#article-list {
flex-direction: column;
text-align: center;
position: fixed;
align-items: flex-start;
left: 0;
width: 20%;
height: 100vh;
background-color: var(--article-bg-dark);
color: var(--color-dark);
overflow-y: auto;
padding-top: 6%;
flex-grow: 1;
}
/* Style for the subtitles */
.article-subtitle {
bottom: 0;
left: 10%;
width: 80%;
padding: 5px;
text-align: center;
position: relative;
font-size: small;
}
/* Style for the container of the article content */
#article-container {
flex-grow: 1;
position: relative;
width: 85%; /* Adjusted width to accommodate the article list */
padding-left: 45%;
padding-right: 20%; /* Add some padding for spacing */
}
#article-container h1 {
text-align: center;
}
#article-container h3 {
text-align: left;
position: absolute;
left: 20%;
margin-top: 2%;
}
#article-container h6 {
text-align: left;
position: absolute;
left: 20%;
margin-top: 5%;
}
#article-container p {
text-align: left;
position: absolute;
left: 20%;
margin-top: 8%;
}
/* Responsive styles for smaller screens */
@media screen and (max-width: 768px) {
body {
padding-top: 10%; /* Adjust as needed */
}
#article-list {
width: 100%;
padding-top: 10%; /* Adjust as needed */
}
#article-container {
margin-left: 0;
width: 100%;
}
}

View file

@ -1,77 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" sizes="48x48" href="/images/bunnie48px.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="dark light">
<title>Zoey's Bits - About</title>
<link rel="stylesheet" href="/css/about.css" type="text/css" media="all">
</head>
<body>
<div id="header-placeholder"></div>
<div class="headercontent">
<h1 id="title">About me!</h1>
<h4 id="subtitle">booba</h4>
<p>
I like bunnies, but don't own any.
</p>
<p>
Mostly a jack of all trades, master of none.
<br>
At least it makes for conversations that don't really die down.
</p>
<p>
Big proponent of Free and Open Source Software.
<br>
Self-hosting Gitea and Nextcloud servers.
<br>
Running Arch Linux (btw) since 2019.
<br>
My first Linux distro was Ubuntu 14.04 in, well.., 2014.
<br>
<p>
Aspiring game dev, doing everything from code,
<br>
through hosting services,
and creating all the 3D models, sprites and soon also sounds.
<br>
Yet to release a single project. ヽ(゚Д゚)ノ
</p>
<p>
Used to, and still do, have a relatively big K-On! oriented Discord server, <br>
like that's anything to brag about, <br>
but it's basically been on maintenance mode for maybe 2 years now. <br>
If you'd still like to join, knock yourself out. <br>
<a href="https://discord.gg/qpsYX58">
<img class="TTClogo" src="/images/TTClatestCircleCrop.png">
<br>
<img class="ShieldsDiscord" alt="Discord" src="https://img.shields.io/discord/625008568369938445?logo=discord">
</a>
<br>
<a href='https://mastodon.online/@sailorzoop'>
<img alt='Mastodon' src='https://img.shields.io/badge/| sailorzoop-darkblue?&logo=mastodon'>
</a>
<a href=''>
<img alt='Discord' src='https://img.shields.io/badge/| @sailorzoop-purple?&logo=discord'>
</a>
<a href='https://matrix.to/#/@sailorzoop:matrix.org'>
<img alt='Matrix' src='https://img.shields.io/badge/| @sailorzoop:matrix.org-darkgreen?&logo=matrix'>
</a>
</p>
</div>
<div id="footer-placeholder"></div>
<script src="/js/loadnavs.js" defer></script>
</body>
</html>

View file

@ -1,8 +0,0 @@
<footer>
<nav class="bottom-nav">
<ul>
<li>© LibreBun™ 2023</li>
</ul>
</nav>
</footer>

View file

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/css/styleHF.css" type="text/css" media="all">
</head>
<body>
<header>
<nav class="top-nav">
<ul>
<li>
<div class="image-popup">
<a href="/index.html">
<img src="/images/bunnie48px.png"></a>
<div class="popup-content">
<a class="gt" href="https://librebun.ooguy.com/gt" target="_blank"><img src="/images/gt.png"></a>
<a class="nc" href="https://librebun.ooguy.com/nc" target="_blank"><img src="/images/nc.png"></a>
</div>
</div>
</li>
<li><a href="/html/projects.html">Projects</a></li>
<li><a href="/html/rants.html">Rants</a></li>
<li><a href="/html/about.html">About</a></li>
<li>
<label for="toggle-checkbox" class="toggle-label">
<button class="toggle-button" onclick="toggleHeaderColor()"><img src="/images/moon.svg"</button>
</label>
</li>
</ul>
</nav>
</header>
<script src="/js/loadnavs.js" defer></script>
</body>
</html>

View file

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" sizes="48x48" href="/images/bunnie48px.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zoey's Bits - Projects</title>
<link rel="stylesheet" href="/css/style.css" type="text/css" media="all">
</head>
<body>
<div id="header-placeholder"></div>
<div class="centered-content">
<h1 id="title">Welcome to the projects section!</h1>
<h3 id="subtitle">WIP</h3>
</div>
<div id="footer-placeholder"></div>
<script src="/js/loadnavs.js" defer></script>
</body>
</html>

View file

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" sizes="48x48" href="/images/bunnie48px.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zoey's Bits - Rants</title>
<script src="https://cdn.jsdelivr.net/npm/showdown/dist/showdown.min.js"></script>
<link rel="stylesheet" href="/css/rants.css" type="text/css" media="all">
</head>
<body>
<div id="article-container"></div>
<div id="article-list"></div>
<div id="header-placeholder"></div>
<div id="footer-placeholder"></div>
<script src="/js/loadnavs.js" defer></script>
<script src="/js/articleload.js" defer></script>
<script src="/js/rants.js" defer></script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View file

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="300"
height="300"
viewBox="0 0 79.374998 79.375"
version="1.1"
id="svg1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
sodipodi:docname="moon.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="2.2022289"
inkscape:cx="128.27913"
inkscape:cy="149.84818"
inkscape:window-width="1916"
inkscape:window-height="1056"
inkscape:window-x="1920"
inkscape:window-y="20"
inkscape:window-maximized="1"
inkscape:current-layer="layer3" />
<defs
id="defs1" />
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2">
<circle
style="display:none;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2.11667;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
id="path4"
cx="39.6875"
cy="39.6875"
r="38.629166" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Layer 3">
<path
id="circle1"
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2.11667;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
d="M 46.058114,4.3440906 A 39.6875,39.6875 0 0 0 18.710238,53.357241 39.6875,39.6875 0 0 0 36.600488,76.534986 37.765205,46.535679 29.487085 0 1 40.156987,32.694321 37.765205,46.535679 29.487085 0 1 74.832599,7.1323231 39.6875,39.6875 0 0 0 46.058114,4.3440906 Z" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View file

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="300"
height="300"
viewBox="0 0 79.374998 79.375"
version="1.1"
id="svg1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
sodipodi:docname="sun.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="2.2022289"
inkscape:cx="128.27913"
inkscape:cy="149.84818"
inkscape:window-width="1916"
inkscape:window-height="1056"
inkscape:window-x="1920"
inkscape:window-y="20"
inkscape:window-maximized="1"
inkscape:current-layer="layer3" />
<defs
id="defs1" />
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2">
<circle
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2.11667;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
id="path4"
cx="39.6875"
cy="39.6875"
r="38.629166" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Layer 3">
<path
id="circle1"
style="display:none;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2.11667;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
d="M 46.058114,4.3440906 A 39.6875,39.6875 0 0 0 18.710238,53.357241 39.6875,39.6875 0 0 0 36.600488,76.534986 37.765205,46.535679 29.487085 0 1 40.156987,32.694321 37.765205,46.535679 29.487085 0 1 74.832599,7.1323231 39.6875,39.6875 0 0 0 46.058114,4.3440906 Z" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 KiB

View file

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" sizes="48x48" href="/images/bunnie48px.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zoey's Bits</title>
<link rel="stylesheet" href="/css/style.css" type="text/css" media="all">
<script src="/js/loadnavs.js" defer></script>
</head>
<body>
<div id="header-placeholder"></div>
<div class="centered-content">
<h1 id="title">Welcome to my Website!</h1>
<h3 id="subtitle">WIP</h3>
<img src="/images/under_construction.gif" alt="Under Construction">
<h3 id="blahaj">blahaj dance</h3>
</div>
<div id="footer-placeholder"></div>
</body>
</html>

View file

@ -1,23 +0,0 @@
// Function to convert Markdown to HTML
function convertMarkdownToHTML(markdownContent) {
// Simple Markdown to HTML conversion
// This is a basic example and may not cover all Markdown features
// You may need to enhance this function based on your requirements
return markdownContent
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>') // Bold
.replace(/\*(.*?)\*/g, '<em>$1</em>'); // Italics
}
// Function to fetch and display an article
function displayArticle(articlePath) {
fetch(articlePath)
.then(response => response.text())
.then(markdownContent => {
const htmlContent = convertMarkdownToHTML(markdownContent);
document.getElementById('article-container').innerHTML = htmlContent;
})
.catch(error => console.error('Error fetching article:', error));
}
// Call the function with the path to your Markdown file
displayArticle('/md/rants/test.md');

View file

@ -1,90 +0,0 @@
document.addEventListener('DOMContentLoaded', function () {
console.log('DOMContentLoaded event fired');
// Wait for the DOM to load
// Load header and footer
loadContent('/html/elements/header.html', document.getElementById('header-placeholder'))
.then(() => {
toggleHeaderColor();
// After loading the header content, initialize toggle button and checkbox for header color
const toggleButton = document.querySelector('button.toggle-button');
});
loadContent('/html/elements/footer.html', document.getElementById('footer-placeholder'));
// Load external stylesheets
loadStylesheet('/css/style.css'); // Add more stylesheets if needed
loadStylesheet('/css/styleHF.css');
// Retrieve the header element
const header = document.querySelector('header');
// Check if the header element exists before initializing the toggle button
if (header) {
// Call the function once to set the initial header color based on checkbox state
toggleHeaderColor();
}
});
async function loadContent(url, container) {
try {
const response = await fetch(url);
const html = await response.text();
container.innerHTML = html;
// After loading the content, load any stylesheets within it
const stylesheets = container.querySelectorAll('link[rel="stylesheet"]');
stylesheets.forEach(stylesheet => {
const href = stylesheet.getAttribute('href');
loadStylesheet(href);
});
} catch (error) {
console.error('Error loading content:', error);
}
}
function loadStylesheet(href) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = href;
document.head.appendChild(link);
}
let isLightMode = true;
function toggleHeaderColor() {
const header = document.querySelector('header');
const togglebutton = document.querySelector('.toggle-button');
const body = document.querySelector('body');
const articlelist = document.querySelector('#article-list');
isLightMode = !isLightMode;
if (!isLightMode) {
header.style.backgroundColor = 'var(--background-color-dark)';
header.style.color = 'var(--color-dark)';
togglebutton.backgroundColor = 'var(--color-button-dark)';
togglebutton.classList.add('dark-mode');
togglebutton.classList.remove('light-mode');
body.style.backgroundColor = 'var(--color-bg-body-dark)';
body.style.color = 'var(--color-bg-body-light)';
articlelist.style.backgroundColor = 'var(--article-bg-dark)';
articlelist.style.color = 'var(--color-dark)';
} else {
header.style.backgroundColor = 'var(--background-color-light)';
header.style.color = 'var(--color-light)';
togglebutton.backgroundColor = 'var(--color-button-light)';
togglebutton.classList.add('light-mode');
togglebutton.classList.remove('dark-mode');
body.style.backgroundColor = 'var(--color-bg-body-light)';
body.style.color = 'var(--color-bg-body-dark)';
articlelist.style.backgroundColor = 'var(--article-bg-light)';
articlelist.style.color = 'var(--color-light)';
}
}

View file

@ -1,79 +0,0 @@
const articles = [
{ title: 'Electron', subtitle: '', path: '/md/rants/electron.md' },
{ title: 'Discord', subtitle: '', path: '/md/rants/discord.md' },
{ title: 'Wayland', subtitle: '', path: '/md/rants/wayland.md' },
];
const showdownConverter = new showdown.Converter();
function createArticleBox(article) {
const articleBox = document.createElement('div');
articleBox.className = 'article-box';
articleBox.setAttribute('data-path', article.path);
const titleElement = document.createElement('h3');
titleElement.textContent = article.title;
const subtitleElement = document.createElement('p');
subtitleElement.textContent = article.subtitle;
subtitleElement.className = 'article-subtitle';
articleBox.appendChild(titleElement);
articleBox.appendChild(subtitleElement);
articleBox.addEventListener('click', () => {
loadArticle(article.path);
updateArticleBoxContent(article.path, article.title, article.subtitle);
});
return articleBox;
}
function createArticleList() {
const articleListContainer = document.getElementById('article-list');
articles.forEach(article => {
const articleBox = createArticleBox(article);
articleListContainer.appendChild(articleBox);
});
}
function loadArticle(articlePath) {
fetch(articlePath)
.then(response => response.text())
.then(markdownContent => {
const { title, subtitle } = extractTitleAndSubtitle(markdownContent);
const htmlContent = showdownConverter.makeHtml(markdownContent);
document.getElementById('article-container').innerHTML = htmlContent;
updateArticleBoxContent(articlePath, title, subtitle);
})
.catch(error => console.error('Error fetching article:', error));
}
function extractTitleAndSubtitle(markdownContent) {
const lines = markdownContent.split('\n');
const title = lines[0] ? lines[0].replace(/^#+\s*/, '').trim() : 'Untitled';
const subtitle = lines[3] ? lines[3].replace(/^#+\s*/, '').trim() : '';
return { title, subtitle };
}
function updateArticleBoxContent(articlePath, title, subtitle) {
const articleBox = document.querySelector(`.article-box[data-path="${articlePath}"]`);
if (articleBox) {
articleBox.innerHTML = '';
const titleElement = document.createElement('h3');
titleElement.textContent = title;
const subtitleElement = document.createElement('p');
subtitleElement.textContent = subtitle;
subtitleElement.className = 'article-subtitle';
articleBox.appendChild(titleElement);
articleBox.appendChild(subtitleElement);
}
}
// Load the functions when the DOM is fully loaded
document.addEventListener('DOMContentLoaded', () => {
createArticleList();
if (articles.length > 0) {
loadArticle(articles[0].path);
}
});

View file

@ -1,43 +0,0 @@
document.addEventListener('DOMContentLoaded', function () {
const title = document.querySelector('#title');
const subtitle = document.querySelector('#subtitle');
const blahaj = document.querySelector('#blahaj');
function handleClick() {
// Move elements up and fade them out
title.animate(
[
{ transform: 'translateY(0)', opacity: 1 },
{ transform: 'translateY(-50px)', opacity: 0 }
],
{ duration: 1000, easing: 'ease-out', fill: 'forwards' }
);
subtitle.animate(
[
{ transform: 'translateY(0)', opacity: 1 },
{ transform: 'translateY(-50px)', opacity: 0 }
],
{ duration: 1000, easing: 'ease-out', fill: 'forwards', delay: 200 }
);
blahaj.animate(
[
{ transform: 'translateY(-50px)', opacity: 0 },
{ transform: 'translateY(-0px)', opacity: 1 }
],
{ duration: 500, easing: 'ease-out', fill: 'forwards', delay: 400 }
);
// Remove the event listener after it has been triggered
document.body.removeEventListener('click', handleClick);
title.addEventListener('animationend', function () {
title.remove();
});
subtitle.addEventListener('animationend', function () {
subtitle.remove();
});
}
});

View file

@ -1,3 +0,0 @@
{
"godotver": "4.2.1"
}

View file

@ -1,10 +0,0 @@
# Discord
###### 20th December 2023 - Zoey
<br>
### Here's the reason I hate Discord.
<br>
lorem ipsum butts and cakes, you are now my favourite person who bakes
this is still the same paragraph
yeah
<br>
butts

View file

@ -1,6 +0,0 @@
# Electron
###### 21th December 2023 - Zoey
<br>
### Electron is awful and here's why.
<br>
Lorem ipsum motherfuckerssss

View file

@ -1,6 +0,0 @@
# Wayland
######22th December 2023 - Zoey
<br>
### Insane defaults.
<br>
Lorem ipsum motherfuckerssss

View file

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Not Found</title>
<link href="/style.css" rel="stylesheet" type="text/css" media="all">
</head>
<body>
<div class="centered-content">
<h1>Page Not Found</h1>
<p>There's nobunny here.</p>
</div>
</body>
</html>

18201
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

41
package.json Normal file
View file

@ -0,0 +1,41 @@
{
"name": "zoeysbits",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"tailwindcss": "^3.4.1"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

43
public/index.html Normal file
View file

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

BIN
public/logo192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
public/logo512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

25
public/manifest.json Normal file
View file

@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

3
public/robots.txt Normal file
View file

@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

43
src/App.css Normal file
View file

@ -0,0 +1,43 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind variants;
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

25
src/App.js Normal file
View file

@ -0,0 +1,25 @@
import logo from './logo.svg';
import './App.css';
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and butt to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}
export default App;

8
src/App.test.js Normal file
View file

@ -0,0 +1,8 @@
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

13
src/index.css Normal file
View file

@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

17
src/index.js Normal file
View file

@ -0,0 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

21
src/logo.svg Normal file
View file

@ -0,0 +1,21 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" width="200" height="200">
<!-- Bunny body -->
<ellipse cx="100" cy="150" rx="80" ry="100" fill="#f5c7a1"/>
<!-- Bunny head -->
<circle cx="100" cy="70" r="50" fill="#f5c7a1"/>
<!-- Bunny eyes -->
<circle cx="80" cy="60" r="5" fill="#000"/>
<circle cx="120" cy="60" r="5" fill="#000"/>
<!-- Bunny nose -->
<polygon points="100,70 95,80 105,80" fill="#000"/>
<!-- Bunny ears -->
<polygon points="50,30 80,10 90,30" fill="#f5c7a1"/>
<polygon points="110,30 140,10 150,30" fill="#f5c7a1"/>
<!-- Bunny mouth -->
<path d="M 90 80 Q 100 90 110 80" fill="transparent" stroke="#000" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 743 B

13
src/reportWebVitals.js Normal file
View file

@ -0,0 +1,13 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;

5
src/setupTests.js Normal file
View file

@ -0,0 +1,5 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

9
tailwind.config.js Normal file
View file

@ -0,0 +1,9 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}