Skip to content

Commit

Permalink
Update weasley-card.js
Browse files Browse the repository at this point in the history
Finally incorporating customisable size changes suggested by @mikeage about 4 years ago...
  • Loading branch information
malcolmrigg authored Apr 24, 2024
1 parent 76d6eb8 commit ed83eae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions weasley-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,22 @@ class WeasleyClockCard extends HTMLElement {
}
document.body.appendChild(fontstyle);

this.div = document.createElement('div');
this.div.style.textAlign = 'center';
this.canvas = document.createElement('canvas');
card.appendChild(this.canvas);
this.div.appendChild(this.canvas);
card.appendChild(this.div);
this.appendChild(card);
this.ctx = this.canvas.getContext("2d");
}

this.canvas.style.maxWidth = "-webkit-fill-available";
this.canvas.width="500";
this.canvas.height="500";
this.canvas.width=this.config.width ? this.config.width : "500";
this.canvas.height=this.config.width ? this.config.width : "500";

this.radius = this.canvas.height / 2;
this.ctx.translate(this.radius, this.radius);
this.radius = this.radius * 0.90
this.radius = this.radius * 0.90;

if (this.config.fontName) {
this.selectedFont = this.config.fontName;
Expand Down

0 comments on commit ed83eae

Please sign in to comment.