all in one commit: feat: add countdown integration
fix: home nav icon spacing fix: various typos correction fix: right email texts
This commit is contained in:
parent
bac5347c65
commit
9002086180
19 changed files with 147 additions and 50 deletions
|
|
@ -6,34 +6,37 @@ const hoursContainer = document.getElementById('hours')
|
|||
const minutesContainer = document.getElementById('minutes')
|
||||
const secondsContainer = document.getElementById('seconds')
|
||||
|
||||
let target = new Date("2020-09-04 15:00:00")
|
||||
|
||||
let shown = false
|
||||
|
||||
const enableReload = window.location.pathname.indexOf('c') === -1
|
||||
|
||||
function render() {
|
||||
let current = new Date()
|
||||
let difference = target - current
|
||||
let difference = openDate - current
|
||||
|
||||
var _second = 1000,
|
||||
_minute = _second * 60,
|
||||
_hour = _minute * 60,
|
||||
_day = _hour * 24;
|
||||
_day = _hour * 24
|
||||
|
||||
var days = Math.floor(difference / _day),
|
||||
hours = Math.floor((difference % _day) / _hour),
|
||||
minutes = Math.floor((difference % _hour) / _minute),
|
||||
seconds = Math.floor((difference % _minute) / _second);
|
||||
seconds = Math.floor((difference % _minute) / _second)
|
||||
|
||||
days = (String(days).length >= 2) ? days : '0' + days;
|
||||
hours = (String(hours).length >= 2) ? hours : '0' + hours;
|
||||
minutes = (String(minutes).length >= 2) ? minutes : '0' + minutes;
|
||||
seconds = (String(seconds).length >= 2) ? seconds : '0' + seconds;
|
||||
|
||||
daysContainer.textContent = days
|
||||
hoursContainer.textContent = hours
|
||||
minutesContainer.textContent = minutes
|
||||
secondsContainer.textContent = seconds
|
||||
|
||||
days = (String(days).length >= 2) ? days : '0' + days
|
||||
hours = (String(hours).length >= 2) ? hours : '0' + hours
|
||||
minutes = (String(minutes).length >= 2) ? minutes : '0' + minutes
|
||||
seconds = (String(seconds).length >= 2) ? seconds : '0' + seconds
|
||||
|
||||
if (openDate <= current && enableReload) {
|
||||
window.location.reload(false)
|
||||
} else {
|
||||
daysContainer.textContent = days
|
||||
hoursContainer.textContent = hours
|
||||
minutesContainer.textContent = minutes
|
||||
secondsContainer.textContent = seconds
|
||||
}
|
||||
if (!shown) {
|
||||
setTimeout(() => {
|
||||
countdown.style.opacity = 1
|
||||
|
|
|
|||
|
|
@ -160,7 +160,13 @@ function enableTag(node) {
|
|||
if (!all) {
|
||||
tagId = node.attributes['data-tag-id'].value
|
||||
}
|
||||
let data = organizations.filter(orga => orga.tags.filter(id => id === tagId).length > 0 || all)
|
||||
let data = organizations
|
||||
.filter(orga => orga.tags.filter(id => id === tagId).length > 0 || all)
|
||||
.sort((a, b) => {
|
||||
var textA = a.name.toUpperCase()
|
||||
var textB = b.name.toUpperCase()
|
||||
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
|
||||
})
|
||||
renderMosaic(data)
|
||||
node.className += ' enabled'
|
||||
if (currentTag !== null) {
|
||||
|
|
@ -168,7 +174,7 @@ function enableTag(node) {
|
|||
}
|
||||
currentTag = node
|
||||
if (data === undefined || data === null || data.length <= 0) {
|
||||
mosaicHeader.textContent = "Aucune associations listées"
|
||||
mosaicHeader.textContent = "Aucune association listée"
|
||||
} else if (data.length === 1) {
|
||||
mosaicHeader.textContent = "Une association listée"
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue