made navbar and sidebars dynamic, cba editing all of them each time i do an update

This commit is contained in:
2026-03-07 13:08:48 +02:00
parent ab7dac6bd3
commit ae981c2adb
4 changed files with 658 additions and 259 deletions

110
components.js Normal file
View File

@@ -0,0 +1,110 @@
document.addEventListener("DOMContentLoaded", function () {
// Create the navbar HTML
const navbar = `
<nav id="navbar" style="margin-bottom: 10px">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="reviews.html">Reviews</a></li>
<li><a href="https://git.moonsbian.gay/">Git</a></li>
</ul>
</nav>`;
// Inject it into the placeholder
const navPlaceholder = document.getElementById("navbar-container");
if (navPlaceholder) navPlaceholder.innerHTML = navbar;
const leftSidebar = `
<h2>Updates (Content)</h2>
<div class="box">
<p>
This is where things like new things put on the website
are shown, if I consider them important enough to
remember to add :p
</p>
<ul style="padding-left: 10px">
<li>Placeholder</li>
<li>Placeholder</li>
<li>Placeholder</li>
<li>Placeholder</li>
</ul>
</div>
<!--
<h2>Hi there!</h2>
<h3>Other Tools</h3>
<ul>
<li>
<a
href="https://sadgrlonline.github.io/html-cheatsheet/"
target="_blank"
>HTML Cheatsheet</a
>
</li>
<li>
<a
href="webmastery/webmaster-links.html"
target="_blank"
>Webmaster Links</a
>
</li>
<li>
<a
href="webmastery/downloads/tiledbgs.html"
target="_blank"
>Tiled BGs</a
>
</li>
<li>
<a
href="webmastery/downloads/fonts.html"
target="_blank"
>Fonts</a
>
</li>
<li>
<a href="projects/ideas/" target="_blank">Site Ideas</a>
</li>
</ul>
`;
const rightSidebar = `
<h2>Updates (Website)</h2>
<div class="box">
<p>
Updates regarding the website, style, layout, new
features
</p>
<ul style="padding-left: 10px">
<li>
No longer just a white blank page with placeholder
text on it
</li>
<li>Reviews page</li>
</ul>
</div>
<h2>:3</h2>
<h3>Other Sites/Tools I like</h3>
<ul>
<li>
<a href="https://sadgrl.online/" target="_blank"
>Sadgrl.online</a
>
</li>
<li>
<a href="https://neocities.org/" target="_blank"
>Neocities</a
>
<p>Go make a personal website, it's fun!</p>
</li>
</ul>
`;
const leftSidebarPlaceholder = document.getElementById(
"leftSidebarPlaceholder",
);
const rightSidebarPlaceholder = document.getElementById(
"rightSidebarPlaceholder",
);
if (leftSidebarPlaceholder) leftSidebarPlaceholder.innerHTML = leftSidebar;
if (rightSidebarPlaceholder)
rightSidebarPlaceholder.innerHTML = rightSidebar;
});

View File

@@ -1 +0,0 @@
document.write("<script src='"+document.currentScript.src+"/?clt="+(localStorage.getItem('compteurlt')||0)+"&ca="+(localStorage.getItem('compteuraut')||0)+"&s="+encodeURIComponent(window.location.hostname)+"'></script>");

View File

