Commit ce4b4919 authored by sajolida's avatar sajolida
Browse files

Display a slightly outdated number of days remaining if JS is disabled

- Maybe it's better than nothing (and there is the 'last updated' info)
- It simplifies the code a bit
parent c9a31927
......@@ -96,11 +96,6 @@ .donate-pt {
left: -50px;
/* Hide the number of days remaining when there is no JS to calculate them */
.counter-days {
display: none;
/* Style for 2018 */
#donate-banner {
......@@ -2,13 +2,8 @@ document.addEventListener('DOMContentLoaded', function() {
var endOfCampaign = new Date("2019-01-15");
// Display days remaining when JS is enabled
var days = document.getElementsByClassName('counter-days');
for (let i = 0; i < days.length; i++) {
days[i].style.display = "block";
// Adjust the number of days remaining
// Without JS, it's still displayed but not updated automatically and thus slightly outdated
var numberOfDays = document.getElementsByClassName('counter-number-of-days');
for (let i = 0; i < numberOfDays.length; i++) {
let now = new Date();
......@@ -125,13 +125,13 @@
<div class="counter-progress">
<div class="counter-progress-bar" role="progressbar" style="width: 20%" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
<div class="donate-en"><div class="counter-days"><span class="counter-number-of-days"></span> days remaining</div></div>
<div class="donate-es"><div class="counter-days">Quedan <span class="counter-number-of-days"></span> días</div></div>
<div class="donate-de"><div class="counter-days">Noch <span class="counter-number-of-days"></span> Tage übrig</div></div>
<div class="donate-fa"><div class="counter-days"><span class="counter-number-of-days"></span> days remaining</div></div>
<div class="donate-fr"><div class="counter-days"><span class="counter-number-of-days"></span> jours restants</div></div>
<div class="donate-it"><div class="counter-days"><span class="counter-number-of-days"></span> days remaining</div></div>
<div class="donate-pt"><div class="counter-days"><span class="counter-number-of-days"></span> days remaining</div></div>
<div class="donate-en"><div class="counter-days"><span class="counter-number-of-days">XX</span> days remaining</div></div>
<div class="donate-es"><div class="counter-days">Quedan <span class="counter-number-of-days">XX</span> días</div></div>
<div class="donate-de"><div class="counter-days">Noch <span class="counter-number-of-days">XX</span> Tage übrig</div></div>
<div class="donate-fa"><div class="counter-days"><span class="counter-number-of-days">XX</span> days remaining</div></div>
<div class="donate-fr"><div class="counter-days"><span class="counter-number-of-days">XX</span> jours restants</div></div>
<div class="donate-it"><div class="counter-days"><span class="counter-number-of-days">XX</span> days remaining</div></div>
<div class="donate-pt"><div class="counter-days"><span class="counter-number-of-days">XX</span> days remaining</div></div>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment