From 22b070a421fd15435cd10d4084fea05526660c11 Mon Sep 17 00:00:00 2001 From: zx14 Date: Mon, 22 Oct 2018 08:30:53 +0700 Subject: Add JS-less NSFW toggle --- data/js/misc.js | 19 ------------------- data/style.css | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 21 deletions(-) (limited to 'data') diff --git a/data/js/misc.js b/data/js/misc.js index 81f2890f..57c40ba5 100644 --- a/data/js/misc.js +++ b/data/js/misc.js @@ -79,25 +79,6 @@ if(byId('listsel')) ulist_redirect('[rv]', '/list', this.name, 'e='+this.options[this.selectedIndex].value); }; - -// NSFW VN image toggle (/v+) -(function() { - var msg = byId('nsfw_show'); - if(msg) { - var img = byId('nsfw_hid'); - byName(msg, 'a')[0].onclick = function() { - setClass(msg, 'hidden', true); - setClass(img, 'hidden', false); - return false; - }; - img.onclick = function() { - setClass(msg, 'hidden', false); - setClass(img, 'hidden', true); - }; - } -})(); - - // NSFW toggle for screenshots (/v+) if(byId('nsfwhide')) byId('nsfwhide').onclick = function() { diff --git a/data/style.css b/data/style.css index e29302bc..4b979bad 100644 --- a/data/style.css +++ b/data/style.css @@ -1,13 +1,17 @@ * { margin: 0; padding: 0; } body, td { font: 12px "Tahoma", "Arial", sans-serif; } body { $_bodybg$; color: $maintext$ } -a { color: $link$; text-decoration: none; } -a:hover { border-bottom: 1px dotted $maintext$; } table { border-collapse: collapse; } table td, table th { vertical-align: top; padding: 3px; } img { border: none; } +a, +.fake_link { color: $link$; text-decoration: none; cursor:pointer; } + +a:hover, +.fake_link:hover { border-bottom: 1px dotted $maintext$; } + table tr.odd, table.stripe tbody tr:nth-child(odd):not(.nostripe), .docs table tbody tr:nth-child(odd) { background: url($_boxbg$) repeat; } @@ -38,6 +42,14 @@ table.stripe tbody tr:nth-child(odd):not(.nostripe), #debug h2 { color: #f00!important; font-size: 20px; } #debug, #debug a { color: #fff!important; } +.visuallyhidden { + position: absolute !important; + left: 0; + height: 1px; width: 1px; + border: 0; padding: 0; + overflow: hidden; + clip: rect(1px 1px 1px 1px); +} /* Warning/Notice Box */ div.warning, div.notice { margin: 5px 10%; padding: 15px; background-color: $warnbg$; border: 1px solid $warnborder$; } @@ -337,6 +349,10 @@ h1.boxtitle, h1.boxtitle a { /***** VN page *******/ +#nsfw_chk:checked ~ * { cursor: pointer; } +#nsfw_chk:checked ~ * > #nsfw_show { display: none; } +#nsfw_chk:not(:checked) ~ * > #nsfw_hid { display: none; } + div.vndetails { margin: 0 auto; max-width: 820px; } div.vnimg { float: left; width: 250px; margin: 0 10px; } div.vnimg i { display: block; width: 100%; text-align: center; font-size: 11px; } -- cgit v1.2.3