Skip to content

Commit

Permalink
Merge branch 'logic-rewrite'
Browse files Browse the repository at this point in the history
  • Loading branch information
MotorTruck1221 committed Jan 15, 2025
2 parents c5799fb + d17d008 commit 660e4c3
Show file tree
Hide file tree
Showing 46 changed files with 2,677 additions and 1,086 deletions.
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"chalk": "^5.4.1",
"fastify": "^5.2.0",
"gradient-string": "^3.0.0",
"nanostores": "^0.11.3",
"pg": "^8.13.1",
"pg-hstore": "^2.3.4",
"sequelize": "^6.37.5",
Expand Down
295 changes: 151 additions & 144 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions server/dbSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ async function setupDB(db: ModelStatic<CatalogModel>) {
tags: ["Theme", "Simple", "Dark", "Retro"],
payload: "retro.css",
type: "theme"
},
{
package_name: 'gyatt',
title: 'gyatt',
image: 'gyatt',
author: "nebuka",
version: "2",
description: "e",
tags: [ "e" ],
payload: "gyatt.js",
type: "plugin-page"
}
//To add plugins: plugin types consist of plugin-sw (workerware) & plugin-page (uv.config.inject)
];
Expand Down
50 changes: 1 addition & 49 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { MARKETPLACE_ENABLED } from "astro:env/client";
import { Icon } from "astro-icon/components";
import { getLangFromUrl, useTranslations } from "../i18n/utils";
import { isMobileNavOpen } from "../store.js";
import HeaderButton from "./HeaderButton.astro";
import Logo from "./Logo.astro";
const lang = getLangFromUrl(Astro.url);
Expand Down Expand Up @@ -56,7 +55,7 @@ const t = useTranslations(lang);
</HeaderButton>
</div>
{/* Mobile hamburger menu */}
<div class="flex lg:hidden" id="mobileNavTrigger" transition:persist>
<div class="flex lg:hidden cursor-pointer" id="mobileNavTrigger">
<Icon
name="ph:text-align-justify-bold"
class="h-9 w-9 text-text-color"
Expand All @@ -70,50 +69,3 @@ const t = useTranslations(lang);
</div>
</div>
</div>
<script>
import { isMobileNavOpen } from "../store.js";
let isMobileNavOpenLocal = true;
const right_caret = document.getElementById("right_caret");
const hamburger_menu = document.getElementById("hamburger_menu");
const mobileNavTrigger = document.getElementById("mobileNavTrigger");
// Create a copy of the nano store so we can make this a toggle

// Set the store to true when the button is clicked
function openDialog() {
if (isMobileNavOpenLocal == false) {
isMobileNavOpen.set(true);
if (hamburger_menu && right_caret) {
hamburger_menu.style.display = "none";
right_caret.style.display = "block";
}
} else {
isMobileNavOpen.set(false);
if (hamburger_menu && right_caret) {
hamburger_menu.style.display = "block";
right_caret.style.display = "none";
}
}
}

isMobileNavOpen.subscribe((open) => {
if (open) {
isMobileNavOpenLocal = true;
if (hamburger_menu && right_caret) {
hamburger_menu.style.display = "none";
right_caret.style.display = "block";
}
} else {
isMobileNavOpenLocal = false;
if (hamburger_menu && right_caret) {
hamburger_menu.style.display = "block";
right_caret.style.display = "none";
}
}
});

// Add an event listener to the button

