Browse Source

Over Age of Majority Warning

Steffen Cole Blake 4 năm trước cách đây
mục cha
commit
cb12229f35

+ 1 - 0
config.toml

@@ -9,4 +9,5 @@ pluralizelisttitles = false
         '/css/site.css'
     ]
     js = [
+        '/js/site.js'
     ]

+ 3 - 3
content/catalogue/deaths-breath.md

@@ -22,7 +22,7 @@ A clock chimed now at 11 o'clock. I had an hour, at best. Pushing my chair back
 
 I had to hurry, this was the impression above all else I am certain of now, looking back on those faint memories. The halls were cold and my breath was opaque in the icy clutch of night. For a moment I paused mid-hall to peer through a looming keep window down into the baileys below. The gardens were breathtaking under the silver moon's light in the sky, but as a cloud passed overhead and bathed all in darkness I pulled my jacket tighter. I had no time for gawking.
 
-Through that keep and halls I ran for I do not recall how long, but eventually I came unto a flight up a rocky stairwell. My pace quickened and I scrambled my way up, my breath now haggered and labored. At the top I came out a large inset door, and it took all my strength to force it open. The room within was once perhaps a place of great splendor, but long since unused. Silken bedsheets long mottled away to time and soaked in dust befit an ancient bed, its bronze clawed feet now tarnished with age.
+Through that keep and halls I ran for I do not recall how long, but eventually I came unto a flight up a rocky stairwell. My pace quickened and I scrambled my way up, my breath now haggard and labored. At the top I came out a large inset door, and it took all my strength to force it open. The room within was once perhaps a place of great splendor, but long since unused. Silken bedsheets long mottled away to time and soaked in dust befit an ancient bed, its bronze clawed feet now tarnished with age.
 
 But this was not what my eyes fell to, no, my voice caught in my throat and I had to turn away, hand to my mouth to cut back a guttural cry from deep within.
 
@@ -36,7 +36,7 @@ As I stepped towards the door, however, I heard something. It was quiet, barely
 
 "No..." the voice croaked out in a hoarse whisper. Slowly I turned to look back at Camellia's corpse, my lantern cautiously raised above my shoulder as my pupils tightened.
 
-Her face was raised, Camellia's gaze raised to meet mine. But there was no life left in those eyes, that I was certain. All had been drained from her and what remained was... something else entirely. Like staring deep into a pair of mawing pits her gaze was nought but two cold onyx pearls, and despite a total lack of direction from them I was completely certain she was staring right back at me.
+Her face was raised, Camellia's gaze raised to meet mine. But there was no life left in those eyes, that I was certain. All had been drained from her and what remained was... something else entirely. Like staring deep into a pair of mawing pits her gaze was naught but two cold onyx pearls, and despite a total lack of direction from them I was completely certain she was staring right back at me.
 
 She raised a blood soaked arm out towards me and I stumbled back. "Don't leave me" she croaked out once again, then began coughing and spluttering up a vile black bile. The room smelled of rot and the stench assaulted my senses beyond reason. Camellia planted her outstretched hand on the ground, the sticky blood making a soft '*splat*' that I recall vividly now even as I recant those events. And then she began to drag her body forward across the floor towards me as black bile continued to pour forth from her gaping mouth.
 
@@ -52,7 +52,7 @@ That is where I would find Julia.
 
 Her room sat nestled at the back of the lower halls, deep in the farthest corner. But as I drew nearer to that place it became evident something had occurred, or, was occuring. The darkness was tight and had a stranglehold on my lantern, as if some malevolent force had formed a grip around the very light itself. The walls pulled in closer and the great portraits of Julia that normally adorned these walls now seemed... changed. Perhaps a trick of the shadows?
 
-But with each turn and portal I passed it became apparent it was no trick. Her face had become stretched, twisted, contorned by the dark shadows. Her body now pulled and disfigured into something disproportionate and inhuman. The darkness cast just enough doubt on the images though for me to be unsure of what I was even perceiving.
+But with each turn and portal I passed it became apparent it was no trick. Her face had become stretched, twisted, contorted by the dark shadows. Her body now pulled and disfigured into something disproportionate and inhuman. The darkness cast just enough doubt on the images though for me to be unsure of what I was even perceiving.
 
 And at last the door to Julia's room stood before me. Or, what remained of it. The hardwood oaken handles had rotted away and the steel reinforcements all but rusted away. Cautiously I stepped through the debris to survey the room, earnestly searching for my companion.
 

+ 3 - 0
content/warn/_index.md

@@ -0,0 +1,3 @@
+---
+layout: warn
+---

+ 40 - 0
layouts/_default/warn.html

@@ -0,0 +1,40 @@
+{{ define "main" }}
+
+<div class="container warn">
+
+    <h1>Warning</h1>
+    <p>This website contains mature content meant for adults and is not suitable for minors.</p>
+    <p>By clicking the link below you certify you are over the age of majority in your country.</p>
+    <p>Consumer discretion is advised.</p>
+    
+    <a id="warn-certify" class="warn-certify" href="/" onclick="return warnCertify();">Let me in.</a>
+
+</div>
+
+<script>
+    window.onload = onLoad;
+
+    function onLoad() {
+        if (!window.URLSearchParams) {
+            return;
+        }
+        
+        var params = new URLSearchParams(window.location.search);
+        if (!params.has(`redirectURI`))
+        {
+            return;
+        }
+
+        var redirectURI = params.get(`redirectURI`);
+
+        document.getElementById(`warn-certify`).href = redirectURI;
+    }
+
+    function warnCertify() {
+        window.localStorage.setItem('warned', true);
+        return true;
+    }
+
+</script>
+
+{{ end }}

+ 18 - 0
static/css/site.css

@@ -114,6 +114,24 @@ a:hover {
     font-size: max(16px, 1vw);
 }
 
+.warn {
+    padding-top: 25vh;
+    height: 100%;
+}
+
+.warn h1 {
+    font-size: max(48px, 4vw);
+}
+
+.warn p {
+    font-size: max(18px, 1.5vw);
+}
+
+.warn a {
+    font-size: max(24px, 2vw);
+    color: snow;
+}
+
 .list h1 {
     font-size: max(2.5vw, 40px);
 }

+ 18 - 0
static/js/site.js

@@ -0,0 +1,18 @@
+(function() {
+    checkWarned();
+
+    function checkWarned() {
+        if (window.localStorage.getItem('warned')) {
+            return;
+        }
+
+        if (window.location.pathname == `/warn/`)
+        {
+            return;
+        }
+        var warnUri = new URL(`${window.location.origin}/warn/`);
+        warnUri.searchParams.append(`redirectURI`, window.location.href);
+
+        window.location.href = warnUri;
+    }
+})();