@realsee/dnalogel 2.0.0-alpha.43 → 2.0.0-alpha.44
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/dist/CSS3DRenderPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/CameraMovementPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/ItemLabelPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/ItemLabelPlugin/index.js +138 -73
- package/dist/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/ModelChassisCompassPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/ModelEntryDoorGuidePlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/ModelItemLabelPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/ModelRoomLabelPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/ModelTVVideoPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/ModelViewPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/PanoCompassPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/PanoCursorRaycasterPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/PanoMeasurePlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/PanoRulerPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/PanoRulerProPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/ItemLabelPlugin/typings.d.ts +1 -0
- package/dist/index.es.js +156 -91
- package/dist/index.js +156 -91
- package/dist/index.umd.js +156 -91
- package/docs/classes/Magnifier.html +4 -4
- package/docs/classes/ModelRoomLabelController.html +4 -4
- package/docs/enums/CameraMovementEffect.html +1 -1
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/Rotation.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/FloorplanBounding.html +3 -3
- package/docs/interfaces/FloorplanData.html +1 -1
- package/docs/interfaces/FloorplanEntrance.html +6 -6
- package/docs/interfaces/FloorplanExtraObject.html +2 -2
- package/docs/interfaces/FloorplanExtraObject3D.html +1 -1
- package/docs/interfaces/FloorplanFloorData.html +1 -1
- package/docs/interfaces/FloorplanImagePosition.html +1 -1
- package/docs/interfaces/FloorplanObserver.html +1 -1
- package/docs/interfaces/FloorplanOutlineItem.html +1 -1
- package/docs/interfaces/FloorplanPosition.html +1 -1
- package/docs/interfaces/FloorplanRoomItem.html +5 -5
- package/docs/interfaces/FloorplanRoomLabelItem.html +2 -2
- package/docs/interfaces/FloorplanServerBounding.html +3 -3
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +1 -1
- package/docs/interfaces/FloorplanServerEntrance.html +6 -6
- package/docs/interfaces/FloorplanServerFloorData.html +1 -1
- package/docs/interfaces/FloorplanServerImagePosition.html +1 -1
- package/docs/interfaces/FloorplanServerObserver.html +1 -1
- package/docs/interfaces/FloorplanServerOutlineItem.html +1 -1
- package/docs/interfaces/FloorplanServerPosition.html +1 -1
- package/docs/interfaces/FloorplanServerRoomItem.html +6 -6
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +2 -2
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoMeasureParameterType.html +1 -1
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginState.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/modules.html +18 -18
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +2 -2
- package/libs/ItemLabelPlugin/ItemLabelComponent.svelte +251 -0
- package/libs/ItemLabelPlugin/ItemLabelItem.js +141 -74
- package/libs/ItemLabelPlugin/ItemLabelItem.svelte +180 -0
- package/libs/ItemLabelPlugin/Plugin.js +1 -1
- package/libs/ItemLabelPlugin/typings.d.ts +3 -1
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +2 -2
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.svelte +155 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +6 -6
- package/libs/ModelItemLabelPlugin/ItemLabelItem.svelte +100 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +1 -1
- package/libs/ModelItemLabelPlugin/typings.d.ts +1 -1
- package/libs/ModelRoomLabelPlugin/Controller.js +1 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +4 -4
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +63 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +2 -2
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +94 -0
- package/libs/PanoRulerProPlugin/Controller.js +1 -1
- package/libs/PanoRulerProPlugin/RulerItem.js +9 -9
- package/libs/PanoRulerProPlugin/RulerItem.svelte +166 -0
- package/libs/PanoRulerProPlugin/RulerItems.svelte +212 -0
- package/libs/PanoSpatialTagPlugin/Components/origins.js +2 -2
- package/libs/PanoSpatialTagPlugin/Components/origins.svelte +58 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +9 -9
- package/libs/PanoSpatialTagPlugin/Components/tag.svelte +292 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +2 -2
- package/libs/floorplan/Components/BaseImage.js +2 -2
- package/libs/floorplan/Components/BaseImage.svelte +26 -0
- package/libs/floorplan/Components/Camera.js +3 -3
- package/libs/floorplan/Components/Camera.svelte +46 -0
- package/libs/floorplan/Components/Compass.js +4 -4
- package/libs/floorplan/Components/Compass.svelte +51 -0
- package/libs/floorplan/Components/CurrentFloor.js +3 -3
- package/libs/floorplan/Components/CurrentFloor.svelte +46 -0
- package/libs/floorplan/Components/Main.js +2 -2
- package/libs/floorplan/Components/Main.svelte +51 -0
- package/libs/floorplan/Components/Normalmage.js +2 -2
- package/libs/floorplan/Components/Normalmage.svelte +11 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +2 -2
- package/libs/floorplan/Components/RoomHighlight/Room.svelte +27 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +3 -3
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +29 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +3 -3
- package/libs/floorplan/Components/RoomLabels/RoomLabel.svelte +119 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +2 -2
- package/libs/floorplan/Components/RoomLabels/RoomLabels.svelte +35 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +3 -3
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +42 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +7 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +24 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +33 -0
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +9 -9
- package/libs/floorplan/Components/RuleLabels/RuleItem.svelte +174 -0
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +2 -2
- package/libs/floorplan/Components/RuleLabels/RuleLabels.svelte +32 -0
- package/libs/floorplan/Components/SvgImage.js +3 -4
- package/libs/floorplan/Components/SvgImage.svelte +28 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +1 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +4 -4
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +85 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +18 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +4 -4
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +40 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +3 -3
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +64 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<script>import "./events.type";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
export let itemLabel;
|
|
4
|
+
export let hooks;
|
|
5
|
+
export let anchorEnabled;
|
|
6
|
+
export let onIconClick;
|
|
7
|
+
// const defaultIcon = '//vrlab-public.ljcdn.com/common/file/web/c8591aaa-e62b-4e31-8fed-671483ace37f.svg\n'
|
|
8
|
+
function onClick() {
|
|
9
|
+
hooks.emit('onLabelClick', itemLabel);
|
|
10
|
+
}
|
|
11
|
+
let customElement;
|
|
12
|
+
$: {
|
|
13
|
+
if (typeof itemLabel.render === 'function' && customElement) {
|
|
14
|
+
if (customElement.children.length === 0) {
|
|
15
|
+
const child = itemLabel.render(itemLabel);
|
|
16
|
+
if (child) {
|
|
17
|
+
customElement.appendChild(child);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<div class={classNames("item-label-item", { fold: itemLabel.isFold })}
|
|
25
|
+
style:z-index="{itemLabel.zIndex}"
|
|
26
|
+
style:transform="{itemLabel.transform}"
|
|
27
|
+
>
|
|
28
|
+
<div class={classNames("item-label-item__text-wrap", { 'item-label-item__custom': Boolean(typeof itemLabel.render === 'function') })}
|
|
29
|
+
style="bottom: {`${itemLabel.strokeLength}px`}"
|
|
30
|
+
on:click="{onClick}"
|
|
31
|
+
>
|
|
32
|
+
{#if Boolean(typeof itemLabel.render === 'function')}
|
|
33
|
+
<div bind:this={customElement}></div>
|
|
34
|
+
{:else}
|
|
35
|
+
{#if itemLabel.icon}
|
|
36
|
+
<div class="icon-wrap"
|
|
37
|
+
on:click="{(e) => onIconClick(itemLabel)}"
|
|
38
|
+
>
|
|
39
|
+
<div class="icon" style={`background-image: url(${itemLabel.icon})`} ></div>
|
|
40
|
+
</div>
|
|
41
|
+
{/if}
|
|
42
|
+
<div class="item-label-text">
|
|
43
|
+
<span class="item-model">{itemLabel.code || itemLabel.id}</span>
|
|
44
|
+
<span class="item-name">{itemLabel.name}</span>
|
|
45
|
+
</div>
|
|
46
|
+
{/if}
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
<div class={classNames("item-label-item__bar", { anchor: anchorEnabled })}
|
|
50
|
+
style="height: {`${itemLabel.strokeLength}px`}">
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<style>
|
|
55
|
+
.item-label-item {
|
|
56
|
+
position: absolute;
|
|
57
|
+
z-index: 0;
|
|
58
|
+
transform: none;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
user-select: none;
|
|
62
|
+
animation: fadeIn .3s ease-in;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.item-label-item.fold >.item-label-item__text-wrap {
|
|
66
|
+
visibility: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.item-label-item.fold >.item-label-item__bar.anchor {
|
|
70
|
+
visibility: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.item-label-item.fold >.item-label-item__bar.anchor:after {
|
|
74
|
+
visibility: visible;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.item-label-item__text-wrap {
|
|
78
|
+
height: fit-content;
|
|
79
|
+
padding: 12px 20px 12px 12px;
|
|
80
|
+
position: absolute;
|
|
81
|
+
width: max-content;
|
|
82
|
+
max-width: 473px;
|
|
83
|
+
min-height: 92px;
|
|
84
|
+
background-image: linear-gradient(269deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.60) 49%, rgba(31, 38, 46, 0.70) 100%);
|
|
85
|
+
border: 1.5px solid rgba(255, 255, 255, .65);
|
|
86
|
+
border-radius: 3px;
|
|
87
|
+
color: white;
|
|
88
|
+
transform: translate(-50%, 0);
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: flex-start;
|
|
91
|
+
align-items: center;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
pointer-events: all;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.item-label-item__custom {
|
|
98
|
+
padding: 12px;
|
|
99
|
+
max-width: unset;
|
|
100
|
+
min-height: unset;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.icon-wrap {
|
|
104
|
+
width: 68px;
|
|
105
|
+
height: 100%;
|
|
106
|
+
display: flex;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
align-content: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.icon {
|
|
112
|
+
width: 68px;
|
|
113
|
+
height: 68px;
|
|
114
|
+
background-repeat: no-repeat;
|
|
115
|
+
background-size: contain;
|
|
116
|
+
background-position: center;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.item-label-text {
|
|
120
|
+
margin-left: 12px;
|
|
121
|
+
padding-left: 12px;
|
|
122
|
+
min-height: 68px;
|
|
123
|
+
height: auto;
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-flow: column;
|
|
126
|
+
justify-content: space-around;
|
|
127
|
+
align-content: flex-start;
|
|
128
|
+
border-left: solid rgba(255, 255, 255, .2) 1px;
|
|
129
|
+
border-top: solid rgba(255, 255, 255, .2) 0;
|
|
130
|
+
border-right: solid rgba(255, 255, 255, .2) 0;
|
|
131
|
+
border-bottom: solid rgba(255, 255, 255, .2) 0;
|
|
132
|
+
pointer-events: auto;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.item-model {
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
font-size: 22px;
|
|
138
|
+
font-weight: bold;
|
|
139
|
+
line-height: 30px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.item-name {
|
|
143
|
+
height: auto;
|
|
144
|
+
word-wrap: break-word;
|
|
145
|
+
word-break: break-all;
|
|
146
|
+
font-size: 20px;
|
|
147
|
+
line-height: 28px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.item-label-item__bar {
|
|
151
|
+
position: absolute;
|
|
152
|
+
bottom: 0;
|
|
153
|
+
width: 3px;
|
|
154
|
+
background-image: linear-gradient(to bottom, white, rgba(255, 255, 255, 0));
|
|
155
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.20);
|
|
156
|
+
pointer-events: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.item-label-item__bar.anchor:after {
|
|
160
|
+
content: '';
|
|
161
|
+
position: absolute;
|
|
162
|
+
bottom: 0;
|
|
163
|
+
width: 24px;
|
|
164
|
+
height: 24px;
|
|
165
|
+
background-image: url("//vrlab-public.ljcdn.com/common/file/web/67e7a198-28c9-47dc-879b-507bd3ae600c.png ");
|
|
166
|
+
background-position: center;
|
|
167
|
+
background-size: contain;
|
|
168
|
+
transform: translate(-10.5px, 50%);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@keyframes fadeIn {
|
|
172
|
+
from {
|
|
173
|
+
opacity: 0
|
|
174
|
+
}
|
|
175
|
+
to {
|
|
176
|
+
opacity: 1
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
</style>
|
|
180
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Five, Subscribe } from "@realsee/five";
|
|
2
|
-
import ItemLabelComponent from './ItemLabelComponent';
|
|
2
|
+
import ItemLabelComponent from './ItemLabelComponent.svelte';
|
|
3
3
|
import { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from "./typings";
|
|
4
4
|
import { parseItemLabelPluginData } from "./utils/parseData";
|
|
5
5
|
const defaultMaxVisibleDistance = undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Subscribe } from "@realsee/five";
|
|
2
2
|
import type { PluginEvent } from "./events.type";
|
|
3
|
-
import type ItemLabelComponent from './ItemLabelComponent';
|
|
3
|
+
import type ItemLabelComponent from './ItemLabelComponent.svelte';
|
|
4
4
|
export declare enum ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE {
|
|
5
5
|
SMALL = "small",
|
|
6
6
|
MIDLLE = "middle",
|
|
@@ -22,6 +22,7 @@ export interface ItemLabelPluginData {
|
|
|
22
22
|
position: [number, number, number];
|
|
23
23
|
type?: string[];
|
|
24
24
|
icon?: string;
|
|
25
|
+
render?: (data: ItemLabel) => HTMLDivElement;
|
|
25
26
|
[key: string]: any;
|
|
26
27
|
}>[];
|
|
27
28
|
}
|
|
@@ -37,6 +38,7 @@ export interface ItemLabel {
|
|
|
37
38
|
observerIndex?: number | undefined;
|
|
38
39
|
visible?: boolean;
|
|
39
40
|
isFold?: boolean;
|
|
41
|
+
render?: (data: ItemLabel) => HTMLDivElement;
|
|
40
42
|
[key: string]: any;
|
|
41
43
|
}
|
|
42
44
|
export interface ItemLabelPluginExportReturnsType {
|
|
@@ -31,7 +31,7 @@ import "./events.type";
|
|
|
31
31
|
import debounce from '../shared-utils/debounce';
|
|
32
32
|
|
|
33
33
|
function add_css(target) {
|
|
34
|
-
append_styles(target, "svelte-
|
|
34
|
+
append_styles(target, "svelte-gk8s47", ".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}");
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function get_each_context(ctx, list, i) {
|
|
@@ -112,7 +112,7 @@ function create_fragment(ctx) {
|
|
|
112
112
|
each_blocks[i].c();
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
attr(div, "class", "item-labels-container svelte-
|
|
115
|
+
attr(div, "class", "item-labels-container svelte-gk8s47");
|
|
116
116
|
add_render_callback(() => /*div_elementresize_handler*/ ctx[9].call(div));
|
|
117
117
|
set_style(div, "opacity", /*itemsVisible*/ ctx[4] ? 1 : 0, false);
|
|
118
118
|
},
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<script>import { DISPLAY_STRATEGY_TYPE } from "./typings";
|
|
2
|
+
import { beforeUpdate, onDestroy, onMount } from "svelte";
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import ItemLabelItem from './ItemLabelItem.svelte';
|
|
5
|
+
import "./events.type";
|
|
6
|
+
import debounce from '../shared-utils/debounce';
|
|
7
|
+
const { Raycaster, Vector3 } = THREE;
|
|
8
|
+
export let five;
|
|
9
|
+
export let modelOcclusionEnable;
|
|
10
|
+
export let itemLabels;
|
|
11
|
+
export let hooks;
|
|
12
|
+
export let displayStrategyType;
|
|
13
|
+
let curItemLabels = null;
|
|
14
|
+
let renderItemLabels = null;
|
|
15
|
+
let containerWidth;
|
|
16
|
+
let containerHeight;
|
|
17
|
+
// 计算重叠
|
|
18
|
+
let cssOffsetLists = [];
|
|
19
|
+
let cssHeight = 26;
|
|
20
|
+
let basicWidth = 11;
|
|
21
|
+
// 动画过程中 itemsVisible 为 false
|
|
22
|
+
let itemsVisible = true;
|
|
23
|
+
/**
|
|
24
|
+
* 可见性策略:
|
|
25
|
+
* 1、当前楼层(假设先不考虑多楼层)
|
|
26
|
+
* 2、模型未被遮挡(一个 box 有没有被遮挡的计算? TODO)
|
|
27
|
+
* */
|
|
28
|
+
const getLabelVisible = (five, itemLabel) => {
|
|
29
|
+
// 虚拟 VR 仅有一层,不考虑楼层信息
|
|
30
|
+
const raycaster = new Raycaster();
|
|
31
|
+
const cameraPosition = five.camera.position.clone();
|
|
32
|
+
const modelPosition = new Vector3().fromArray(itemLabel.modelPosition);
|
|
33
|
+
// 计算点到相机的位置
|
|
34
|
+
const vectorDistance = modelPosition.distanceTo(cameraPosition);
|
|
35
|
+
raycaster.set(cameraPosition.clone(), modelPosition.clone().sub(cameraPosition).normalize());
|
|
36
|
+
const [intersection] = five.model.intersectRaycaster(raycaster);
|
|
37
|
+
return !(intersection && intersection.distance + 1 < vectorDistance);
|
|
38
|
+
};
|
|
39
|
+
// cssOffset 获取
|
|
40
|
+
const getLabelCssOffset = (five, itemLabel) => {
|
|
41
|
+
const modelPosition = new Vector3(itemLabel.modelPosition[0], itemLabel.modelPosition[1], itemLabel.modelPosition[2]);
|
|
42
|
+
const cssPosition = five.project2d(modelPosition);
|
|
43
|
+
const xOffset = cssPosition === null || cssPosition === void 0 ? void 0 : cssPosition.x;
|
|
44
|
+
const yOffset = cssPosition === null || cssPosition === void 0 ? void 0 : cssPosition.y;
|
|
45
|
+
return [xOffset, yOffset];
|
|
46
|
+
};
|
|
47
|
+
const getLabelTransform = (cssOffset) => {
|
|
48
|
+
return `translate(${cssOffset[0]}px, ${cssOffset[1]}px)`;
|
|
49
|
+
};
|
|
50
|
+
// 重叠计算
|
|
51
|
+
const isOverlap = (cssOffset, widthOffset) => {
|
|
52
|
+
if (cssOffsetLists.length === 0) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const hasOverlapPoint = cssOffsetLists.find(item => ((cssOffset[0] >= item[0] - widthOffset && cssOffset[0] <= item[0] + widthOffset)
|
|
56
|
+
|| (cssOffset[1] >= item[1] - cssHeight && cssOffset[1] <= item[1] + cssHeight)));
|
|
57
|
+
return !!hasOverlapPoint;
|
|
58
|
+
};
|
|
59
|
+
function getStrokeLength(itemSpaceHeight, type) {
|
|
60
|
+
switch (type) {
|
|
61
|
+
case DISPLAY_STRATEGY_TYPE.SMALL:
|
|
62
|
+
return Math.ceil(-27.78 * itemSpaceHeight + 85);
|
|
63
|
+
case DISPLAY_STRATEGY_TYPE.MIDLLE:
|
|
64
|
+
return Math.ceil(-38.9 * itemSpaceHeight + 130);
|
|
65
|
+
case DISPLAY_STRATEGY_TYPE.LARGE:
|
|
66
|
+
return Math.ceil(-44.44 * itemSpaceHeight + 140);
|
|
67
|
+
case DISPLAY_STRATEGY_TYPE.EXTRA_LARGE:
|
|
68
|
+
return Math.ceil(-92.59 * itemSpaceHeight + 300);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const getFormatedItemLabels = (five, labels) => {
|
|
72
|
+
// 计算位置 & 可见性
|
|
73
|
+
const newLabels = labels.map(label => {
|
|
74
|
+
const cssOffset = getLabelCssOffset(five, label);
|
|
75
|
+
const curLabelWidth = label.name.length * basicWidth;
|
|
76
|
+
const strokeLength = getStrokeLength(label.modelPosition[1], displayStrategyType);
|
|
77
|
+
// 是否加入碰撞检测
|
|
78
|
+
const naturalVisible = modelOcclusionEnable ? getLabelVisible(five, label) : true;
|
|
79
|
+
const visible = naturalVisible && !isOverlap([cssOffset[0], cssOffset[1] + strokeLength], curLabelWidth);
|
|
80
|
+
if (!visible)
|
|
81
|
+
return Object.assign(Object.assign({}, label), { visible });
|
|
82
|
+
cssOffsetLists.push(cssOffset);
|
|
83
|
+
// position
|
|
84
|
+
const transform = getLabelTransform(cssOffset);
|
|
85
|
+
return Object.assign(Object.assign({}, label), { visible, transform, strokeLength });
|
|
86
|
+
});
|
|
87
|
+
const sortedItemLabelItems = newLabels
|
|
88
|
+
.filter(({ visible }) => visible)
|
|
89
|
+
.map(label => ({
|
|
90
|
+
itemLabelItem: label,
|
|
91
|
+
distance: new Vector3(label.modelPosition[0], label.modelPosition[1], label.modelPosition[2]).clone().distanceTo(five.camera.position)
|
|
92
|
+
}))
|
|
93
|
+
.sort((a, b) => a.distance - b.distance);
|
|
94
|
+
return newLabels.map(label => {
|
|
95
|
+
const sortIndex = sortedItemLabelItems.findIndex(item => item.itemLabelItem.id === label.id);
|
|
96
|
+
if (sortIndex !== undefined)
|
|
97
|
+
return Object.assign(Object.assign({}, label), { zIndex: sortIndex * 10 });
|
|
98
|
+
return label;
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const onItemLabelUpdate = () => {
|
|
102
|
+
cssOffsetLists = [];
|
|
103
|
+
renderItemLabels = getFormatedItemLabels(five, renderItemLabels);
|
|
104
|
+
};
|
|
105
|
+
beforeUpdate(() => {
|
|
106
|
+
addDataUpdateListener();
|
|
107
|
+
});
|
|
108
|
+
const handleCameraUpdateCallback = () => {
|
|
109
|
+
itemsVisible = false;
|
|
110
|
+
handleCameraUpdate();
|
|
111
|
+
};
|
|
112
|
+
onMount(() => {
|
|
113
|
+
renderItemLabels = itemLabels;
|
|
114
|
+
curItemLabels = itemLabels;
|
|
115
|
+
onItemLabelUpdate();
|
|
116
|
+
addResizeListener();
|
|
117
|
+
five.on('cameraUpdate', handleCameraUpdateCallback);
|
|
118
|
+
});
|
|
119
|
+
const handleCameraUpdate = debounce(() => {
|
|
120
|
+
itemsVisible = true;
|
|
121
|
+
onItemLabelUpdate();
|
|
122
|
+
}, 300);
|
|
123
|
+
const addResizeListener = () => {
|
|
124
|
+
window.addEventListener('resize', onResize, false);
|
|
125
|
+
};
|
|
126
|
+
const addDataUpdateListener = () => {
|
|
127
|
+
if (curItemLabels !== itemLabels) {
|
|
128
|
+
renderItemLabels = itemLabels;
|
|
129
|
+
curItemLabels = itemLabels;
|
|
130
|
+
onItemLabelUpdate();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const onResize = () => {
|
|
134
|
+
five.once('renderFrame', onItemLabelUpdate);
|
|
135
|
+
};
|
|
136
|
+
onDestroy(() => {
|
|
137
|
+
five.off('cameraUpdate', handleCameraUpdateCallback);
|
|
138
|
+
window.removeEventListener('resize', onResize, false);
|
|
139
|
+
});
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<div class="item-labels-container" bind:clientWidth="{containerWidth}" bind:clientHeight="{containerHeight}"
|
|
143
|
+
style:opacity="{itemsVisible ? 1 : 0}">
|
|
144
|
+
{#each renderItemLabels as itemLabelItem (itemLabelItem.id)}
|
|
145
|
+
<ItemLabelItem itemLabel="{itemLabelItem}" hooks="{hooks}" />
|
|
146
|
+
{/each}
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<style>
|
|
150
|
+
.item-labels-container {
|
|
151
|
+
width: 100%;
|
|
152
|
+
height: 100%;
|
|
153
|
+
position: relative;
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
@@ -22,7 +22,7 @@ import "./events.type";
|
|
|
22
22
|
import classNames from 'classnames';
|
|
23
23
|
|
|
24
24
|
function add_css(target) {
|
|
25
|
-
append_styles(target, "svelte-
|
|
25
|
+
append_styles(target, "svelte-n1c1kg", ".item-label-item.svelte-n1c1kg{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:0}.item-label-item.visible.svelte-n1c1kg{opacity:1;-webkit-animation:svelte-n1c1kg-fadeIn .3s ease-in;animation:svelte-n1c1kg-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-n1c1kg::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(0.83333rem);z-index:-1}.item-label-item__text-wrap.svelte-n1c1kg{padding:0.3125rem 0.3125rem 0;position:absolute;height:1.04167rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.52083rem;font-size:0.57292rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-n1c1kg{padding-bottom:0.20833rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px solid;-o-border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-n1c1kg{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@-webkit-keyframes svelte-n1c1kg-fadeIn{from{opacity:0\n }to{opacity:1\n }}@keyframes svelte-n1c1kg-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function create_fragment(ctx) {
|
|
@@ -49,12 +49,12 @@ function create_fragment(ctx) {
|
|
|
49
49
|
t0 = text(t0_value);
|
|
50
50
|
t1 = space();
|
|
51
51
|
div1 = element("div");
|
|
52
|
-
attr(span, "class", "item-label-item__text svelte-
|
|
53
|
-
attr(div0, "class", "item-label-item__text-wrap svelte-
|
|
52
|
+
attr(span, "class", "item-label-item__text svelte-n1c1kg");
|
|
53
|
+
attr(div0, "class", "item-label-item__text-wrap svelte-n1c1kg");
|
|
54
54
|
set_style(div0, "top", `-${/*itemLabel*/ ctx[0].strokeLength + 26}px`);
|
|
55
|
-
attr(div1, "class", "item-label-item__bar svelte-
|
|
55
|
+
attr(div1, "class", "item-label-item__bar svelte-n1c1kg");
|
|
56
56
|
set_style(div1, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
|
|
57
|
-
attr(div2, "class", div2_class_value = "" + (null_to_empty(classNames("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-
|
|
57
|
+
attr(div2, "class", div2_class_value = "" + (null_to_empty(classNames("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-n1c1kg"));
|
|
58
58
|
set_style(div2, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
|
|
59
59
|
set_style(div2, "transform", /*itemLabel*/ ctx[0].transform, false);
|
|
60
60
|
},
|
|
@@ -84,7 +84,7 @@ function create_fragment(ctx) {
|
|
|
84
84
|
set_style(div1, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
if (dirty & /*itemLabel*/ 1 && div2_class_value !== (div2_class_value = "" + (null_to_empty(classNames("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-
|
|
87
|
+
if (dirty & /*itemLabel*/ 1 && div2_class_value !== (div2_class_value = "" + (null_to_empty(classNames("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-n1c1kg"))) {
|
|
88
88
|
attr(div2, "class", div2_class_value);
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script>import "./events.type";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
export let itemLabel;
|
|
4
|
+
export let hooks;
|
|
5
|
+
function onClick() {
|
|
6
|
+
console.log('__onclick___: ', itemLabel);
|
|
7
|
+
hooks.emit('onLabelClick', itemLabel);
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div
|
|
12
|
+
class={classNames("item-label-item", { visible: itemLabel.visible })}
|
|
13
|
+
style:z-index="{itemLabel.zIndex}"
|
|
14
|
+
style:transform="{itemLabel.transform}"
|
|
15
|
+
>
|
|
16
|
+
<div
|
|
17
|
+
class="item-label-item__text-wrap"
|
|
18
|
+
style="top: {`-${itemLabel.strokeLength + 26}px`}"
|
|
19
|
+
>
|
|
20
|
+
<span
|
|
21
|
+
class="item-label-item__text"
|
|
22
|
+
on:click="{onClick}"
|
|
23
|
+
>{itemLabel.name.length > 6 ? `${itemLabel.name.slice(0, 6)}...` : itemLabel.name}</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div
|
|
26
|
+
class="item-label-item__bar"
|
|
27
|
+
style="height: {`${itemLabel.strokeLength}px`}">
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.item-label-item {
|
|
33
|
+
position: absolute;
|
|
34
|
+
z-index: 0;
|
|
35
|
+
transform: none;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
user-select: none;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.item-label-item.visible {
|
|
43
|
+
opacity: 1;
|
|
44
|
+
animation: fadeIn .3s ease-in;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.item-label-item__text-wrap::before {
|
|
48
|
+
content: '';
|
|
49
|
+
position: absolute;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
background-color: rgba(0, 0, 0, .3);
|
|
53
|
+
filter: blur(16px);
|
|
54
|
+
z-index: -1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.item-label-item__text-wrap {
|
|
58
|
+
padding: 6px 6px 0;
|
|
59
|
+
position: absolute;
|
|
60
|
+
height: 20px;
|
|
61
|
+
pointer-events: all;
|
|
62
|
+
background-size: 100% 100%;
|
|
63
|
+
background-repeat: no-repeat;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
line-height: 10px;
|
|
66
|
+
font-size: 11px;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
color: #FFEAC0;
|
|
69
|
+
transform: translate(-50%, 0);
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.item-label-item__text {
|
|
76
|
+
padding-bottom: 4px;
|
|
77
|
+
border-top: 0 solid;
|
|
78
|
+
border-left: 0 solid;
|
|
79
|
+
border-right: 0 solid;
|
|
80
|
+
border-bottom: 1px solid;
|
|
81
|
+
border-image: linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.item-label-item__bar {
|
|
85
|
+
position: absolute;
|
|
86
|
+
bottom: 0;
|
|
87
|
+
width: 1px;
|
|
88
|
+
background-image: linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@keyframes fadeIn {
|
|
92
|
+
from {
|
|
93
|
+
opacity: 0
|
|
94
|
+
}
|
|
95
|
+
to {
|
|
96
|
+
opacity: 1
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
100
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Five, Subscribe } from "@realsee/five";
|
|
2
|
-
import ItemLabelComponent from './ItemLabelComponent';
|
|
2
|
+
import ItemLabelComponent from './ItemLabelComponent.svelte';
|
|
3
3
|
import { DISPLAY_STRATEGY_TYPE } from "./typings";
|
|
4
4
|
import { parseModelItemLabelPluginData } from "./utils/parseData";
|
|
5
5
|
export const ModelItemLabelPlugin = (five, params) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Subscribe } from "@realsee/five";
|
|
2
2
|
import type { PluginEvent } from "./events.type";
|
|
3
|
-
import type ItemLabelComponent from './ItemLabelComponent';
|
|
3
|
+
import type ItemLabelComponent from './ItemLabelComponent.svelte';
|
|
4
4
|
export declare enum DISPLAY_STRATEGY_TYPE {
|
|
5
5
|
SMALL = "small",
|
|
6
6
|
MIDLLE = "middle",
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import { ROOM_LABEL_BG } from './Assets/roomLabelBg';
|
|
22
22
|
|
|
23
23
|
function add_css(target) {
|
|
24
|
-
append_styles(target, "svelte-
|
|
24
|
+
append_styles(target, "svelte-877671", ".room-label-item.svelte-877671{position:absolute;font-size:0.41667rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-877671{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-877671{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-877671{font-size:0.52083rem}");
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function create_fragment(ctx) {
|
|
@@ -41,11 +41,11 @@ function create_fragment(ctx) {
|
|
|
41
41
|
t0 = text(t0_value);
|
|
42
42
|
t1 = space();
|
|
43
43
|
div0 = element("div");
|
|
44
|
-
attr(span, "class", "room-label-item__text svelte-
|
|
44
|
+
attr(span, "class", "room-label-item__text svelte-877671");
|
|
45
45
|
set_style(span, "background-image", "url(" + ROOM_LABEL_BG + ")");
|
|
46
46
|
toggle_class(span, "wide", /*roomLabel*/ ctx[0].name.length > 3);
|
|
47
|
-
attr(div0, "class", "room-label-item__bar svelte-
|
|
48
|
-
attr(div1, "class", "room-label-item svelte-
|
|
47
|
+
attr(div0, "class", "room-label-item__bar svelte-877671");
|
|
48
|
+
attr(div1, "class", "room-label-item svelte-877671");
|
|
49
49
|
set_style(div1, "z-index", /*roomLabel*/ ctx[0].zIndex, false);
|
|
50
50
|
set_style(div1, "transform", /*roomLabel*/ ctx[0].transform, false);
|
|
51
51
|
set_style(div1, "opacity", /*roomLabel*/ ctx[0].visible ? 1 : 0, false);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script>import { ROOM_LABEL_BG } from './Assets/roomLabelBg';
|
|
2
|
+
export let five;
|
|
3
|
+
export let roomLabel;
|
|
4
|
+
function onClick() {
|
|
5
|
+
five.setState({ panoIndex: roomLabel.panoIndex, mode: 'Panorama', longitude: roomLabel.longitude });
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div
|
|
10
|
+
class="room-label-item"
|
|
11
|
+
style:z-index="{roomLabel.zIndex}"
|
|
12
|
+
style:transform="{roomLabel.transform}"
|
|
13
|
+
style:opacity="{roomLabel.visible ? 1 : 0}"
|
|
14
|
+
>
|
|
15
|
+
<span
|
|
16
|
+
class="room-label-item__text"
|
|
17
|
+
class:wide="{roomLabel.name.length > 3}"
|
|
18
|
+
style="background-image: url({ROOM_LABEL_BG})"
|
|
19
|
+
on:click="{onClick}">{roomLabel.name}</span
|
|
20
|
+
>
|
|
21
|
+
<div class="room-label-item__bar"></div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<style>
|
|
25
|
+
.room-label-item {
|
|
26
|
+
position: absolute;
|
|
27
|
+
font-size: 8px;
|
|
28
|
+
z-index: 0;
|
|
29
|
+
transform: none;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
user-select: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.room-label-item__text {
|
|
36
|
+
position: absolute;
|
|
37
|
+
left: 0;
|
|
38
|
+
top: -64px;
|
|
39
|
+
transform: translate(-50%, 0);
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
align-items: center;
|
|
43
|
+
height: 20px;
|
|
44
|
+
min-width: 32px;
|
|
45
|
+
padding: 0 6px;
|
|
46
|
+
pointer-events: all;
|
|
47
|
+
background-size: 100% 100%;
|
|
48
|
+
background-repeat: no-repeat;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.room-label-item__bar {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: -44px;
|
|
55
|
+
height: 48px;
|
|
56
|
+
width: 1px;
|
|
57
|
+
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.wide {
|
|
61
|
+
font-size: 10px;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -29,7 +29,7 @@ import { Raycaster, Vector3 } from 'three';
|
|
|
29
29
|
import RoomLabelItem from './RoomLabelItem';
|
|
30
30
|
|
|
31
31
|
function add_css(target) {
|
|
32
|
-
append_styles(target, "svelte-
|
|
32
|
+
append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function get_each_context(ctx, list, i) {
|
|
@@ -110,7 +110,7 @@ function create_fragment(ctx) {
|
|
|
110
110
|
each_blocks[i].c();
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
attr(div, "class", "room-labels-container svelte-
|
|
113
|
+
attr(div, "class", "room-labels-container svelte-9eg4zi");
|
|
114
114
|
add_render_callback(() => /*div_elementresize_handler*/ ctx[6].call(div));
|
|
115
115
|
},
|
|
116
116
|
m(target, anchor) {
|