if (mobileNavTrigger) {
mobileNavTrigger.addEventListener("click", openDialog);
}
</script>
2 changes: 1 addition & 1 deletion src/components/Loading.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="w-full h-full bg-primary text-navbar-text-color flex justify-center items-center">
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" viewBox="0 0 400 400" width="400" height="400" fill="#5e17eb" class="animate-pulse-brighter w-48 h-48">
<g id="svgg">
<path id="path0" fill-rule="evenodd" class="s0" d="m213.6 84c1 0.3 3.4 0.7 5.1 1 1.8 0.2 4.1 0.7 5.2 1 13.2 4.1 20.3 6.8 24.5 9.1 0.6 0.3 2.3 1.2 3.8 2 2.8 1.4 13.1 8 14.4 9.2 0.5 0.3 2.3 1.9 4.2 3.5 6.7 5.5 15.5 14.9 19.2 20.4 1 1.4 2 2.7 2.2 2.8 0.3 0.1 0.5 0.5 0.5 0.8 0 0.3 1.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.6-13.3-1.1-2.1-6.7-7.2-7.9-7.2-0.4 0-0.9-0.2-1-0.5-0.4-1.1-11.8-6.1-19.2-8.5-2.3-0.7-4.2-1.4-4.3-1.4zm-199.4 63.4l-3.1-0.4 1.8 3.2c0.9 1.8 1.9 3.4 2.2 3.5 0.3 0.1 0.5 0.6 0.5 1.1 0 0.4 0.6 1.5 1.3 2.3 0.7 0.9 1.5 1.9 1.8 2.2 0.3 0.4 0.8 1.2 1.1 1.7 6.2 10.7 35.6 33.5 43.3 33.5 0.2 0 1.3 0.4 2.5 0.9 2.5 1.2 10.6 3.4 15.3 4.2 9.5 1.8 11.6 2.1 17.4 2.1 6.6 0 16.4-1.3 22.9-3 2.2-0.5 5.2-1.3 6.8-1.7 1.6-0.3 3.2-0.9 3.5-1.2 0.4-0.3 1.1-0.6 1.6-0.6 2.3 0 22-10.6 24-12.9 0.2-0.2 2.2-1.9 4.5-3.7 5.7-4.5 11.8-11 17.1-18.4 1.6-2.3 3.2-4.5 3.6-4.9 0.4-0.4 0.7-1 0.7-1.2 0-0.2 0.8-1.9 1.9-3.6 1.1-1.7 1.9-3.2 1.9-3.4 0-0.2-3.8 0.4-11 1.6-31.7 5.4-85.1 6.7-126.9 3.1-9.6-0.8-23.1-2.3-27.8-3.2-2.2-0.4-5.3-0.9-6.9-1.2z"/>
</g>
</svg>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Logo.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
style="width: 100%; height: 100%;"
><title>nebula</title><g id="svgg"
><path
id="path0"
id="path0"
fill-rule="evenodd"
d="m213.6 84c1 0.3 3.4 0.7 5.1 1 1.8 0.2 4.1 0.7 5.2 1 13.2 4.1 20.3 6.8 24.5 9.1 0.6 0.3 2.3 1.2 3.8 2 2.8 1.4 13.1 8 14.4 9.2 0.5 0.3 2.3 1.9 4.2 3.5 6.7 5.5 15.5 14.9 19.2 20.4 1 1.4 2 2.7 2.2 2.8 0.3 0.1 0.5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3 0 34-0.5 2.2-0.4 2.2 1.3 1.8 3.1-0.7 12.9-4.5 18.3-7 8.5-4 14.3-10.1 12.6-13.3-1.1-2.1-6.7-7.2-7.9-7.2-0.4 0-0.9-0.2-1-0.5-0.4-1.1-11.8-6.1-19.2-8.5-2.3-0.7-4.2-1.4-4.3-1.4zm-199.4 63.4l-3.1-0.4 1.8 3.2c0.9 1.8 1.9 3.4 2.2 3.5 0.3 0.1 0.5 0.6 0.5 1.1 0 0.4 0.6 1.5 1.3 2.3 0.7 0.9 1.5 1.9 1.8 2.2 0.3 0.4 0.8 1.2 1.1 1.7 6.2 10.7 35.6 33.5 43.3 33.5 0.2 0 1.3 0.4 2.5 0.9 2.5 1.2 10.6 3.4 15.3 4.2 9.5 1.8 11.6 2.1 17.4 2.1 6.6 0 16.4-1.3 22.9-3 2.2-0.5 5.2-1.3 6.8-1.7 1.6-0.3 3.2-0.9 3.5-1.2 0.4-0.3 1.1-0.6 1.6-0.6 2.3 0 22-10.6 24-12.9 0.2-0.2 2.2-1.9 4.5-3.7 5.7-4.5 11.8-11 17.1-18.4 1.6-2.3 3.2-4.5 3.6-4.9 0.4-0.4 0.7-1 0.7-1.2 0-0.2 0.8-1.9 1.9-3.6 1.1-1.7 1.9-3.2 1.9-3.4 0-0.2-3.8 0.4-11 1.6-31.7 5.4-85.1 6.7-126.9 3.1-9.6-0.8-23.1-2.3-27.8-3.2-2.2-0.4-5.3-0.9-6.9-1.2z"
class="s0"></path></g
Expand Down
66 changes: 55 additions & 11 deletions src/components/MobileNavigation.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ const t = useTranslations(lang);
import { MARKETPLACE_ENABLED } from "astro:env/client";
---

<div
class="h-full mt-16 flex w-full flex-col justify-evenly bg-navbar-color m-auto"
id="mobileNavMenu"
>
<div class="h-full mt-16 flex w-full flex-col justify-evenly bg-navbar-color m-auto" id="mobilenav">
<HeaderButton text={t("header.home")} route={`/${lang}/`}>
<Icon
name="ph:house-bold"
Expand Down Expand Up @@ -47,12 +44,59 @@ import { MARKETPLACE_ENABLED } from "astro:env/client";
/>
</HeaderButton>
</div>
<style is:global>
#mobilenav {
-webkit-transition-duration: 600ms;
transition-duration: 600ms;
transform: translateX(100%);
}
#mobilenavwrapper {
-webkit-transition-duration: 600ms;
transition-duration: 600ms;
transform: translateX(100%);
}
</style>
<script>
import { fade } from "astro:transitions";
import { isMobileNavOpen } from "../store.js";
function closeMobileNav() {
isMobileNavOpen.set(false);
}
const mobileNavMenu = document.getElementById("mobileNavMenu");
mobileNavMenu!.addEventListener("click", closeMobileNav);
import { EventHandler } from "@utils/events";
import { Elements } from "@utils/index";

const init = async () => {
const els = Elements.select([
{ type: 'id', val: 'mobileNavTrigger' },
{ type: 'id', val: 'right_caret' },
{ type: 'id', val: 'hamburger_menu' },
{ type: 'id', val: 'mobilenavwrapper' },
{ type: 'id', val: 'mobilenav' }
]);
const trigger = Elements.exists<HTMLDivElement>(await els.next());
const rightCaret = Elements.exists<SVGElement>(await els.next());
const hamburgerMenu = Elements.exists<SVGElement>(await els.next());
const wrapper = Elements.exists<HTMLDivElement>(await els.next());
const mnm = Elements.exists<HTMLDivElement>(await els.next());
let isOpen = false;
Elements.attachEvent(trigger, "click", async () => {
console.log(isOpen);
if (isOpen) {
rightCaret.style.display = "none";
hamburgerMenu.style.display = "block";
mnm.style.transform = "translateX(100%)";
wrapper.style.transform = "translateX(100%)";
isOpen = false;
}
else {
hamburgerMenu.style.display = "none";
rightCaret.style.display = "block";
mnm.style.display = "flex";
mnm.style.transform = "translateX(0%)";
wrapper.style.transform = "translateX(0%)";
isOpen = true;
}
});
}
new EventHandler({
events: {
"astro:page-load": init
},
logging: false
}).bind();
</script>
Loading

0 comments on commit 660e4c3

Please sign in to comment.