The first commit

This commit is contained in:
Andros Fenollosa
2022-03-04 11:33:29 +01:00
commit 9996b1e14c
20 changed files with 600 additions and 0 deletions

24
static/js/index.js Normal file
View File

@ -0,0 +1,24 @@
const notyf = new Notyf({
position: {
x: 'right',
y: 'top',
}
});
const sse = new EventSource("/events/");
sse.onmessage = function(event) {
const data = JSON.parse(event.data);
console.log(data);
switch (data.action) {
case 'User connected':
notyf.success(`Connected: ${data.name}`);
break;
case 'User disconnected':
notyf.error(`Disconnected: ${data.name}`);
break;
case 'New message':
notyf.success(`${data.name}: ${data.text.slice(0, 20)}...`);
break;
}
}

8
static/js/prism.js Normal file

File diff suppressed because one or more lines are too long