funuicss 2.0.25 → 2.5.0
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/css/fun.css +1002 -3749
- package/js/Fun.js +2 -2
- package/js/Fun.tsx +9 -8
- package/package.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/ui/alert/Alert.d.ts +1 -1
- package/ui/aos/AOS.d.ts +1 -1
- package/ui/appbar/AppBar.d.ts +1 -1
- package/ui/avatar/Avatar.d.ts +2 -1
- package/ui/breadcrumb/BreadCrumb.d.ts +2 -1
- package/ui/button/Button.d.ts +1 -1
- package/ui/card/Card.d.ts +1 -1
- package/ui/card/CardBody.d.ts +2 -2
- package/ui/card/CardFab.d.ts +2 -2
- package/ui/card/CardFooter.d.ts +2 -2
- package/ui/card/CardHeader.d.ts +2 -2
- package/ui/div/Div.d.ts +1 -1
- package/ui/drop/Action.d.ts +1 -1
- package/ui/drop/Down.d.ts +1 -1
- package/ui/drop/Item.d.ts +1 -1
- package/ui/drop/Menu.d.ts +1 -1
- package/ui/drop/Up.d.ts +1 -1
- package/ui/grid/Col.d.ts +2 -1
- package/ui/grid/Grid.d.ts +2 -1
- package/ui/input/Iconic.d.ts +2 -2
- package/ui/input/Input.d.ts +2 -0
- package/ui/input/Input.js +50 -9
- package/ui/input/Input.tsx +34 -7
- package/ui/list/Item.d.ts +1 -1
- package/ui/list/List.d.ts +1 -1
- package/ui/loader/Loader.d.ts +2 -1
- package/ui/modal/Action.d.ts +1 -1
- package/ui/modal/Close.d.ts +2 -1
- package/ui/modal/Content.d.ts +1 -1
- package/ui/modal/Header.d.ts +2 -2
- package/ui/modal/Header.tsx +1 -1
- package/ui/modal/Modal.d.ts +1 -1
- package/ui/notification/Content.d.ts +1 -1
- package/ui/notification/Footer.d.ts +1 -1
- package/ui/notification/Header.d.ts +1 -1
- package/ui/notification/Notification.d.ts +1 -1
- package/ui/page/NotFound.d.ts +1 -1
- package/ui/page/UnAuthorized.d.ts +1 -1
- package/ui/progress/Bar.d.ts +1 -1
- package/ui/sidebar/SideBar.d.ts +2 -1
- package/ui/sidebar/SideContent.d.ts +1 -1
- package/ui/specials/Circle.d.ts +3 -2
- package/ui/specials/Circle.js +2 -2
- package/ui/specials/Circle.tsx +4 -2
- package/ui/specials/FullCenteredPage.d.ts +1 -1
- package/ui/specials/Hr.d.ts +1 -1
- package/ui/specials/RowFlex.d.ts +1 -1
- package/ui/specials/Section.d.ts +1 -1
- package/ui/table/Body.d.ts +1 -1
- package/ui/table/Data.d.ts +1 -1
- package/ui/table/Head.d.ts +1 -1
- package/ui/table/Row.d.ts +1 -1
- package/ui/table/Table.d.ts +1 -1
- package/ui/table/Table.js +11 -7
- package/ui/table/Table.tsx +20 -8
- package/ui/text/Text.d.ts +5 -5
- package/ui/text/Text.js +20 -11
- package/ui/text/Text.tsx +62 -33
- package/ui/tooltip/Tip.d.ts +2 -1
- package/ui/tooltip/Tip.js +9 -5
- package/ui/tooltip/Tip.tsx +12 -2
- package/ui/tooltip/ToolTip.d.ts +1 -1
- package/ui/tooltip/ToolTip.js +1 -1
- package/ui/tooltip/ToolTip.tsx +7 -1
- package/ui/video/FunPlayer.d.ts +0 -7
- package/ui/video/FunPlayer.js +202 -179
- package/ui/video/FunPlayer.tsx +218 -218
package/ui/video/FunPlayer.tsx
CHANGED
|
@@ -1,221 +1,221 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
-
import { PiCornersOut, PiDownload, PiFastForward, PiFileAudio, PiPause, PiPlay, PiRewind, PiSpeakerHifi, PiSpeakerLow } from 'react-icons/pi';
|
|
3
|
-
import ToolTip from "../tooltip/ToolTip"
|
|
4
|
-
import RowFlex from '../specials/RowFlex';
|
|
5
|
-
import Button from '../button/Button'
|
|
6
|
-
import Text from '../text/Text'
|
|
7
|
-
import Tip from '../tooltip/Tip'
|
|
8
|
-
|
|
9
|
-
interface VideoProps {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default function Video({ src, autoPlay, onDuration }: VideoProps) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// const handleExitFullScreen = () => {
|
|
92
|
-
// if (document.exitFullscreen) {
|
|
93
|
-
// document.exitFullscreen();
|
|
94
|
-
// } else if (document.mozCancelFullScreen) {
|
|
95
|
-
// document.mozCancelFullScreen();
|
|
96
|
-
// } else if (document.webkitExitFullscreen) {
|
|
97
|
-
// document.webkitExitFullscreen();
|
|
98
|
-
// } else if (document.msExitFullscreen) {
|
|
99
|
-
// document.msExitFullscreen();
|
|
1
|
+
// import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
+
// import { PiCornersOut, PiDownload, PiFastForward, PiFileAudio, PiPause, PiPlay, PiRewind, PiSpeakerHifi, PiSpeakerLow } from 'react-icons/pi';
|
|
3
|
+
// import ToolTip from "../tooltip/ToolTip"
|
|
4
|
+
// import RowFlex from '../specials/RowFlex';
|
|
5
|
+
// import Button from '../button/Button'
|
|
6
|
+
// import Text from '../text/Text'
|
|
7
|
+
// import Tip from '../tooltip/Tip'
|
|
8
|
+
|
|
9
|
+
// interface VideoProps {
|
|
10
|
+
// src: string;
|
|
11
|
+
// autoPlay: boolean;
|
|
12
|
+
// onDuration?: (duration: number) => void;
|
|
13
|
+
// }
|
|
14
|
+
|
|
15
|
+
// export default function Video({ src, autoPlay, onDuration }: VideoProps) {
|
|
16
|
+
// const videoRef = useRef<HTMLVideoElement>(null);
|
|
17
|
+
// const [isPlaying, setIsPlaying] = useState<boolean>(autoPlay);
|
|
18
|
+
// const [currentTime, setCurrentTime] = useState<number>(0);
|
|
19
|
+
// const [duration, setDuration] = useState<number>(0);
|
|
20
|
+
// const [volume, setVolume] = useState<number>(1);
|
|
21
|
+
// const [isFullScreen, setIsFullScreen] = useState<boolean>(false);
|
|
22
|
+
// const [showVolume, setShowVolume] = useState<boolean>(false);
|
|
23
|
+
|
|
24
|
+
// useEffect(() => {
|
|
25
|
+
// if (!videoRef.current) return;
|
|
26
|
+
|
|
27
|
+
// const handleTimeUpdate = () => {
|
|
28
|
+
// setCurrentTime(videoRef.current.currentTime);
|
|
29
|
+
// };
|
|
30
|
+
|
|
31
|
+
// const handleDurationChange = () => {
|
|
32
|
+
// const newDuration = videoRef.current.duration;
|
|
33
|
+
// setDuration(newDuration);
|
|
34
|
+
// onDuration && onDuration(newDuration);
|
|
35
|
+
// };
|
|
36
|
+
|
|
37
|
+
// videoRef.current.addEventListener('timeupdate', handleTimeUpdate);
|
|
38
|
+
// videoRef.current.addEventListener('durationchange', handleDurationChange);
|
|
39
|
+
|
|
40
|
+
// return () => {
|
|
41
|
+
// videoRef.current?.removeEventListener('timeupdate', handleTimeUpdate);
|
|
42
|
+
// videoRef.current?.removeEventListener('durationchange', handleDurationChange);
|
|
43
|
+
// };
|
|
44
|
+
// }, [onDuration]);
|
|
45
|
+
|
|
46
|
+
// const formatTime = (time: number) => {
|
|
47
|
+
// const minutes = Math.floor(time / 60);
|
|
48
|
+
// const seconds = Math.floor(time % 60);
|
|
49
|
+
// return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
|
50
|
+
// };
|
|
51
|
+
|
|
52
|
+
// const handlePlay = () => {
|
|
53
|
+
// videoRef.current?.play();
|
|
54
|
+
// setIsPlaying(true);
|
|
55
|
+
// };
|
|
56
|
+
|
|
57
|
+
// const handlePause = () => {
|
|
58
|
+
// videoRef.current?.pause();
|
|
59
|
+
// setIsPlaying(false);
|
|
60
|
+
// };
|
|
61
|
+
|
|
62
|
+
// const handleStop = () => {
|
|
63
|
+
// videoRef.current?.pause();
|
|
64
|
+
// videoRef.current.currentTime = 0;
|
|
65
|
+
// setIsPlaying(false);
|
|
66
|
+
// };
|
|
67
|
+
|
|
68
|
+
// const handleRewind = () => {
|
|
69
|
+
// if (videoRef.current) videoRef.current.currentTime -= 10; // Rewind 10 seconds
|
|
70
|
+
// };
|
|
71
|
+
|
|
72
|
+
// const handleForward = () => {
|
|
73
|
+
// if (videoRef.current) videoRef.current.currentTime += 10; // Forward 10 seconds
|
|
74
|
+
// };
|
|
75
|
+
|
|
76
|
+
// const handleToggleFullScreen = () => {
|
|
77
|
+
// if (videoRef.current) {
|
|
78
|
+
// if (videoRef.current.requestFullscreen) {
|
|
79
|
+
// videoRef.current.requestFullscreen();
|
|
80
|
+
// } else if (videoRef.current.mozRequestFullScreen) {
|
|
81
|
+
// videoRef.current.mozRequestFullScreen();
|
|
82
|
+
// } else if (videoRef.current.webkitRequestFullscreen) {
|
|
83
|
+
// videoRef.current.webkitRequestFullscreen();
|
|
84
|
+
// } else if (videoRef.current.msRequestFullscreen) {
|
|
85
|
+
// videoRef.current.msRequestFullscreen();
|
|
86
|
+
// }
|
|
87
|
+
// setIsFullScreen(true);
|
|
100
88
|
// }
|
|
101
|
-
// setIsFullScreen(false);
|
|
102
89
|
// };
|
|
103
90
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
91
|
+
// // const handleExitFullScreen = () => {
|
|
92
|
+
// // if (document.exitFullscreen) {
|
|
93
|
+
// // document.exitFullscreen();
|
|
94
|
+
// // } else if (document.mozCancelFullScreen) {
|
|
95
|
+
// // document.mozCancelFullScreen();
|
|
96
|
+
// // } else if (document.webkitExitFullscreen) {
|
|
97
|
+
// // document.webkitExitFullscreen();
|
|
98
|
+
// // } else if (document.msExitFullscreen) {
|
|
99
|
+
// // document.msExitFullscreen();
|
|
100
|
+
// // }
|
|
101
|
+
// // setIsFullScreen(false);
|
|
102
|
+
// // };
|
|
103
|
+
|
|
104
|
+
// const handleProgressBarChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
105
|
+
// const newTime = parseFloat(e.target.value);
|
|
106
|
+
// setCurrentTime(newTime);
|
|
107
|
+
// if (videoRef.current) videoRef.current.currentTime = newTime;
|
|
108
|
+
// };
|
|
109
|
+
|
|
110
|
+
// const handleVolumeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
111
|
+
// const newVolume = parseFloat(e.target.value);
|
|
112
|
+
// setVolume(newVolume);
|
|
113
|
+
// if (videoRef.current) videoRef.current.volume = newVolume;
|
|
114
|
+
// };
|
|
115
|
+
|
|
116
|
+
// const timePlayed = formatTime(currentTime);
|
|
117
|
+
// const timeLeft = formatTime(duration - currentTime);
|
|
118
|
+
|
|
119
|
+
// return (
|
|
120
|
+
// <div className="vide_container">
|
|
121
|
+
// <video
|
|
122
|
+
// ref={videoRef}
|
|
123
|
+
// autoPlay={autoPlay}
|
|
124
|
+
// src={src}
|
|
125
|
+
// className="fit"
|
|
126
|
+
// ></video>
|
|
127
|
+
// <div className="video_controls" onDoubleClick={isPlaying ? handlePause : handlePlay}>
|
|
128
|
+
// <RowFlex gap={0.3} funcss="padding-5">
|
|
129
|
+
// <div>
|
|
130
|
+
// <Text
|
|
131
|
+
// text={timePlayed}
|
|
132
|
+
// size="small"
|
|
133
|
+
// bold
|
|
134
|
+
// />
|
|
135
|
+
// </div>
|
|
136
|
+
// <div className="col width-100-p">
|
|
137
|
+
// <input
|
|
138
|
+
// type="range"
|
|
139
|
+
// min={0}
|
|
140
|
+
// max={duration}
|
|
141
|
+
// value={currentTime}
|
|
142
|
+
// className="width-100-p"
|
|
143
|
+
// style={{ height: "3px" }}
|
|
144
|
+
// onChange={handleProgressBarChange}
|
|
145
|
+
// />
|
|
146
|
+
// </div>
|
|
147
|
+
// <div>
|
|
148
|
+
// <Text
|
|
149
|
+
// text={timeLeft}
|
|
150
|
+
// size="small"
|
|
151
|
+
// bold
|
|
152
|
+
// />
|
|
153
|
+
// </div>
|
|
154
|
+
// </RowFlex>
|
|
155
|
+
// <div className="margin-top-5"></div>
|
|
156
|
+
// <RowFlex gap={1} justify="space-between">
|
|
157
|
+
// <div>
|
|
158
|
+
// <RowFlex gap={0.5}>
|
|
159
|
+
// <ToolTip>
|
|
160
|
+
// <div className="width-30 height-30 pointer padding-5" onClick={isPlaying ? handlePause : handlePlay}>
|
|
161
|
+
// {isPlaying ? <PiPause /> : <PiPlay />}
|
|
162
|
+
// </div>
|
|
163
|
+
// <Tip tip="top" animation="ScaleUp" duration={0.5} content={isPlaying ? "Pause" : "Play"} />
|
|
164
|
+
// </ToolTip>
|
|
165
|
+
// <ToolTip>
|
|
166
|
+
// <div className="width-30 height-30 pointer padding-5" onClick={handleRewind}>
|
|
167
|
+
// <PiRewind />
|
|
168
|
+
// </div>
|
|
169
|
+
// <Tip tip="top" animation="ScaleUp" duration={0.5} content={"10 sec Back"} />
|
|
170
|
+
// </ToolTip>
|
|
171
|
+
// <ToolTip>
|
|
172
|
+
// <div className="width-30 height-30 pointer padding-5" onClick={handleForward}>
|
|
173
|
+
// <PiFastForward />
|
|
174
|
+
// </div>
|
|
175
|
+
// <Tip tip="top" animation="ScaleUp" duration={0.5} content={"10 sec Forward"} />
|
|
176
|
+
// </ToolTip>
|
|
177
|
+
// <div onMouseEnter={() => setShowVolume(true)} onMouseLeave={() => setShowVolume(false)}>
|
|
178
|
+
// <RowFlex >
|
|
179
|
+
// <ToolTip>
|
|
180
|
+
// <div className="width-30 height-30 pointer padding-5">
|
|
181
|
+
// <PiSpeakerLow />
|
|
182
|
+
// </div>
|
|
183
|
+
// <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Volume"} />
|
|
184
|
+
// </ToolTip>
|
|
185
|
+
// {showVolume &&
|
|
186
|
+
// <input
|
|
187
|
+
// type="range"
|
|
188
|
+
// min={0}
|
|
189
|
+
// max={1}
|
|
190
|
+
// step={0.01}
|
|
191
|
+
// value={volume}
|
|
192
|
+
// className="width-100"
|
|
193
|
+
// style={{ height: "3px" }}
|
|
194
|
+
// onChange={handleVolumeChange}
|
|
195
|
+
// />
|
|
196
|
+
// }
|
|
197
|
+
// </RowFlex>
|
|
198
|
+
// </div>
|
|
199
|
+
// </RowFlex>
|
|
200
|
+
// </div>
|
|
201
|
+
// <div>
|
|
202
|
+
// <RowFlex gap={0.3}>
|
|
203
|
+
// <ToolTip>
|
|
204
|
+
// <div className="width-30 height-30 pointer padding-5" onClick={handleToggleFullScreen}>
|
|
205
|
+
// <PiCornersOut />
|
|
206
|
+
// </div>
|
|
207
|
+
// <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Expand"} />
|
|
208
|
+
// </ToolTip>
|
|
209
|
+
// <ToolTip>
|
|
210
|
+
// <div className="width-30 height-30 pointer padding-5" onClick={() => { window.open(src || "", '_blank'); }}>
|
|
211
|
+
// <PiDownload />
|
|
212
|
+
// </div>
|
|
213
|
+
// <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Download"} />
|
|
214
|
+
// </ToolTip>
|
|
215
|
+
// </RowFlex>
|
|
216
|
+
// </div>
|
|
217
|
+
// </RowFlex>
|
|
218
|
+
// </div>
|
|
219
|
+
// </div>
|
|
220
|
+
// );
|
|
221
|
+
// }
|