git ssb

0+

Rômulo Alves / dat-letnice



Commit 1f6537ee5b47f8d5332b0334c11845264d6264d9

hash works

nomand committed on 6/6/2018, 7:01:43 AM
Parent: f9f124743c6d2ed1345bc16c37379f5fe5e01f47

Files changed

css/style.csschanged
index.htmlchanged
js/letnice.jschanged
css/style.cssView
@@ -1,9 +1,9 @@
11 html,
22 body {
3+ display: block;
34 height: 100%;
45 width: 100%;
5- display: block;
66 padding: 0px;
77 margin: 0px;
88 font-family: 'input_mono_regular';
99 text-transform: uppercase;
@@ -22,17 +22,19 @@
2222 text-align: center;
2323 }
2424
2525 .month { width:100px; margin: 10px; display: inline-block;}
26-.header { margin-bottom: 40px; }
26+.header { margin: 0px 0px 40px 10px; text-align: left; align-content: flex-start;}
2727
2828 p { margin: 0px; }
29-.m { font-size: 20px; font-weight: bold; margin-bottom: 5px; text-align: left; }
29+
3030 .y { font-size: 40px; font-weight: bold; }
31-.y a { font-size: 20px; cursor: pointer; width: 24px; height: 24px; }
32-.y a:hover {color: #ffffff; background-color: #000000;}
33-.p { font-size: 20px; text-align: left; color: #8b8b8b}
31+.y a { text-align: center; color: #000; width: 30px; display: inline-block; margin-left: 10px;}
32+.y a:hover { color: #ffffff; background: #000; cursor: pointer;}
33+.p { font-size: 20px; color: #8b8b8b}
3434
35+.m { font-size: 20px; font-weight: bold; margin-bottom: 5px; text-align: left; }
36+
3537 svg.graph { color:white; width: 100%; }
3638 svg.graph text {font-family: 'input_mono_regular'; stroke:none; fill:#8b8b8b; font-size:14px; text-anchor: middle; }
3739 svg.graph text.dayLabel { font-size: 10px; }
3840 svg.graph rect { stroke:none }
@@ -49,6 +51,5 @@
4951 @media only screen and (max-width: 1440px)
5052 { section { width: 720px; }}
5153
5254 @media only screen and (max-width: 720px)
53-{ section { width: 360px; }}
54-
55+{ section { width: 360px; }}
index.htmlView
@@ -10,8 +10,8 @@
1010 <body>
1111 <section id="center">
1212 </section>
1313 <script>
14- let letnice = new Year(location.hash);
14+ let letnice = new Year();
1515 </script>
1616 </body>
1717 </html>
js/letnice.jsView
@@ -3,10 +3,9 @@
33 let base = document.getElementById("center");
44 base.innerHTML = "";
55 let year;
66
7- isNaN(letnice) ? year = new Date().getFullYear() : year = String(letnice).replace("#", "").substr(0,4);
8-
7+ isNaN(letnice) || letnice==null ? year = new Date().getFullYear() : year = String(letnice).replace("#", "").substr(0,4);
98 location.hash = year;
109
1110 const monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
1211 const dayNames = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ]
@@ -14,12 +13,13 @@
1413 let month = 0;
1514 let today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()-1, 0);
1615 let style = "";
1716
17+ base.innerHTML += doHeader();
18+
1819 while(month < 12)
1920 {
2021 base.innerHTML += `<div class="month">
21- ${month==0?doHeader():""}
2222 <p class="m">${monthNames[new Date(year, month).getMonth()].substr(0,2)}</p>
2323 <svg class="graph" id="${monthNames[month]}">
2424 ${doLabels()}
2525 ${doMonth(month)}

Built with git-ssb-web