From 01ba813f2fb9b12e9c105ce0f0ba5b163510a8c0 Mon Sep 17 00:00:00 2001 From: Tony Ford <tonyford@strategy-investor.de> Date: Sat, 27 Apr 2024 10:56:56 +0200 Subject: [PATCH] Optimierungen --- html/_layouts/default.php | 53 ++++++++++++++++++++----------------- html/assets/css/custom.scss | 15 +++++++++-- html/assets/js/script.js | 6 ++++- 3 files changed, 46 insertions(+), 28 deletions(-) diff --git a/html/_layouts/default.php b/html/_layouts/default.php index cb3ee13..51c60f3 100644 --- a/html/_layouts/default.php +++ b/html/_layouts/default.php @@ -419,32 +419,35 @@ if( !empty($csv) ){ </tbody> </table> - <table id="tabelle_team" class="tabelle d-none" ondblclick="backToActiveTable()"> - <thead> - <tr> - <th></th> - <th>Nt</th> - <th>Spieler</th> - <th>Alter</th> - <th>S/T/A</th> - <th>Zwk</th> - </tr> - </thead> - <tbody> - </tbody> - </table> - - <table id="tabelle_historie" class="tabelle d-none" ondblclick="backToActiveTable()"> - <thead> - <tr> - </tr> - </thead> - <tbody> - </tbody> - </table> + <div class="scrollen_team"> + <table id="tabelle_team" class="tabelle d-none" ondblclick="backToActiveTable()"> + <thead> + <tr> + <th></th> + <th>Nt</th> + <th>Spieler</th> + <th>Alter</th> + <th>S/T/A</th> + <th>Zwk</th> + </tr> + </thead> + <tbody> + </tbody> + </table> + </div> + <div class="scrollen"> + <table id="tabelle_historie" class="tabelle d-none" ondblclick="backToActiveTable()"> + <thead> + <tr> + </tr> + </thead> + <tbody> + </tbody> + </table> + </div> - <h3>Spielerdebüts</h3> - <table id="news"> + <h3 class="news">Spielerdebüts</h3> + <table id="news" class="news"> <thead> <th>Zeit</th> <th></th> diff --git a/html/assets/css/custom.scss b/html/assets/css/custom.scss index f793f5b..ba0c8c5 100644 --- a/html/assets/css/custom.scss +++ b/html/assets/css/custom.scss @@ -266,6 +266,7 @@ tr.stats { /* &:nth-child(4) { width: 50px; } */ } } + margin-bottom: 5em; } td.p { color: green; } @@ -382,9 +383,10 @@ td.n { color: firebrick; } } .face { - position: fixed; + /* position: fixed; top: 100px; right: 65%; + */ > img { position: absolute; &:nth-child(1){ z-index: 1 } @@ -408,7 +410,7 @@ td.n { color: firebrick; } } .tabelle td.face { - position: initial; + position: sticky; img { width: 20px; } @@ -449,4 +451,13 @@ i.fas { td.managervoted { background: palegoldenrod; +} + +div.scrollen { + overflow: scroll; +} + +div.scrollen_team { + overflow: auto; + max-height: 80vh; } \ No newline at end of file diff --git a/html/assets/js/script.js b/html/assets/js/script.js index f11ccbb..37bf6d6 100644 --- a/html/assets/js/script.js +++ b/html/assets/js/script.js @@ -472,7 +472,7 @@ function calculatePunktestand(saison,runde,show=true){ function calculateTabelle(saison,param){ var STATISTIK=saison == 0 ? STATISTIK_ALL : STATISTIK_SAISON; - var n=Object.entries( STATISTIK ).sort( (a,b) => ( a[1][param] < b[1][param] || ( a[1][param] == b[1][param] && a[1].S > b[1].S ) ) ? 1 : -1 ).slice(0,10).map( + var n=Object.entries( STATISTIK ).sort( (a,b) => ( a[1][param] < b[1][param] || ( a[1][param] == b[1][param] && a[1].S > b[1].S ) ) ? 1 : -1 ).slice(0,20).map( function(v,i){ var team=TEAMS.filter( (a) => ( a.nt == v[1].nt ) ); @@ -574,6 +574,7 @@ function calculateTabelle(saison,param){ ); $('#tabelle_'+param+' tbody').html( n ); + $('.news').toggleClass('d-none', false); } function calculateTeam(saison,nt){ @@ -693,6 +694,7 @@ function calculateEwige(){ $('#tabelle_P').toggleClass('d-none'); $('h4.tabelle > button.punktestand').toggleClass('active',true); $('h4.tabelle').toggleClass('d-none',false); + $('.news').toggleClass('d-none', true); } function backToActiveTable(){ @@ -727,6 +729,8 @@ function calculateHistorie(){ $('button.active').toggleClass('active',false); $('#historie').toggleClass('active',true); $('h4.tabelle').toggleClass('d-none',true); + $('.news').toggleClass('d-none', true); + $('.rest')[0].scrollIntoView(); } var R=undefined; -- GitLab