gez-boykott.de > Inhalte / Funktionen für das NEUE gez-boykott.de
Vorschlag: Countdown Entscheidungstermin Bundesverfassungsgericht und EUGH
Bürger:
Ich kann da leider (zumindest bzgl. des Counters selbst) nicht praktisch dienen - aber vielleicht ja PersonX...?
Am besten wäre es, der Counter könnte hier erst mal testweise implementiert und später dann nach Bedarf inhaltlich und/oder bzgl. Formatierung angepasst werden.
PersonX:
Der Block im Code kann als html gespeichert werden und würde wohl in etwa das machen, also zwei Werte zählen, das ist zwar jetzt von der Programmierung nicht besonders schön, könnte aber so sicherlich Verwendung finden.
--- Code: ---<!-- Display the countdown timer in an element -->
<p><span id="counter1"></span> bis zur Entscheidung des Bundesverfassungsgerichts</p>
<span id="counter2"></span>bis zur Entscheidung des EUGH</p>
<script>
// Set the date we're counting down to
var countDownDate1 = new Date("Dec 31, 2017 23:59:59").getTime();
var countDownDate2 = new Date("Dec 31, 2018 23:59:59").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now an the count down date
var distance1 = countDownDate1 - now;
var distance2 = countDownDate2 - now;
// Time calculations for days, hours, minutes and seconds
var days1 = Math.floor(distance1 / (1000 * 60 * 60 * 24));
var hours1 = Math.floor((distance1 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes1 = Math.floor((distance1 % (1000 * 60 * 60)) / (1000 * 60));
var seconds1 = Math.floor((distance1 % (1000 * 60)) / 1000);
var days2 = Math.floor(distance2 / (1000 * 60 * 60 * 24));
var hours2 = Math.floor((distance2 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes2 = Math.floor((distance2 % (1000 * 60 * 60)) / (1000 * 60));
var seconds2 = Math.floor((distance2 % (1000 * 60)) / 1000);
// Display the result in the element with id="counter1"
document.getElementById("counter1").innerHTML = days1 + "d " + hours1 + "h "
+ minutes1 + "m " + seconds1 + "s ";
// Display the result in the element with id="counter2"
document.getElementById("counter2").innerHTML = days2 + "d " + hours2 + "h "
+ minutes2 + "m " + seconds2 + "s ";
// If the count down is finished, write some text
if (distance1 < 0){
document.getElementById("counter1").innerHTML = "EXPIRED";
}
if (distance2 < 0) {
clearInterval(x);
document.getElementById("counter2").innerHTML = "EXPIRED";
}
if(distance1 < 0 && distance2 < 0)
{
clearInterval(x);
}
}, 1000);
</script>
--- Ende Code ---
Bürger:
Danke für die Vorlage!
Eine fiktive Person B hat sich nur noch etwas mit ihrem HTML-Restwissen an der Optik versucht:
+ Arial-Schrift bzw. serifenlos
+ zentriert
+ Zeilenumbrüche
+ Counter-Schrift groß, fett, rot ;)
...möglicherweise nicht ganz "sauberes" HTML.
--- Code: ---<!-- Display the countdown timer in an element -->
<p align=center>
<font face="verdana,arial,sans-serif">
<font size=7 color=#FF0000 face="verdana,arial,sans-serif">
<b><span id="counter1"></span></b></font><br>
bis zur Entscheidung des<br>
<b>Bundesverfassungsgerichts (BVerfG)</b>
<br>
<br>
<font size=7 color=#FF0000>
<b><span id="counter2"></span></b></font><br>
bis zur Entscheidung des<br>
<b>Europäischen Gerichtshofs (EuGH)</b></font>
</p>
<script>
// Set the date we're counting down to
var countDownDate1 = new Date("Dec 31, 2017 23:59:59").getTime();
var countDownDate2 = new Date("Dec 31, 2018 23:59:59").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now an the count down date
var distance1 = countDownDate1 - now;
var distance2 = countDownDate2 - now;
// Time calculations for days, hours, minutes and seconds
var days1 = Math.floor(distance1 / (1000 * 60 * 60 * 24));
var hours1 = Math.floor((distance1 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes1 = Math.floor((distance1 % (1000 * 60 * 60)) / (1000 * 60));
var seconds1 = Math.floor((distance1 % (1000 * 60)) / 1000);
var days2 = Math.floor(distance2 / (1000 * 60 * 60 * 24));
var hours2 = Math.floor((distance2 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes2 = Math.floor((distance2 % (1000 * 60 * 60)) / (1000 * 60));
var seconds2 = Math.floor((distance2 % (1000 * 60)) / 1000);
// Display the result in the element with id="counter1"
document.getElementById("counter1").innerHTML = days1 + "d " + hours1 + "h "
+ minutes1 + "m " + seconds1 + "s ";
// Display the result in the element with id="counter2"
document.getElementById("counter2").innerHTML = days2 + "d " + hours2 + "h "
+ minutes2 + "m " + seconds2 + "s ";
// If the count down is finished, write some text
if (distance1 < 0){
document.getElementById("counter1").innerHTML = "EXPIRED";
}
if (distance2 < 0) {
clearInterval(x);
document.getElementById("counter2").innerHTML = "EXPIRED";
}
if(distance1 < 0 && distance2 < 0)
{
clearInterval(x);
}
}, 1000);
</script>
--- Ende Code ---
Wer könnte das noch um Millisekunden erweitern?
Das "tickt" dann etwas "schneller"... ;)
Auch könnte man überlegen, eine Aufteilung in
Jahr(e) - Monat(e) - Wochen - Tage - Stunden - Minuten - Sekunden - Millisekunden
vorzunehmen, da das etwas "portionierter"/ überschaubarer wäre, als 40-400 Tage (was so ewig erscheint).
Wer könnte das bewerkstelligen?
drone:
--- Zitat von: Bürger am 18. November 2017, 00:24 ---Wer könnte das noch um Millisekunden erweitern?
--- Ende Zitat ---
Wenn CPU-schonende Zehntel auch in Ordnung sind, wäre das hier ein Gerüst:
--- Code: ---<!-- Display the countdown timer in an element -->
<p align=center>
<font face="verdana,arial,sans-serif">
<font size=7 color=#FF0000 face="verdana,arial,sans-serif">
<b><span id="counter1"></span></b></font><br>
bis zur Entscheidung des<br>
<b>Bundesverfassungsgerichts (BVerfG)</b>
<br>
<br>
<font size=7 color=#FF0000>
<b><span id="counter2"></span></b></font><br>
bis zur Entscheidung des<br>
<b>Europäischen Gerichtshofs (EuGH)</b></font>
</p>
<script>
// Set the date we're counting down to
var countDownDate1 = new Date("Dec 31, 2017 23:59:59").getTime();
var countDownDate2 = new Date("Dec 31, 2018 23:59:59").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now an the count down date
var distance1 = countDownDate1 - now;
var distance2 = countDownDate2 - now;
// Time calculations for days, hours, minutes and seconds
var days1 = Math.floor(distance1 / (1000 * 60 * 60 * 24));
var hours1 = Math.floor((distance1 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes1 = Math.floor((distance1 % (1000 * 60 * 60)) / (1000 * 60));
var seconds1 = Math.floor((distance1 % (1000 * 60)) / 1000);
var tsec1 = Math.floor((distance1 % (10 * 60)) / 100);
var days2 = Math.floor(distance2 / (1000 * 60 * 60 * 24));
var hours2 = Math.floor((distance2 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes2 = Math.floor((distance2 % (1000 * 60 * 60)) / (1000 * 60));
var seconds2 = Math.floor((distance2 % (1000 * 60)) / 1000);
var tsec2 = Math.floor((distance2 % (10 * 60)) / 100);
// Display the result in the element with id="counter1"
document.getElementById("counter1").innerHTML = days1 + "d " + hours1 + "h "
+ minutes1 + "m " + seconds1 + "." + tsec1 + "s ";
// Display the result in the element with id="counter2"
document.getElementById("counter2").innerHTML = days2 + "d " + hours2 + "h "
+ minutes2 + "m " + seconds2 + "." + tsec2 + "s ";
// If the count down is finished, write some text
if (distance1 < 0){
document.getElementById("counter1").innerHTML = "EXPIRED";
}
if (distance2 < 0) {
clearInterval(x);
document.getElementById("counter2").innerHTML = "EXPIRED";
}
if(distance1 < 0 && distance2 < 0)
{
clearInterval(x);
}
}, 100);
</script>
--- Ende Code ---
Sollte aber bitte nochmal jemand überprüfen, ob's wirklich Zehntel sind, die runtergezählt werden - ist mir für die Uhrzeit jetzt zu schnell... ;-)
Bürger:
--- Zitat von: drone am 18. November 2017, 02:08 ---Wenn CPU-schonenende Zehntel auch in Ordnung sind, wäre das hier ein Gerüst:
--- Ende Zitat ---
Klar - wunderbar.
Zehntelsekunden ausreichend.
Hatte ich nicht so vor Augen.
Jetzt noch die Aufteilung mit
Jahr(e) - Monat(e) - Wochen - Tage [...] ?
Wer macht mit?
Danke ;)
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln