@jjlmoya/utils-science 1.23.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -140,6 +140,7 @@ const { ui } = Astro.props;
|
|
|
140
140
|
isExtreme: boolean;
|
|
141
141
|
efolds: number;
|
|
142
142
|
gridColor: string;
|
|
143
|
+
isDark: boolean;
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
function drawVerticalGridLines(c: DrawingContext) {
|
|
@@ -205,7 +206,7 @@ const { ui } = Astro.props;
|
|
|
205
206
|
for (let p = 1; p <= pulseCount; p++) {
|
|
206
207
|
const radius = ((p * 40 + (c.efolds * 2)) % 150) + 10;
|
|
207
208
|
c.ctx.beginPath();
|
|
208
|
-
c.ctx.strokeStyle = c.gridColor + (1 - radius / 160) * 0.3 + ')';
|
|
209
|
+
c.ctx.strokeStyle = c.gridColor + (1 - radius / 160) * (c.isDark ? 0.3 : 0.7) + ')';
|
|
209
210
|
c.ctx.lineWidth = 1.5;
|
|
210
211
|
c.ctx.arc(c.centerX, c.centerY, radius, 0, Math.PI * 2);
|
|
211
212
|
c.ctx.stroke();
|
|
@@ -224,15 +225,16 @@ const { ui } = Astro.props;
|
|
|
224
225
|
const h = canvas.height / dpr;
|
|
225
226
|
ctx.clearRect(0, 0, w, h);
|
|
226
227
|
const isDark = document.body.classList.contains('theme-dark') || document.documentElement.classList.contains('theme-dark');
|
|
227
|
-
ctx.strokeStyle = isDark ? 'rgba(255, 255, 255, 0.
|
|
228
|
-
ctx.lineWidth = 0
|
|
228
|
+
ctx.strokeStyle = isDark ? 'rgba(255, 255, 255, 0.15)' : 'rgba(15, 23, 42, 0.45)';
|
|
229
|
+
ctx.lineWidth = 1.0;
|
|
229
230
|
const drawingCtx: DrawingContext = {
|
|
230
231
|
ctx, w, h,
|
|
231
232
|
centerX: w / 2, centerY: h / 2,
|
|
232
233
|
scale: 1 + (efolds - 10) / 10,
|
|
233
234
|
isExtreme: efolds > 80,
|
|
234
235
|
efolds,
|
|
235
|
-
gridColor: isDark ? 'rgba(244, 114, 182, ' : 'rgba(236, 72, 153, '
|
|
236
|
+
gridColor: isDark ? 'rgba(244, 114, 182, ' : 'rgba(236, 72, 153, ',
|
|
237
|
+
isDark
|
|
236
238
|
};
|
|
237
239
|
drawVerticalGridLines(drawingCtx);
|
|
238
240
|
drawHorizontalGridLines(drawingCtx);
|