diff options
author | Minteck <contact@minteck.org> | 2022-09-21 22:42:33 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-09-21 22:42:33 +0200 |
commit | e95b208af90cc386a7d8d1bcab426727cf4f0121 (patch) | |
tree | b293e0c644513fbeb6e9ad29be97fa6347a55e9f /app/banner.js | |
parent | b5f589c323f415bb42ea7069cb4d1a8a2233dd69 (diff) | |
download | pluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.tar.gz pluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.tar.bz2 pluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.zip |
Update time
Diffstat (limited to 'app/banner.js')
-rw-r--r-- | app/banner.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/app/banner.js b/app/banner.js index 81991e9..6815de1 100644 --- a/app/banner.js +++ b/app/banner.js @@ -6,10 +6,10 @@ function timeAgo(time) { time = new Date(time).getTime(); } - let periods = ["second", "minute", "hour", "day", "week", "month", "year", "age"]; + let periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"]; if (bannerFrench) { - periods = ["seconde", "minute", "heure", "jour", "semaine", "mois", "an", "des année"]; + periods = ["sec.", "min.", "h.", "j.", "sem.", "mois", "an.", "des années"]; } let lengths = ["60", "60", "24", "7", "4.35", "12", "100"]; @@ -46,7 +46,7 @@ function timeAgo(time) { difference = Math.round(difference); - period = periods[j] + (difference > 1 ? "s" : ''); + period = periods[j]; if (bannerFrench) { return `${tense} ${difference} ${period}`; @@ -130,17 +130,17 @@ async function refreshBanner(offline, french) { <div style="display:grid;grid-template-columns: repeat(${data['median'] || data['id'] === "unknown" ? 4 : data['id'] === "fusion" ? 3 : 5}, 1fr);" id="member-card"> <span> - <b>${french ? `Préfixe${data['prefixes'].length > 1 ? 's' : ''} ` : `Prefix${data['prefixes'].length > 1 ? 'es' : ''}`}: </b> + <b>${french ? `Préfixe${data['prefixes'].length > 1 ? 's' : ''} ` : `Prefix${data['prefixes'].length > 1 ? 'es' : ''}`}: </b><span class="member-small-separator"><br></span> <code style="color: white;">${data['prefixes'].join('</code>, <code style="color: white;">')}</code> </span> <span> - <b>${french ? "Pronoms :" : "Pronouns:"} </b> + <b>${french ? "Pronoms :" : "Pronouns:"} </b><span class="member-small-separator"><br></span> ${data['id'] === "fusion" ? "she/her" : data['pronouns']} </span> ${!data['median'] && data['id'] !== "unknown" ? ` <span> ${data["id"] === "fusion" ? ` - <b>Fronting since : </b> + <b>Fronting since: </b><span class="member-small-separator"><br></span> ${data['last_fronted'] ? ` ${data['last_fronted']['now'] ? ` <span class="relative-time" data-relative-timestamp="${data['last_fronted']['timestamp']}">${data['last_fronted']['relative']}</span><br> @@ -148,7 +148,7 @@ async function refreshBanner(offline, french) { <span class="text-muted">Not fronting</span><br> `} ` : `<span class="text-muted">Not fronting</span><br> `}` : ` - <b>${french ? "Front :" : "Last fronted:"} </b> + <b>${french ? "Front :" : "Last fronted:"} </b><span class="member-small-separator"><br></span> ${data['last_fronted'] ? ` ${data['last_fronted']['now'] ? ` ${french ? "En ce moment" : "Right now"}<br> @@ -157,23 +157,23 @@ async function refreshBanner(offline, french) { <span class="relative-time" data-relative-timestamp="${data['last_fronted']['timestamp']}">${data['last_fronted']['relative']}</span><br> (${french ? "pendant" : "for"} ${data['last_fronted']['duration']['pretty']}) `} - ` : `${french ? "Il y a très longtemps" : "A long time ago"}<br> `}`} + ` : `${french ? "Jamais" : "Never"}<br> `}`} </span> ` : ''} ${data['id'] !== "fusion" ? ` <span> ${data['id'] === "unknown" ? "<b>Species: </b> best to ask" : ` - <span style="vertical-align: middle;position:relative;top:-5px;"><b>${french ? (data['species'].length > 1 ? "Espèces : " : "Espèce : ") : "Species: "}</b></span> + <span class="member-small-only"><b>Species: </b></span> ${data['species'].map(species => ` <img data-bs-toggle="tooltip" title="${species['name']}" style="width:32px;vertical-align: middle;position:relative;top:-5px;" src="${offline ? species['icon_offline'] : `/assets/species/${species['icon']}`}" alt="${species['name']}"> `).join("")}`} </span>` : ''} ${data['id'] !== "fusion" ? ` <span> - <b>${french ? "Système : " : "System: "}</b> + <span class="member-small-only"><b>System: </b></span> <a class="member-link" href="${data['system']['page']}"><img style="width:24px;border-radius:5px;" src="${offline ? data['system']['icon_offline'] : `/assets/uploads/${data['system']['icon']}`}"> ${data['system']['name']}</a> ${data['system']['subsystem'] ? ` - <br><b>${french ? "Sous-système : " : "Subsystem: "} </b><a class="member-link" href="${data['system']['subsystem']['page']}"><img style="width:24px;border-radius:5px;" src="/assets/uploads/${data['system']['subsystem']['icon']}"> ${data['system']['subsystem']['name']}</a> + <br><span class="member-small-only"><b>Subsystem: </b></span><a class="member-link" href="${data['system']['subsystem']['page']}"><img style="width:24px;border-radius:5px;" src="/assets/uploads/${data['system']['subsystem']['icon']}"> ${data['system']['subsystem']['name']}</a> ` : data['system']['temporary'] ? '<br>(temporary)' : ''} </span> ` : ''} @@ -183,20 +183,20 @@ async function refreshBanner(offline, french) { <span> <b>${french ? (data['relations']['marefriends'].length > 1 ? 'Partenaires ' : 'Partenaire ') : `Marefriend${data['relations']['marefriends'].length > 1 ? 's' : ''}`}: </b>${data['relations']['marefriends'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['marefriends'].map(relation => ` - <a class="member-link" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"> ${relation['name']}</a>`).join(`<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>`)} + <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['marefriends'].length === 0 ? '-' : ''} </span> <span> <b>${french ? (data['relations']['sisters'].length > 1 ? 'Sœurs ' : 'Sœur ') : `Sister${data['relations']['sisters'].length > 1 ? 's' : ''}`}: </b>${data['relations']['sisters'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['sisters'].map(relation => ` - <a class="member-link" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"> ${relation['name']}</a>`).join(`<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>`)} + <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['sisters'].length === 0 ? '-' : ''} </span> ${data['little'] ? ` <span> - <b>${french ? (data['relations']['sisters'].length > 1 ? 'Caretakers ' : 'Caretaker ') : `Caretakers${data['relations']['caretakers'].length > 1 ? 's' : ''}`}: </b>${data['relations']['caretakers'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} + <b>${french ? (data['relations']['sisters'].length > 1 ? 'Caretakers ' : 'Caretaker ') : `Caretaker${data['relations']['caretakers'].length > 1 ? 's' : ''}`}: </b>${data['relations']['caretakers'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['caretakers'].map(relation => ` - <a class="member-link" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"> ${relation['name']}</a>`).join(`<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>`)} + <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['caretakers'].length === 0 ? '-' : ''} </span> ` : ''} |