@panoramax/web-viewer 5.1.1-develop-f7f14900 → 5.1.1-develop-942a7005
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/build/cjs/index.js +55 -54
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index_photoviewer.js +54 -59
- package/build/cjs/index_photoviewer.js.map +1 -1
- package/build/esm/components/core/Basic.js +1 -1
- package/build/esm/components/menus/PlayerOptions.js +18 -11
- package/build/esm/components/ui/Photo.js +24 -3
- package/build/esm/translations/en.json +2 -0
- package/build/esm/translations/fr.json +2 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import BasicStyles from "./Basic.css" with { type: "css" };
|
|
|
9
9
|
document.adoptedStyleSheets.push(AtkinsonStyles);
|
|
10
10
|
document.adoptedStyleSheets.push(BasicStyles);
|
|
11
11
|
|
|
12
|
-
const __COMMIT_HASH__ = "
|
|
12
|
+
const __COMMIT_HASH__ = "942a700";
|
|
13
13
|
const __PACKAGE_VERSION__ = "5.1.1";
|
|
14
14
|
const __PACKAGE_ISSUES_URL__ = "https://gitlab.com/panoramax/clients/web-viewer/-/work_items";
|
|
15
15
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement, css, html } from "lit";
|
|
2
2
|
import { faSvg } from "../styles.js";
|
|
3
3
|
import { faLightbulb, faPersonBiking, faRocket } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
+
import { faLightbulb as farLightbulb } from "@fortawesome/free-regular-svg-icons";
|
|
4
5
|
import { PIC_MAX_STAY_DURATION } from "../ui/Photo.js";
|
|
5
6
|
import { fa, onceParentAvailable } from "../../utils/widgets.js";
|
|
6
7
|
|
|
@@ -35,6 +36,17 @@ export default class PlayerOptions extends LitElement {
|
|
|
35
36
|
}
|
|
36
37
|
` ];
|
|
37
38
|
|
|
39
|
+
/** @private */
|
|
40
|
+
static properties = {
|
|
41
|
+
contrast: {state: true},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @private */
|
|
45
|
+
constructor() {
|
|
46
|
+
super();
|
|
47
|
+
this.contrast = 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
/** @private */
|
|
39
51
|
connectedCallback() {
|
|
40
52
|
super.connectedCallback();
|
|
@@ -51,15 +63,9 @@ export default class PlayerOptions extends LitElement {
|
|
|
51
63
|
|
|
52
64
|
/** @private */
|
|
53
65
|
_onContrastClick() {
|
|
54
|
-
|
|
55
|
-
if(
|
|
56
|
-
|
|
57
|
-
this._parent?.psv?.setHigherContrast(false);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
btn.setAttribute("active", "true");
|
|
61
|
-
this._parent?.psv?.setHigherContrast(true);
|
|
62
|
-
}
|
|
66
|
+
this.contrast++;
|
|
67
|
+
if(this.contrast > 1) { this.contrast = -1; }
|
|
68
|
+
this._parent?.psv?.setContrast(this.contrast);
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
/** @private */
|
|
@@ -80,11 +86,12 @@ export default class PlayerOptions extends LitElement {
|
|
|
80
86
|
</div>
|
|
81
87
|
<pnx-button
|
|
82
88
|
id="pnx-player-contrast"
|
|
83
|
-
title
|
|
89
|
+
title=${this._parent?._t.pnx[this.contrast === 0 ? "contrast" : (this.contrast === 1 ? "low_contrast" : "reset_contrast")]}
|
|
84
90
|
kind="outline"
|
|
91
|
+
.active=${this.contrast !== 0 ? "true" : null}
|
|
85
92
|
@click=${this._onContrastClick}
|
|
86
93
|
>
|
|
87
|
-
${fa(faLightbulb)}
|
|
94
|
+
${this.contrast === -1 ? fa(farLightbulb) : fa(faLightbulb)}
|
|
88
95
|
</pnx-button>
|
|
89
96
|
`;
|
|
90
97
|
}
|
|
@@ -822,13 +822,34 @@ export default class Photo extends PSViewer {
|
|
|
822
822
|
}
|
|
823
823
|
|
|
824
824
|
/**
|
|
825
|
-
* Enable or disable higher contrast on picture
|
|
825
|
+
* Enable or disable higher contrast on picture.
|
|
826
|
+
* Equivalent to setContrast(1) (or 0 to disable).
|
|
826
827
|
* @param {boolean} enable True to enable higher contrast
|
|
827
828
|
* @memberof Panoramax.components.ui.Photo#
|
|
828
829
|
*/
|
|
829
830
|
setHigherContrast(enable) {
|
|
830
|
-
this.
|
|
831
|
-
|
|
831
|
+
this.setContrast(enable ? 1 : 0);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Change picture contrast
|
|
836
|
+
* @param {number} value Set to 0 to have original, -1 to lower, +1 to higher
|
|
837
|
+
* @memberof Panoramax.components.ui.Photo#
|
|
838
|
+
*/
|
|
839
|
+
setContrast(value) {
|
|
840
|
+
switch(value) {
|
|
841
|
+
case -1:
|
|
842
|
+
this.renderer.renderer.toneMapping = 3;
|
|
843
|
+
this.renderer.renderer.toneMappingExposure = 0.3;
|
|
844
|
+
break;
|
|
845
|
+
case 1:
|
|
846
|
+
this.renderer.renderer.toneMapping = 3;
|
|
847
|
+
this.renderer.renderer.toneMappingExposure = 1.7;
|
|
848
|
+
break;
|
|
849
|
+
default:
|
|
850
|
+
this.renderer.renderer.toneMapping = 0;
|
|
851
|
+
this.renderer.renderer.toneMappingExposure = 1;
|
|
852
|
+
}
|
|
832
853
|
this.needsUpdate();
|
|
833
854
|
}
|
|
834
855
|
|
|
@@ -158,6 +158,8 @@
|
|
|
158
158
|
"map_theme_score": "Quality score",
|
|
159
159
|
"map_theme_gps": "Location precision",
|
|
160
160
|
"contrast": "Enable higher image contrast",
|
|
161
|
+
"low_contrast": "Lower image contrast",
|
|
162
|
+
"reset_contrast": "Reset image contrast",
|
|
161
163
|
"metadata": "Picture metadata",
|
|
162
164
|
"metadata_summary": "Summary",
|
|
163
165
|
"metadata_general_copy_id": "Copy ID",
|
|
@@ -158,6 +158,8 @@
|
|
|
158
158
|
"map_theme_score": "Score de qualité",
|
|
159
159
|
"map_theme_gps": "Précision du positionnement",
|
|
160
160
|
"contrast": "Augmenter le contraste de l'image",
|
|
161
|
+
"low_contrast": "Diminuer le contraste de l'image",
|
|
162
|
+
"reset_contrast": "Rétablir le contraste de l'image",
|
|
161
163
|
"metadata": "Métadonnées de la photo",
|
|
162
164
|
"metadata_summary": "Résumé",
|
|
163
165
|
"metadata_general_copy_id": "Copier l'ID",
|
package/package.json
CHANGED