diff --git a/asset/style.css b/asset/style.css index c50ac49..c5262e3 100644 --- a/asset/style.css +++ b/asset/style.css @@ -1,189 +1,200 @@ -html { - background:#ddd; - font-family:'Monaco', 'Andale Mono', 'Deja Vu Sans Mono', 'Consolas', monospace; - font-size:1em; +/* VARIABLES */ +:root { + /* COLOR */ + --color-menu0: #000; /* bg */ + --color-menu1: #333; /* low */ + --color-menu2: #999; /* mid */ + --color-menu3: #ddd; /* high */ + + --color-bg: #ddd; /* bg main */ + + --color-content0: #ccc; /* bg */ + --color-content1: #bbb; /* low */ + --color-content2: #999; /* mid */ + --color-content3: #000; /* high */ + + /* SIZE */ + --menu-width: 150px; + --menu-item-vert-sep: 20px; /*vertical space between menu items*/ + --menu-item-elem-sep: 10px; /*horizontal space between menu item count and icon*/ + --menu-item-spacer: 30px; /*vertical space between menu types (types to terms, terms to tags)*/ + --menu-tag-sep: 10px; /*space between tag items*/ + + --size-gutter: 20px; + --size-grid-column: 350px; + + --size-item-corner: 3px; + --size-item-elem-padding: 1em; /*vertical space between grid item internal elements (tags, notes, quotes etc)*/ + --size-item-elem-sep: 0.75em; /*horizontal space between item element icon and element text (tag icon and tags)*/ + + --size-font-title: 1em; + --size-font-body: 0.8em; + --type-icon-size: 24px; /*font size of type icon/count*/ +} + +html { + font-family: 'Monaco', 'Andale Mono', 'Deja Vu Sans Mono', 'Consolas', monospace; + background: var(--color-bg); box-sizing: border-box; padding: 0em; - margin:0; + margin: 0; } -body { +* { + box-sizing: border-box; +} + +body { padding: 0em; - margin:0; + margin: 0; } -* { box-sizing: border-box; } - /* MENU */ .menu { - color: #fff; + background: var(--color-menu0); + padding-top: var(--size-gutter); + width: var(--menu-width); + position: fixed; height: 100%; - background:#000; - position:fixed; + z-index: 100; left: 0px; top: 0px; - z-index: 100; - padding-top:20px; - width: 150px; - /*-webkit-transition: width 0.05s ease-in-out; - transition: width 0.05s ease-in-out;*/ -} -.menu:hover { - /*width: 370px;*/ - /*-webkit-transition: width 0.05s ease-in-out; - transition: width 0.05s ease-in-out;*/ - /*box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, .1);*/ } .menu a { - color: #333; + color: var(--color-menu1); } .menu:hover a { - color: #999; + color: var(--color-menu2); } .menu:hover a:hover { - color: #eee; + color: var(--color-menu3); } .menu-spacer { - height: 30px; -} -.menu-item { - font-size:1.5em; - height: 50px; - padding-top: 10px; - margin: 0px auto; -} -.menu-item .count { + height: var(--menu-item-spacer); + width: 100%; float: left; - text-align: right; - width: 50%; - padding-right: 10px; -} -.menu-item i { - float: left; - text-align: center; - width: 50px; - margin-top: 2px; } +/* MENU ITEMS */ +.menu-item { + padding-top: calc(var(--menu-item-vert-sep) / 2); + padding-bottom: calc(var(--menu-item-vert-sep) / 2); + font-size: var(--type-icon-size); + box-sizing: border-box; + margin: 0px auto; + width: 100%; + float: left; +} +.menu-item .count { + padding-right: calc(var(--menu-item-elem-sep) / 2); + display: inline-block; + text-align: right; + float: left; + width: 50%; +} +.menu-item i { + margin-left: calc(var(--menu-item-elem-sep) / 2); + margin-top: calc(var(--type-icon-size) / 10); + width: calc(var(--type-icon-size) * 1.25); + display: inline-block; + text-align: center; + float: left; +} + +/* MENU TAGS */ .menu-tag-container { + margin: 0 auto; display: table; - margin: 40px auto; } .menu-tag-container i { + padding-bottom: calc(var(--menu-item-vert-sep) / 2); + padding-top: calc(var(--menu-item-vert-sep) / 2); + font-size: var(--type-icon-size); + color: var(--color-menu1); display: table-row; - font-size:1.5em; - width: 100%; text-align: center; - color: #333; - height: 30px; + width: 100%; + float: left; } .menu:hover .menu-tag-container i { - color: #999; + color: var(--color-menu2); } .menu-tag { + padding-bottom: calc(var(--menu-tag-sep) / 2); + padding-top: calc(var(--menu-tag-sep) / 2); + font-size: var(--size-font-body); display: table-row; - font-size:0.8em; - height: 20px; - margin-top: 5px; - padding-top: 2px; + width: 100%; float: left; clear: left; } .menu-tag-count { - float: left; + padding-right: var(--menu-tag-sep); text-align: right; - padding-right: 10px; + float: left; } .menu-tag-label { - float: left; text-align: left; + float: left; } - - +/* CONTENT */ .container { - margin-left: 150px; /* This should be the width of the menu */ + margin-left: var(--menu-width); } -/*.menu:hover + .container{ - transition: 0.05s -webkit-filter ease-in; - filter: blur(3px); -}*/ - .grid { - border: 1px; - filter: blur(0px); - margin: 20px auto; - transition: 0.05s -webkit-filter ease-out; + margin: var(--size-gutter) auto; } .grid:after { /* clearfix */ - content: ''; display: block; + content: ''; clear: both; } - .grid-item, .grid-item--width2 { - width: 350px; - margin-bottom: 20px; - border-radius: 3px; - color:#000; - background:#ccc; - padding:20px; - min-height:2.4em; - float:left; + border-radius: var(--size-item-corner); + margin-bottom: var(--size-gutter); + background: var(--color-content0); + width: var(--size-grid-column); + padding: var(--size-gutter); box-sizing: border-box; + float: left; } @media screen and (min-width: 886px) { .grid-item--width2 { - width: 720px; + width: calc(var(--size-grid-column) * 2 + var(--size-gutter)); } - /*html { - background:#000; - }*/ } .grid-item:hover { - background:#bbb; box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, .1); + background: var(--color-content1); } /* LINK */ -a#url { - color:#aaa; - text-decoration:underline; +a#url, a#urlseen { + color: var(--color-content2); + text-decoration: underline; } -a#urlseen { - color:#aaa; - text-decoration:underline; +.grid-item:hover a#url, .grid-item:hover a#urlseen { + color: var(--color-content3); } - -.grid-item:hover a#url { - color:#000; -} -.grid-item:hover a#url:hover { - color:#bbb; - background-color: #000; -} -.grid-item:hover a#urlseen { - color:#666; -} -.grid-item:hover a#urlseen:hover { - color:#bbb; - background-color: #000; +.grid-item:hover a#url:hover, .grid-item:hover a#urlseen:hover { + background-color: var(--color-content3); + color: var(--color-content1); } /* TITLE */ .title { - margin-right: 45px; - font-size:1em; - color:#000; - /*background-color: #000;*/ + margin-right: calc(var(--type-icon-size) * 2); + font-size: var(--size-font-title); + color: var(--color-content3); } /* LINK, NOTE, QUOTE, TERM, TAGS */ .link, .note, .quote, .term, .tags, .prog { - padding-top: 1em; - font-size:0.8em; - color:#999; + padding-top: var(--size-item-elem-padding); + font-size: var(--size-font-body); + color: var(--color-content2); } .grid-item:hover .link, .grid-item:hover .note, @@ -191,46 +202,42 @@ a#urlseen { .grid-item:hover .term, .grid-item:hover .prog { - color:#000; + color: var(--color-content3); } .tags a { - color:#999; + color: var(--color-content2); text-decoration:none; } .grid-item:hover .tags a { - color:#000; + color: var(--color-content3); } .grid-item:hover .tags a:hover { - color:#bbb; - background-color: #000; + background-color: var(--color-content3); + color: var(--color-content1); } .textIcon { - color:#bbb; - margin-right:0.75em; + color: var(--color-content1); + margin-right: var(--size-item-elem-sep); } .grid-item:hover .textIcon { - color:#999; + color: var(--color-content2); } /* TYPE */ #type a { - text-align: center; + color: var(--color-content1); + font-size: var(--type-icon-size); + padding: var(--size-gutter); vertical-align: top; - width: 70px; - height: 62px; + text-align: center; position: absolute; - padding-top: 18px; - top: 0px; - right: 0px; - color:#bbb; - font-size:1.5em; - /*background: #000;*/ -} - -.grid-item:hover #type a:hover { - color:#000; + right: 0px; + top: 0px; } .grid-item:hover #type a { - color:#999; + color: var(--color-content2); +} +.grid-item:hover #type a:hover { + color: var(--color-content3); } \ No newline at end of file diff --git a/logic/viewmasonry.js b/logic/viewmasonry.js index 53e682a..2004fa5 100644 --- a/logic/viewmasonry.js +++ b/logic/viewmasonry.js @@ -300,7 +300,6 @@ function ViewMasonry() } } - // SPACER menuContent += `
`; // TERM @@ -315,6 +314,8 @@ function ViewMasonry() menuContent += ``; } + menuContent += ``; + // TAGS if (stats.tags.length > 0) {