fix auto scroll

main
Razmig Sarkissian 2 years ago
parent 53db1b955d
commit 169068362a
  1. 15
      scores/templates/scores/brackets.html
  2. 17
      scores/templates/scores/ranks.html
  3. 17
      scores/templates/scores/teams.html
  4. 73
      scores/templates/scores/tournament.html

@ -32,14 +32,6 @@
} else { } else {
iScrollInterval = iScroll * 10; iScrollInterval = iScroll * 10;
} }
var fade = function() {
$("body").fadeOut(iFadeInterval, function(){
$("html, body").scrollTop(0);
$("body").fadeIn(iFadeInterval,function(){
setTimeout(loop, iInterval);
});
});
}
var loop = function() { var loop = function() {
var iScroll = $(document).height() - $(window).height(); var iScroll = $(document).height() - $(window).height();
@ -54,12 +46,11 @@
duration : iScrollInterval, duration : iScrollInterval,
easing : "linear", easing : "linear",
complete : function() { complete : function() {
setTimeout(fade, iInterval); setTimeout(function(){
window.location.reload();
}, iInterval);
} }
}); });
setTimeout(function(){
window.location.reload();
}, Math.max(iScrollInterval * 10 + 2000, 15000));
}; };
setTimeout(loop, iInterval); setTimeout(loop, iInterval);
</script> </script>

@ -15,7 +15,7 @@
<title>Padel</title> <title>Padel</title>
</head> </head>
{% if tv %} {% if tv %}
<div class="wrapper" style="zoom:200%"> <div class="wrapper" style="zoom:125%">
{% else %} {% else %}
<div class="wrapper"> <div class="wrapper">
{% endif %} {% endif %}
@ -33,14 +33,6 @@
} else { } else {
iScrollInterval = iScroll * 10; iScrollInterval = iScroll * 10;
} }
var fade = function() {
$("body").fadeOut(iFadeInterval, function(){
$("html, body").scrollTop(0);
$("body").fadeIn(iFadeInterval,function(){
setTimeout(loop, iInterval);
});
});
}
var loop = function() { var loop = function() {
var iScroll = $(document).height() - $(window).height(); var iScroll = $(document).height() - $(window).height();
@ -55,12 +47,11 @@
duration : iScrollInterval, duration : iScrollInterval,
easing : "linear", easing : "linear",
complete : function() { complete : function() {
setTimeout(fade, iInterval); setTimeout(function(){
window.location.reload();
}, iInterval);
} }
}); });
setTimeout(function(){
window.location.reload();
}, Math.max(iScrollInterval * 10 + 2000, 15000));
}; };
setTimeout(loop, iInterval); setTimeout(loop, iInterval);
</script> </script>

@ -15,7 +15,7 @@
<title>Padel</title> <title>Padel</title>
</head> </head>
{% if tv %} {% if tv %}
<div class="wrapper" style="zoom:200%"> <div class="wrapper" style="zoom:125%">
{% else %} {% else %}
<div class="wrapper"> <div class="wrapper">
{% endif %} {% endif %}
@ -33,14 +33,6 @@
} else { } else {
iScrollInterval = iScroll * 10; iScrollInterval = iScroll * 10;
} }
var fade = function() {
$("body").fadeOut(iFadeInterval, function(){
$("html, body").scrollTop(0);
$("body").fadeIn(iFadeInterval,function(){
setTimeout(loop, iInterval);
});
});
}
var loop = function() { var loop = function() {
var iScroll = $(document).height() - $(window).height(); var iScroll = $(document).height() - $(window).height();
@ -55,12 +47,11 @@
duration : iScrollInterval, duration : iScrollInterval,
easing : "linear", easing : "linear",
complete : function() { complete : function() {
setTimeout(fade, iInterval); setTimeout(function(){
window.location.reload();
}, iInterval);
} }
}); });
setTimeout(function(){
window.location.reload();
}, Math.max(iScrollInterval * 10 + 2000, 15000));
}; };
setTimeout(loop, iInterval); setTimeout(loop, iInterval);
</script> </script>

@ -22,47 +22,38 @@
{% if tv %} {% if tv %}
<script> <script>
var iInterval = 2000; var iInterval = 2000;
var iScrollInterval = 10000; var iScrollInterval = 10000;
var iFadeInterval = 500; var iFadeInterval = 500;
var iScroll = $(document).height() - $(window).height(); var iScroll = $(document).height() - $(window).height();
if (iScroll * 10 + 4000 < 15000) { if (iScroll * 10 + 4000 < 15000) {
iScrollInterval = 10000; iScrollInterval = 10000;
} else { } else {
iScrollInterval = iScroll * 10; iScrollInterval = iScroll * 10;
} }
var fade = function() {
$("body").fadeOut(iFadeInterval, function(){ var loop = function() {
$("html, body").scrollTop(0); var iScroll = $(document).height() - $(window).height();
$("body").fadeIn(iFadeInterval,function(){ if (iScroll * 10 + 4000 < 15000) {
setTimeout(loop, iInterval); iScrollInterval = 10000;
}); } else {
}); iScrollInterval = iScroll * 10;
} }
$("html, body").animate({
var loop = function() { scrollTop: iScroll
var iScroll = $(document).height() - $(window).height(); }, {
if (iScroll * 10 + 4000 < 15000) { duration : iScrollInterval,
iScrollInterval = 10000; easing : "linear",
} else { complete : function() {
iScrollInterval = iScroll * 10; setTimeout(function(){
} window.location.reload();
$("html, body").animate({ }, iInterval);
scrollTop: iScroll }
}, { });
duration : iScrollInterval, };
easing : "linear", setTimeout(loop, iInterval);
complete : function() { </script>
setTimeout(fade, iInterval);
}
});
setTimeout(function(){
window.location.reload();
}, Math.max(iScrollInterval * 10 + 2000, 15000));
};
setTimeout(loop, iInterval);
</script>
{% endif %} {% endif %}
{% if tournament.club.header %} {% if tournament.club.header %}

Loading…
Cancel
Save