diff --git a/assets/css/layout.css b/assets/css/layout.css index 6f87eb5..1d0533e 100644 --- a/assets/css/layout.css +++ b/assets/css/layout.css @@ -138,23 +138,20 @@ summary { **/ .spoiler-title { color: #6da3bd; - text-decoration: underline 1px dashed; + border-bottom: 1px dashed; font-weight: normal; cursor: pointer; } .spoiler-title:hover { color: #4d7285; } -.spoiler[open] .spoiler-title { - text-decoration: none; - margin-bottom: .5em; -} -.spoiler { +.spoiler-body { + display: none; padding: 10px; -} -.spoiler[open] { border: 1px solid #eee; background: #f9f9f9; + margin-top: 10px; + overflow: hidden; } .spoiler-title:before { float: left; @@ -166,7 +163,42 @@ summary { border: 0px solid red; background: url(../images/spoiler.icon.png) no-repeat left top; } -.spoiler[open] .spoiler-title:before { +.spoiler-title.open:before { + background: url(../images/spoiler.icon.png) no-repeat left bottom; +} + + +.newspoiler-title { + color: #6da3bd; + text-decoration: underline 1px dashed; + font-weight: normal; + cursor: pointer; +} +.newspoiler-title:hover { + color: #4d7285; +} +.newspoiler[open] .newspoiler-title { + text-decoration: none; + margin-bottom: .5em; +} +.newspoiler { + padding: 10px; +} +.newspoiler[open] { + border: 1px solid #eee; + background: #f9f9f9; +} +.newspoiler-title:before { + float: left; + content: " "; + width: 16px; + height: 16px; + margin-top: 2px; + display: block; + border: 0px solid red; + background: url(../images/spoiler.icon.png) no-repeat left top; +} +.newspoiler[open] .newspoiler-title:before { background: url(../images/spoiler.icon.png) no-repeat left bottom; } diff --git a/assets/js/ifhub.js b/assets/js/ifhub.js index db7a5ff..a825e63 100644 --- a/assets/js/ifhub.js +++ b/assets/js/ifhub.js @@ -9,6 +9,11 @@ jQuery(document).ready(function($){ $(".search-icon").on('click touchstart', function(){ $(".main-search").toggle() }); + $('.spoiler-title').on('click touchstart', function(){ + $(this).toggleClass('open'); + $(this).parent().children('div.spoiler-body').toggle('normal'); + return false; + }); }); /* --- https://github.com/stationer/DetailsShim/blob/master/details-shim.js --- */