@iobroker/gui-components 10.3.14 → 10.3.15
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/README.md +8 -1
- package/build/Components/AnimatedIcons/IconBell.d.ts +21 -0
- package/build/Components/AnimatedIcons/IconBell.js +50 -0
- package/build/Components/AnimatedIcons/IconBell.js.map +1 -0
- package/build/Components/AnimatedIcons/IconConnectionState.d.ts +19 -0
- package/build/Components/AnimatedIcons/IconConnectionState.js +25 -0
- package/build/Components/AnimatedIcons/IconConnectionState.js.map +1 -0
- package/build/Components/AnimatedIcons/IconExpertMode.d.ts +22 -0
- package/build/Components/AnimatedIcons/IconExpertMode.js +47 -0
- package/build/Components/AnimatedIcons/IconExpertMode.js.map +1 -0
- package/build/Components/AnimatedIcons/IconFolder.d.ts +22 -0
- package/build/Components/AnimatedIcons/IconFolder.js +29 -0
- package/build/Components/AnimatedIcons/IconFolder.js.map +1 -0
- package/build/Components/AnimatedIcons/IconMenuArrow.d.ts +23 -0
- package/build/Components/AnimatedIcons/IconMenuArrow.js +26 -0
- package/build/Components/AnimatedIcons/IconMenuArrow.js.map +1 -0
- package/build/Components/AnimatedIcons/IconPlayPause.d.ts +23 -0
- package/build/Components/AnimatedIcons/IconPlayPause.js +25 -0
- package/build/Components/AnimatedIcons/IconPlayPause.js.map +1 -0
- package/build/Components/AnimatedIcons/IconRefresh.d.ts +23 -0
- package/build/Components/AnimatedIcons/IconRefresh.js +86 -0
- package/build/Components/AnimatedIcons/IconRefresh.js.map +1 -0
- package/build/Components/AnimatedIcons/IconResult.d.ts +21 -0
- package/build/Components/AnimatedIcons/IconResult.js +36 -0
- package/build/Components/AnimatedIcons/IconResult.js.map +1 -0
- package/build/Components/AnimatedIcons/IconStatusLed.d.ts +25 -0
- package/build/Components/AnimatedIcons/IconStatusLed.js +58 -0
- package/build/Components/AnimatedIcons/IconStatusLed.js.map +1 -0
- package/build/Components/AnimatedIcons/IconTrash.d.ts +20 -0
- package/build/Components/AnimatedIcons/IconTrash.js +23 -0
- package/build/Components/AnimatedIcons/IconTrash.js.map +1 -0
- package/build/Components/AnimatedIcons/common.d.ts +31 -0
- package/build/Components/AnimatedIcons/common.js +164 -0
- package/build/Components/AnimatedIcons/common.js.map +1 -0
- package/build/Components/FileBrowser.js +4 -5
- package/build/Components/FileBrowser.js.map +1 -1
- package/build/Components/Loaders/Community.d.ts +13 -2
- package/build/Components/Loaders/Community.js +176 -243
- package/build/Components/Loaders/Community.js.map +1 -1
- package/build/Components/Loaders/CommunityLegacy.d.ts +32 -0
- package/build/Components/Loaders/CommunityLegacy.js +266 -0
- package/build/Components/Loaders/CommunityLegacy.js.map +1 -0
- package/build/Components/ObjectBrowser/ObjectBrowserClass.d.ts +9 -0
- package/build/Components/ObjectBrowser/ObjectBrowserClass.js +62 -2
- package/build/Components/ObjectBrowser/ObjectBrowserClass.js.map +1 -1
- package/build/Components/ObjectBrowser/dialogs.js +2 -2
- package/build/Components/ObjectBrowser/dialogs.js.map +1 -1
- package/build/Components/ObjectBrowser/renderLeaf.js +6 -6
- package/build/Components/ObjectBrowser/renderLeaf.js.map +1 -1
- package/build/Components/ObjectBrowser/rowAnimation.d.ts +9 -0
- package/build/Components/ObjectBrowser/rowAnimation.js +122 -0
- package/build/Components/ObjectBrowser/rowAnimation.js.map +1 -0
- package/build/Components/ObjectBrowser/toolbar.js +5 -4
- package/build/Components/ObjectBrowser/toolbar.js.map +1 -1
- package/build/index.d.ts +13 -0
- package/build/index.js +12 -0
- package/build/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2018-
|
|
2
|
+
* Copyright 2018-2026 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
6
|
+
* Loader of the community edition: the ioBroker mark is a power button, so the loader switches ioBroker on.
|
|
7
|
+
* 1. Switch on: the top of the "i" lights up, the ring draws itself from there to both sides, the stem grows.
|
|
8
|
+
* 2. Wait: light runs through the ring, devices on an orbit send data packets into it.
|
|
9
|
+
* 3. Open (only with `done`): the devices gather in the ring, the ring flashes and a circle opens from the centre.
|
|
10
|
+
* Only SVG and CSS, no JavaScript timer. The previous loader is `LoaderCommunityLegacy`.
|
|
6
11
|
*/
|
|
7
12
|
import React from 'react';
|
|
8
13
|
import type { ThemeName, ThemeType } from '../../types';
|
|
@@ -14,7 +19,7 @@ declare global {
|
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
interface LoaderProps {
|
|
17
|
-
/**
|
|
22
|
+
/** Width of the mark in pixels (default 210); on small screens it shrinks to 30% of the shorter side. */
|
|
18
23
|
size?: number;
|
|
19
24
|
/** The chosen theme type. */
|
|
20
25
|
themeType?: ThemeType;
|
|
@@ -26,6 +31,12 @@ interface LoaderProps {
|
|
|
26
31
|
backgroundColor?: string;
|
|
27
32
|
/** Background image URL */
|
|
28
33
|
backgroundImage?: string;
|
|
34
|
+
/** Optional line below the mark, e.g. the current loading step. Shown in capitals with a leading "//". */
|
|
35
|
+
status?: string;
|
|
36
|
+
/** Play the closing animation: the loader opens and shows what is rendered below it. */
|
|
37
|
+
done?: boolean;
|
|
38
|
+
/** Called when the closing animation is over, so the loader can be removed. */
|
|
39
|
+
onFinished?: () => void;
|
|
29
40
|
}
|
|
30
41
|
export declare function LoaderCommunity(props: LoaderProps): React.JSX.Element;
|
|
31
42
|
export {};
|
|
@@ -1,265 +1,198 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2018-
|
|
2
|
+
* Copyright 2018-2026 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
6
|
+
* Loader of the community edition: the ioBroker mark is a power button, so the loader switches ioBroker on.
|
|
7
|
+
* 1. Switch on: the top of the "i" lights up, the ring draws itself from there to both sides, the stem grows.
|
|
8
|
+
* 2. Wait: light runs through the ring, devices on an orbit send data packets into it.
|
|
9
|
+
* 3. Open (only with `done`): the devices gather in the ring, the ring flashes and a circle opens from the centre.
|
|
10
|
+
* Only SVG and CSS, no JavaScript timer. The previous loader is `LoaderCommunityLegacy`.
|
|
6
11
|
*/
|
|
7
|
-
import React, { useEffect } from 'react';
|
|
12
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
13
|
+
/** The ring of the mark (img/logo.svg), used as mask for the light running through it */
|
|
14
|
+
const RING_PATH = 'M386,91v68.6c68.2,25.1,117,90.5,117,167c0,98.1-80.2,177.9-178.7,177.9s-178.7-79.8-178.7-177.9c0-76.5,48.8-141.9,117-167V91C159.2,118.5,83.1,213.5,83.1,326.5c0,134.6,107.9,243.7,241.1,243.7s241.1-109.1,241.1-243.7C565.3,213.5,489.2,118.5,386,91z';
|
|
15
|
+
const CAP_PATH = 'M324.2,148.6c12.4,0,24.5,1.3,36.3,3.7V85.6c-11.8-1.8-23.9-2.7-36.3-2.7s-24.4,0.9-36.3,2.7v66.7C299.7,149.9,311.8,148.6,324.2,148.6z';
|
|
16
|
+
const STEM_PATH = 'M324.2,175.3c-12.5,0-24.6,1.5-36.2,4.4v291c11.6,2.9,23.8,4.4,36.2,4.4c12.5,0,24.6-1.5,36.3-4.4v-291C348.9,176.9,336.7,175.3,324.2,175.3z';
|
|
17
|
+
const RING_MASK = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 648.5 652.8'%3E%3Cpath d='${RING_PATH}'/%3E%3C/svg%3E") center / 100% 100% no-repeat`;
|
|
18
|
+
/** Devices on the orbit: angle in degrees, radius of the dot, delay of its packet in seconds */
|
|
19
|
+
const NODES = [
|
|
20
|
+
[14, 10, 0],
|
|
21
|
+
[66, 7, 1.9],
|
|
22
|
+
[117, 12, 0.7],
|
|
23
|
+
[163, 8, 3.1],
|
|
24
|
+
[208, 10, 1.3],
|
|
25
|
+
[259, 7, 2.5],
|
|
26
|
+
[312, 9, 3.7],
|
|
27
|
+
];
|
|
28
|
+
/** Duration of the closing animation in ms (reduced motion: crossfade) */
|
|
29
|
+
const OPEN_DURATION = 1150;
|
|
30
|
+
const OPEN_DURATION_REDUCED = 350;
|
|
8
31
|
const loaderStyles = `
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
.logo-background-dark, .logo-background-blue {
|
|
20
|
-
background: black;
|
|
21
|
-
}
|
|
22
|
-
.logo-div {
|
|
23
|
-
position: absolute;
|
|
24
|
-
top: 50%;
|
|
25
|
-
left: 50%;
|
|
26
|
-
-ms-transform: translateX(-50%) translateY(-50%);
|
|
27
|
-
-webkit-transform: translate(-50%,-50%);
|
|
28
|
-
transform: translate(-50%,-50%);
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
border-radius: 50%;
|
|
31
|
-
z-index: 2;
|
|
32
|
-
}
|
|
33
|
-
.logo-border {
|
|
34
|
-
/*border-color: #164477;*/
|
|
35
|
-
border-top-color: #3399CC;
|
|
36
|
-
border-left-color: #164477;
|
|
37
|
-
border-bottom-color: #164477;
|
|
38
|
-
border-right-color: #164477;
|
|
39
|
-
border-radius: 50%;
|
|
40
|
-
border-style: solid;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 100%;
|
|
44
|
-
position: absolute;
|
|
45
|
-
}
|
|
46
|
-
.logo-top {
|
|
47
|
-
position: absolute;
|
|
48
|
-
width: 4.5%;
|
|
49
|
-
height: 16%;
|
|
50
|
-
top: 0;
|
|
51
|
-
z-index: 2;
|
|
52
|
-
}
|
|
53
|
-
.logo-i {
|
|
54
|
-
position: absolute;
|
|
55
|
-
width: 14.5%;
|
|
56
|
-
height: 60%;
|
|
57
|
-
top: 20%;
|
|
58
|
-
left: 42%;
|
|
59
|
-
background: #3399CC;
|
|
60
|
-
}
|
|
61
|
-
.logo-i-top {
|
|
62
|
-
position: absolute;
|
|
63
|
-
width: 14.5%;
|
|
64
|
-
height: 4%;
|
|
65
|
-
left: 42%;
|
|
66
|
-
background: #3399CC;
|
|
67
|
-
border-radius: 100%;
|
|
68
|
-
}
|
|
69
|
-
.logo-back {
|
|
70
|
-
width: 100%;
|
|
71
|
-
height: 100%;
|
|
72
|
-
z-index: 0;
|
|
73
|
-
overflow: hidden;
|
|
74
|
-
}
|
|
75
|
-
@keyframes logo-grow {
|
|
76
|
-
0% {
|
|
77
|
-
width: 230px;
|
|
78
|
-
height: 230px;
|
|
79
|
-
transform: translate(-50%,-50%) scale(1);
|
|
80
|
-
opacity: 1
|
|
81
|
-
}
|
|
82
|
-
99% {
|
|
83
|
-
width: 230px;
|
|
84
|
-
height: 230px;
|
|
85
|
-
transform: translate(-50%,-50%) scale(10);
|
|
86
|
-
opacity: 0;
|
|
87
|
-
}
|
|
88
|
-
100% {
|
|
89
|
-
width: 0;
|
|
90
|
-
height: 0;
|
|
91
|
-
opacity: 0;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
@keyframes logo-spin { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
|
|
95
|
-
@keyframes logo-color-inside-light {
|
|
96
|
-
0% {
|
|
97
|
-
background: #FEFEFE;
|
|
98
|
-
}
|
|
99
|
-
100% {
|
|
100
|
-
background: #3399CC;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
@keyframes logo-color-inside-dark {
|
|
104
|
-
0% {
|
|
105
|
-
background: #030303;
|
|
106
|
-
}
|
|
107
|
-
100% {
|
|
108
|
-
background: #3399CC;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
@keyframes logo-color-inside-colored {
|
|
112
|
-
0% {
|
|
113
|
-
background: #FEFEFE;
|
|
114
|
-
}
|
|
115
|
-
100% {
|
|
116
|
-
background: #3399CC;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
@keyframes logo-color-inside-blue {
|
|
120
|
-
0% {
|
|
121
|
-
background: #030303;
|
|
122
|
-
}
|
|
123
|
-
100% {
|
|
124
|
-
background: #3399CC;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
32
|
+
@property --iob-ld-hole { syntax: '<length>'; inherits: false; initial-value: 0px; }
|
|
33
|
+
.iob-ld {
|
|
34
|
+
--iob-ld-mark: min(210px, 30vmin);
|
|
35
|
+
position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden;
|
|
36
|
+
background-color: var(--iob-ld-bg); background-size: cover; background-position: center;
|
|
37
|
+
}
|
|
38
|
+
.iob-ld-dark { --iob-ld-bg: #080B1C; --iob-ld-orbit: rgba(126, 195, 243, 0.16); --iob-ld-node: #1D90CA; --iob-ld-packet: #7EC3F3; --iob-ld-label: #1D90CA; --iob-ld-flash: #E8F6FF; }
|
|
39
|
+
.iob-ld-blue { --iob-ld-bg: #031D38; --iob-ld-orbit: rgba(126, 195, 243, 0.22); --iob-ld-node: #7EC3F3; --iob-ld-packet: #E8F6FF; --iob-ld-label: #7EC3F3; --iob-ld-flash: #E8F6FF; }
|
|
40
|
+
.iob-ld-light { --iob-ld-bg: #FFFFFF; --iob-ld-orbit: rgba(0, 88, 148, 0.14); --iob-ld-node: #1D90CA; --iob-ld-packet: #1D90CA; --iob-ld-label: #005894; --iob-ld-flash: #FFFFFF; }
|
|
41
|
+
.iob-ld-colored { --iob-ld-bg: #E6EEF7; --iob-ld-orbit: rgba(0, 88, 148, 0.16); --iob-ld-node: #005894; --iob-ld-packet: #1D90CA; --iob-ld-label: #005894; --iob-ld-flash: #FFFFFF; }
|
|
127
42
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
@keyframes logo-color-outside-dark {
|
|
140
|
-
0% {
|
|
141
|
-
border-color: #040404;
|
|
142
|
-
}
|
|
143
|
-
100% {
|
|
144
|
-
border-top-color: #3399CC;
|
|
145
|
-
border-left-color: #164477;
|
|
146
|
-
border-bottom-color: #164477;
|
|
147
|
-
border-right-color: #164477;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
@keyframes logo-color-outside-colored {
|
|
151
|
-
0% {
|
|
152
|
-
border-color: #FEFEFE;
|
|
153
|
-
}
|
|
154
|
-
100% {
|
|
155
|
-
border-top-color: #3399CC;
|
|
156
|
-
border-left-color: #164477;
|
|
157
|
-
border-bottom-color: #164477;
|
|
158
|
-
border-right-color: #164477;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
@keyframes logo-color-outside-blue {
|
|
162
|
-
0% {
|
|
163
|
-
border-color: #040404;
|
|
164
|
-
}
|
|
165
|
-
100% {
|
|
166
|
-
border-top-color: #3399CC;
|
|
167
|
-
border-left-color: #164477;
|
|
168
|
-
border-bottom-color: #164477;
|
|
169
|
-
border-right-color: #164477;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
43
|
+
.iob-ld-orbit {
|
|
44
|
+
position: absolute; left: 50%; top: 50%; width: calc(var(--iob-ld-mark) * 1.8505); height: calc(var(--iob-ld-mark) * 1.8505);
|
|
45
|
+
transform: translate(-50%, -50%); overflow: visible; opacity: 0;
|
|
46
|
+
animation: iob-ld-fade-in 0.9s 0.95s forwards;
|
|
47
|
+
}
|
|
48
|
+
.iob-ld-orbit-line { fill: none; stroke: var(--iob-ld-orbit); stroke-width: 2; stroke-dasharray: 2 12; }
|
|
49
|
+
.iob-ld-gather, .iob-ld-nodes { transform-box: view-box; transform-origin: 0 0; }
|
|
50
|
+
.iob-ld-nodes { animation: iob-ld-spin 90s linear infinite; }
|
|
51
|
+
.iob-ld-dot { fill: var(--iob-ld-node); transform-box: fill-box; transform-origin: center; animation: iob-ld-send 4.2s ease-out infinite; }
|
|
52
|
+
.iob-ld-packet { fill: var(--iob-ld-packet); opacity: 0; animation: iob-ld-travel 4.2s infinite; }
|
|
53
|
+
.iob-ld-splash { fill: none; stroke: var(--iob-ld-packet); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; animation: iob-ld-splash 4.2s infinite; }
|
|
172
54
|
|
|
173
|
-
.
|
|
174
|
-
|
|
175
|
-
}
|
|
55
|
+
.iob-ld-mark { position: absolute; left: 50%; top: 50%; width: var(--iob-ld-mark); aspect-ratio: 648.5 / 652.8; transform: translate(-50%, -50%); }
|
|
56
|
+
.iob-ld-mark svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; }
|
|
57
|
+
.iob-ld-draw { fill: none; stroke: #FFFFFF; stroke-width: 90; stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: iob-ld-draw 0.62s cubic-bezier(0.6, 0, 0.2, 1) 0.3s forwards; }
|
|
58
|
+
.iob-ld-cap { transform-box: fill-box; transform-origin: center; animation: iob-ld-pop 0.42s cubic-bezier(0.3, 1.7, 0.5, 1) both; }
|
|
59
|
+
.iob-ld-stem { transform-box: fill-box; transform-origin: 50% 100%; animation: iob-ld-grow 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) 0.8s both; }
|
|
60
|
+
.iob-ld-flash { fill: var(--iob-ld-flash); opacity: 0; }
|
|
61
|
+
.iob-ld-current { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; animation: iob-ld-fade-in 0.5s 1.15s forwards; -webkit-mask: ${RING_MASK}; mask: ${RING_MASK}; }
|
|
62
|
+
.iob-ld-current > div {
|
|
63
|
+
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
|
|
64
|
+
background: conic-gradient(from 0deg, transparent 0turn 0.68turn, rgba(126, 195, 243, 0.55) 0.95turn, rgba(232, 246, 255, 0.95) 1turn);
|
|
65
|
+
animation: iob-ld-spin 1.9s linear infinite;
|
|
66
|
+
}
|
|
67
|
+
.iob-ld-status {
|
|
68
|
+
position: absolute; left: 0; right: 0; top: calc(50% + var(--iob-ld-mark) * 0.86);
|
|
69
|
+
text-align: center; padding: 0 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
70
|
+
font: 500 13px/1.5 Roboto, Arial, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--iob-ld-label);
|
|
71
|
+
opacity: 0; animation: iob-ld-fade-in 0.5s 1s forwards;
|
|
72
|
+
}
|
|
73
|
+
.iob-ld-status::before { content: '// '; }
|
|
176
74
|
|
|
177
|
-
.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
.
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
.logo-animate-grow-blue {
|
|
187
|
-
background: #1d1d1d;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.logo-animate-grow {
|
|
191
|
-
display: inline-block;
|
|
192
|
-
text-align: center;
|
|
193
|
-
z-index: 1;
|
|
194
|
-
top: 50%;
|
|
195
|
-
left: 50%;
|
|
196
|
-
-ms-transform: translateX(-50%) translateY(-50%);
|
|
197
|
-
-webkit-transform: translate(-50%,-50%);
|
|
198
|
-
transform: translate(-50%,-50%);
|
|
199
|
-
width: 245px;
|
|
200
|
-
height: 245px;
|
|
201
|
-
border-radius: 50%;
|
|
202
|
-
position: absolute;
|
|
203
|
-
animation: logo-grow 1s 1 ease forwards;
|
|
204
|
-
}
|
|
75
|
+
.iob-ld-done {
|
|
76
|
+
-webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--iob-ld-hole), #000 calc(var(--iob-ld-hole) + 1px));
|
|
77
|
+
mask-image: radial-gradient(circle at 50% 50%, transparent var(--iob-ld-hole), #000 calc(var(--iob-ld-hole) + 1px));
|
|
78
|
+
animation: iob-ld-open 0.75s 0.3s cubic-bezier(0.6, 0, 0.4, 1) forwards;
|
|
79
|
+
}
|
|
80
|
+
.iob-ld-done .iob-ld-gather { animation: iob-ld-gather 0.45s cubic-bezier(0.5, 0, 0.9, 0.4) forwards; }
|
|
81
|
+
.iob-ld-done .iob-ld-flash { animation: iob-ld-flash 0.5s 0.12s ease-out; }
|
|
82
|
+
.iob-ld-done .iob-ld-mark { animation: iob-ld-mark-out 0.6s 0.35s cubic-bezier(0.5, 0, 0.75, 0) forwards; }
|
|
83
|
+
.iob-ld-done .iob-ld-status { animation: none; opacity: 0; transition: opacity 0.2s; }
|
|
205
84
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
85
|
+
@keyframes iob-ld-fade-in { to { opacity: 1; } }
|
|
86
|
+
@keyframes iob-ld-fade-out { to { opacity: 0; } }
|
|
87
|
+
@keyframes iob-ld-spin { to { transform: rotate(360deg); } }
|
|
88
|
+
@keyframes iob-ld-draw { to { stroke-dashoffset: 0; } }
|
|
89
|
+
@keyframes iob-ld-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
|
|
90
|
+
@keyframes iob-ld-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
|
|
91
|
+
@keyframes iob-ld-send { 0% { transform: scale(1.5); } 12%, 100% { transform: scale(1); } }
|
|
92
|
+
@keyframes iob-ld-travel {
|
|
93
|
+
0% { transform: translateY(0); opacity: 0; animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }
|
|
94
|
+
6% { opacity: 1; }
|
|
95
|
+
36% { transform: translateY(176px); opacity: 1; }
|
|
96
|
+
38%, 100% { transform: translateY(176px); opacity: 0; }
|
|
97
|
+
}
|
|
98
|
+
@keyframes iob-ld-splash {
|
|
99
|
+
0%, 35% { transform: scale(0.2); opacity: 0; }
|
|
100
|
+
38% { transform: scale(0.5); opacity: 0.9; }
|
|
101
|
+
58%, 100% { transform: scale(2); opacity: 0; }
|
|
102
|
+
}
|
|
103
|
+
@keyframes iob-ld-gather { to { transform: scale(0.5); opacity: 0; } }
|
|
104
|
+
@keyframes iob-ld-flash { 0% { opacity: 0; } 35% { opacity: 0.85; } 100% { opacity: 0; } }
|
|
105
|
+
@keyframes iob-ld-mark-out { to { transform: translate(-50%, -50%) scale(1.4); opacity: 0; } }
|
|
106
|
+
@keyframes iob-ld-open { to { --iob-ld-hole: 120vmax; } }
|
|
218
107
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
.
|
|
223
|
-
animation:
|
|
224
|
-
}
|
|
225
|
-
.
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
.logo-animate-color-outside-blue {
|
|
229
|
-
animation: logo-color-outside-blue 1.5s;
|
|
108
|
+
@media (prefers-reduced-motion: reduce) {
|
|
109
|
+
.iob-ld-orbit, .iob-ld-current { display: none; }
|
|
110
|
+
.iob-ld-draw { animation: none; stroke-dashoffset: 0; }
|
|
111
|
+
.iob-ld-cap, .iob-ld-stem { animation: none; }
|
|
112
|
+
.iob-ld-mark { opacity: 0; animation: iob-ld-fade-in 0.3s forwards; }
|
|
113
|
+
.iob-ld-status { animation: iob-ld-fade-in 0.3s forwards; }
|
|
114
|
+
.iob-ld-done { -webkit-mask-image: none; mask-image: none; animation: iob-ld-fade-out 0.3s forwards; }
|
|
115
|
+
.iob-ld-done .iob-ld-mark { animation: none; opacity: 1; }
|
|
230
116
|
}
|
|
231
117
|
`;
|
|
118
|
+
let maskCounter = 0;
|
|
232
119
|
export function LoaderCommunity(props) {
|
|
120
|
+
// Every instance needs its own mask id, there may be more than one loader on a page
|
|
121
|
+
const [maskId] = useState(() => `iob-ld-draw-${++maskCounter}`);
|
|
233
122
|
useEffect(() => {
|
|
234
|
-
if (!window.document.getElementById('loader-iobroker-
|
|
123
|
+
if (!window.document.getElementById('loader-iobroker-community')) {
|
|
235
124
|
const style = window.document.createElement('style');
|
|
236
|
-
style.setAttribute('id', 'loader-iobroker-
|
|
125
|
+
style.setAttribute('id', 'loader-iobroker-community');
|
|
237
126
|
style.innerHTML = loaderStyles;
|
|
238
127
|
window.document.head.appendChild(style);
|
|
239
128
|
}
|
|
240
129
|
}, []);
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
130
|
+
// Kept in a ref, so a new callback on every render of the parent does not restart the timer
|
|
131
|
+
const onFinished = useRef(props.onFinished);
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
onFinished.current = props.onFinished;
|
|
134
|
+
}, [props.onFinished]);
|
|
135
|
+
const { done } = props;
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (!done) {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
const reduced = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
|
|
141
|
+
const timer = setTimeout(() => onFinished.current?.(), reduced ? OPEN_DURATION_REDUCED : OPEN_DURATION);
|
|
142
|
+
return () => clearTimeout(timer);
|
|
143
|
+
}, [done]);
|
|
144
|
+
// "blue" and "colored" have own looks; "modernDark" is dark; other names (PT, DX...) follow themeType
|
|
145
|
+
const themeName = props.themeName || props.theme;
|
|
146
|
+
let theme;
|
|
147
|
+
if (themeName === 'blue' || themeName === 'colored') {
|
|
148
|
+
theme = themeName;
|
|
149
|
+
}
|
|
150
|
+
else if (themeName === 'dark' || themeName === 'modernDark') {
|
|
151
|
+
theme = 'dark';
|
|
152
|
+
}
|
|
153
|
+
else if (themeName === 'light' || themeName === 'modernLight') {
|
|
154
|
+
theme = 'light';
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
theme = props.themeType === 'dark' ? 'dark' : 'light';
|
|
158
|
+
}
|
|
159
|
+
const backgroundImage = props.backgroundImage && props.backgroundImage !== '@@loginBackgroundImage@@'
|
|
160
|
+
? props.backgroundImage
|
|
161
|
+
: window.loadingBackgroundImage && window.loadingBackgroundImage !== '@@loginBackgroundImage@@'
|
|
162
|
+
? `url(${window.loadingBackgroundImage})`
|
|
163
|
+
: undefined;
|
|
164
|
+
const backgroundColor = props.backgroundColor && props.backgroundColor !== '@@loginBackgroundColor@@'
|
|
165
|
+
? props.backgroundColor
|
|
166
|
+
: window.loadingBackgroundColor && window.loadingBackgroundColor !== '@@loginBackgroundColor@@'
|
|
167
|
+
? window.loadingBackgroundColor
|
|
168
|
+
: undefined;
|
|
169
|
+
const style = { backgroundImage, backgroundColor };
|
|
170
|
+
if (props.size) {
|
|
171
|
+
style['--iob-ld-mark'] = `min(${props.size}px, 30vmin)`;
|
|
172
|
+
}
|
|
173
|
+
return (React.createElement("div", { className: `iob-ld iob-ld-${theme}${done ? ' iob-ld-done' : ''}`, style: style, "aria-busy": !done },
|
|
174
|
+
React.createElement("svg", { className: "iob-ld-orbit", viewBox: "-600 -600 1200 1200", "aria-hidden": "true" },
|
|
175
|
+
React.createElement("circle", { className: "iob-ld-orbit-line", r: "430" }),
|
|
176
|
+
React.createElement("g", { className: "iob-ld-gather" },
|
|
177
|
+
React.createElement("g", { className: "iob-ld-nodes" }, NODES.map(([angle, radius, delay]) => {
|
|
178
|
+
const animationDelay = `${delay}s`;
|
|
179
|
+
return (React.createElement("g", { key: angle, transform: `rotate(${angle})` },
|
|
180
|
+
React.createElement("circle", { className: "iob-ld-splash", cy: "-252", r: "16", style: { animationDelay } }),
|
|
181
|
+
React.createElement("circle", { className: "iob-ld-packet", cy: "-430", r: "7", style: { animationDelay } }),
|
|
182
|
+
React.createElement("circle", { className: "iob-ld-dot", cy: "-430", r: radius, style: { animationDelay } })));
|
|
183
|
+
})))),
|
|
184
|
+
window.loadingHideLogo === 'true' ? null : (React.createElement("div", { className: "iob-ld-mark", "aria-hidden": "true" },
|
|
185
|
+
React.createElement("svg", { viewBox: "0 0 648.5 652.8" },
|
|
186
|
+
React.createElement("defs", null,
|
|
187
|
+
React.createElement("mask", { id: maskId, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "648.5", height: "652.8" },
|
|
188
|
+
React.createElement("path", { className: "iob-ld-draw", pathLength: 1, d: "M324.2,116.5A210,210 0 0 1 324.2,536.5" }),
|
|
189
|
+
React.createElement("path", { className: "iob-ld-draw", pathLength: 1, d: "M324.2,116.5A210,210 0 0 0 324.2,536.5" }))),
|
|
190
|
+
React.createElement("path", { mask: `url(#${maskId})`, fill: "#164477", d: RING_PATH }),
|
|
191
|
+
React.createElement("path", { className: "iob-ld-cap", fill: "#3399CC", d: CAP_PATH }),
|
|
192
|
+
React.createElement("path", { className: "iob-ld-stem", fill: "#3399CC", d: STEM_PATH }),
|
|
193
|
+
React.createElement("path", { className: "iob-ld-flash", d: RING_PATH })),
|
|
194
|
+
React.createElement("div", { className: "iob-ld-current" },
|
|
195
|
+
React.createElement("div", null)))),
|
|
196
|
+
props.status ? (React.createElement("div", { className: "iob-ld-status", role: "status" }, props.status)) : null));
|
|
264
197
|
}
|
|
265
198
|
//# sourceMappingURL=Community.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Community.js","sourceRoot":"./src/","sources":["Components/Loaders/Community.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWzC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+NpB,CAAC;AAiBF,MAAM,UAAU,eAAe,CAAC,KAAkB;IAC9C,SAAS,CAAC,GAAG,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M,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxC;QACI,6BACI,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;YAEpC,6BACI,SAAS,EAAE,4BAA4B,KAAK,EAAE,EAC9C,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GACxB;YACF,6BACI,SAAS,EAAE,4BAA4B,KAAK,EAAE,EAC9C,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GACxB;YACF,6BACI,SAAS,EAAE,+BAA+B,KAAK,oBAAoB,EACnE,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,GAAG,KAAK,EAAE,GACtC;YACF,6BAAK,SAAS,EAAE,oCAAoC,KAAK,EAAE,GAAI;YAC/D,6BACI,SAAS,EAAE,wCAAwC,KAAK,EAAE,EAC1D,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,GACvB;YACF,6BACI,SAAS,EAAE,wCAAwC,KAAK,EAAE,EAC1D,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAC1B,CACA;QACN,6BACI,SAAS,EAAE,uCAAuC,KAAK,EAAE,EACzD,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,GAChD,CACH,CACN,CACC,CACT,CAAC;AACN,CAAC","sourcesContent":["/**\n * Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\n *\n */\nimport React, { useEffect } from 'react';\nimport type { ThemeName, ThemeType } from '../../types';\n\ndeclare global {\n interface Window {\n loadingBackgroundImage: undefined | string;\n loadingBackgroundColor: undefined | string;\n loadingHideLogo: undefined | 'true';\n }\n}\n\nconst loaderStyles = `\n/**\n * Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n.logo-div {\n position: absolute;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n overflow: hidden;\n border-radius: 50%;\n z-index: 2;\n}\n.logo-border {\n /*border-color: #164477;*/\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n border-radius: 50%;\n border-style: solid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n position: absolute;\n}\n.logo-top {\n position: absolute;\n width: 4.5%;\n height: 16%;\n top: 0;\n z-index: 2;\n}\n.logo-i {\n position: absolute;\n width: 14.5%;\n height: 60%;\n top: 20%;\n left: 42%;\n background: #3399CC;\n}\n.logo-i-top {\n position: absolute;\n width: 14.5%;\n height: 4%;\n left: 42%;\n background: #3399CC;\n border-radius: 100%;\n}\n.logo-back {\n width: 100%;\n height: 100%;\n z-index: 0;\n overflow: hidden;\n}\n@keyframes logo-grow {\n 0% {\n width: 230px;\n height: 230px;\n transform: translate(-50%,-50%) scale(1);\n opacity: 1\n }\n 99% {\n width: 230px;\n height: 230px;\n transform: translate(-50%,-50%) scale(10);\n opacity: 0;\n }\n 100% {\n width: 0;\n height: 0;\n opacity: 0;\n }\n}\n@keyframes logo-spin { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }\n@keyframes logo-color-inside-light {\n 0% {\n background: #FEFEFE;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-dark {\n 0% {\n background: #030303;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-colored {\n 0% {\n background: #FEFEFE;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-blue {\n 0% {\n background: #030303;\n }\n 100% {\n background: #3399CC;\n }\n}\n\n@keyframes logo-color-outside-light {\n 0% {\n border-color: #FEFEFE;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-dark {\n 0% {\n border-color: #040404;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-colored {\n 0% {\n border-color: #FEFEFE;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-blue {\n 0% {\n border-color: #040404;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n\n.logo-animate-wait {\n animation: logo-color-outside 1.5s, logo-spin 1.5s linear infinite;\n}\n\n.logo-animate-grow-light {\n background: #DDD;\n}\n.logo-animate-grow-dark {\n background: #1d1d1d;\n}\n.logo-animate-grow-colored {\n background: #DDD;\n}\n.logo-animate-grow-blue {\n background: #1d1d1d;\n}\n\n.logo-animate-grow {\n display: inline-block;\n text-align: center;\n z-index: 1;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n width: 245px;\n height: 245px;\n border-radius: 50%;\n position: absolute;\n animation: logo-grow 1s 1 ease forwards;\n}\n\n.logo-animate-color-inside-light {\n animation: logo-color-inside-light 2.5s;\n}\n.logo-animate-color-inside-dark {\n animation: logo-color-inside-dark 2.5s;\n}\n.logo-animate-color-inside-colored {\n animation: logo-color-inside-colored 2.5s;\n}\n.logo-animate-color-inside-blue {\n animation: logo-color-inside-blue 2.5s;\n}\n\n.logo-animate-color-outside-light {\n animation: logo-color-outside-light 1.5s;\n}\n.logo-animate-color-outside-dark {\n animation: logo-color-outside-dark 1.5s;\n}\n.logo-animate-color-outside-colored {\n animation: logo-color-outside-colored 1.5s;\n}\n.logo-animate-color-outside-blue {\n animation: logo-color-outside-blue 1.5s;\n}\n`;\n\ninterface LoaderProps {\n /** The size in pixels of this loader. */\n size?: number;\n /** The chosen theme type. */\n themeType?: ThemeType;\n /** Theme name */\n themeName?: ThemeName;\n /** @deprecated Theme name. use themeName instead */\n theme?: ThemeName;\n /** Background color */\n backgroundColor?: string;\n /** Background image URL */\n backgroundImage?: string;\n}\n\nexport function LoaderCommunity(props: LoaderProps): React.JSX.Element {\n useEffect(() => {\n if (!window.document.getElementById('loader-iobroker-component')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'loader-iobroker-component');\n style.innerHTML = loaderStyles;\n window.document.head.appendChild(style);\n }\n }, []);\n\n const size = props.size || 234;\n const theme = props.themeName || props.theme || props.themeType || 'light';\n return (\n <div\n className={`logo-back logo-background-${theme}`}\n style={{\n backgroundImage:\n props.backgroundImage && props.backgroundImage !== '@@loginBackgroundImage@@'\n ? props.backgroundImage\n : window.loadingBackgroundImage && window.loadingBackgroundImage !== '@@loginBackgroundImage@@'\n ? `url(${window.loadingBackgroundImage})`\n : undefined,\n backgroundColor:\n props.backgroundColor && props.backgroundColor !== '@@loginBackgroundColor@@'\n ? props.backgroundColor\n : window.loadingBackgroundColor && window.loadingBackgroundColor !== '@@loginBackgroundColor@@'\n ? window.loadingBackgroundColor\n : undefined,\n backgroundSize: 'cover',\n }}\n >\n {window.loadingHideLogo === 'true' ? null : (\n <>\n <div\n className=\"logo-div\"\n style={{ width: size, height: size }}\n >\n <div\n className={`logo-top logo-background-${theme}`}\n style={{ left: '37%' }}\n />\n <div\n className={`logo-top logo-background-${theme}`}\n style={{ left: '57%' }}\n />\n <div\n className={`logo-border logo-background-${theme} logo-animate-wait`}\n style={{ borderWidth: size * 0.132 }}\n />\n <div className={`logo-i logo-animate-color-inside-${theme}`} />\n <div\n className={`logo-i-top logo-animate-color-inside-${theme}`}\n style={{ top: '18%' }}\n />\n <div\n className={`logo-i-top logo-animate-color-inside-${theme}`}\n style={{ bottom: '18%' }}\n />\n </div>\n <div\n className={`logo-animate-grow logo-animate-grow-${theme}`}\n style={{ width: size + 11, height: size + 11 }}\n />\n </>\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Community.js","sourceRoot":"./src/","sources":["Components/Loaders/Community.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAW3D,yFAAyF;AACzF,MAAM,SAAS,GACX,sPAAsP,CAAC;AAC3P,MAAM,QAAQ,GACV,qIAAqI,CAAC;AAC1I,MAAM,SAAS,GACX,0IAA0I,CAAC;AAC/I,MAAM,SAAS,GAAG,4GAA4G,SAAS,gDAAgD,CAAC;AAExL,gGAAgG;AAChG,MAAM,KAAK,GAA+B;IACtC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACX,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC;IACZ,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC;IACd,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC;IACb,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC;IACd,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC;IACb,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF,0EAA0E;AAC1E,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6JA8BwI,SAAS,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDzL,CAAC;AAuBF,IAAI,WAAW,GAAG,CAAC,CAAC;AAEpB,MAAM,UAAU,eAAe,CAAC,KAAkB;IAC9C,oFAAoF;IACpF,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CA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AgB,EAC1B,CAAC,EAAC,GAAG,EACL,CAAC,EAAC,GAAG,EACL,KAAK,EAAC,OAAO,EACb,MAAM,EAAC,OAAO;wBAEd,8BACI,SAAS,EAAC,aAAa,EACvB,UAAU,EAAE,CAAC,EACb,CAAC,EAAC,wCAAwC,GAC5C;wBACF,8BACI,SAAS,EAAC,aAAa,EACvB,UAAU,EAAE,CAAC,EACb,CAAC,EAAC,wCAAwC,GAC5C,CACC,CACJ;gBACP,8BACI,IAAI,EAAE,QAAQ,MAAM,GAAG,EACvB,IAAI,EAAC,SAAS,EACd,CAAC,EAAE,SAAS,GACd;gBACF,8BACI,SAAS,EAAC,YAAY,EACtB,IAAI,EAAC,SAAS,EACd,CAAC,EAAE,QAAQ,GACb;gBACF,8BACI,SAAS,EAAC,aAAa,EACvB,IAAI,EAAC,SAAS,EACd,CAAC,EAAE,SAAS,GACd;gBACF,8BACI,SAAS,EAAC,cAAc,EACxB,CAAC,EAAE,SAAS,GACd,CACA;YACN,6BAAK,SAAS,EAAC,gBAAgB;gBAC3B,gCAAO,CACL,CACJ,CACT;QACA,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CACZ,6BACI,SAAS,EAAC,eAAe,EACzB,IAAI,EAAC,QAAQ,IAEZ,KAAK,CAAC,MAAM,CACX,CACT,CAAC,CAAC,CAAC,IAAI,CACN,CACT,CAAC;AACN,CAAC","sourcesContent":["/**\n * Copyright 2018-2026 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\n *\n * Loader of the community edition: the ioBroker mark is a power button, so the loader switches ioBroker on.\n * 1. Switch on: the top of the \"i\" lights up, the ring draws itself from there to both sides, the stem grows.\n * 2. Wait: light runs through the ring, devices on an orbit send data packets into it.\n * 3. Open (only with `done`): the devices gather in the ring, the ring flashes and a circle opens from the centre.\n * Only SVG and CSS, no JavaScript timer. The previous loader is `LoaderCommunityLegacy`.\n */\nimport React, { useEffect, useRef, useState } from 'react';\nimport type { ThemeName, ThemeType } from '../../types';\n\ndeclare global {\n interface Window {\n loadingBackgroundImage: undefined | string;\n loadingBackgroundColor: undefined | string;\n loadingHideLogo: undefined | 'true';\n }\n}\n\n/** The ring of the mark (img/logo.svg), used as mask for the light running through it */\nconst RING_PATH =\n 'M386,91v68.6c68.2,25.1,117,90.5,117,167c0,98.1-80.2,177.9-178.7,177.9s-178.7-79.8-178.7-177.9c0-76.5,48.8-141.9,117-167V91C159.2,118.5,83.1,213.5,83.1,326.5c0,134.6,107.9,243.7,241.1,243.7s241.1-109.1,241.1-243.7C565.3,213.5,489.2,118.5,386,91z';\nconst CAP_PATH =\n 'M324.2,148.6c12.4,0,24.5,1.3,36.3,3.7V85.6c-11.8-1.8-23.9-2.7-36.3-2.7s-24.4,0.9-36.3,2.7v66.7C299.7,149.9,311.8,148.6,324.2,148.6z';\nconst STEM_PATH =\n 'M324.2,175.3c-12.5,0-24.6,1.5-36.2,4.4v291c11.6,2.9,23.8,4.4,36.2,4.4c12.5,0,24.6-1.5,36.3-4.4v-291C348.9,176.9,336.7,175.3,324.2,175.3z';\nconst RING_MASK = `url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 648.5 652.8'%3E%3Cpath d='${RING_PATH}'/%3E%3C/svg%3E\") center / 100% 100% no-repeat`;\n\n/** Devices on the orbit: angle in degrees, radius of the dot, delay of its packet in seconds */\nconst NODES: [number, number, number][] = [\n [14, 10, 0],\n [66, 7, 1.9],\n [117, 12, 0.7],\n [163, 8, 3.1],\n [208, 10, 1.3],\n [259, 7, 2.5],\n [312, 9, 3.7],\n];\n\n/** Duration of the closing animation in ms (reduced motion: crossfade) */\nconst OPEN_DURATION = 1150;\nconst OPEN_DURATION_REDUCED = 350;\n\nconst loaderStyles = `\n@property --iob-ld-hole { syntax: '<length>'; inherits: false; initial-value: 0px; }\n.iob-ld {\n --iob-ld-mark: min(210px, 30vmin);\n position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden;\n background-color: var(--iob-ld-bg); background-size: cover; background-position: center;\n}\n.iob-ld-dark { --iob-ld-bg: #080B1C; --iob-ld-orbit: rgba(126, 195, 243, 0.16); --iob-ld-node: #1D90CA; --iob-ld-packet: #7EC3F3; --iob-ld-label: #1D90CA; --iob-ld-flash: #E8F6FF; }\n.iob-ld-blue { --iob-ld-bg: #031D38; --iob-ld-orbit: rgba(126, 195, 243, 0.22); --iob-ld-node: #7EC3F3; --iob-ld-packet: #E8F6FF; --iob-ld-label: #7EC3F3; --iob-ld-flash: #E8F6FF; }\n.iob-ld-light { --iob-ld-bg: #FFFFFF; --iob-ld-orbit: rgba(0, 88, 148, 0.14); --iob-ld-node: #1D90CA; --iob-ld-packet: #1D90CA; --iob-ld-label: #005894; --iob-ld-flash: #FFFFFF; }\n.iob-ld-colored { --iob-ld-bg: #E6EEF7; --iob-ld-orbit: rgba(0, 88, 148, 0.16); --iob-ld-node: #005894; --iob-ld-packet: #1D90CA; --iob-ld-label: #005894; --iob-ld-flash: #FFFFFF; }\n\n.iob-ld-orbit {\n position: absolute; left: 50%; top: 50%; width: calc(var(--iob-ld-mark) * 1.8505); height: calc(var(--iob-ld-mark) * 1.8505);\n transform: translate(-50%, -50%); overflow: visible; opacity: 0;\n animation: iob-ld-fade-in 0.9s 0.95s forwards;\n}\n.iob-ld-orbit-line { fill: none; stroke: var(--iob-ld-orbit); stroke-width: 2; stroke-dasharray: 2 12; }\n.iob-ld-gather, .iob-ld-nodes { transform-box: view-box; transform-origin: 0 0; }\n.iob-ld-nodes { animation: iob-ld-spin 90s linear infinite; }\n.iob-ld-dot { fill: var(--iob-ld-node); transform-box: fill-box; transform-origin: center; animation: iob-ld-send 4.2s ease-out infinite; }\n.iob-ld-packet { fill: var(--iob-ld-packet); opacity: 0; animation: iob-ld-travel 4.2s infinite; }\n.iob-ld-splash { fill: none; stroke: var(--iob-ld-packet); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; animation: iob-ld-splash 4.2s infinite; }\n\n.iob-ld-mark { position: absolute; left: 50%; top: 50%; width: var(--iob-ld-mark); aspect-ratio: 648.5 / 652.8; transform: translate(-50%, -50%); }\n.iob-ld-mark svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; }\n.iob-ld-draw { fill: none; stroke: #FFFFFF; stroke-width: 90; stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: iob-ld-draw 0.62s cubic-bezier(0.6, 0, 0.2, 1) 0.3s forwards; }\n.iob-ld-cap { transform-box: fill-box; transform-origin: center; animation: iob-ld-pop 0.42s cubic-bezier(0.3, 1.7, 0.5, 1) both; }\n.iob-ld-stem { transform-box: fill-box; transform-origin: 50% 100%; animation: iob-ld-grow 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) 0.8s both; }\n.iob-ld-flash { fill: var(--iob-ld-flash); opacity: 0; }\n.iob-ld-current { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; animation: iob-ld-fade-in 0.5s 1.15s forwards; -webkit-mask: ${RING_MASK}; mask: ${RING_MASK}; }\n.iob-ld-current > div {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n background: conic-gradient(from 0deg, transparent 0turn 0.68turn, rgba(126, 195, 243, 0.55) 0.95turn, rgba(232, 246, 255, 0.95) 1turn);\n animation: iob-ld-spin 1.9s linear infinite;\n}\n.iob-ld-status {\n position: absolute; left: 0; right: 0; top: calc(50% + var(--iob-ld-mark) * 0.86);\n text-align: center; padding: 0 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n font: 500 13px/1.5 Roboto, Arial, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--iob-ld-label);\n opacity: 0; animation: iob-ld-fade-in 0.5s 1s forwards;\n}\n.iob-ld-status::before { content: '// '; }\n\n.iob-ld-done {\n -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--iob-ld-hole), #000 calc(var(--iob-ld-hole) + 1px));\n mask-image: radial-gradient(circle at 50% 50%, transparent var(--iob-ld-hole), #000 calc(var(--iob-ld-hole) + 1px));\n animation: iob-ld-open 0.75s 0.3s cubic-bezier(0.6, 0, 0.4, 1) forwards;\n}\n.iob-ld-done .iob-ld-gather { animation: iob-ld-gather 0.45s cubic-bezier(0.5, 0, 0.9, 0.4) forwards; }\n.iob-ld-done .iob-ld-flash { animation: iob-ld-flash 0.5s 0.12s ease-out; }\n.iob-ld-done .iob-ld-mark { animation: iob-ld-mark-out 0.6s 0.35s cubic-bezier(0.5, 0, 0.75, 0) forwards; }\n.iob-ld-done .iob-ld-status { animation: none; opacity: 0; transition: opacity 0.2s; }\n\n@keyframes iob-ld-fade-in { to { opacity: 1; } }\n@keyframes iob-ld-fade-out { to { opacity: 0; } }\n@keyframes iob-ld-spin { to { transform: rotate(360deg); } }\n@keyframes iob-ld-draw { to { stroke-dashoffset: 0; } }\n@keyframes iob-ld-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }\n@keyframes iob-ld-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }\n@keyframes iob-ld-send { 0% { transform: scale(1.5); } 12%, 100% { transform: scale(1); } }\n@keyframes iob-ld-travel {\n 0% { transform: translateY(0); opacity: 0; animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }\n 6% { opacity: 1; }\n 36% { transform: translateY(176px); opacity: 1; }\n 38%, 100% { transform: translateY(176px); opacity: 0; }\n}\n@keyframes iob-ld-splash {\n 0%, 35% { transform: scale(0.2); opacity: 0; }\n 38% { transform: scale(0.5); opacity: 0.9; }\n 58%, 100% { transform: scale(2); opacity: 0; }\n}\n@keyframes iob-ld-gather { to { transform: scale(0.5); opacity: 0; } }\n@keyframes iob-ld-flash { 0% { opacity: 0; } 35% { opacity: 0.85; } 100% { opacity: 0; } }\n@keyframes iob-ld-mark-out { to { transform: translate(-50%, -50%) scale(1.4); opacity: 0; } }\n@keyframes iob-ld-open { to { --iob-ld-hole: 120vmax; } }\n\n@media (prefers-reduced-motion: reduce) {\n .iob-ld-orbit, .iob-ld-current { display: none; }\n .iob-ld-draw { animation: none; stroke-dashoffset: 0; }\n .iob-ld-cap, .iob-ld-stem { animation: none; }\n .iob-ld-mark { opacity: 0; animation: iob-ld-fade-in 0.3s forwards; }\n .iob-ld-status { animation: iob-ld-fade-in 0.3s forwards; }\n .iob-ld-done { -webkit-mask-image: none; mask-image: none; animation: iob-ld-fade-out 0.3s forwards; }\n .iob-ld-done .iob-ld-mark { animation: none; opacity: 1; }\n}\n`;\n\ninterface LoaderProps {\n /** Width of the mark in pixels (default 210); on small screens it shrinks to 30% of the shorter side. */\n size?: number;\n /** The chosen theme type. */\n themeType?: ThemeType;\n /** Theme name */\n themeName?: ThemeName;\n /** @deprecated Theme name. use themeName instead */\n theme?: ThemeName;\n /** Background color */\n backgroundColor?: string;\n /** Background image URL */\n backgroundImage?: string;\n /** Optional line below the mark, e.g. the current loading step. Shown in capitals with a leading \"//\". */\n status?: string;\n /** Play the closing animation: the loader opens and shows what is rendered below it. */\n done?: boolean;\n /** Called when the closing animation is over, so the loader can be removed. */\n onFinished?: () => void;\n}\n\nlet maskCounter = 0;\n\nexport function LoaderCommunity(props: LoaderProps): React.JSX.Element {\n // Every instance needs its own mask id, there may be more than one loader on a page\n const [maskId] = useState(() => `iob-ld-draw-${++maskCounter}`);\n\n useEffect(() => {\n if (!window.document.getElementById('loader-iobroker-community')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'loader-iobroker-community');\n style.innerHTML = loaderStyles;\n window.document.head.appendChild(style);\n }\n }, []);\n\n // Kept in a ref, so a new callback on every render of the parent does not restart the timer\n const onFinished = useRef(props.onFinished);\n useEffect(() => {\n onFinished.current = props.onFinished;\n }, [props.onFinished]);\n\n const { done } = props;\n useEffect(() => {\n if (!done) {\n return undefined;\n }\n const reduced = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n const timer = setTimeout(() => onFinished.current?.(), reduced ? OPEN_DURATION_REDUCED : OPEN_DURATION);\n return () => clearTimeout(timer);\n }, [done]);\n\n // \"blue\" and \"colored\" have own looks; \"modernDark\" is dark; other names (PT, DX...) follow themeType\n const themeName = props.themeName || props.theme;\n let theme: 'dark' | 'light' | 'blue' | 'colored';\n if (themeName === 'blue' || themeName === 'colored') {\n theme = themeName;\n } else if (themeName === 'dark' || themeName === 'modernDark') {\n theme = 'dark';\n } else if (themeName === 'light' || themeName === 'modernLight') {\n theme = 'light';\n } else {\n theme = props.themeType === 'dark' ? 'dark' : 'light';\n }\n\n const backgroundImage =\n props.backgroundImage && props.backgroundImage !== '@@loginBackgroundImage@@'\n ? props.backgroundImage\n : window.loadingBackgroundImage && window.loadingBackgroundImage !== '@@loginBackgroundImage@@'\n ? `url(${window.loadingBackgroundImage})`\n : undefined;\n const backgroundColor =\n props.backgroundColor && props.backgroundColor !== '@@loginBackgroundColor@@'\n ? props.backgroundColor\n : window.loadingBackgroundColor && window.loadingBackgroundColor !== '@@loginBackgroundColor@@'\n ? window.loadingBackgroundColor\n : undefined;\n\n const style: React.CSSProperties & Record<string, string | undefined> = { backgroundImage, backgroundColor };\n if (props.size) {\n style['--iob-ld-mark'] = `min(${props.size}px, 30vmin)`;\n }\n\n return (\n <div\n className={`iob-ld iob-ld-${theme}${done ? ' iob-ld-done' : ''}`}\n style={style}\n aria-busy={!done}\n >\n <svg\n className=\"iob-ld-orbit\"\n viewBox=\"-600 -600 1200 1200\"\n aria-hidden=\"true\"\n >\n <circle\n className=\"iob-ld-orbit-line\"\n r=\"430\"\n />\n <g className=\"iob-ld-gather\">\n <g className=\"iob-ld-nodes\">\n {NODES.map(([angle, radius, delay]) => {\n const animationDelay = `${delay}s`;\n return (\n <g\n key={angle}\n transform={`rotate(${angle})`}\n >\n <circle\n className=\"iob-ld-splash\"\n cy=\"-252\"\n r=\"16\"\n style={{ animationDelay }}\n />\n <circle\n className=\"iob-ld-packet\"\n cy=\"-430\"\n r=\"7\"\n style={{ animationDelay }}\n />\n <circle\n className=\"iob-ld-dot\"\n cy=\"-430\"\n r={radius}\n style={{ animationDelay }}\n />\n </g>\n );\n })}\n </g>\n </g>\n </svg>\n {window.loadingHideLogo === 'true' ? null : (\n <div\n className=\"iob-ld-mark\"\n aria-hidden=\"true\"\n >\n <svg viewBox=\"0 0 648.5 652.8\">\n <defs>\n <mask\n id={maskId}\n maskUnits=\"userSpaceOnUse\"\n x=\"0\"\n y=\"0\"\n width=\"648.5\"\n height=\"652.8\"\n >\n <path\n className=\"iob-ld-draw\"\n pathLength={1}\n d=\"M324.2,116.5A210,210 0 0 1 324.2,536.5\"\n />\n <path\n className=\"iob-ld-draw\"\n pathLength={1}\n d=\"M324.2,116.5A210,210 0 0 0 324.2,536.5\"\n />\n </mask>\n </defs>\n <path\n mask={`url(#${maskId})`}\n fill=\"#164477\"\n d={RING_PATH}\n />\n <path\n className=\"iob-ld-cap\"\n fill=\"#3399CC\"\n d={CAP_PATH}\n />\n <path\n className=\"iob-ld-stem\"\n fill=\"#3399CC\"\n d={STEM_PATH}\n />\n <path\n className=\"iob-ld-flash\"\n d={RING_PATH}\n />\n </svg>\n <div className=\"iob-ld-current\">\n <div />\n </div>\n </div>\n )}\n {props.status ? (\n <div\n className=\"iob-ld-status\"\n role=\"status\"\n >\n {props.status}\n </div>\n ) : null}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Previous loader of the community edition, replaced by `LoaderCommunity` in 2026-11.
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { ThemeName, ThemeType } from '../../types';
|
|
10
|
+
declare global {
|
|
11
|
+
interface Window {
|
|
12
|
+
loadingBackgroundImage: undefined | string;
|
|
13
|
+
loadingBackgroundColor: undefined | string;
|
|
14
|
+
loadingHideLogo: undefined | 'true';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
interface LoaderProps {
|
|
18
|
+
/** The size in pixels of this loader. */
|
|
19
|
+
size?: number;
|
|
20
|
+
/** The chosen theme type. */
|
|
21
|
+
themeType?: ThemeType;
|
|
22
|
+
/** Theme name */
|
|
23
|
+
themeName?: ThemeName;
|
|
24
|
+
/** @deprecated Theme name. use themeName instead */
|
|
25
|
+
theme?: ThemeName;
|
|
26
|
+
/** Background color */
|
|
27
|
+
backgroundColor?: string;
|
|
28
|
+
/** Background image URL */
|
|
29
|
+
backgroundImage?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function LoaderCommunityLegacy(props: LoaderProps): React.JSX.Element;
|
|
32
|
+
export {};
|