git ssb

0+

Rômulo Alves / dat-letnice



Commit c745fe77bdac98673209f311adf6180dcb1dcaba

footer setup

nomand committed on 6/7/2018, 4:50:46 AM
Parent: ac07cc9bbc36e3c887cf7d617c0129eb96f5f45b

Files changed

css/style.csschanged
js/letnice.jschanged
css/style.cssView
@@ -21,10 +21,11 @@
2121 transform: translateY(-50%);
2222 text-align: center;
2323 }
2424
25-.month { width:100px; margin: 10px; display: inline-block;}
25+.month { margin: 10px; display: inline-block; width:100px; height: 130px; }
2626 .header { margin: 0px 0px 40px 10px; text-align: left; align-content: flex-start;}
27+.footer { margin: 40px 0px 0px 10px; text-align: left; height: 20px;}
2728
2829 p { margin: 0px; }
2930
3031 .y { font-size: 40px; font-weight: bold; }
@@ -33,12 +34,13 @@
3334 .p { font-size: 20px; color: #8b8b8b}
3435
3536 .m { font-size: 20px; font-weight: bold; margin-bottom: 5px; text-align: left; }
3637
37-svg.graph { color:white; width: 100%; }
38+svg.graph { color:white; width: 100%; height: 100px; }
3839 svg.graph text {font-family: 'input_mono_regular'; stroke:none; fill:#8b8b8b; font-size:14px; text-anchor: middle; }
3940 svg.graph text.dayLabel { font-size: 10px; }
40-svg.graph rect { stroke:none }
41+svg.graph rect { stroke:none; }
42+svg.graph rect:hover { fill: #f011f0 !important; cursor:pointer}
4143 svg.graph rect.null { fill: none; stroke: none;}
4244 svg.graph rect.today { fill:#ff1e00; }
4345 svg.graph rect.day { fill:#8b8b8b; }
4446 svg.graph rect.weekend { fill:#747474 }
js/letnice.jsView
@@ -12,9 +12,10 @@
1212
1313 let month = 0;
1414 let today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()-1, 0);
1515 let style = "";
16-
16+ let footer = "";
17+
1718 base.innerHTML += doHeader();
1819
1920 while(month < 12)
2021 {
@@ -26,13 +27,20 @@
2627 </svg></div>`
2728 month++
2829 }
2930
31+ base.innerHTML += doFooter();
32+
3033 function doHeader()
3134 {
3235 return `<div class="header"><p class="y">${year}<a onclick="scrollYear(-1);">-</a><a onclick="scrollYear(1);">+</a></p><p class="p">${yearProgress(year)}</p></div>`;
3336 }
3437
38+ function doFooter(content)
39+ {
40+ return `<div class="footer">${footer}</div>`;
41+ }
42+
3543 function yearProgress(year)
3644 {
3745 diff = new Date() - new Date(year, 0, 1, 0);
3846 progress = ((diff/31536000000)*100).toFixed(2);
@@ -47,9 +55,9 @@
4755 let y = 0;
4856
4957 for(i = 0; i < 7; i++)
5058 {
51- y = (i * 14) + 1;
59+ y = (i * 14);
5260 html += `<text class="dayLabel" x="5" y='${y}' dy="10">${dayNames[i].substr(0,1)}</text>`
5361 }
5462 return html;
5563 }
@@ -68,9 +76,9 @@
6876 let week = 0;
6977
7078 while(week < 7 && date != monthLength)
7179 {
72- y = week * 14 + 2;
80+ y = week * 14;
7381 let day = new Date(year, month, date, 0);
7482
7583 if(day.getDay() != week)
7684 {
@@ -92,9 +100,9 @@
92100 else
93101 {
94102 style = "day";
95103 }
96- html += `<rect class='${style}' x='${x}' y='${y}' title='${(date+1) == 0 ? "null" : dayNames[week] + " " + (date+1)}' width="12px" height="12px" rx="2" ry="2" onclick=""></rect>`
104+ html += `<rect class='${style}' x='${x}' y='${y}' title='${(date+1) == 0 ? "null" : dayNames[week] + " " + (date+1)}' width="12px" height="12px" rx="2" ry="2" onclick="doFooter()"></rect>`
97105 week++
98106 date++
99107 }
100108 }

Built with git-ssb-web