diff --git a/.gitignore b/.gitignore
old mode 100755
new mode 100644
diff --git a/src/components/admin/App.svelte b/src/components/admin/App.svelte
index 26a031d..9923513 100644
--- a/src/components/admin/App.svelte
+++ b/src/components/admin/App.svelte
@@ -63,5 +63,5 @@
-
+
diff --git a/src/components/publics/PublicPreview.svelte b/src/components/publics/PublicPreview.svelte
index 503540c..8934b83 100644
--- a/src/components/publics/PublicPreview.svelte
+++ b/src/components/publics/PublicPreview.svelte
@@ -22,8 +22,9 @@
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
import {onDestroy, onMount} from "svelte";
+ import { CollectionEntry } from "astro:content";
- export let file: string;
+ export let pub: CollectionEntry<"publics">;
export let fov: number = 60;
export let near: number = 1
export let far: number = 1000;
@@ -40,6 +41,10 @@
let observer: ResizeObserver;
onMount(() => {
+ if (!pub.data["3d"]) {
+ return;
+ }
+
scene = new THREE.Scene();
scene.background = new THREE.Color(0x171717);
camera = new THREE.PerspectiveCamera(fov, 1, near, far);
@@ -52,8 +57,8 @@
const loader = new GLTFLoader();
- loader.load(`/3d/${file}.glb`, (gltf) => {
- let s = scene.add(gltf.scene);
+ loader.load(`/3d/${pub.id}.glb`, (gltf) => {
+ scene.add(gltf.scene);
let cube_bbox = new THREE.Box3();
cube_bbox.setFromObject(gltf.scene);
@@ -64,7 +69,9 @@
camera.position.set(0, center.y, distance);
controls.update();
- }, undefined, console.log);
+ }, undefined, (e) => {
+ console.error(e);
+ });
div.append(renderer.domElement);
diff --git a/src/components/publics/XRayPreview.svelte b/src/components/publics/XRayPreview.svelte
index b458e98..1676343 100644
--- a/src/components/publics/XRayPreview.svelte
+++ b/src/components/publics/XRayPreview.svelte
@@ -20,29 +20,19 @@
-
+
diff --git a/src/content/config.ts b/src/content/config.ts
index ff45259..048b28c 100644
--- a/src/content/config.ts
+++ b/src/content/config.ts
@@ -97,6 +97,7 @@ export const publics = defineCollection({
"image": image(),
"xray": image().optional(),
"gamemode": reference("modes"),
+ "3d": z.boolean().optional().default(true),
}),
});
diff --git a/src/content/publics/frostbite.json b/src/content/publics/frostbite.json
index 95e8c1b..9379724 100644
--- a/src/content/publics/frostbite.json
+++ b/src/content/publics/frostbite.json
@@ -4,6 +4,6 @@
"id": 123,
"creator": ["Test", "Test2"],
"gamemode": "wargear",
- "image": "../../images/area_render_2_.png",
- "xray": "../../images/area_render_1_.png"
+ "image": "../../images/publics/frostbite/area_render_2_.png",
+ "xray": "../../images/publics/frostbite/area_render_1_.png"
}
\ No newline at end of file
diff --git a/src/images/2024-03-24_20.59.03.png b/src/images/2024-03-24_20.59.03.png
deleted file mode 100644
index 2fcfc90..0000000
Binary files a/src/images/2024-03-24_20.59.03.png and /dev/null differ
diff --git a/src/images/2024-03-24_20.59.59.png b/src/images/2024-03-24_20.59.59.png
deleted file mode 100644
index 81d82de..0000000
Binary files a/src/images/2024-03-24_20.59.59.png and /dev/null differ
diff --git a/src/images/area_render_1_.png b/src/images/area_render_1_.png
deleted file mode 100644
index 45dd348..0000000
Binary files a/src/images/area_render_1_.png and /dev/null differ
diff --git a/src/images/area_render_2_.png b/src/images/area_render_2_.png
deleted file mode 100644
index febd0ab..0000000
Binary files a/src/images/area_render_2_.png and /dev/null differ
diff --git a/src/layouts/NavbarLayout.astro b/src/layouts/NavbarLayout.astro
index 2ce9df5..d639e0a 100644
--- a/src/layouts/NavbarLayout.astro
+++ b/src/layouts/NavbarLayout.astro
@@ -29,7 +29,7 @@ const {title, description} = Astro.props;