Refactored css.

This commit is contained in:
kor 2018-07-18 06:17:43 +12:00
parent 4e5c7e8b81
commit c277a302af
2 changed files with 142 additions and 134 deletions

View File

@ -1,189 +1,200 @@
html { /* VARIABLES */
background:#ddd; :root {
font-family:'Monaco', 'Andale Mono', 'Deja Vu Sans Mono', 'Consolas', monospace; /* COLOR */
font-size:1em; --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; box-sizing: border-box;
padding: 0em; padding: 0em;
margin:0; margin: 0;
} }
body { * {
box-sizing: border-box;
}
body {
padding: 0em; padding: 0em;
margin:0; margin: 0;
} }
* { box-sizing: border-box; }
/* MENU */ /* MENU */
.menu { .menu {
color: #fff; background: var(--color-menu0);
padding-top: var(--size-gutter);
width: var(--menu-width);
position: fixed;
height: 100%; height: 100%;
background:#000; z-index: 100;
position:fixed;
left: 0px; left: 0px;
top: 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 { .menu a {
color: #333; color: var(--color-menu1);
} }
.menu:hover a { .menu:hover a {
color: #999; color: var(--color-menu2);
} }
.menu:hover a:hover { .menu:hover a:hover {
color: #eee; color: var(--color-menu3);
} }
.menu-spacer { .menu-spacer {
height: 30px; height: var(--menu-item-spacer);
} width: 100%;
.menu-item {
font-size:1.5em;
height: 50px;
padding-top: 10px;
margin: 0px auto;
}
.menu-item .count {
float: left; 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 { .menu-tag-container {
margin: 0 auto;
display: table; display: table;
margin: 40px auto;
} }
.menu-tag-container i { .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; display: table-row;
font-size:1.5em;
width: 100%;
text-align: center; text-align: center;
color: #333; width: 100%;
height: 30px; float: left;
} }
.menu:hover .menu-tag-container i { .menu:hover .menu-tag-container i {
color: #999; color: var(--color-menu2);
} }
.menu-tag { .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; display: table-row;
font-size:0.8em; width: 100%;
height: 20px;
margin-top: 5px;
padding-top: 2px;
float: left; float: left;
clear: left; clear: left;
} }
.menu-tag-count { .menu-tag-count {
float: left; padding-right: var(--menu-tag-sep);
text-align: right; text-align: right;
padding-right: 10px; float: left;
} }
.menu-tag-label { .menu-tag-label {
float: left;
text-align: left; text-align: left;
float: left;
} }
/* CONTENT */
.container { .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 { .grid {
border: 1px; margin: var(--size-gutter) auto;
filter: blur(0px);
margin: 20px auto;
transition: 0.05s -webkit-filter ease-out;
} }
.grid:after { .grid:after {
/* clearfix */ /* clearfix */
content: '';
display: block; display: block;
content: '';
clear: both; clear: both;
} }
.grid-item, .grid-item--width2 { .grid-item, .grid-item--width2 {
width: 350px; border-radius: var(--size-item-corner);
margin-bottom: 20px; margin-bottom: var(--size-gutter);
border-radius: 3px; background: var(--color-content0);
color:#000; width: var(--size-grid-column);
background:#ccc; padding: var(--size-gutter);
padding:20px;
min-height:2.4em;
float:left;
box-sizing: border-box; box-sizing: border-box;
float: left;
} }
@media screen and (min-width: 886px) { @media screen and (min-width: 886px) {
.grid-item--width2 { .grid-item--width2 {
width: 720px; width: calc(var(--size-grid-column) * 2 + var(--size-gutter));
} }
/*html {
background:#000;
}*/
} }
.grid-item:hover { .grid-item:hover {
background:#bbb;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, .1); box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, .1);
background: var(--color-content1);
} }
/* LINK */ /* LINK */
a#url { a#url, a#urlseen {
color:#aaa; color: var(--color-content2);
text-decoration:underline; text-decoration: underline;
} }
a#urlseen { .grid-item:hover a#url, .grid-item:hover a#urlseen {
color:#aaa; color: var(--color-content3);
text-decoration:underline;
} }
.grid-item:hover a#url:hover, .grid-item:hover a#urlseen:hover {
.grid-item:hover a#url { background-color: var(--color-content3);
color:#000; color: var(--color-content1);
}
.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;
} }
/* TITLE */ /* TITLE */
.title { .title {
margin-right: 45px; margin-right: calc(var(--type-icon-size) * 2);
font-size:1em; font-size: var(--size-font-title);
color:#000; color: var(--color-content3);
/*background-color: #000;*/
} }
/* LINK, NOTE, QUOTE, TERM, TAGS */ /* LINK, NOTE, QUOTE, TERM, TAGS */
.link, .note, .quote, .term, .tags, .prog { .link, .note, .quote, .term, .tags, .prog {
padding-top: 1em; padding-top: var(--size-item-elem-padding);
font-size:0.8em; font-size: var(--size-font-body);
color:#999; color: var(--color-content2);
} }
.grid-item:hover .link, .grid-item:hover .link,
.grid-item:hover .note, .grid-item:hover .note,
@ -191,46 +202,42 @@ a#urlseen {
.grid-item:hover .term, .grid-item:hover .term,
.grid-item:hover .prog .grid-item:hover .prog
{ {
color:#000; color: var(--color-content3);
} }
.tags a { .tags a {
color:#999; color: var(--color-content2);
text-decoration:none; text-decoration:none;
} }
.grid-item:hover .tags a { .grid-item:hover .tags a {
color:#000; color: var(--color-content3);
} }
.grid-item:hover .tags a:hover { .grid-item:hover .tags a:hover {
color:#bbb; background-color: var(--color-content3);
background-color: #000; color: var(--color-content1);
} }
.textIcon { .textIcon {
color:#bbb; color: var(--color-content1);
margin-right:0.75em; margin-right: var(--size-item-elem-sep);
} }
.grid-item:hover .textIcon { .grid-item:hover .textIcon {
color:#999; color: var(--color-content2);
} }
/* TYPE */ /* TYPE */
#type a { #type a {
text-align: center; color: var(--color-content1);
font-size: var(--type-icon-size);
padding: var(--size-gutter);
vertical-align: top; vertical-align: top;
width: 70px; text-align: center;
height: 62px;
position: absolute; position: absolute;
padding-top: 18px; right: 0px;
top: 0px; top: 0px;
right: 0px;
color:#bbb;
font-size:1.5em;
/*background: #000;*/
}
.grid-item:hover #type a:hover {
color:#000;
} }
.grid-item:hover #type a { .grid-item:hover #type a {
color:#999; color: var(--color-content2);
}
.grid-item:hover #type a:hover {
color: var(--color-content3);
} }

View File

@ -300,7 +300,6 @@ function ViewMasonry()
} }
} }
// SPACER
menuContent += `<div class="menu-spacer"></div>`; menuContent += `<div class="menu-spacer"></div>`;
// TERM // TERM
@ -315,6 +314,8 @@ function ViewMasonry()
menuContent += `</a>`; menuContent += `</a>`;
} }
menuContent += `<div class="menu-spacer"></div>`;
// TAGS // TAGS
if (stats.tags.length > 0) if (stats.tags.length > 0)
{ {