@@ -1,75 +1,53 @@
<body>
<div id="container"><div id="header" style="height: 188px;"></div>
<div id="container">
<div id="header" style="height: 188px"></div>
<div id="headerArea">
<nav id="navbar" style="margin-bottom: 10px;"><ul>
<li><a href="#">Home</a></li>
<li><a href="https://file.moonsbian.gay/admin">Moonfile</a></li>
<li><a href="https://convert.moonsbian.gay/">Convert</a></li>
<li><a href="https://git.moonsbian.gay/">Git</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul></nav></div>
<div id="navbar-container"></div>
</div>
<div id="flex">
<aside id="leftSidebar" style="margin-right: 10px;">
<script type="text/javascript" src="https://moonsbian.gay/counter.js"></script>
<h2>Updates</h2>
<div class="box">
<p>I have recently updated this tool as of August 2022!</p>
<ul style="padding-left:10px;">
<li>Rewrote the JS to generate cleaner code</li>
<li>Rewrote the CSS in a way that hopefully makes much more sense to edit</li>
<li>Added a couple of new features!</li>
<li>Old version is still available <a href="old.html" target="_blank">here</a></li>
</ul>
</div>
<h2>Hi there!</h2>
<h3>Other Tools</h3>
<ul>
<li><a href="https://sadgrlonline.github.io/html-cheatsheet/" target="_blank">HTML Cheatsheet</a>
</li><li><a href="webmastery/webmaster-links.html" target="_blank">Webmaster Links</a></li>
<li><a href="webmastery/downloads/tiledbgs.html" target="_blank">Tiled BGs</a></li>
<li><a href="webmastery/downloads/fonts.html" target="_blank">Fonts</a></li>
<li><a href="projects/ideas/" target="_blank">Site Ideas</a></li>
</ul>
<!-- left !-->
<aside id="leftSidebar" style="margin-right: 10px">
<script
type="text/javascript"
src="https://counter.websiteout.com/js/30/0/0/0"
></script>
<div id="leftSidebarPlaceholder"></div>
</aside>
<!-- MIDDLE !-->
<main>
<marquee><h1>Welcome to the website!</h1></marquee>
<p><strong>Not much here for now :)</strong></p>
<p>Just barely had stuff changed after being made with sadgrl.online layout maker</p>
<p> - Cat Ipsum - </p>
<p>Rub my belly hiss swipe at owner's legs sniff catnip and act crazy growl at dogs in my sleep sit on the laptop for hiss at vacuum cleaner i like to spend my days sleeping and eating fishes that my human fished for me.</p>
<p>Head nudges eat my own ears. Hey! you there, with the hands why can't i catch that stupid red dot, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff, or roll over and sun my belly curl up and sleep on the freshly laundered towels.</p>
<p>
Just barely had stuff changed after being made with
sadgrl.online layout maker
</p>
<p>- Cat Ipsum -</p>
<p>
Rub my belly hiss swipe at owner's legs sniff catnip and act
crazy growl at dogs in my sleep sit on the laptop for hiss
at vacuum cleaner i like to spend my days sleeping and
eating fishes that my human fished for me.
</p>
<p>
Head nudges eat my own ears. Hey! you there, with the hands
why can't i catch that stupid red dot, shed everywhere shed
everywhere stretching attack your ankles chase the red dot,
hairball run catnip eat the grass sniff, or roll over and
sun my belly curl up and sleep on the freshly laundered
towels.
</p>
</main>
<aside id="rightSidebar" style="margin-left: 10px;">
<h2>Updates</h2>
<div class="box">
<p>It's a page now!</p>
<ul style="padding-left:10px;">
<li>No longer just a white blank page with placeholder text on it</li>
<li>Now links to the other sites under the moonsbian.gay domain</li>
</ul>
</div>
<h2>Hi there!</h2>
<h3>Other Tools</h3>
<ul>
<li><a href="https://sadgrlonline.github.io/html-cheatsheet/" target="_blank">HTML Cheatsheet</a>
</li><li><a href="webmastery/webmaster-links.html" target="_blank">Webmaster Links</a></li>
<li><a href="webmastery/downloads/tiledbgs.html" target="_blank">Tiled BGs</a></li>
<li><a href="webmastery/downloads/fonts.html" target="_blank">Fonts</a></li>
<li><a href="projects/ideas/" target="_blank">Site Ideas</a></li>
</ul>
<!-- right !-->
<aside id="rightSidebar" style="margin-left: 10px">
<div id="rightSidebarPlaceholder"></div>
</aside>
</div>
<footer id="footer" style="margin-top: 10px;"></footer></div>
<footer id="footer" style="margin-top: 10px"></footer>
</div>
<!-- THIS IS THE CSS !-->
<style>
/* user styles */
@@ -81,11 +59,11 @@
the images as variables */
:root {
--header-image: url('https://sadhost.neocities.org/images/layouts/wp.jpeg');
--body-bg-image: url('https://sadhost.neocities.org/images/tiles/heartstring.gif');
--header-image: url("https://sadhost.neocities.org/images/layouts/wp.jpeg");
--body-bg-image: url("https://sadhost.neocities.org/images/tiles/heartstring.gif");
/* colors */
--content: #43256E;
--content: #43256e;
}
/* if you have the URL of a font, you can set it below */
@@ -101,32 +79,32 @@
@font-face {
font-family: Nunito;
src: url('https://sadhost.neocities.org/fonts/Nunito-Regular.ttf');
src: url("https://sadhost.neocities.org/fonts/Nunito-Regular.ttf");
}
@font-face {
font-family: Nunito;
src: url('https://sadhost.neocities.org/fonts/Nunito-Bold.ttf');
src: url("https://sadhost.neocities.org/fonts/Nunito-Bold.ttf");
font-weight: bold;
}
@font-face {
font-family: Nunito;
src: url('https://sadhost.neocities.org/fonts/Nunito-Italic.ttf');
src: url("https://sadhost.neocities.org/fonts/Nunito-Italic.ttf");
font-style: italic;
}
@font-face {
font-family: Nunito;
src: url('https://sadhost.neocities.org/fonts/Nunito-BoldItalic.ttf');
src: url("https://sadhost.neocities.org/fonts/Nunito-BoldItalic.ttf");
font-style: italic;
font-weight: bold;
}
body {
font-family: 'Nunito', sans-serif;
font-family: "Nunito", sans-serif;
margin: 0;
background-color: #08031A;
background-color: #08031a;
/* you can delete the line below if you'd prefer to not use an image */
background-size: 65px;
color: #fceaff;
@@ -143,7 +121,6 @@
to uncomment a line of CSS, remove the * and the /
before and after the text */
/* the "container" is what wraps your entire website */
/* if you want something (like the header) to be Wider than
the other elements, you will need to move that div outside
@@ -201,7 +178,7 @@
/* navigation links*/
#navbar li a {
color: #ED64F5;
color: #ed64f5;
/* navbar text color */
font-weight: 800;
text-decoration: none;
@@ -229,7 +206,6 @@
/* this makes the sidebar text slightly smaller */
}
/* this is the color of the main content area,
between the sidebars! */
main {
@@ -254,7 +230,7 @@
}
footer {
background-color: #13092D;
background-color: #13092d;
/* background color for footer */
width: 100%;
height: 40px;
@@ -266,7 +242,7 @@
h1,
h2,
h3 {
color: #ED64F5;
color: #ed64f5;
}
h1 {
@@ -275,13 +251,13 @@
strong {
/* this styles bold text */
color: #ED64F5;
color: #ed64f5;
}
/* this is just a cool box, it's the darker colored one */
.box {
background-color: #13092D;
border: 1px solid #ED64F5;
background-color: #13092d;
border: 1px solid #ed64f5;
padding: 10px;
}
@@ -292,10 +268,9 @@
height: 30px;
padding: 10px;
font-size: smaller;
background-color: #13092D;
background-color: #13092d;
}
/* BELOW THIS POINT IS MEDIA QUERY */
/* so you wanna change the width of your page?
@@ -335,4 +310,5 @@
}
}
</style>
<script src="components.js"></script>
</body>

314
reviews.html Normal file
View File

@@ -0,0 +1,314 @@
<body>
<div id="container">
<div id="header" style="height: 188px"></div>
<div id="headerArea">
<div id="navbar-container"></div>
</div>
<div id="flex">
<!-- left !-->
<aside id="leftSidebar" style="margin-right: 10px">
<script
type="text/javascript"
src="https://counter.websiteout.com/js/30/0/0/0"
></script>
<div id="leftSidebarPlaceholder">
<p>This content failed to load, try enabling javascript</p>
</div>
</aside>
<!-- MIDDLE !-->
<main>
<h1>Reviews!</h1>
<p><strong>Categories</strong></p>
<ul>
<li>
<a href="">Games</a>
</li>
<li>
<a href="">Movies</a>
</li>
<li>
<a href="">TV/Series</a>
</li>
<li>
<a href="">Books</a>
</li>
<li>
<a href="">Comics/Manga etc.</a>
</li>
</ul>
</main>
<!-- right !-->
<aside id="rightSidebar" style="margin-left: 10px">
<div id="rightSidebarPlaceholder">
<p>This content failed to load, try enabling javascript</p>
</div>
</aside>
</div>
<footer id="footer" style="margin-top: 10px"></footer>
</div>
<!-- THIS IS THE CSS !-->
<style>
/* user styles */
/* styles are what change the color and sizes of stuff on your site. */
/* these are variables that are being used in the code
these tended to confuse some people, so I only kept
the images as variables */
:root {
--header-image: url("https://sadhost.neocities.org/images/layouts/wp.jpeg");
--body-bg-image: url("https://sadhost.neocities.org/images/tiles/heartstring.gif");
/* colors */
--content: #43256e;
}
/* if you have the URL of a font, you can set it below */
/* feel free to delete this if it's not your vibe */
/* this seems like a lot for just one font and I would have to agree
but I wanted to include an example of how to include a custom font.
If you download a font file you can upload it onto your Neocities
and then link it! Many fonts have separate files for each style
(bold, italic, etc. T_T) which is why there are so many!
*/
@font-face {
font-family: Nunito;
src: url("https://sadhost.neocities.org/fonts/Nunito-Regular.ttf");
}
@font-face {
font-family: Nunito;
src: url("https://sadhost.neocities.org/fonts/Nunito-Bold.ttf");
font-weight: bold;
}
@font-face {
font-family: Nunito;
src: url("https://sadhost.neocities.org/fonts/Nunito-Italic.ttf");
font-style: italic;
}
@font-face {
font-family: Nunito;
src: url("https://sadhost.neocities.org/fonts/Nunito-BoldItalic.ttf");
font-style: italic;
font-weight: bold;
}
body {
font-family: "Nunito", sans-serif;
margin: 0;
background-color: #08031a;
/* you can delete the line below if you'd prefer to not use an image */
background-size: 65px;
color: #fceaff;
background-image: var(--body-bg-image);
}
* {
box-sizing: border-box;
}
/* below this line is CSS for the layout */
/* this is a CSS comment
to uncomment a line of CSS, remove the * and the /
before and after the text */
/* the "container" is what wraps your entire website */
/* if you want something (like the header) to be Wider than
the other elements, you will need to move that div outside
of the container */
#container {
max-width: 900px;
/* this is the width of your layout! */
/* if you change the above value, scroll to the bottom
and change the media query according to the comment! */
margin: 0 auto;
/* this centers the entire page */
}
/* the area below is for all links on your page
EXCEPT for the navigation */
#container a {
color: #fcc3ff;
font-weight: bold;
/* if you want to remove the underline
you can add a line below here that says:
text-decoration:none; */
}
#header {
width: 100%;
background-color: #ffa6da;
/* header color here! */
height: 150px;
/* this is only for a background image! */
/* if you want to put images IN the header,
you can add them directly to the <div id="header"></div> element! */
background-image: var(--header-image);
background-size: 100%;
}
/* navigation section!! */
#navbar {
height: 40px;
background-color: #a0006b;
/* navbar color */
width: 100%;
}
#navbar ul {
display: flex;
padding: 0;
margin: 0;
list-style-type: none;
justify-content: space-evenly;
}
#navbar li {
padding-top: 10px;
}
/* navigation links*/
#navbar li a {
color: #ed64f5;
/* navbar text color */
font-weight: 800;
text-decoration: none;
/* this removes the underline */
}
/* navigation link when a link is hovered over */
#navbar li a:hover {
color: #a49cba;
text-decoration: underline;
}
#flex {
display: flex;
}
/* this colors BOTH sidebars
if you want to style them separately,
create styles for #leftSidebar and #rightSidebar */
aside {
background-color: #a0006b;
width: 200px;
padding: 20px;
font-size: smaller;
/* this makes the sidebar text slightly smaller */
}
/* this is the color of the main content area,
between the sidebars! */
main {
background-color: #bd2289;
flex: 1;
padding: 20px;
order: 2;
}
/* what's this "order" stuff about??
allow me to explain!
if you're using both sidebars, the "order" value
tells the CSS the order in which to display them.
left sidebar is 1, content is 2, and right sidebar is 3! */
#leftSidebar {
order: 1;
}
#rightSidebar {
order: 3;
}
footer {
background-color: #13092d;
/* background color for footer */
width: 100%;
height: 40px;
padding: 10px;
text-align: center;
/* this centers the footer text */
}
h1,
h2,
h3 {
color: #ed64f5;
}
h1 {
font-size: 25px;
}
strong {
/* this styles bold text */
color: #ed64f5;
}
/* this is just a cool box, it's the darker colored one */
.box {
background-color: #13092d;
border: 1px solid #ed64f5;
padding: 10px;
}
/* CSS for extras */
#topBar {
width: 100%;
height: 30px;
padding: 10px;
font-size: smaller;
background-color: #13092d;
}
/* BELOW THIS POINT IS MEDIA QUERY */
/* so you wanna change the width of your page?
by default, the container width is 900px.
in order to keep things responsive, take your new height,
and then subtrack it by 100. use this new number as the
"max-width" value below
*/
@media only screen and (max-width: 800px) {
#flex {
flex-wrap: wrap;
}
aside {
width: 100%;
}
/* the order of the items is adjusted here for responsiveness!
since the sidebars would be too small on a mobile device.
feel free to play around with the order!
*/
main {
order: 1;
}
#leftSidebar {
order: 2;
}
#rightSidebar {
order: 3;
}
#navbar ul {
flex-wrap: wrap;
}
}
</style>
<script src="components.js"></script>
</body>