Skip to content

Commit

Permalink
mobile ui improved
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilsaini1107 committed Nov 24, 2023
1 parent c46bb99 commit dbb4998
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/components/herocanvas/HeroCanvas.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,33 @@ const HeroCanvas = ({ images }) => {
const textWidth = ctx.measureText(text).width;
const fontSize = Math.min(10, 5+(Math.min(cellWidth+10, cellHeight+10) / ((textWidth) ? textWidth/2: 1)));

const circle1X = imageX + 35;
const circle1Y = imageY + 35;
let circlesize1 = 30;
let circlesize2 = 10;
let circle1X = imageX + 35;
let circle1Y = imageY + 35;
let circle2X = imageX + 69;
let circle2Y = imageY + 59;
if(isMobile){
circlesize1 = 15;
circle1X = imageX + 18;
circle1Y = imageY + 18;
circle2X = imageX + 38;
circle2Y = imageY + 33;
circlesize2 = 8;
}


ctx.beginPath();
ctx.arc(circle1X, circle1Y, fontSize+15, 0, 2 * Math.PI);
ctx.arc(circle1X, circle1Y, circlesize1, 0, 2 * Math.PI);
ctx.fillStyle = 'white';
ctx.fill();
ctx.strokeStyle = 'orange';
ctx.lineWidth = 2;
ctx.stroke();

const circle2X = imageX + 65;
const circle2Y = imageY + 60;

ctx.beginPath();
ctx.arc(circle2X, circle2Y, 8, 0, 2 * Math.PI);
ctx.arc(circle2X, circle2Y, circlesize2, 0, 2 * Math.PI);
ctx.fillStyle = 'white';
ctx.fill();
ctx.strokeStyle = 'orange';
Expand Down

1 comment on commit dbb4998

@vercel
Copy link

@vercel vercel bot commented on dbb4998 Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.