Commit 29e10e89b29e21699acb50380ef8640f3334735e
layout
nomand committed on 6/3/2018, 5:54:52 AMParent: da95a942d6f86bb03c02c65962da608ec5859847
Files changed
css/style.css | changed |
js/letnice.js | changed |
css/style.css | ||
---|---|---|
@@ -23,23 +23,21 @@ | ||
23 | 23 | } |
24 | 24 | |
25 | 25 | .month { |
26 | 26 | background-color: #b7b7b7; |
27 | - width:300px; | |
27 | + width:200px; | |
28 | 28 | display: inline-block; |
29 | 29 | margin: 10px; |
30 | 30 | } |
31 | 31 | .m { |
32 | + font-size: 20px; | |
33 | + font-weight: bold; | |
32 | 34 | font-family: Arial, Helvetica, sans-serif; |
33 | 35 | text-transform: capitalize; |
34 | 36 | } |
35 | 37 | |
36 | - | |
37 | - | |
38 | - | |
39 | 38 | svg.graph { color:white; max-width:1000px; width: 100%; height:100%;} |
40 | 39 | svg.graph text {font-family: Arial, Helvetica, sans-serif; stroke:none; fill:#000000; font-size:14px; text-anchor: middle;} |
41 | -svg.graph text.m { font-size: 14px;} | |
42 | 40 | svg.graph text.w { font-size: 10px; font-weight: 200;} |
43 | 41 | svg.graph rect { stroke:none } |
44 | 42 | svg.graph rect:hover { fill:#a1a1a1 ; cursor:pointer} |
45 | 43 | svg.graph rect.null { fill: none; stroke: none;} |
js/letnice.js | ||
---|---|---|
@@ -69,33 +69,33 @@ | ||
69 | 69 | //mtwtfss |
70 | 70 | //start comparing date with weekdays |
71 | 71 | //start iterating through days from a match until month is over |
72 | 72 | |
73 | + | |
74 | + //let cell = parseInt((base.getBoundingClientRect().width - 52*2)/52) | |
75 | + | |
73 | 76 | while(month < 12) |
74 | 77 | { |
75 | 78 | base.innerHTML += ` |
76 | 79 | <div class="month"> |
77 | 80 | <span class="m" x="" y='${month * 140}' dy="10">${monthNames[new Date(year, month).getMonth()].substr(0,1)}</span> |
78 | - <svg class="graph"> | |
81 | + <svg class="graph" > | |
79 | 82 | ${doweeks()} |
80 | - </svg></div> | |
81 | - ` | |
83 | + </svg></div>` | |
82 | 84 | month++ |
83 | 85 | } |
84 | 86 | |
85 | 87 | function doweeks() |
86 | 88 | { |
87 | 89 | let html = ""; |
88 | 90 | let y = 0; |
89 | 91 | |
90 | - while(week<7) | |
92 | + for(i=0; i<7; i++) | |
91 | 93 | { |
92 | - y += week * 20; | |
93 | - html += `<text class="w" x="10" y='${y}' dy="10">${dayNames[new Date(year, month, week).getDay()].substr(0,1)}</text>` | |
94 | - week++ | |
94 | + y = i * 20; | |
95 | + html += `<text class="w" x="7" y='${y}' dy="10">${dayNames[new Date(year, month, i).getDay()].substr(0,1)}</text>` | |
95 | 96 | count++ |
96 | 97 | } |
97 | - week = 0; | |
98 | 98 | return html; |
99 | 99 | } |
100 | 100 | } |
101 | 101 |
Built with git-ssb-web