Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
MAC_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이정민
2021-05-26 00:13:01 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
223c011605ebfbed5d180b65e59093433d4983f9
223c0116
1 parent
40d967eb
gif 퍼센트 표시
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
src/components/GifEditor.tsx
src/components/GifEditor.tsx
View file @
223c011
...
...
@@ -17,6 +17,7 @@ const GifEditor = ({ previewURL }) => {
const [download, setDownload] = useState(null);
const [blob, setBlob] = useState(null);
const [percent, setPercent] = useState(0);
const [isMakeStarted, setIsMakeStarted] = useState(false);
const [isUploadLoading, setIsUploadLoading] = useState(false);
...
...
@@ -51,8 +52,11 @@ const GifEditor = ({ previewURL }) => {
const gifGenerator = new window.GifGenerator(
imageEditor._graphics.getCanvas()
);
gifGenerator.on("progress", (p: number) => {
setPercent(Math.round(p * 100));
});
gifGenerator.make().then(
(blob) => {
(blob
: Blob
) => {
setBlob(blob);
setDownload(window.URL.createObjectURL(blob));
},
...
...
@@ -80,7 +84,7 @@ const GifEditor = ({ previewURL }) => {
{((isMakeStarted && !download) || isUploadLoading) && (
<>
<div className="background" />
<div className="download">loading...</div>
<div className="download">loading...
{percent}%
</div>
</>
)}
{!isUploadLoading && viewLink && (
...
...
Please
register
or
login
to post a comment