minor style changes

merge-requests/208/head
fatchan 5 years ago
parent f1a3f3848d
commit 754cc6d332
  1. 13
      gulp/res/css/style.css
  2. 13
      gulp/res/css/themes/chaos.css
  3. 4
      gulp/res/css/themes/tomorrow2.css
  4. 41
      gulp/res/js/hover.js

@ -2,7 +2,7 @@ body {
font-family: arial, helvetica, sans-serif;
font-size: 10pt;
color: var(--font-color);
background: linear-gradient(var(--background-top) 38px, var(--background-rest) 238px);
background: linear-gradient(var(--background-top) 3em, var(--background-rest) 230px);
flex: 1;
display: flex;
flex-direction: column;
@ -11,7 +11,7 @@ body {
}
main {
margin: 38px 0 0 0;
margin: 3em 0 0 0;
}
.row {
@ -59,6 +59,7 @@ pre {
.navbar {
background: var(--navbar-color);
box-shadow: 0 0 3px 1px var(--darken);
border-bottom: 1px solid var(--post-outline-color);
position: fixed;
width: 100%;
@ -424,7 +425,7 @@ td, th {
max-width: calc(100% - 10px);
max-height: calc(100% - 50px);
position: fixed;
top: 38px;
top: 3em;
background-color: var(--post-color);
z-index: 4;
box-sizing: border-box;
@ -731,7 +732,7 @@ input:invalid, textarea:invalid {
}
.nav-item {
line-height: 38px;
line-height: 3em;
text-decoration: none;
float: left;
padding-left: 10px;
@ -793,7 +794,7 @@ input[type="file"] {
max-width: calc(100% - 10px);
max-height: calc(100% - 50px);
position: fixed;
top: 38px;
top: 3em;
right: 5px;
background-color: var(--post-color);
z-index: 2;
@ -974,7 +975,7 @@ table.boardtable td:nth-child(6) {
}
.pages {
width:100%;
/*width:100%;*/
}
.pad-anchor {

@ -27,6 +27,8 @@
--title-color:#d70000;
--greentext-color:#FF0000;
}
#livetext,
#threadstats,
#float .post-container,
.catalog-tile,
.live,
@ -63,3 +65,14 @@ a:hover {
background:var(--link-hover)!important;
color:black!important;
}
.anchor:target + .post-container .post-info, .post-container.highlighted .post-info {
border-bottom: none;
}
@media only screen and (max-width: 600px) {
.post-info{
background: none;
border-bottom: none;
}
}

@ -30,9 +30,7 @@
}
.anchor:target + .post-container,
.post-container.highlighted,
.anchor:target + table tbody tr th,
.anchor:target + table {
.post-container.highlighted {
border: 1px solid var(--highlighted-post-outline-color) !important;
}

@ -84,20 +84,16 @@ window.addEventListener('DOMContentLoaded', (event) => {
hoveredPost = anchor.nextSibling;
} else {
let hovercache = localStorage.getItem(`hovercache-${jsonPath}`);
let threadJson;
let postJson;
if (hovercache) {
hovercache = JSON.parse(hovercache);
let highestId = 0;
if (hovercache.replies && hovercache.replies.length > 0) {
highestId = Math.max(hovercache.postId, hovercache.replies[hovercache.replies.length-1].postId);
}
if (highestId && highestId >= hash) {
//post already in our cache
threadJson = hovercache;
if (hovercache.postId == hash) {
postJson = hovercache;
} else if (hovercache.replies.length > 0) {
postJson = hovercache.replies.find(r => r.postId == hash);
}
}
if (!threadJson) {
if (!postJson) {//wasnt cached or cache outdates
this.style.cursor = 'wait';
let json;
try {
@ -111,8 +107,12 @@ window.addEventListener('DOMContentLoaded', (event) => {
this.style.cursor = '';
}
if (json) {
threadJson = json;
setLocalStorage(`hovercache-${jsonPath}`, JSON.stringify(threadJson));
setLocalStorage(`hovercache-${jsonPath}`, JSON.stringify(jsonson));
if (json.postId == hash) {
postJson = json;
} else {
postJson = json.replies.find(r => r.postId == hash);
}
} else {
return localStorage.removeItem(`hovercache-${jsonPath}`); //thread deleted
}
@ -120,13 +120,8 @@ window.addEventListener('DOMContentLoaded', (event) => {
if (lastHover !== loading) {
return; //dont show for ones not hovering
}
if (threadJson.postId == hash) {
postJson = threadJson;
} else {
postJson = threadJson.replies.find(r => r.postId == hash);
}
if (!postJson) {
return; //post was deleted or missing for some reason
return; //post was deleted or missing
}
const postHtml = post({ post: postJson });
const wrap = document.createElement('div');
@ -134,13 +129,13 @@ window.addEventListener('DOMContentLoaded', (event) => {
hoveredPost = wrap.firstChild.nextSibling;
//need this event so handlers like post hiding still apply to hover introduced posts
const newPostEvent = new CustomEvent('addPost', {
detail: {
post: hoveredPost,
postId: postJson.postId,
detail: {
post: hoveredPost,
postId: postJson.postId,
hover: true
}
});
window.dispatchEvent(newPostEvent);
}
});
window.dispatchEvent(newPostEvent);
}
toggleDottedUnderlines(hoveredPost, thisId);
hoveredPost.classList.remove('highlighted');

Loading…
Cancel
Save