What is this project?
app is a small, opinionated toolbox where I store
scripts that I find myself reusing across multiple projects. Instead
of rewriting logic for every new idea, I centralize them here and
keep them simple, framework-free, and easy to understand.
Vanilla JavaScript
Front-end helpers
Static-site friendly
Reusable. Drop the helpers into any static site or
SPA with minimal setup.
Practical. Every helper solves a real problem I had
in my own projects.
Simple. No build step required — just HTML, CSS, JS.
Open. Learn from the code or adapt it to your needs.
Current module: token.js
token.js is a tiny client-side token manager using
localStorage, useful for lightweight access flows:
-
One-time access to a simple “protected” page
-
Discouraging direct URL sharing without going through a start page
-
Quick gating for demos, prototypes, or mini tools
token.js · Quick Start
token.js helps you create and validate tokens purely
in the browser. No backend is required.
1. Include script
<script src="token/token.js"></script>
2. Create token & redirect
Example: from a landing page
<script>
Token.create({
target: "secret.html", // page to go to
extraQuery: "from=landing" // optional query string
});
</script>
3. Validate token on target page
<script src="token/token.js"></script>
<script>
// Optional (via CSS): body { display: none; }
if (Token.validate()) {
document.body.style.display = "block";
} else {
window.location.href = "index.html"; // or any fallback page
}
</script>