From c5758ee813eba09384d1a619c2d7eea6e183f287 Mon Sep 17 00:00:00 2001 From: LimesKey Date: Mon, 9 Sep 2024 16:33:46 -0400 Subject: [PATCH] fix cloudflare issue --- ...trasonic_distance_sensor_-_hc-sr04-01a.png | Bin .../assets}/0470_ohm_resistor_processed.png | Bin .../lib/assets}/074hc595.png | Bin .../0a934be7c-0c10-4b05-ada5-d09c00b2bf1e.png | Bin .../lib/assets}/0acceler.png | Bin .../lib/assets}/0buzzer.png | Bin ...lay-lcd-16x2-backlight-amarelo-verde-2.png | Bin ...-module-i2c-interface-for-arduino_copy.png | Bin .../electronics => src/lib/assets}/0file.png | Bin .../lib/assets}/0file_1.png | Bin .../lib/assets}/0file__2_.png | Bin .../electronics => src/lib/assets}/0image.png | Bin .../lib/assets}/0matriz-1.png | Bin .../assets}/0modulo-joystick-analogico-1.png | Bin ...o-sensor-presenca-movimento-hc-sr501-3.png | Bin ...527-max7219-dot-matrix-module-single-3.png | Bin .../electronics => src/lib/assets}/0oled.png | Bin .../electronics => src/lib/assets}/0relay.png | Bin .../lib/assets}/0s-l1200_copy.png | Bin .../0screenshot_2024-05-07_at_19.22.16.png | Bin .../lib/assets}/0sensor-de-encoder-ky040.png | Bin .../electronics => src/lib/assets}/0servo.png | Bin ...ino---red-1571993143434._w500_p1__copy.png | Bin ...lado-matricial-membrana-3x4-numerico-1.png | Bin .../lib/assets}/1humidity.png | Bin .../lib/assets}/1modulo-led-rgb-smd-1.png | Bin .../electronics => src/lib/assets}/2ir.png | Bin showcase/src/routes/+page.svelte | 426 +++++++++--------- showcase/vite.config.ts | 9 +- 29 files changed, 214 insertions(+), 221 deletions(-) rename showcase/{static/electronics => src/lib/assets}/015569-ultrasonic_distance_sensor_-_hc-sr04-01a.png (100%) rename showcase/{static/electronics => src/lib/assets}/0470_ohm_resistor_processed.png (100%) rename showcase/{static/electronics => src/lib/assets}/074hc595.png (100%) rename showcase/{static/electronics => src/lib/assets}/0a934be7c-0c10-4b05-ada5-d09c00b2bf1e.png (100%) rename showcase/{static/electronics => src/lib/assets}/0acceler.png (100%) rename showcase/{static/electronics => src/lib/assets}/0buzzer.png (100%) rename showcase/{static/electronics => src/lib/assets}/0display-lcd-16x2-backlight-amarelo-verde-2.png (100%) rename showcase/{static/electronics => src/lib/assets}/0ds1307-rtc-module-real-time-clock-module-i2c-interface-for-arduino_copy.png (100%) rename showcase/{static/electronics => src/lib/assets}/0file.png (100%) rename showcase/{static/electronics => src/lib/assets}/0file_1.png (100%) rename showcase/{static/electronics => src/lib/assets}/0file__2_.png (100%) rename showcase/{static/electronics => src/lib/assets}/0image.png (100%) rename showcase/{static/electronics => src/lib/assets}/0matriz-1.png (100%) rename showcase/{static/electronics => src/lib/assets}/0modulo-joystick-analogico-1.png (100%) rename showcase/{static/electronics => src/lib/assets}/0modulo-sensor-presenca-movimento-hc-sr501-3.png (100%) rename showcase/{static/electronics => src/lib/assets}/0oky3527-max7219-dot-matrix-module-single-3.png (100%) rename showcase/{static/electronics => src/lib/assets}/0oled.png (100%) rename showcase/{static/electronics => src/lib/assets}/0relay.png (100%) rename showcase/{static/electronics => src/lib/assets}/0s-l1200_copy.png (100%) rename showcase/{static/electronics => src/lib/assets}/0screenshot_2024-05-07_at_19.22.16.png (100%) rename showcase/{static/electronics => src/lib/assets}/0sensor-de-encoder-ky040.png (100%) rename showcase/{static/electronics => src/lib/assets}/0servo.png (100%) rename showcase/{static/electronics => src/lib/assets}/0slide-potentiometer-sensor-module-with-volume-control-for-arduino---red-1571993143434._w500_p1__copy.png (100%) rename showcase/{static/electronics => src/lib/assets}/0teclado-matricial-membrana-3x4-numerico-1.png (100%) rename showcase/{static/electronics => src/lib/assets}/1humidity.png (100%) rename showcase/{static/electronics => src/lib/assets}/1modulo-led-rgb-smd-1.png (100%) rename showcase/{static/electronics => src/lib/assets}/2ir.png (100%) diff --git a/showcase/static/electronics/015569-ultrasonic_distance_sensor_-_hc-sr04-01a.png b/showcase/src/lib/assets/015569-ultrasonic_distance_sensor_-_hc-sr04-01a.png similarity index 100% rename from showcase/static/electronics/015569-ultrasonic_distance_sensor_-_hc-sr04-01a.png rename to showcase/src/lib/assets/015569-ultrasonic_distance_sensor_-_hc-sr04-01a.png diff --git a/showcase/static/electronics/0470_ohm_resistor_processed.png b/showcase/src/lib/assets/0470_ohm_resistor_processed.png similarity index 100% rename from showcase/static/electronics/0470_ohm_resistor_processed.png rename to showcase/src/lib/assets/0470_ohm_resistor_processed.png diff --git a/showcase/static/electronics/074hc595.png b/showcase/src/lib/assets/074hc595.png similarity index 100% rename from showcase/static/electronics/074hc595.png rename to showcase/src/lib/assets/074hc595.png diff --git a/showcase/static/electronics/0a934be7c-0c10-4b05-ada5-d09c00b2bf1e.png b/showcase/src/lib/assets/0a934be7c-0c10-4b05-ada5-d09c00b2bf1e.png similarity index 100% rename from showcase/static/electronics/0a934be7c-0c10-4b05-ada5-d09c00b2bf1e.png rename to showcase/src/lib/assets/0a934be7c-0c10-4b05-ada5-d09c00b2bf1e.png diff --git a/showcase/static/electronics/0acceler.png b/showcase/src/lib/assets/0acceler.png similarity index 100% rename from showcase/static/electronics/0acceler.png rename to showcase/src/lib/assets/0acceler.png diff --git a/showcase/static/electronics/0buzzer.png b/showcase/src/lib/assets/0buzzer.png similarity index 100% rename from showcase/static/electronics/0buzzer.png rename to showcase/src/lib/assets/0buzzer.png diff --git a/showcase/static/electronics/0display-lcd-16x2-backlight-amarelo-verde-2.png b/showcase/src/lib/assets/0display-lcd-16x2-backlight-amarelo-verde-2.png similarity index 100% rename from showcase/static/electronics/0display-lcd-16x2-backlight-amarelo-verde-2.png rename to showcase/src/lib/assets/0display-lcd-16x2-backlight-amarelo-verde-2.png diff --git a/showcase/static/electronics/0ds1307-rtc-module-real-time-clock-module-i2c-interface-for-arduino_copy.png b/showcase/src/lib/assets/0ds1307-rtc-module-real-time-clock-module-i2c-interface-for-arduino_copy.png similarity index 100% rename from showcase/static/electronics/0ds1307-rtc-module-real-time-clock-module-i2c-interface-for-arduino_copy.png rename to showcase/src/lib/assets/0ds1307-rtc-module-real-time-clock-module-i2c-interface-for-arduino_copy.png diff --git a/showcase/static/electronics/0file.png b/showcase/src/lib/assets/0file.png similarity index 100% rename from showcase/static/electronics/0file.png rename to showcase/src/lib/assets/0file.png diff --git a/showcase/static/electronics/0file_1.png b/showcase/src/lib/assets/0file_1.png similarity index 100% rename from showcase/static/electronics/0file_1.png rename to showcase/src/lib/assets/0file_1.png diff --git a/showcase/static/electronics/0file__2_.png b/showcase/src/lib/assets/0file__2_.png similarity index 100% rename from showcase/static/electronics/0file__2_.png rename to showcase/src/lib/assets/0file__2_.png diff --git a/showcase/static/electronics/0image.png b/showcase/src/lib/assets/0image.png similarity index 100% rename from showcase/static/electronics/0image.png rename to showcase/src/lib/assets/0image.png diff --git a/showcase/static/electronics/0matriz-1.png b/showcase/src/lib/assets/0matriz-1.png similarity index 100% rename from showcase/static/electronics/0matriz-1.png rename to showcase/src/lib/assets/0matriz-1.png diff --git a/showcase/static/electronics/0modulo-joystick-analogico-1.png b/showcase/src/lib/assets/0modulo-joystick-analogico-1.png similarity index 100% rename from showcase/static/electronics/0modulo-joystick-analogico-1.png rename to showcase/src/lib/assets/0modulo-joystick-analogico-1.png diff --git a/showcase/static/electronics/0modulo-sensor-presenca-movimento-hc-sr501-3.png b/showcase/src/lib/assets/0modulo-sensor-presenca-movimento-hc-sr501-3.png similarity index 100% rename from showcase/static/electronics/0modulo-sensor-presenca-movimento-hc-sr501-3.png rename to showcase/src/lib/assets/0modulo-sensor-presenca-movimento-hc-sr501-3.png diff --git a/showcase/static/electronics/0oky3527-max7219-dot-matrix-module-single-3.png b/showcase/src/lib/assets/0oky3527-max7219-dot-matrix-module-single-3.png similarity index 100% rename from showcase/static/electronics/0oky3527-max7219-dot-matrix-module-single-3.png rename to showcase/src/lib/assets/0oky3527-max7219-dot-matrix-module-single-3.png diff --git a/showcase/static/electronics/0oled.png b/showcase/src/lib/assets/0oled.png similarity index 100% rename from showcase/static/electronics/0oled.png rename to showcase/src/lib/assets/0oled.png diff --git a/showcase/static/electronics/0relay.png b/showcase/src/lib/assets/0relay.png similarity index 100% rename from showcase/static/electronics/0relay.png rename to showcase/src/lib/assets/0relay.png diff --git a/showcase/static/electronics/0s-l1200_copy.png b/showcase/src/lib/assets/0s-l1200_copy.png similarity index 100% rename from showcase/static/electronics/0s-l1200_copy.png rename to showcase/src/lib/assets/0s-l1200_copy.png diff --git a/showcase/static/electronics/0screenshot_2024-05-07_at_19.22.16.png b/showcase/src/lib/assets/0screenshot_2024-05-07_at_19.22.16.png similarity index 100% rename from showcase/static/electronics/0screenshot_2024-05-07_at_19.22.16.png rename to showcase/src/lib/assets/0screenshot_2024-05-07_at_19.22.16.png diff --git a/showcase/static/electronics/0sensor-de-encoder-ky040.png b/showcase/src/lib/assets/0sensor-de-encoder-ky040.png similarity index 100% rename from showcase/static/electronics/0sensor-de-encoder-ky040.png rename to showcase/src/lib/assets/0sensor-de-encoder-ky040.png diff --git a/showcase/static/electronics/0servo.png b/showcase/src/lib/assets/0servo.png similarity index 100% rename from showcase/static/electronics/0servo.png rename to showcase/src/lib/assets/0servo.png diff --git a/showcase/static/electronics/0slide-potentiometer-sensor-module-with-volume-control-for-arduino---red-1571993143434._w500_p1__copy.png b/showcase/src/lib/assets/0slide-potentiometer-sensor-module-with-volume-control-for-arduino---red-1571993143434._w500_p1__copy.png similarity index 100% rename from showcase/static/electronics/0slide-potentiometer-sensor-module-with-volume-control-for-arduino---red-1571993143434._w500_p1__copy.png rename to showcase/src/lib/assets/0slide-potentiometer-sensor-module-with-volume-control-for-arduino---red-1571993143434._w500_p1__copy.png diff --git a/showcase/static/electronics/0teclado-matricial-membrana-3x4-numerico-1.png b/showcase/src/lib/assets/0teclado-matricial-membrana-3x4-numerico-1.png similarity index 100% rename from showcase/static/electronics/0teclado-matricial-membrana-3x4-numerico-1.png rename to showcase/src/lib/assets/0teclado-matricial-membrana-3x4-numerico-1.png diff --git a/showcase/static/electronics/1humidity.png b/showcase/src/lib/assets/1humidity.png similarity index 100% rename from showcase/static/electronics/1humidity.png rename to showcase/src/lib/assets/1humidity.png diff --git a/showcase/static/electronics/1modulo-led-rgb-smd-1.png b/showcase/src/lib/assets/1modulo-led-rgb-smd-1.png similarity index 100% rename from showcase/static/electronics/1modulo-led-rgb-smd-1.png rename to showcase/src/lib/assets/1modulo-led-rgb-smd-1.png diff --git a/showcase/static/electronics/2ir.png b/showcase/src/lib/assets/2ir.png similarity index 100% rename from showcase/static/electronics/2ir.png rename to showcase/src/lib/assets/2ir.png diff --git a/showcase/src/routes/+page.svelte b/showcase/src/routes/+page.svelte index 2b2f1131bf..08a7b4877a 100644 --- a/showcase/src/routes/+page.svelte +++ b/showcase/src/routes/+page.svelte @@ -8,12 +8,18 @@ y: number; } - let randomParts: string[] = Object.values(import.meta.glob('@assets/electronics/*.{png,jpg,jpeg,PNG,JPEG}', { eager: true, query: '?url', import: 'default'})); + let randomParts: string[] = Object.values( + import.meta.glob('$lib/assets/*.{png,jpg,jpeg,PNG,JPEG}', { + eager: true, + query: '?url', + import: 'default' + }) + ); let randomItems: RandomItem[] = []; let innerWidth = 0; let innerHeight = 0; - + // Function to generate random positions function getRandomPosition(): { x: number; y: number } { let x = Math.random() * innerWidth; @@ -28,7 +34,7 @@ return { part, x, - y, // Create the CSS translate for position + y // Create the CSS translate for position }; }); } @@ -39,15 +45,13 @@ // Update positions every 5 seconds setInterval(() => { randomItems = createRandomParts(); -}, 5000); // Adjust interval time as needed + }, 9000); // Adjust interval time as needed -
- -
+
@@ -62,13 +66,13 @@ {#each randomItems as item} - Random Electronics - {/each} + Random Electronics + {/each}
@@ -153,206 +157,202 @@ diff --git a/showcase/vite.config.ts b/showcase/vite.config.ts index aa7a3f0ab0..6331108bf8 100644 --- a/showcase/vite.config.ts +++ b/showcase/vite.config.ts @@ -5,16 +5,9 @@ import * as path from "path"; export default defineConfig({ plugins: [sveltekit()], - server: { - fs: { - // Allow serving files from one level up to the project root - allow: ['./static/electronics/'], - }, - }, - resolve: { alias: { - "@assets": path.resolve(__dirname, "static"), + "@lib": path.resolve(__dirname, "src/lib"), }, },