Skip to content

Commit 73a26d3

Browse files
fix: oracleのスマホ対応 (#16)
* fix: oracleのスマホ対応 * fix: lint --------- Co-authored-by: nova27 <[email protected]>
1 parent 4b4c395 commit 73a26d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/app/components/oracle.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const drawEllipse5 = (context: CanvasRenderingContext2D, time: number, width: nu
6565
const drawEllipse6 = (context: CanvasRenderingContext2D, time: number, width: number, height: number) => {
6666
const angle = (time * Math.PI) / 4;
6767

68-
const ellipseHeight = height / 3.1 + 3 * Math.cos((time % 2) * Math.PI);
68+
const ellipseHeight = Math.max(height / 3.1 + 3 * Math.cos((time % 2) * Math.PI), 1);
6969
context.beginPath();
7070
setGradient(context, angle, width, height);
7171
context.ellipse(width / 2, height / 2, width / 2.4, ellipseHeight, angle, 0, 2 * Math.PI);
@@ -76,6 +76,7 @@ const drawBlinking = (context: CanvasRenderingContext2D, time: number, width: nu
7676
const intensityRadian = (time % 1) * 6 * Math.PI;
7777

7878
let r = time % 2 < 1 ? width / 15 : width / 30 + 2 * Math.cos(intensityRadian);
79+
r = Math.max(r, 1);
7980
let gradient = context.createRadialGradient(width / 2, height / 2, 0, width / 2, height / 2, r);
8081
gradient.addColorStop(0, "rgba(255, 255, 255, 0.5)");
8182
gradient.addColorStop(1, "rgba(255, 255, 255, 0)");
@@ -86,6 +87,7 @@ const drawBlinking = (context: CanvasRenderingContext2D, time: number, width: nu
8687
context.fill();
8788

8889
r = time % 2 < 1 ? width / 7.5 : width / 15 + 4 * Math.cos(intensityRadian);
90+
r = Math.max(r, 1);
8991
gradient = context.createRadialGradient(width / 2, height / 2, 0, width / 2, height / 2, r);
9092
gradient.addColorStop(0, "rgba(255, 255, 255, 0.5)");
9193
gradient.addColorStop(1, "rgba(255, 255, 255, 0)");

0 commit comments

Comments
 (0)