Skip to content

Commit

Permalink
add class options
Browse files Browse the repository at this point in the history
  • Loading branch information
Haluska77 committed Feb 7, 2025
1 parent 399203a commit f7e5971
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,10 @@ class MiniGraphCard extends LitElement {
if (diffInMinutes > 0 && diffInMinutes < minutesInGraph) {
const startDate = new Date(startTime);
const x = graphWidth - graphWidth / minutesInGraph * diffInMinutes;
lines.push(svg`<line x1=${x} y1="0" x2=${x} y2=${height - 12}
stroke="grey"
stroke-width=${this.isMidnight(hour, minutes) ? '2' : '1'}
stroke-dasharray=${this.isMidnight(hour, minutes) ? '0' : '10,5'}
/><text x=${x} y=${height - 2} font-size="10" fill="grey" text-anchor="middle">
lines.push(svg`<line class="line-${time.replace(':', '-')}" x1=${x} y1="0" x2=${x} y2=${height - 12}
stroke="grey" stroke-width="2" />
<text class="text-${time.replace(':', '-')}" x=${x} y=${height - 2}
font-size="10" fill="grey" text-anchor="middle">
${this.isMidnight(hour, minutes)
? `${this.zeroPad(startDate.getDate())}-${this.zeroPad(startDate.getMonth() + 1)}`
: time}</text>`);
Expand Down

0 comments on commit f7e5971

Please sign in to comment.