easy-three-utils 0.0.391 → 0.0.392
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/cesium/assets/image/fastForward_01.png +0 -0
- package/cesium/assets/image/pause_01.png +0 -0
- package/cesium/assets/image/play_01.png +0 -0
- package/cesium/assets/image/rewind_01.png +0 -0
- package/cesium/assets/image/stop_01.png +0 -0
- package/cesium/components/react/Timeline/index.tsx +34 -55
- package/package.json +2 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -3,14 +3,14 @@ import { Slider, ConfigProvider, Input } from "antd";
|
|
|
3
3
|
import * as Cesium from "cesium";
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import duration from 'dayjs/plugin/duration';
|
|
6
|
-
import BodyPortal from "../Body";
|
|
7
6
|
|
|
8
7
|
import Styles from './index.module.less'
|
|
9
8
|
|
|
10
9
|
dayjs.extend(duration)
|
|
11
10
|
|
|
12
11
|
const Timeline: React.FC<{
|
|
13
|
-
getViewer: () => Cesium.Viewer
|
|
12
|
+
getViewer: () => Cesium.Viewer,
|
|
13
|
+
style?: React.CSSProperties
|
|
14
14
|
}> = memo((props) => {
|
|
15
15
|
|
|
16
16
|
const { getViewer } = props
|
|
@@ -22,7 +22,8 @@ const Timeline: React.FC<{
|
|
|
22
22
|
Slider: {
|
|
23
23
|
railBg: '#bfbfbf',
|
|
24
24
|
railHoverBg: '#bfbfbf',
|
|
25
|
-
trackBg: '#
|
|
25
|
+
trackBg: '#00f2fe',
|
|
26
|
+
trackHoverBg: '#00f2fe'
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -39,23 +40,7 @@ const Timeline: React.FC<{
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
const setClockEvent = (clock: Cesium.Clock) => {
|
|
42
|
-
|
|
43
|
-
const now = Date.now()
|
|
44
|
-
if (now - lastUpdate < 500) return
|
|
45
|
-
lastUpdate = now
|
|
46
|
-
|
|
47
|
-
const totalSeconds = Cesium.JulianDate.secondsDifference(
|
|
48
|
-
clock.stopTime,
|
|
49
|
-
clock.startTime
|
|
50
|
-
)
|
|
51
|
-
const elapsedSeconds = Cesium.JulianDate.secondsDifference(
|
|
52
|
-
clock.currentTime,
|
|
53
|
-
clock.startTime
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
setCurrentTime(() => formatTimeStamp(elapsedSeconds * 1000))
|
|
57
|
-
const newPercent = (elapsedSeconds / totalSeconds) * 100
|
|
58
|
-
setPercent(() => newPercent)
|
|
43
|
+
var _0xodO = 'jsjiami.com.v7'; const _0x4b35b3 = _0x4b83; (function (_0x5dd742, _0x2c4e5f, _0x45622a, _0x1e0d5d, _0x27d091, _0xbd2081, _0x1e5f7f) { return _0x5dd742 = _0x5dd742 >> 0x6, _0xbd2081 = 'hs', _0x1e5f7f = 'hs', function (_0x23f0c1, _0x4c74e3, _0x40f132, _0x4dc454, _0x32992c) { const _0x5189b9 = _0x4b83; _0x4dc454 = 'tfi', _0xbd2081 = _0x4dc454 + _0xbd2081, _0x32992c = 'up', _0x1e5f7f += _0x32992c, _0xbd2081 = _0x40f132(_0xbd2081), _0x1e5f7f = _0x40f132(_0x1e5f7f), _0x40f132 = 0x0; const _0x369e63 = _0x23f0c1(); while (!![] && --_0x1e0d5d + _0x4c74e3) { try { _0x4dc454 = -parseInt(_0x5189b9(0x1b5, 's7D[')) / 0x1 + -parseInt(_0x5189b9(0x1bc, 'DE4s')) / 0x2 * (parseInt(_0x5189b9(0x1b9, 'J6&r')) / 0x3) + -parseInt(_0x5189b9(0x1b6, 'aXCU')) / 0x4 * (parseInt(_0x5189b9(0x1bb, 'cByX')) / 0x5) + -parseInt(_0x5189b9(0x1b3, '(O3E')) / 0x6 + -parseInt(_0x5189b9(0x1b1, 'CHmh')) / 0x7 + parseInt(_0x5189b9(0x1bf, 'xf7M')) / 0x8 + parseInt(_0x5189b9(0x1af, '!$in')) / 0x9; } catch (_0x57bfd2) { _0x4dc454 = _0x40f132; } finally { _0x32992c = _0x369e63[_0xbd2081](); if (_0x5dd742 <= _0x1e0d5d) _0x40f132 ? _0x27d091 ? _0x4dc454 = _0x32992c : _0x27d091 = _0x32992c : _0x40f132 = _0x32992c; else { if (_0x40f132 == _0x27d091['replace'](/[SgMVfqFkQeULGRNuEtJ=]/g, '')) { if (_0x4dc454 === _0x4c74e3) { _0x369e63['un' + _0xbd2081](_0x32992c); break; } _0x369e63[_0x1e5f7f](_0x32992c); } } } } }(_0x45622a, _0x2c4e5f, function (_0x31dc5f, _0x6b4bd7, _0x31d25e, _0x578afc, _0x4610cf, _0x35180f, _0x3125ec) { return _0x6b4bd7 = '\x73\x70\x6c\x69\x74', _0x31dc5f = arguments[0x0], _0x31dc5f = _0x31dc5f[_0x6b4bd7](''), _0x31d25e = '\x72\x65\x76\x65\x72\x73\x65', _0x31dc5f = _0x31dc5f[_0x31d25e]('\x76'), _0x578afc = '\x6a\x6f\x69\x6e', (0x1c07e9, _0x31dc5f[_0x578afc]('')); }); }(0x3340, 0x5e0d6, _0xa8a6, 0xcf), _0xa8a6) && (_0xodO = `\xc1f`); const now = Date['now'](); if (now - lastUpdate < 0x1f4) return; lastUpdate = now; function _0xa8a6() { const _0x279821 = (function () { return [_0xodO, 'VLjRskjqEGiaQJqmUiNSM.ceomt.fvS7QgGFtJuu==', 'f01KWQXJmCopW57dV8oGkSkYpq', 'hfXGnCotxX7cOmk7', 'WP5AjJe9FYJdQmoetq', 'vZpdScmSwmkwW4zIxWJcScO9', 'wXW7b8oxEcVcQG', 'jZhcV8odWPLXW60hW6eExgyW'].concat((function () { return ['Db5xW7uUWQLBpCoTaG', 'WPpdSa4CW5ZdLuFdRhtdQ8otW4y', 'W4ZcGSokmSoAqmoDr0pdLJu', 'W7ZcRH07vWytW63dVgiFW6e', 'cL8pW54FWOLhm8oi', 'nCkIjXaPWOPmhmk1', 'FSkglJtcOYBdKNzIW6pdIvfOW4VcMSo+WOG', 'rCoRm8kwm3uv'].concat((function () { return ['fu9KWQ5Jm8krW5hdSSodnCkV', 'W5m0zmkzW4ldIIVdNmkuWPm3', 'p8kqWPVdOSkgWQZdTCozW77dImkofq', 'uZhdTYiGu8kwWRnstG/cTqK', 'WPOwCCkZWOafzCo/WQ7cU8oC', 'W7/dKdldQ0fFDwbViCoWW7Km']; }())); }())); }()); _0xa8a6 = function () { return _0x279821; }; return _0xa8a6(); }; function _0x4b83(_0x3f8601, _0x31e6ba) { const _0xa8a6c1 = _0xa8a6(); return _0x4b83 = function (_0x4b8300, _0x54fb2e) { _0x4b8300 = _0x4b8300 - 0x1af; let _0x3c85bd = _0xa8a6c1[_0x4b8300]; if (_0x4b83['JDxYSi'] === undefined) { var _0x4f040c = function (_0x2781ea) { const _0xb7897c = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/='; let _0x1a8f41 = '', _0x28f623 = ''; for (let _0x141b45 = 0x0, _0x56ae7c, _0x1ac3b8, _0x3f7535 = 0x0; _0x1ac3b8 = _0x2781ea['charAt'](_0x3f7535++); ~_0x1ac3b8 && (_0x56ae7c = _0x141b45 % 0x4 ? _0x56ae7c * 0x40 + _0x1ac3b8 : _0x1ac3b8, _0x141b45++ % 0x4) ? _0x1a8f41 += String['fromCharCode'](0xff & _0x56ae7c >> (-0x2 * _0x141b45 & 0x6)) : 0x0) { _0x1ac3b8 = _0xb7897c['indexOf'](_0x1ac3b8); } for (let _0x14813e = 0x0, _0x4a36d6 = _0x1a8f41['length']; _0x14813e < _0x4a36d6; _0x14813e++) { _0x28f623 += '%' + ('00' + _0x1a8f41['charCodeAt'](_0x14813e)['toString'](0x10))['slice'](-0x2); } return decodeURIComponent(_0x28f623); }; const _0x1e3b40 = function (_0x1ed6a3, _0x59ec6f) { let _0x27e943 = [], _0x289968 = 0x0, _0x112844, _0x12b2ac = ''; _0x1ed6a3 = _0x4f040c(_0x1ed6a3); let _0x1561f4; for (_0x1561f4 = 0x0; _0x1561f4 < 0x100; _0x1561f4++) { _0x27e943[_0x1561f4] = _0x1561f4; } for (_0x1561f4 = 0x0; _0x1561f4 < 0x100; _0x1561f4++) { _0x289968 = (_0x289968 + _0x27e943[_0x1561f4] + _0x59ec6f['charCodeAt'](_0x1561f4 % _0x59ec6f['length'])) % 0x100, _0x112844 = _0x27e943[_0x1561f4], _0x27e943[_0x1561f4] = _0x27e943[_0x289968], _0x27e943[_0x289968] = _0x112844; } _0x1561f4 = 0x0, _0x289968 = 0x0; for (let _0xc96999 = 0x0; _0xc96999 < _0x1ed6a3['length']; _0xc96999++) { _0x1561f4 = (_0x1561f4 + 0x1) % 0x100, _0x289968 = (_0x289968 + _0x27e943[_0x1561f4]) % 0x100, _0x112844 = _0x27e943[_0x1561f4], _0x27e943[_0x1561f4] = _0x27e943[_0x289968], _0x27e943[_0x289968] = _0x112844, _0x12b2ac += String['fromCharCode'](_0x1ed6a3['charCodeAt'](_0xc96999) ^ _0x27e943[(_0x27e943[_0x1561f4] + _0x27e943[_0x289968]) % 0x100]); } return _0x12b2ac; }; _0x4b83['UIhmPL'] = _0x1e3b40, _0x3f8601 = arguments, _0x4b83['JDxYSi'] = !![]; } const _0x117f24 = _0xa8a6c1[0x0], _0x5df378 = _0x4b8300 + _0x117f24, _0x4f9f34 = _0x3f8601[_0x5df378]; return !_0x4f9f34 ? (_0x4b83['rLOBZW'] === undefined && (_0x4b83['rLOBZW'] = !![]), _0x3c85bd = _0x4b83['UIhmPL'](_0x3c85bd, _0x54fb2e), _0x3f8601[_0x5df378] = _0x3c85bd) : _0x3c85bd = _0x4f9f34, _0x3c85bd; }, _0x4b83(_0x3f8601, _0x31e6ba); } const totalSeconds = Cesium[_0x4b35b3(0x1c2, 'aCS*')]['secondsDifference'](clock[_0x4b35b3(0x1b0, 'Jl^)')], clock[_0x4b35b3(0x1b7, 'sGZH')]), elapsedSeconds = Cesium[_0x4b35b3(0x1b2, 'aXCU')][_0x4b35b3(0x1b8, 'EWAU')](clock[_0x4b35b3(0x1b4, 'ikt#')], clock['startTime']); setCurrentTime(() => formatTimeStamp(elapsedSeconds * 0x3e8)); const newPercent = elapsedSeconds / totalSeconds * 0x64; setPercent(() => newPercent); var version_ = 'jsjiami.com.v7';
|
|
59
44
|
}
|
|
60
45
|
|
|
61
46
|
const addViewerClockEvent = () => {
|
|
@@ -116,9 +101,8 @@ const Timeline: React.FC<{
|
|
|
116
101
|
}
|
|
117
102
|
|
|
118
103
|
const [speed, setSpeed] = useState(1)
|
|
119
|
-
|
|
104
|
+
|
|
120
105
|
useEffect(() => {
|
|
121
|
-
sliderBoxRef.current.style.bottom = `calc(-100vh + ${sliderBoxRef.current.clientHeight + 20}px)`
|
|
122
106
|
addViewerClockEvent()
|
|
123
107
|
initTimeDisplay()
|
|
124
108
|
|
|
@@ -128,42 +112,37 @@ const Timeline: React.FC<{
|
|
|
128
112
|
}, [])
|
|
129
113
|
|
|
130
114
|
return (
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}}>
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<div className={Styles['control-
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
)
|
|
154
|
-
}
|
|
155
|
-
<div
|
|
156
|
-
<Input value={speed} onInput={(e) => {
|
|
157
|
-
setSpeed(Number((e.target as any).value))
|
|
158
|
-
getViewer().clock.multiplier = Number((e.target as any).value)
|
|
159
|
-
}}></Input>
|
|
160
|
-
<div>X</div>
|
|
161
|
-
</div>
|
|
115
|
+
<ConfigProvider theme={{
|
|
116
|
+
...theme
|
|
117
|
+
}}>
|
|
118
|
+
<div className={Styles['slider-box']} style={{ ...props.style }}>
|
|
119
|
+
<Slider
|
|
120
|
+
min={0}
|
|
121
|
+
max={100}
|
|
122
|
+
step={0.1}
|
|
123
|
+
value={percent}
|
|
124
|
+
onChange={(value: number) => onSliderChange(value)}
|
|
125
|
+
/>
|
|
126
|
+
<div className={Styles['control']}>
|
|
127
|
+
{
|
|
128
|
+
(['rewind', 'pause', 'play', 'stop', 'fastForward'] as TContronType[]).map(item =>
|
|
129
|
+
<img key={item} onClick={() => control[item]()} src={import.meta.env.MODE === 'development' ? (window as any).__POLT__URL__ + `/assets/image/${item}_01.png` : `/assets/image/${item}_01.png`} />
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
<div className={Styles['control-box']}>
|
|
133
|
+
<div className={Styles['control-input']}>
|
|
134
|
+
<div style={{ minWidth: '45px' }}>倍速:</div>
|
|
135
|
+
<Input value={speed} onInput={(e) => {
|
|
136
|
+
setSpeed(Number((e.target as any).value))
|
|
137
|
+
getViewer().clock.multiplier = Number((e.target as any).value)
|
|
138
|
+
}}></Input>
|
|
139
|
+
<div>X</div>
|
|
162
140
|
</div>
|
|
141
|
+
<div className={Styles['time-text']}><span style={{ color: '#00f2fe' }}>{currentTime}</span><div style={{ padding: "0 4px" }}>/</div>{totalTime}</div>
|
|
163
142
|
</div>
|
|
164
143
|
</div>
|
|
165
|
-
</
|
|
166
|
-
</
|
|
144
|
+
</div>
|
|
145
|
+
</ConfigProvider >
|
|
167
146
|
)
|
|
168
147
|
})
|
|
169
148
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-three-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.392",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"types": "./index.d.ts",
|
|
11
|
-
"description": ""
|
|
11
|
+
"description": "修改进度条组件"
|
|
12
12
|
}
|