프로그래스바 추가 및 UI 수정
This commit is contained in:
1 parent
6675b5301f
commit
29cee13da7
10 files changed
+232
-136
No files matched your search
@@ -1,9 +1,26 @@
|
||||
|
||||
import React from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const LoadingSection: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const [progress, setProgress] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
setProgress(prev => {
|
||||
if (prev >= 100) {
|
||||
clearInterval(interval);
|
||||
return 100;
|
||||
}
|
||||
// 느리게 올라가다가 90% 이후 거의 멈춤
|
||||
const increment = prev < 50 ? 1 : prev < 85 ? 0.5 : 0.1;
|
||||
return Math.min(prev + increment, 100);
|
||||
});
|
||||
}, 100);
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="loading-container">
|
||||
<div className="loading-content">
|
||||
@@ -23,6 +40,16 @@ const LoadingSection: React.FC = () => {
|
||||
className="loading-spinner-icon"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="loading-progress-wrapper">
|
||||
<div className="loading-progress-bar">
|
||||
<div
|
||||
className="loading-progress-fill"
|
||||
style={{ width: `${progress}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="loading-progress-text">{Math.floor(progress)}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user