viral-viewer-2 1.4.4 → 1.4.5
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ViralViewerTool } from "../..";
|
|
1
2
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
2
3
|
export declare class ViralTools {
|
|
3
4
|
viralViewerApi: ViralViewerApi;
|
|
@@ -8,10 +9,12 @@ export declare class ViralTools {
|
|
|
8
9
|
index: number;
|
|
9
10
|
activate: boolean;
|
|
10
11
|
name: string;
|
|
12
|
+
action: (model: ViralViewerTool) => void;
|
|
11
13
|
}[];
|
|
12
14
|
}[];
|
|
13
15
|
items: HTMLElement[];
|
|
14
16
|
constructor(viralViewerApi: ViralViewerApi);
|
|
15
17
|
private injectTools;
|
|
16
18
|
private handleClick;
|
|
19
|
+
private nightMode;
|
|
17
20
|
}
|
|
@@ -12,13 +12,15 @@ class ViralTools {
|
|
|
12
12
|
"svg": `<svg fill="#56674d" style="height: 30px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>cursor-move</title><path d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z" /></svg>`,
|
|
13
13
|
'index': 0,
|
|
14
14
|
'activate': true,
|
|
15
|
-
"name": 'orbit'
|
|
15
|
+
"name": 'orbit',
|
|
16
|
+
"action": () => { }
|
|
16
17
|
},
|
|
17
18
|
{
|
|
18
19
|
"svg": `<svg fill="#86957d" style="height: 30px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>nature-people-outline</title><path d="M16 20V16.12C19.47 15.71 22.17 12.76 22.17 9.17C22.17 5.3 19.04 2.17 15.17 2.17C13.31 2.17 11.53 2.91 10.22 4.22C8.91 5.53 8.17 7.31 8.17 9.17C8.17 9.95 8.3 10.69 8.53 11.38C8.64 11.71 8.77 12.03 8.93 12.33C9.91 14.27 11.78 15.68 14 16.06V20H6V17H7V12.95C7 12.72 6.89 12.5 6.74 12.33L6.71 12.29L6.66 12.25C6.5 12.09 6.25 12 6 12H3C2.76 12 2.5 12.09 2.34 12.25L2.29 12.29C2.11 12.5 2 12.74 2 13V17H3V22H19V20H16M15.08 14.22L14.33 14.09C11.96 13.69 10.17 11.64 10.17 9.17C10.17 7.84 10.7 6.57 11.63 5.63C12.57 4.7 13.85 4.17 15.17 4.17C17.93 4.17 20.17 6.41 20.17 9.17C20.17 11.73 18.24 13.84 15.77 14.13L15.08 14.21M4.5 11C5.33 11 6 10.33 6 9.5C6 8.67 5.33 8 4.5 8C3.67 8 3 8.67 3 9.5C3 10.33 3.67 11 4.5 11Z" /></svg>`,
|
|
19
20
|
'index': 1,
|
|
20
21
|
'activate': false,
|
|
21
|
-
"name": 'first-person'
|
|
22
|
+
"name": 'first-person',
|
|
23
|
+
"action": () => { }
|
|
22
24
|
},
|
|
23
25
|
]
|
|
24
26
|
},
|
|
@@ -29,13 +31,15 @@ class ViralTools {
|
|
|
29
31
|
"svg": `<svg fill="#86957d" style="height: 30px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>ruler</title><path d="M1.39,18.36L3.16,16.6L4.58,18L5.64,16.95L4.22,15.54L5.64,14.12L8.11,16.6L9.17,15.54L6.7,13.06L8.11,11.65L9.53,13.06L10.59,12L9.17,10.59L10.59,9.17L13.06,11.65L14.12,10.59L11.65,8.11L13.06,6.7L14.47,8.11L15.54,7.05L14.12,5.64L15.54,4.22L18,6.7L19.07,5.64L16.6,3.16L18.36,1.39L22.61,5.64L5.64,22.61L1.39,18.36Z" /></svg>`,
|
|
30
32
|
'index': 0,
|
|
31
33
|
'activate': false,
|
|
32
|
-
"name": 'ruler'
|
|
34
|
+
"name": 'ruler',
|
|
35
|
+
"action": () => { }
|
|
33
36
|
},
|
|
34
37
|
{
|
|
35
38
|
"svg": `<svg fill="#86957d" style="height: 30px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>vector-intersection</title><path d="M3.14,1A2.14,2.14 0 0,0 1,3.14V5H3V3H5V1H3.14M7,1V3H10V1H7M12,1V3H14V5H16V3.14C16,1.96 15.04,1 13.86,1H12M1,7V10H3V7H1M9,7C7.89,7 7,7.89 7,9C7,11.33 7,16 7,16C7,16 11.57,16 13.86,16A2.14,2.14 0 0,0 16,13.86C16,11.57 16,7 16,7C16,7 11.33,7 9,7M18,7V9H20V11H22V9C22,7.89 21.11,7 20,7H18M9,9H14V14H9V9M1,12V13.86C1,15.04 1.96,16 3.14,16H5V14H3V12H1M20,13V16H22V13H20M7,18V20C7,21.11 7.89,22 9,22H11V20H9V18H7M20,18V20H18V22H20C21.11,22 22,21.11 22,20V18H20M13,20V22H16V20H13Z" /></svg>`,
|
|
36
39
|
'index': 1,
|
|
37
40
|
'activate': false,
|
|
38
|
-
"name": 'clip-plane'
|
|
41
|
+
"name": 'clip-plane',
|
|
42
|
+
"action": () => { }
|
|
39
43
|
},
|
|
40
44
|
]
|
|
41
45
|
},
|
|
@@ -46,7 +50,20 @@ class ViralTools {
|
|
|
46
50
|
"svg": `<svg fill="#86957d" style="height: 30px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>white-balance-sunny</title><path d="M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13" /></svg>`,
|
|
47
51
|
'index': 0,
|
|
48
52
|
'activate': false,
|
|
49
|
-
"name": 'sun'
|
|
53
|
+
"name": 'sun',
|
|
54
|
+
"action": () => { }
|
|
55
|
+
},
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "theme",
|
|
60
|
+
"tools": [
|
|
61
|
+
{
|
|
62
|
+
"svg": `<svg fill="#86957d" style="height: 30px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>moon-waning-crescent</title><path d="M2 12A10 10 0 0 0 15 21.54A10 10 0 0 1 15 2.46A10 10 0 0 0 2 12Z" /></svg>`,
|
|
63
|
+
'index': 0,
|
|
64
|
+
'activate': false,
|
|
65
|
+
"name": 'night-mode',
|
|
66
|
+
"action": (model) => this.nightMode(model)
|
|
50
67
|
},
|
|
51
68
|
]
|
|
52
69
|
}
|
|
@@ -119,6 +136,18 @@ class ViralTools {
|
|
|
119
136
|
borderElement.setAttribute("style", "border-top: 2px solid ; padding-bottom: 2px; border-color: #e2e6dc;");
|
|
120
137
|
svg.setAttribute("fill", "#86957d");
|
|
121
138
|
}
|
|
139
|
+
tool.action(tool);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//#region Action
|
|
143
|
+
nightMode(input) {
|
|
144
|
+
if (this.viralViewerApi.targetElement) {
|
|
145
|
+
if (input.activate) {
|
|
146
|
+
this.viralViewerApi.targetElement.setAttribute("style", "background-color:#303030");
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
this.viralViewerApi.targetElement.setAttribute("style", "background-color:unset");
|
|
150
|
+
}
|
|
122
151
|
}
|
|
123
152
|
}
|
|
124
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-tools.js","sourceRoot":"","sources":["../../../src/components/tools/viral-tools.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"viral-tools.js","sourceRoot":"","sources":["../../../src/components/tools/viral-tools.ts"],"names":[],"mappings":";;;AAGA,MAAa,UAAU;IA+EnB,YAAmB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QA9E1C,UAAK,GAAG;YACX;gBACI,MAAM,EAAE,YAAY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