Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (57 sloc) 1.96 KB
extends layout
block content
main
.calendar
.weeks
- for (let i = 1; i <= 52; i += 1) {
- if (i % 5 === 0) {
.week-in-year= i
- } else {
.week-in-year
- }
- }
.years
- for (let i = 0; i <= 89; i += 1) {
- if (i % 5 === 0) {
- if (i < 10) {
.year &nbsp; #{i}
- } else {
.year= i
- }
- } else {
.year
- }
- }
.life
- for (let i = 1; i <= 4680; i += 1) {
.week-background(id=`week-background${i}`)
.week(id=`week${i}`)
- };
aside
script.
const country = !{JSON.stringify(country)};
const age = !{JSON.stringify(age)};
const earlyChildhood = !{JSON.stringify(earlyChildhood)};
const firstSchool = !{JSON.stringify(firstSchool)};
const averageLifeExpectancyInIsrael = !{JSON.stringify(averageLifeExpectancyInIsrael)};
const retirementAge = !{JSON.stringify(retirementAge)};
for (let i = 1; i <= age; i += 1) {
const currentWeek = $(`#week${i}`);
const x = document.createTextNode('\u00D7');
currentWeek.append(x);
}
for (let i = 1; i <= earlyChildhood; i += 1) {
const currentWeek = $(`#week-background${i}`);
currentWeek.addClass('early-childhood');
currentWeek.attr('title', 'Early childhood');
}
for (let i = averageLifeExpectancyInIsrael; i <= 4680; i += 1) {
const currentWeek = $(`#week-background${i}`);
currentWeek.addClass('post-average');
currentWeek.attr('title', `Only if you're lucky ;)`);
}
for (let i = retirementAge; i <= averageLifeExpectancyInIsrael; i += 1) {
const currentWeek = $(`#week-background${i}`);
currentWeek.addClass('retirement-age');
currentWeek.attr('title', `Retirement age in ${country}`);
}