diff --git a/4chan_x.user.js b/4chan_x.user.js index ba4bd6887..574603b23 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -20,7 +20,7 @@ // @icon https://github.com/MayhemYDG/4chan-x/raw/stable/img/icon.gif // ==/UserScript== -/* 4chan X Alpha - Version 3.0.0 - 2013-02-11 +/* 4chan X Alpha - Version 3.0.0 - 2013-02-12 * http://mayhemydg.github.com/4chan-x/ * * Copyright (c) 2009-2011 James Campos @@ -196,7 +196,7 @@ dialog = function(id, position, html) { var el, move; el = d.createElement('div'); - el.className = 'reply dialog'; + el.className = 'dialog'; el.innerHTML = html; el.id = id; el.style.cssText = localStorage.getItem("" + g.NAMESPACE + id + ".position") || position; @@ -222,7 +222,7 @@ Menu.prototype.makeMenu = function() { var menu; menu = $.el('div', { - className: 'reply dialog', + className: 'dialog', id: 'menu', tabIndex: 0 }); @@ -292,7 +292,7 @@ $.rm(submenu); } submenu = $.el('div', { - className: 'reply dialog submenu' + className: 'dialog submenu' }); _ref = entry.subEntries; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -898,7 +898,7 @@ this.menu = new UI.Menu('header'); this.headerEl = $.el('div', { id: 'header', - innerHTML: '
' + innerHTML: '
' }); headerBar = $('#header-bar', this.headerEl); if ($.get('autohideHeaderBar', false)) { @@ -2860,7 +2860,7 @@ _ref = Get.postDataFromLink(this), board = _ref.board, threadID = _ref.threadID, postID = _ref.postID; qp = $.el('div', { id: 'qp', - className: 'reply dialog' + className: 'dialog' }); $.add(d.body, qp); Get.postClone(board, threadID, postID, qp, Get.contextFromLink(this)); @@ -4193,7 +4193,7 @@ return $.addClass(doc, style); }; $.addClass(doc, $.engine); - $.addClass(doc, 'fourchan_x'); + $.addClass(doc, 'fourchan-x'); setStyle(); if (MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.OMutationObserver) { observer = new MutationObserver(setStyle); @@ -4207,7 +4207,7 @@ }, initReady: function() { var boardChild, errors, posts, thread, threadChild, threads, _i, _j, _len, _len1, _ref, _ref1; - if (!$.hasClass(doc, 'fourchan_x')) { + if (!$.hasClass(doc, 'fourchan-x')) { Main.initStyle(); } if (d.title === '4chan - 404 Not Found') { @@ -4324,7 +4324,7 @@ }); return [message, error]; }, - css: "/* general */\n.dialog.reply {\n display: block;\n border: 1px solid rgba(0, 0, 0, .25);\n padding: 0;\n}\n.move {\n cursor: move;\n}\nlabel {\n cursor: pointer;\n}\na[href=\"javascript:;\"] {\n text-decoration: none;\n}\n.warning {\n color: red;\n}\n\n/* 4chan style fixes */\n.opContainer, .op {\n display: block !important;\n}\n.post {\n overflow: visible !important;\n}\n[hidden] {\n display: none !important;\n}\n\n/* fixed, z-index */\n#qp, #ihover,\n#updater, #stats,\n#header,\n#qr, #watcher {\n position: fixed;\n}\n#notifications {\n z-index: 80;\n}\n#qp, #ihover {\n z-index: 70;\n}\n#menu {\n z-index: 60;\n}\n#updater, #stats {\n z-index: 50;\n}\n#header:hover {\n z-index: 40;\n}\n#qr {\n z-index: 30;\n}\n#header {\n z-index: 20;\n}\n#watcher {\n z-index: 10;\n}\n\n/* XXX support different styles */\n#header-bar {\n font-size: 9pt;\n color: #89A;\n background-color: #D6DAF0;\n border-color: #B7C5D9;\n border-width: 0 0 1px;\n border-style: solid;\n}\n\n/* header */\n.fourchan_x body {\n margin-top: 2em;\n}\n#header {\n top: 0;\n right: 0;\n left: 0;\n}\n#header-bar {\n padding: 4px;\n position: relative;\n transition: all .1s ease-in-out;\n -o-transition: all .1s ease-in-out;\n -moz-transition: all .1s ease-in-out;\n -webkit-transition: all .1s ease-in-out;\n}\n#header-bar.autohide:not(:hover) {\n margin-bottom: -1em;\n transform: translateY(-100%);\n -o-transform: translateY(-100%);\n -moz-transform: translateY(-100%);\n -webkit-transform: translateY(-100%);\n transition: all .75s .25s ease-in-out;\n -o-transition: all .75s .25s ease-in-out;\n -moz-transition: all .75s .25s ease-in-out;\n -webkit-transition: all .75s .25s ease-in-out;\n}\n#toggle-header-bar {\n cursor: n-resize;\n left: 0;\n right: 0;\n bottom: -8px;\n height: 10px;\n position: absolute;\n}\n#header-bar.autohide #toggle-header-bar {\n cursor: s-resize;\n}\n#header-bar a {\n text-decoration: none;\n padding: 1px;\n}\n#header-bar > .menu-button {\n float: right;\n padding: 0;\n}\nbody > #boardNavDesktop,\n#navtopright,\n#boardNavDesktopFoot {\n display: none !important;\n}\n\n/* notifications */\n#notifications {\n text-align: center;\n}\n.notification {\n color: #FFF;\n font-weight: 700;\n text-shadow: 0 1px 2px rgba(0, 0, 0, .5);\n border-radius: 2px;\n margin: 1px auto;\n width: 500px;\n max-width: 100%;\n position: relative;\n transition: all .25s ease-in-out;\n -o-transition: all .25s ease-in-out;\n -moz-transition: all .25s ease-in-out;\n -webkit-transition: all .25s ease-in-out;\n}\n.notification.error {\n background-color: hsl(0, 100%, 40%);\n}\n.notification.warning {\n background-color: hsl(36, 100%, 40%);\n}\n.notification.info {\n background-color: hsl(200, 100%, 40%);\n}\n.notification.success {\n background-color: hsl(104, 100%, 40%);\n}\n.notification > .close {\n color: white;\n padding: 4px 6px;\n top: 0;\n right: 0;\n position: absolute;\n}\n.message {\n box-sizing: border-box;\n padding: 4px 20px;\n max-height: 200px;\n width: 100%;\n overflow: auto;\n}\n\n/* thread updater */\n#updater {\n text-align: right;\n}\n#updater:not(:hover) {\n background: none;\n border: none;\n}\n#updater input[type=number] {\n width: 4em;\n}\n#updater:not(:hover) > div:not(.move) {\n display: none;\n}\n.new {\n color: limegreen;\n}\n\n/* quote */\n.quotelink.deadlink {\n text-decoration: underline !important;\n}\n.deadlink:not(.quotelink) {\n text-decoration: none !important;\n}\n.inlined {\n opacity: .5;\n}\n#qp input, .forwarded {\n display: none;\n}\n.quotelink.forwardlink,\n.backlink.forwardlink {\n text-decoration: none;\n border-bottom: 1px dashed;\n}\n.filtered {\n text-decoration: underline line-through;\n}\n.inline {\n border: 1px solid rgba(128, 128, 128, .5);\n display: table;\n margin: 2px 0;\n}\n.inline .post {\n border: 0 !important;\n display: table !important;\n margin: 0 !important;\n padding: 1px 2px !important;\n}\n#qp {\n padding: 2px 2px 5px;\n}\n#qp .post {\n border: none;\n margin: 0;\n padding: 0;\n}\n#qp img {\n max-height: 300px;\n max-width: 500px;\n}\n.qphl {\n box-shadow: 0 0 0 2px rgba(216, 94, 49, .7);\n}\n\n/* file */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n#ihover {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n max-height: 100%;\n max-width: 75%;\n padding-bottom: 16px;\n}\n\n/* Filter */\n.opContainer.filter-highlight {\n box-shadow: inset 5px 0 rgba(255, 0, 0, .5);\n}\n.opContainer.filter-highlight.qphl {\n box-shadow: inset 5px 0 rgba(255, 0, 0, .5),\n 0 0 0 2px rgba(216, 94, 49, .7);\n}\n.filter-highlight > .reply {\n box-shadow: -5px 0 rgba(255, 0, 0, .5);\n}\n.filter-highlight > .reply.qphl {\n box-shadow: -5px 0 rgba(255, 0, 0, .5),\n 0 0 0 2px rgba(216, 94, 49, .7)\n}\n\n/* Thread & Reply Hiding */\n.hide-thread-button,\n.hide-reply-button {\n float: left;\n margin-right: 2px;\n}\n.stub ~ .sideArrows,\n.stub ~ .hide-reply-button,\n.stub ~ .post {\n display: none !important;\n}\n\n/* Menu */\n.menu-button {\n display: inline-block;\n}\n.menu-button > span {\n border-top: 6px solid;\n border-right: 4px solid transparent;\n border-left: 4px solid transparent;\n display: inline-block;\n margin: 2px;\n vertical-align: middle;\n}\n#menu {\n position: absolute;\n outline: none;\n}\n.entry {\n border-bottom: 1px solid rgba(0, 0, 0, .25);\n cursor: pointer;\n display: block;\n outline: none;\n padding: 3px 7px;\n position: relative;\n text-decoration: none;\n white-space: nowrap;\n}\n.entry:last-child {\n border: none;\n}\n.focused.entry {\n background: rgba(255, 255, 255, .33);\n}\n.entry.has-submenu {\n padding-right: 20px;\n}\n.has-submenu::after {\n content: \"\";\n border-left: 6px solid;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n display: inline-block;\n margin: 4px;\n position: absolute;\n right: 3px;\n}\n.has-submenu:not(.focused) > .submenu {\n display: none;\n}\n.submenu {\n position: absolute;\n margin: -1px 0;\n}\n.entry input {\n margin: 0;\n}" + css: "/* general */\n.dialog {\nbox-shadow: 0 1px 2px rgba(0, 0, 0, .15);\nborder: 1px solid;\ndisplay: block;\npadding: 0;\n}\n.move {\ncursor: move;\n}\nlabel {\ncursor: pointer;\n}\na[href=\"javascript:;\"] {\ntext-decoration: none;\n}\n.warning {\ncolor: red;\n}\n\n/* 4chan style fixes */\n.opContainer, .op {\ndisplay: block !important;\n}\n.post {\noverflow: visible !important;\n}\n[hidden] {\ndisplay: none !important;\n}\n\n/* fixed, z-index */\n#qp, #ihover,\n#updater, #stats,\n#header,\n#qr, #watcher {\nposition: fixed;\n}\n#notifications {\nz-index: 80;\n}\n#qp, #ihover {\nz-index: 70;\n}\n#menu {\nz-index: 60;\n}\n#updater, #stats {\nz-index: 50;\n}\n#header:hover {\nz-index: 40;\n}\n#qr {\nz-index: 30;\n}\n#header {\nz-index: 20;\n}\n#watcher {\nz-index: 10;\n}\n\n/* Header */\n.fourchan-x body {\nmargin-top: 2em;\n}\n.fourchan-x #boardNavDesktop,\n.fourchan-x #navtopright,\n.fourchan-x #boardNavDesktopFoot {\ndisplay: none !important;\n}\n#header {\ntop: 0;\nright: 0;\nleft: 0;\n}\n#header-bar {\nborder-width: 0 0 1px;\npadding: 4px;\nposition: relative;\ntransition: all .1s ease-in-out;\n-o-transition: all .1s ease-in-out;\n-moz-transition: all .1s ease-in-out;\n-webkit-transition: all .1s ease-in-out;\n}\n#header-bar.autohide:not(:hover) {\nmargin-bottom: -1em;\ntransform: translateY(-100%);\n-o-transform: translateY(-100%);\n-moz-transform: translateY(-100%);\n-webkit-transform: translateY(-100%);\ntransition: all .75s .25s ease-in-out;\n-o-transition: all .75s .25s ease-in-out;\n-moz-transition: all .75s .25s ease-in-out;\n-webkit-transition: all .75s .25s ease-in-out;\n}\n#toggle-header-bar {\ncursor: n-resize;\nleft: 0;\nright: 0;\nbottom: -8px;\nheight: 10px;\nposition: absolute;\n}\n#header-bar.autohide #toggle-header-bar {\ncursor: s-resize;\n}\n#header-bar a {\ntext-decoration: none;\npadding: 1px;\n}\n#header-bar > .menu-button {\nfloat: right;\npadding: 0;\n}\n\n/* notifications */\n#notifications {\ntext-align: center;\n}\n.notification {\ncolor: #FFF;\nfont-weight: 700;\ntext-shadow: 0 1px 2px rgba(0, 0, 0, .5);\nborder-radius: 2px;\nmargin: 1px auto;\nwidth: 500px;\nmax-width: 100%;\nposition: relative;\ntransition: all .25s ease-in-out;\n-o-transition: all .25s ease-in-out;\n-moz-transition: all .25s ease-in-out;\n-webkit-transition: all .25s ease-in-out;\n}\n.notification.error {\nbackground-color: hsla(0, 100%, 40%, .9);\n}\n.notification.warning {\nbackground-color: hsla(36, 100%, 40%, .9);\n}\n.notification.info {\nbackground-color: hsla(200, 100%, 40%, .9);\n}\n.notification.success {\nbackground-color: hsla(104, 100%, 40%, .9);\n}\n.notification > .close {\ncolor: white;\npadding: 4px 6px;\ntop: 0;\nright: 0;\nposition: absolute;\n}\n.message {\nbox-sizing: border-box;\npadding: 4px 20px;\nmax-height: 200px;\nwidth: 100%;\noverflow: auto;\n}\n\n/* thread updater */\n#updater {\ntext-align: right;\n}\n#updater:not(:hover) {\nbackground: none;\nborder: none;\n}\n#updater input[type=number] {\nwidth: 4em;\n}\n#updater:not(:hover) > div:not(.move) {\ndisplay: none;\n}\n.new {\ncolor: limegreen;\n}\n\n/* quote */\n.quotelink.deadlink {\ntext-decoration: underline !important;\n}\n.deadlink:not(.quotelink) {\ntext-decoration: none !important;\n}\n.inlined {\nopacity: .5;\n}\n#qp input, .forwarded {\ndisplay: none;\n}\n.quotelink.forwardlink,\n.backlink.forwardlink {\ntext-decoration: none;\nborder-bottom: 1px dashed;\n}\n.filtered {\ntext-decoration: underline line-through;\n}\n.inline {\nborder: 1px solid;\ndisplay: table;\nmargin: 2px 0;\n}\n.inline .post {\nborder: 0 !important;\nbackground-color: transparent !important;\ndisplay: table !important;\nmargin: 0 !important;\npadding: 1px 2px !important;\n}\n#qp {\npadding: 2px 2px 5px;\n}\n#qp .post {\nborder: none;\nmargin: 0;\npadding: 0;\n}\n#qp img {\nmax-height: 300px;\nmax-width: 500px;\n}\n.qphl {\nbox-shadow: 0 0 0 2px rgba(216, 94, 49, .7);\n}\n\n/* file */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\ndisplay: none;\n}\n#ihover {\nbox-sizing: border-box;\n-moz-box-sizing: border-box;\nmax-height: 100%;\nmax-width: 75%;\npadding-bottom: 16px;\n}\n\n/* Filter */\n.opContainer.filter-highlight {\nbox-shadow: inset 5px 0 rgba(255, 0, 0, .5);\n}\n.opContainer.filter-highlight.qphl {\nbox-shadow: inset 5px 0 rgba(255, 0, 0, .5),\n 0 0 0 2px rgba(216, 94, 49, .7);\n}\n.filter-highlight > .reply {\nbox-shadow: -5px 0 rgba(255, 0, 0, .5);\n}\n.filter-highlight > .reply.qphl {\nbox-shadow: -5px 0 rgba(255, 0, 0, .5),\n 0 0 0 2px rgba(216, 94, 49, .7);\n}\n\n/* Thread & Reply Hiding */\n.hide-thread-button,\n.hide-reply-button {\nfloat: left;\nmargin-right: 2px;\n}\n.stub ~ .sideArrows,\n.stub ~ .hide-reply-button,\n.stub ~ .post {\ndisplay: none !important;\n}\n\n/* Menu */\n.menu-button {\ndisplay: inline-block;\n}\n.menu-button > span {\nborder-top: 6px solid;\nborder-right: 4px solid transparent;\nborder-left: 4px solid transparent;\ndisplay: inline-block;\nmargin: 2px;\nvertical-align: middle;\n}\n#menu {\nposition: absolute;\noutline: none;\n}\n.entry {\ncursor: pointer;\ndisplay: block;\noutline: none;\npadding: 3px 7px;\nposition: relative;\ntext-decoration: none;\nwhite-space: nowrap;\n}\n.entry.has-submenu {\npadding-right: 20px;\n}\n.has-submenu::after {\ncontent: \"\";\nborder-left: 6px solid;\nborder-top: 4px solid transparent;\nborder-bottom: 4px solid transparent;\ndisplay: inline-block;\nmargin: 4px;\nposition: absolute;\nright: 3px;\n}\n.has-submenu:not(.focused) > .submenu {\ndisplay: none;\n}\n.submenu {\nposition: absolute;\nmargin: -1px 0;\n}\n.entry input {\nmargin: 0;\n}\n\n/* general */\n:root.yotsuba .dialog {\nbackground-color: #F0E0D6;\nborder-color: #D9BFB7;\n}\n\n/* Header */\n:root.yotsuba #header-bar {\nfont-size: 9pt;\ncolor: #B86;\n}\n:root.yotsuba #header-bar a {\ncolor: #800000;\n}\n\n/* quote */\n:root.yotsuba .inline {\nborder-color: #D9BFB7;\nbackground-color: rgba(255, 255, 255, .14);\n}\n\n/* Menu */\n:root.yotsuba .entry:not(:last-child) {\nborder-bottom: 1px solid #D9BFB7;\n}\n:root.yotsuba .focused.entry {\nbackground: rgba(255, 255, 255, .33);\n}\n\n/* general */\n:root.yotsuba-b .dialog {\nbackground-color: #D6DAF0;\nborder-color: #B7C5D9;\n}\n\n/* Header */\n:root.yotsuba-b #header-bar {\nfont-size: 9pt;\ncolor: #89A;\n}\n:root.yotsuba-b #header-bar a {\ncolor: #34345C;\n}\n\n/* quote */\n:root.yotsuba-b .inline {\nborder-color: #B7C5D9;\nbackground-color: rgba(255, 255, 255, .14);\n}\n\n/* Menu */\n:root.yotsuba-b .entry:not(:last-child) {\nborder-bottom: 1px solid #B7C5D9;\n}\n:root.yotsuba-b .focused.entry {\nbackground: rgba(255, 255, 255, .33);\n}\n\n/* general */\n:root.futaba .dialog {\nbackground-color: #F0E0D6;\nborder-color: #D9BFB7;\n}\n\n/* Header */\n:root.futaba #header-bar {\nfont-size: 11pt;\ncolor: #B86;\n}\n:root.futaba #header-bar a {\ncolor: #800000;\n}\n\n/* quote */\n:root.futaba .inline {\nborder-color: #D9BFB7;\nbackground-color: rgba(255, 255, 255, .14);\n}\n\n/* Menu */\n:root.futaba .entry:not(:last-child) {\nborder-bottom: 1px solid #D9BFB7;\n}\n:root.futaba .focused.entry {\nbackground: rgba(255, 255, 255, .33);\n}\n\n/* general */\n:root.burichan .dialog {\nbackground-color: #D6DAF0;\nborder-color: #B7C5D9;\n}\n\n/* Header */\n:root.burichan #header-bar {\nfont-size: 11pt;\ncolor: #89A;\n}\n:root.burichan #header-bar a {\ncolor: #34345C;\n}\n\n/* quote */\n:root.burichan .inline {\nborder-color: #B7C5D9;\nbackground-color: rgba(255, 255, 255, .14);\n}\n\n/* Menu */\n:root.burichan .entry:not(:last-child) {\nborder-bottom: 1px solid #B7C5D9;\n}\n:root.burichan .focused.entry {\nbackground: rgba(255, 255, 255, .33);\n}\n\n/* general */\n:root.tomorrow .dialog {\nbackground-color: #282A2E;\nborder-color: #111;\n}\n\n/* Header */\n:root.tomorrow #header-bar {\nfont-size: 9pt;\ncolor: #C5C8C6;\n}\n:root.tomorrow #header-bar a {\ncolor: #81A2BE;\n}\n\n/* quote */\n:root.tomorrow .inline {\nborder-color: #111;\nbackground-color: rgba(0, 0, 0, .14);\n}\n\n/* Menu */\n:root.tomorrow .entry:not(:last-child) {\nborder-bottom: 1px solid #111;\n}\n:root.tomorrow .focused.entry {\nbackground: rgba(0, 0, 0, .33);\n}\n\n/* general */\n:root.photon .dialog {\nbackground-color: #DDD;\nborder-color: #CCC;\n}\n\n/* Header */\n:root.photon #header-bar {\nfont-size: 9pt;\ncolor: #333;\n}\n:root.photon #header-bar a {\ncolor: #FF6600;\n}\n\n/* quote */\n:root.photon .inline {\nborder-color: #CCC;\nbackground-color: rgba(255, 255, 255, .14);\n}\n\n/* Menu */\n:root.photon .entry:not(:last-child) {\nborder-bottom: 1px solid #CCC;\n}\n:root.photon .focused.entry {\nbackground: rgba(255, 255, 255, .33);\n}\n" }; Main.init(); diff --git a/changelog b/changelog index 84dc78d7e..2678b3c93 100644 --- a/changelog +++ b/changelog @@ -13,6 +13,7 @@ alpha Fix Chrome's install warning saying that 4chan X would execute on all domains. Fix Quote Backlinks not affecting inlined quotes. Fix Quote Highlighting not affecting inlined quotes. + Fix unreadable inlined posts with the Tomorrow theme. master - Mayhem diff --git a/css/burichan.css b/css/burichan.css new file mode 100644 index 000000000..33ad10d4a --- /dev/null +++ b/css/burichan.css @@ -0,0 +1,28 @@ +/* general */ +:root.burichan .dialog { + background-color: #D6DAF0; + border-color: #B7C5D9; +} + +/* Header */ +:root.burichan #header-bar { + font-size: 11pt; + color: #89A; +} +:root.burichan #header-bar a { + color: #34345C; +} + +/* quote */ +:root.burichan .inline { + border-color: #B7C5D9; + background-color: rgba(255, 255, 255, .14); +} + +/* Menu */ +:root.burichan .entry:not(:last-child) { + border-bottom: 1px solid #B7C5D9; +} +:root.burichan .focused.entry { + background: rgba(255, 255, 255, .33); +} diff --git a/css/futaba.css b/css/futaba.css new file mode 100644 index 000000000..9e98aee89 --- /dev/null +++ b/css/futaba.css @@ -0,0 +1,28 @@ +/* general */ +:root.futaba .dialog { + background-color: #F0E0D6; + border-color: #D9BFB7; +} + +/* Header */ +:root.futaba #header-bar { + font-size: 11pt; + color: #B86; +} +:root.futaba #header-bar a { + color: #800000; +} + +/* quote */ +:root.futaba .inline { + border-color: #D9BFB7; + background-color: rgba(255, 255, 255, .14); +} + +/* Menu */ +:root.futaba .entry:not(:last-child) { + border-bottom: 1px solid #D9BFB7; +} +:root.futaba .focused.entry { + background: rgba(255, 255, 255, .33); +} diff --git a/css/photon.css b/css/photon.css new file mode 100644 index 000000000..d50a8cc14 --- /dev/null +++ b/css/photon.css @@ -0,0 +1,28 @@ +/* general */ +:root.photon .dialog { + background-color: #DDD; + border-color: #CCC; +} + +/* Header */ +:root.photon #header-bar { + font-size: 9pt; + color: #333; +} +:root.photon #header-bar a { + color: #FF6600; +} + +/* quote */ +:root.photon .inline { + border-color: #CCC; + background-color: rgba(255, 255, 255, .14); +} + +/* Menu */ +:root.photon .entry:not(:last-child) { + border-bottom: 1px solid #CCC; +} +:root.photon .focused.entry { + background: rgba(255, 255, 255, .33); +} diff --git a/css/style.css b/css/style.css index a9472404b..1d1b5fce9 100644 --- a/css/style.css +++ b/css/style.css @@ -1,7 +1,8 @@ /* general */ -.dialog.reply { +.dialog { + box-shadow: 0 1px 2px rgba(0, 0, 0, .15); + border: 1px solid; display: block; - border: 1px solid rgba(0, 0, 0, .25); padding: 0; } .move { @@ -60,26 +61,22 @@ a[href="javascript:;"] { z-index: 10; } -/* XXX support different styles */ -#header-bar { - font-size: 9pt; - color: #89A; - background-color: #D6DAF0; - border-color: #B7C5D9; - border-width: 0 0 1px; - border-style: solid; -} - -/* header */ -.fourchan_x body { +/* Header */ +.fourchan-x body { margin-top: 2em; } +.fourchan-x #boardNavDesktop, +.fourchan-x #navtopright, +.fourchan-x #boardNavDesktopFoot { + display: none !important; +} #header { top: 0; right: 0; left: 0; } #header-bar { + border-width: 0 0 1px; padding: 4px; position: relative; transition: all .1s ease-in-out; @@ -117,11 +114,6 @@ a[href="javascript:;"] { float: right; padding: 0; } -body > #boardNavDesktop, -#navtopright, -#boardNavDesktopFoot { - display: none !important; -} /* notifications */ #notifications { @@ -142,16 +134,16 @@ body > #boardNavDesktop, -webkit-transition: all .25s ease-in-out; } .notification.error { - background-color: hsl(0, 100%, 40%); + background-color: hsla(0, 100%, 40%, .9); } .notification.warning { - background-color: hsl(36, 100%, 40%); + background-color: hsla(36, 100%, 40%, .9); } .notification.info { - background-color: hsl(200, 100%, 40%); + background-color: hsla(200, 100%, 40%, .9); } .notification.success { - background-color: hsl(104, 100%, 40%); + background-color: hsla(104, 100%, 40%, .9); } .notification > .close { color: white; @@ -208,12 +200,13 @@ body > #boardNavDesktop, text-decoration: underline line-through; } .inline { - border: 1px solid rgba(128, 128, 128, .5); + border: 1px solid; display: table; margin: 2px 0; } .inline .post { border: 0 !important; + background-color: transparent !important; display: table !important; margin: 0 !important; padding: 1px 2px !important; @@ -260,7 +253,7 @@ body > #boardNavDesktop, } .filter-highlight > .reply.qphl { box-shadow: -5px 0 rgba(255, 0, 0, .5), - 0 0 0 2px rgba(216, 94, 49, .7) + 0 0 0 2px rgba(216, 94, 49, .7); } /* Thread & Reply Hiding */ @@ -292,7 +285,6 @@ body > #boardNavDesktop, outline: none; } .entry { - border-bottom: 1px solid rgba(0, 0, 0, .25); cursor: pointer; display: block; outline: none; @@ -301,12 +293,6 @@ body > #boardNavDesktop, text-decoration: none; white-space: nowrap; } -.entry:last-child { - border: none; -} -.focused.entry { - background: rgba(255, 255, 255, .33); -} .entry.has-submenu { padding-right: 20px; } diff --git a/css/tomorrow.css b/css/tomorrow.css new file mode 100644 index 000000000..071be1ffe --- /dev/null +++ b/css/tomorrow.css @@ -0,0 +1,28 @@ +/* general */ +:root.tomorrow .dialog { + background-color: #282A2E; + border-color: #111; +} + +/* Header */ +:root.tomorrow #header-bar { + font-size: 9pt; + color: #C5C8C6; +} +:root.tomorrow #header-bar a { + color: #81A2BE; +} + +/* quote */ +:root.tomorrow .inline { + border-color: #111; + background-color: rgba(0, 0, 0, .14); +} + +/* Menu */ +:root.tomorrow .entry:not(:last-child) { + border-bottom: 1px solid #111; +} +:root.tomorrow .focused.entry { + background: rgba(0, 0, 0, .33); +} diff --git a/css/yotsuba-b.css b/css/yotsuba-b.css new file mode 100644 index 000000000..c421c83ed --- /dev/null +++ b/css/yotsuba-b.css @@ -0,0 +1,28 @@ +/* general */ +:root.yotsuba-b .dialog { + background-color: #D6DAF0; + border-color: #B7C5D9; +} + +/* Header */ +:root.yotsuba-b #header-bar { + font-size: 9pt; + color: #89A; +} +:root.yotsuba-b #header-bar a { + color: #34345C; +} + +/* quote */ +:root.yotsuba-b .inline { + border-color: #B7C5D9; + background-color: rgba(255, 255, 255, .14); +} + +/* Menu */ +:root.yotsuba-b .entry:not(:last-child) { + border-bottom: 1px solid #B7C5D9; +} +:root.yotsuba-b .focused.entry { + background: rgba(255, 255, 255, .33); +} diff --git a/css/yotsuba.css b/css/yotsuba.css new file mode 100644 index 000000000..897f198ab --- /dev/null +++ b/css/yotsuba.css @@ -0,0 +1,28 @@ +/* general */ +:root.yotsuba .dialog { + background-color: #F0E0D6; + border-color: #D9BFB7; +} + +/* Header */ +:root.yotsuba #header-bar { + font-size: 9pt; + color: #B86; +} +:root.yotsuba #header-bar a { + color: #800000; +} + +/* quote */ +:root.yotsuba .inline { + border-color: #D9BFB7; + background-color: rgba(255, 255, 255, .14); +} + +/* Menu */ +:root.yotsuba .entry:not(:last-child) { + border-bottom: 1px solid #D9BFB7; +} +:root.yotsuba .focused.entry { + background: rgba(255, 255, 255, .33); +} diff --git a/lib/ui.coffee b/lib/ui.coffee index 9c52b0376..40003979e 100644 --- a/lib/ui.coffee +++ b/lib/ui.coffee @@ -1,7 +1,7 @@ UI = (-> dialog = (id, position, html) -> el = d.createElement 'div' - el.className = 'reply dialog' + el.className = 'dialog' el.innerHTML = html el.id = id el.style.cssText = localStorage.getItem("#{g.NAMESPACE}#{id}.position") or position @@ -23,7 +23,7 @@ UI = (-> makeMenu: -> menu = $.el 'div', - className: 'reply dialog' + className: 'dialog' id: 'menu' tabIndex: 0 $.on menu, 'click', (e) -> e.stopPropagation() @@ -89,7 +89,7 @@ UI = (-> # Reset sub menu, remove irrelevant entries. $.rm submenu submenu = $.el 'div', - className: 'reply dialog submenu' + className: 'dialog submenu' for subEntry in entry.subEntries @insertEntry subEntry, submenu, data $.add entry.el, submenu diff --git a/src/features.coffee b/src/features.coffee index 359adda60..911dc8be5 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -4,7 +4,7 @@ Header = @headerEl = $.el 'div', id: 'header' - innerHTML: '
' + innerHTML: '
' headerBar = $('#header-bar', @headerEl) if $.get 'autohideHeaderBar', false @@ -1733,7 +1733,7 @@ QuotePreview = qp = $.el 'div', id: 'qp' - className: 'reply dialog' + className: 'dialog' $.add d.body, qp Get.postClone board, threadID, postID, qp, Get.contextFromLink @ diff --git a/src/main.coffee b/src/main.coffee index 6944c66d4..7401ec9e8 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -337,7 +337,7 @@ Main = break $.addClass doc, style $.addClass doc, $.engine - $.addClass doc, 'fourchan_x' + $.addClass doc, 'fourchan-x' setStyle() if MutationObserver = window.MutationObserver or window.WebKitMutationObserver or window.OMutationObserver observer = new MutationObserver setStyle @@ -349,7 +349,7 @@ Main = $.on mainStyleSheet, 'DOMAttrModified', setStyle initReady: -> - unless $.hasClass doc, 'fourchan_x' + unless $.hasClass doc, 'fourchan-x' # Something might go wrong! Main.initStyle() @@ -435,6 +435,14 @@ Main = textContent: error [message, error] - css: """<%= grunt.file.read('css/style.css') %>""" + css: """ + <%= grunt.file.read('css/style.css') %> + <%= grunt.file.read('css/yotsuba.css') %> + <%= grunt.file.read('css/yotsuba-b.css') %> + <%= grunt.file.read('css/futaba.css') %> + <%= grunt.file.read('css/burichan.css') %> + <%= grunt.file.read('css/tomorrow.css') %> + <%= grunt.file.read('css/photon.css') %> + """ Main.init()