trying some changes to show live status on threads

merge-requests/208/head
fatchan 5 years ago
parent 3d2075e6e1
commit 6b7d2d98bc
  1. 44
      gulp/res/css/style.css
  2. 6
      gulp/res/js/live.js
  3. 8
      views/pages/boardlist.pug
  4. 3
      views/pages/thread.pug

@ -338,7 +338,25 @@ td, th {
z-index: 1;
}
.post-container, .stickynav, .pages, .toggle-summary, .catalog-tile, .modal {
.dot {
height: .75em;
width: .75em;
background-color: orange;
border-radius: 50%;
animation: pulsate 2s ease;
animation-iteration-count: infinite;
}
@keyframes pulsate {
0% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
.post-container, .stickynav, .pages, .toggle-summary, .catalog-tile, .modal, .live {
background: var(--post-color);
border-width: 1px;/*0 1px 1px 0;*/
border-style: solid;
@ -364,21 +382,21 @@ td, th {
.modal {
display: flex;
flex-direction: column;
max-width: calc(100% - 10px);
max-height: calc(100% - 50px);
position: fixed;
top: 38px;
background-color: var(--post-color);
z-index: 4;
box-sizing: border-box;
padding: 5px;
border: 1px solid var(--post-outline-color);
max-width: calc(100% - 10px);
max-height: calc(100% - 50px);
position: fixed;
top: 38px;
background-color: var(--post-color);
z-index: 4;
box-sizing: border-box;
padding: 5px;
border: 1px solid var(--post-outline-color);
align-self: center;
}
details.actions div {
display: flex;
flex-direction: column;
display: flex;
flex-direction: column;
}
.actions {
@ -428,7 +446,7 @@ details.actions div {
flex-flow: column wrap;
width: max-content;
width: -moz-max-content;
margin-top: 10px;
/*margin-top: 10px;*/
}
.toggle {

@ -69,15 +69,21 @@ window.addEventListener('DOMContentLoaded', (event) => {
const room = `${roomParts[1]}-${roomParts[3]}`;
const thread = document.querySelector('.thread');
const socket = io({ transports: ['websocket'] }); //no polling
const livedot = document.getElementById('livedot');
const livetext = document.getElementById('livetext').childNodes[1];
socket.on('connect', () => {
console.log('joined room', room);
livedot.style.color = '#0de600';
socket.emit('room', room);
});
socket.on('disconnect', () => {
console.log('lost connection to room');
livedot.style.color = 'orange';
});
socket.on('reconnect', () => {
console.log('reconnected to room');
livedot.style.color = '#0de600';
livetext.
jsonCatchup();
});
socket.on('newPost', newPost);

@ -55,9 +55,9 @@ block content
span.user-id.sfw SFW
|
a(href=board.path) #{board.siteName} /#{board.uri}/ - #{board.title}
td #{board.subtitle || '-'}
td #{board.postsPerHour || '-'}
td #{board.uniqueUsers || '-'}
td #{board.totalPosts || '-'}
td #{board.subtitle}
td #{board.postsPerHour}
td #{board.uniqueUsers}
td #{board.totalPosts}
nav.pages.text-center.mt-5.mv-0
include ../includes/boardlistpages.pug

@ -34,6 +34,9 @@ block content
for post in thread.replies
+post(post)
hr(size=1)
div.jsonly.live#livetext
.dot#livecolor
| Connecting...
nav.pages
+boardnav(null, true, true)
include ../includes/actionfooter.pug

Loading…
Cancel
Save