chore(upstream): add support for Vegvisir 3.2 (#39)

[Add support for Vegvisir 3.2.0](https://codeberg.org/vegvisir/vegvisir/releases/tag/3.2.0)

Reviewed-on: https://codeberg.org/vlw/vlw.se/pulls/39
This commit is contained in:
Victor Westerlund 2025-04-19 11:06:23 +00:00
parent 62ddd25f38
commit b398354594
5 changed files with 13 additions and 9 deletions

5
composer.lock generated
View file

@ -40,7 +40,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://codeberg.org/reflect/rules-plugin", "url": "https://codeberg.org/reflect/rules-plugin",
"reference": "aa7d969350f50d00d7dce01b948276946fcc0e81" "reference": "01cc1eea020ec5ea23140d86597bb5c8c1c2ec7f"
}, },
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
@ -60,7 +60,8 @@
} }
], ],
"description": "Add request search paramter and request body constraints to an API built with Reflect", "description": "Add request search paramter and request body constraints to an API built with Reflect",
"time": "2024-11-28T17:05:16+00:00" "abandoned": true,
"time": "2025-04-04T06:00:01+00:00"
}, },
{ {
"name": "vlw/mysql", "name": "vlw/mysql",

View file

@ -103,6 +103,6 @@ import { Elevent } from "/assets/js/modules/npm/Elevent.mjs";
}); });
// Reset color on navigation // Reset color on navigation
vv.Navigation.shellElement.addEventListener(vv.Navigation.EVENTS.STARTED, () => updateColor(), { once: true }); VV.shell.addEventListener(VV.EVENT.START, () => updateColor(), { once: true });
} }
} }

View file

@ -1,4 +1,4 @@
// Redirect to work page if no href is defined // Redirect to work page if no href is defined
if (!new URLSearchParams(window.location.search).has("href")) { if (!new URLSearchParams(window.location.search).has("href")) {
new vv.Navigation("/work").navigate(); new VV().navigate("/work");
} }

View file

@ -3,7 +3,7 @@ import { Elevent } from "/assets/js/modules/npm/Elevent.mjs";
const CLASSNAME_SEARCHBOX_ACTIVE = "searchboxActive"; const CLASSNAME_SEARCHBOX_ACTIVE = "searchboxActive";
// Set global Vegvisir naviation delay for page transition effect // Set global Vegvisir naviation delay for page transition effect
globalThis.vegvisir.globalNavigationDelayMs = 100; VV.delay = 100;
// Handle search box open/close buttons // Handle search box open/close buttons
{ {
@ -32,7 +32,7 @@ globalThis.vegvisir.globalNavigationDelayMs = 100;
// Root shell navigation event handlers // Root shell navigation event handlers
{ {
// On all top shell navigations // On all top shell navigations
new Elevent(vv.Navigation.EVENTS.STARTED, vv.Navigation.rootShellElement, () => { new Elevent(VV.EVENT.START, VV.shell, () => {
// Close searchbox on top shell navigations // Close searchbox on top shell navigations
document.querySelector("header").classList.remove(CLASSNAME_SEARCHBOX_ACTIVE); document.querySelector("header").classList.remove(CLASSNAME_SEARCHBOX_ACTIVE);
}); });
@ -47,10 +47,13 @@ globalThis.vegvisir.globalNavigationDelayMs = 100;
clearTimeout(event.target._throttle); clearTimeout(event.target._throttle);
event.target._throttle = setTimeout(() => { event.target._throttle = setTimeout(() => {
// Navigate search-results element on user input // Navigate search-results element on user input
new vv.Navigation(`/search?query=${event.target.value}`).navigate(searchResultsElement); new VV(searchResultsElement).navigate(`/search?query=${event.target.value}`);
}, 100); }, 100);
}); });
} }
// Navigate to the start page if the logo in the header is clicked
document.querySelector("header .logo").addEventListener("click", () => new VV().navigate("/"));
// Scroll page to top on navigation // Scroll page to top on navigation
document.addEventListener(vegvisir.Navigation.EVENTS.FINISHED, () => window.scrollTo({ top: 0 })); VV.shell.addEventListener(VV.EVENT.FINISH, () => window.scrollTo({ top: 0 }));

View file

@ -53,7 +53,7 @@
<?= VV::embed("public/assets/media/icons/search.svg") ?> <?= VV::embed("public/assets/media/icons/search.svg") ?>
<p>search vlw.se...</p> <p>search vlw.se...</p>
</button> </button>
<button class="logo" vv="/"><?= VV::embed("public/assets/media/vw.svg") ?></button> <button class="logo"><?= VV::embed("public/assets/media/vw.svg") ?></button>
<searchbox> <searchbox>
<input type="search" autocomplete="off" placeholder="search vlw.se..."> <input type="search" autocomplete="off" placeholder="search vlw.se...">
<button class="close searchbox-close"><?= VV::embed("public/assets/media/icons/close.svg") ?></button> <button class="close searchbox-close"><?= VV::embed("public/assets/media/icons/close.svg") ?></button>