Skip to content

Commit

Permalink
Add shelf text (#39)
Browse files Browse the repository at this point in the history
* add the base into the scene

* start placing things

* all shelves

* update product card appearance

* fix camera orientation

* fix camer

* put items in objects

* fix product cards

* fix highlights

* add text

* merge

* update label opacity
  • Loading branch information
nils-mathieu committed Jan 25, 2024
1 parent b737770 commit ddcb683
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 1 deletion.
95 changes: 95 additions & 0 deletions src/lib/3dmap/labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[
{
"text": "Parfum Femmes",
"position": [-65, 15, -28],
"rotation": [-1.57, 0, 1.57],
"fontSize": 6
},
{
"text": "Parfum Hommes",
"position": [66, 15, -80],
"rotation": [-1.57, 0, -1.57],
"fontSize": 6
},
{
"text": "Too Faced",
"position": [-20, 8, -34]
},
{
"text": "Huda Beauty",
"position": [-20, 8, -28]
},
{
"text": "Rare Beauty",
"position": [-20, 8, -28],
"rotation": [-1.57, 0, 1.57],
"fontSize": 2
},
{
"text": "Beauty\nHub",
"position": [-22, 12, -45]
},
{
"text": "Tarte",
"position": [-45, 8, -66],
"rotation": [-1.57, 0, 1.57],
"fontSize": 2
},
{
"text": "Dior",
"position": [-25, 8, -64],
"fontSize": 6
},
{
"text": "Fenty Beauty",
"position": [-18, 8, -62],
"rotation": [-1.57, 0, 1.57],
"fontSize": 2
},
{
"text": "Coffrets\nen promo",
"position": [-21, 8, -80],
"rotation": [-1.57, 0, 1.57],
"fontSize": 3
},
{
"text": "Sephora Collection",
"position": [-13, 8, -105],
"fontSize": 4
},
{
"text": "Clarins",
"position": [25, 8, -15]
},
{
"text": "Skincare",
"position": [36, 8, -32]
},
{
"text": "Beauty\nHub",
"position": [30, 12, -45]
},
{
"text": "Sephora",
"position": [41, 8, -64],
"fontSize": 5
},
{
"text": "Hot on\nsocial media",
"position": [41, 8, -80],
"fontSize": 4
},
{
"text": "Séphora",
"position": [15, 30, 30],
"rotation": [0, 3.14, 0],
"fontSize": 8,
"color": "gray"
},
{
"text": "Entrance",
"position": [15, 0, -110],
"fontSize": 8,
"color": "gray"
}
]
14 changes: 13 additions & 1 deletion src/lib/3dmap/scene.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { GLTF, interactivity } from '@threlte/extras';
import { GLTF, interactivity, Text } from '@threlte/extras';
import { T } from '@threlte/core';
import CameraControls from './cameracontrols.svelte';
import {
Expand All @@ -13,6 +13,7 @@
import ObjectModel from './objectmodel.svelte';
import { onMount } from 'svelte';
import { base } from '$app/paths';
import labelsList from './labels.json';
let objects = $objectsData;
let categories = $categoryData;
Expand Down Expand Up @@ -139,3 +140,14 @@

<!-- Floor -->
<GLTF url={base + '/models/base.glb'} rotation={[0, 1.57, 0]} />

<!-- Labels -->
{#each labelsList as label}
{@const text = label.text || ''}
{@const fontSize = label.fontSize || 3}
{@const position = label.position || [0, 20, 0]}
{@const scale = label.scale || [1, 1, 1]}
{@const color = label.color || 'black'}
{@const rotation = label.rotation || [-1.57, 0, Math.PI]}
<Text {text} {fontSize} {position} {scale} {color} {rotation} fillOpacity={0.25} />
{/each}

0 comments on commit ddcb683

Please sign in to comment.