diff --git a/content/characters/fortunes.md b/content/characters/fortunes.md new file mode 100644 index 0000000..786c601 --- /dev/null +++ b/content/characters/fortunes.md @@ -0,0 +1,10 @@ +--- +layout: base.njk +title: Kitty and Bunny Fortune +subtitle: since they're not related, it'll be ok! +permalink: /characters/fortunes/ +--- + + + +If you're here, you're in >:3 diff --git a/content/characters.md b/content/characters/index.md similarity index 100% rename from content/characters.md rename to content/characters/index.md diff --git a/content/first-time-horny.md b/content/first-time-horny.md new file mode 100644 index 0000000..c58ea91 --- /dev/null +++ b/content/first-time-horny.md @@ -0,0 +1,15 @@ +--- +layout: base.njk +title: horny check +permalink: /first-time-horny/ +--- + + +You've requested a page that might have something horny on it. Something R-18. Something not safe for work, even. It's probably just cartoon boobs. + +Are you AN ADULT and you WANT TO SEE THAT? + + + + + diff --git a/static/first-time.js b/static/first-time.js new file mode 100644 index 0000000..475a686 --- /dev/null +++ b/static/first-time.js @@ -0,0 +1,95 @@ +/** + * first-time.js by Nick "Nycki" Lamicela, 2025. + * + * A simple script for redirecting the user to a "first time here" page, for example, a nsfw content opt-in page. + * + * You may use this on your site, with or without attribution. + */ + +const firstTime = {}; + +/** + * Check if the user has opted into this gate. If not, redirect to gate page. + * + * Usage: in the head of each protected page. + * + * + * + * + * + */ + +firstTime.check = function (key='default', href=`/first-time-${key}/`) { + const currentSetting = localStorage.getItem(`first-time-${key}`); + if (currentSetting === 'granted') { + // do nothing + return; + } else { + // redirect to gate + const nextPage = window.location; + window.location.replace(`${href}?next=${nextPage}`); + } +}; + +/** + * Grant the user access to this gate. + * + * Usage: on the gate page. + * + * + * + * + * + * + * + */ +firstTime.grant = function (key='default') { + // save preference + localStorage.setItem(`first-time-${key}`, 'granted'); + + // redirect back to original page + let nextPage = '/'; + const queries = (window.location.search || '').slice(1).split('&'); + for (const query of queries) { + const [k, v] = query.split('=', 2); + if (k == 'next') { + nextPage = v; + } + } + window.location.replace(nextPage); +}; + +/** + * "No thanks" button for leaving a gate. + * + * Optional: on the gate page, after the consent button. + * + * + * + * + * + * + * + * + */ +firstTime.leave = function (href='/') { + window.location.replace(href); +}; + +/** + * "Clear settings" button for resetting a gate. + * + * Optional: on the gate page. + * + * + * + * + * + * + * + * + * + */ +firstTime.clear = function (key='default') { + localStorage.removeItem(`first-time-${key}`); +};