update according to webpack changes, replace collapsable navbar with simple links, add download button, import socket.io.client from bundle, fix weird styling issues after dependencies update

This commit is contained in:
2022-05-31 22:41:46 +00:00
parent 94b03e90d9
commit d5691ad264
8 changed files with 47 additions and 38 deletions

View File

@@ -211,10 +211,10 @@ function updateDownloadLink(){
} }
function tableClickListener(){ function tableClickListener(){
$( "tbody tr").unbind(); $( "tbody tr td").unbind();
$( "tbody tr").hover(function(){ $( "tbody tr td").hover(function(){
let selected = $(this).hasClass("ui-state-highlight"); let selected = $(this).hasClass("ui-state-highlight");
$("tbody tr").removeClass("ui-state-highlight"); $("tbody tr td").removeClass("ui-state-highlight");
if (!selected) { if (!selected) {
$(this).addClass("ui-state-highlight"); $(this).addClass("ui-state-highlight");
} }
@@ -278,6 +278,7 @@ Player.prototype = {
requestAnimationFrame(self.step.bind(self)); requestAnimationFrame(self.step.bind(self));
}, },
onload: function() { onload: function() {
console.log(sound.duration())
$( '#txt-duration' ).text(self.formatTime(Math.round(sound.duration()))); $( '#txt-duration' ).text(self.formatTime(Math.round(sound.duration())));
$( '#playBtn' ).prop("disabled", false); $( '#playBtn' ).prop("disabled", false);
$( '#downloadBtn' ).prop("disabled", false); $( '#downloadBtn' ).prop("disabled", false);

View File

@@ -1,5 +1,6 @@
import './scss/app.scss'; import './scss/app.scss';
import 'bootstrap'; import 'bootstrap';
const io = require('socket.io-client')
//adding the fontawesome icons //adding the fontawesome icons
import { library, dom } from "@fortawesome/fontawesome-svg-core"; import { library, dom } from "@fortawesome/fontawesome-svg-core";

View File

@@ -2,17 +2,17 @@
<html> <html>
<head> <head>
<title>SlowDowner</title> <title>SlowDowner</title>
${require ('./views/head.html')} <%= require('./views/head.html').default %>
</head> </head>
<body> <body>
${require ('./views/menu.html')} <%= require('./views/menu.html').default %>
<div class='container-fluid'> <div class='container-fluid'>
<div class='row'> <div class='row'>
<div class='col-md-5'> <div class='col-md-5'>
<div class="input-group mb-3"> <div class="input-group mb-3">
<select class="custom-select" id="dir-dropdown"></select> <select class="custom-select" id="dir-dropdown"></select>
</div> </div>
<table id='songlist' class='table table-bordered'> <table id='songlist' class='table table-bordered table-striped'>
<thead> <thead>
<tr> <tr>
<th>Stücke</th> <th>Stücke</th>
@@ -27,7 +27,7 @@
<p class="info-txt-small" id="txt-timer">0:00</p> <p class="info-txt-small" id="txt-timer">0:00</p>
</div> </div>
<div class='col-6'> <div class='col-6'>
<p class="info-txt-small text-right" id="txt-duration">0:00</p> <p class="info-txt-small align-right" id="txt-duration">0:00</p>
</div> </div>
<div class="col-12 slidecontainer spacer-bottom"> <div class="col-12 slidecontainer spacer-bottom">
<input type="range" min="0" max="1000" value="0" class="slider" id="position-slider"> <input type="range" min="0" max="1000" value="0" class="slider" id="position-slider">
@@ -66,7 +66,7 @@
</div> </div>
</div> </div>
</div> </div>
${require ('./views/footer.html')} <%= require('./views/footer.html').default %>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -5,6 +5,7 @@
/* Colors */ /* Colors */
$secondary-color: #456632; $secondary-color: #456632;
$bg-dark: #343a40; $bg-dark: #343a40;
$bg-grey: #fefefe;
/* scss */ /* scss */
@@ -25,6 +26,7 @@ $bg-dark: #343a40;
body { body {
font: 13px Helvetica, Arial; font: 13px Helvetica, Arial;
background-color: $bg-grey;
} }
.container-fluid { .container-fluid {
@@ -32,6 +34,10 @@ body {
min-width: 25em; min-width: 25em;
} }
.nav-link{
color: $bg-grey;
}
.info-txt{ .info-txt{
font-size: 1.5em; font-size: 1.5em;
} }
@@ -42,6 +48,7 @@ body {
.btn{ .btn{
font-size: 1.8em; font-size: 1.8em;
width: 2em;
} }
#txt-duration-label { #txt-duration-label {
@@ -123,6 +130,6 @@ body {
} }
.ui-state-highlight { .ui-state-highlight {
color: #FFFFFF !important; color: #FFF !important;
background: $bg-dark !important; background: $bg-dark !important;
} }

View File

@@ -2,10 +2,10 @@
<html> <html>
<head> <head>
<title>Noten</title> <title>Noten</title>
${require ('./views/head.html')} <%= require('./views/head.html').default %>
</head> </head>
<body> <body>
${require ('./views/menu.html')} <%= require('./views/menu.html').default %>
<div class='container-fluid'> <div class='container-fluid'>
<div class='row'> <div class='row'>
<div class='col-md-12'> <div class='col-md-12'>
@@ -30,7 +30,7 @@
<div id='pdf_viewer'></div> <div id='pdf_viewer'></div>
</div> </div>
</div> </div>
${require ('./views/footer.html')} <%= require('./views/footer.html').default %>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,4 +1,3 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name='viewport' content='width=device-width, initial-scale=1.0'> <meta name='viewport' content='width=device-width, initial-scale=1.0'>
<link rel='shortcut icon' type='image/png' href='../images/snail.png'/> <link rel='shortcut icon' type='image/png' href='../images/snail.png'/>
<script src='/socket.io/socket.io.js'></script>

View File

@@ -1,13 +1,11 @@
<nav class='navbar navbar-dark navbar-expand-sm bg-dark'> <nav class='navbar navbar-dark bg-dark'>
<div class='container-fluid'> <div class='container-fluid'>
<a class="navbar-brand" href="/"> <ul class="nav nav-pills nav-dark bg-dark">
<li class="nav-item">
<a class="nav-brand" href="/">
<img src="../images/snail.png" width="30" height="30" alt="SlowDowner Logo"> <img src="../images/snail.png" width="30" height="30" alt="SlowDowner Logo">
</a> </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> </li>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item"> <li class="nav-item">
<a class='nav-link' href='/'><i class="fa fa-music"></i> Musik</a> <a class='nav-link' href='/'><i class="fa fa-music"></i> Musik</a>
</li> </li>
@@ -16,5 +14,4 @@
</li> </li>
</ul> </ul>
</div> </div>
</div>
</nav> </nav>

View File

@@ -46,7 +46,10 @@ function get_file_list(socket, req){
let json = []; let json = [];
let files = []; let files = [];
let songs_path = path.join(__dirname, '../dist/', req) let songs_path = path.join(__dirname, '../dist/', req)
fs.readdirSync(songs_path).forEach(dir => { fs.readdir(songs_path, (err, res) => {
if(err) io.to(socket.id).emit('message','failed to load data... - '+err)
else
res.forEach(dir => {
fs.readdirSync(path.join(songs_path,dir)).forEach(file => { fs.readdirSync(path.join(songs_path,dir)).forEach(file => {
files.push({'name': file}); files.push({'name': file});
}); });
@@ -54,4 +57,5 @@ function get_file_list(socket, req){
files = []; files = [];
}); });
io.to(socket.id).emit('update_' + req ,json); io.to(socket.id).emit('update_' + req ,json);
});
} }