commit
7cc2c7f73a
6 changed files with 67 additions and 1 deletions
|
@ -36,3 +36,45 @@
|
|||
left: 1.5px;
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
right: 38px;
|
||||
|
||||
div {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
width: 6px;
|
||||
animation: loading 0.8s cubic-bezier(0, 0.5, 0.5, 1) infinite;
|
||||
}
|
||||
|
||||
div:nth-child(1) {
|
||||
left: 12px;
|
||||
animation-delay: -0.24s;
|
||||
}
|
||||
|
||||
div:nth-child(2) {
|
||||
left: 20px;
|
||||
animation-delay: -0.12s;
|
||||
}
|
||||
|
||||
div:nth-child(3) {
|
||||
left: 28px;
|
||||
animation-delay: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loading {
|
||||
0% {
|
||||
top: 4px;
|
||||
height: 8px;
|
||||
}
|
||||
50%, 100% {
|
||||
top: 8px;
|
||||
height: 4px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,4 +32,8 @@
|
|||
background: unset;
|
||||
fill: $green;
|
||||
}
|
||||
|
||||
.row .loading div {
|
||||
background: $green;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,4 +39,8 @@
|
|||
stroke-width: 5;
|
||||
}
|
||||
}
|
||||
|
||||
.row .loading div {
|
||||
background: $gold;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,3 +134,13 @@ export function RefreshShape({ onClick }: Props) {
|
|||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
export function LoadingShape() {
|
||||
return (
|
||||
<div className="loading">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ export function Timer({
|
|||
const tid = setTimeout(() => setMs(ms - 100), 100);
|
||||
return () => clearTimeout(tid);
|
||||
}
|
||||
}, [isStalled, isPaused, soundOn, ms]);
|
||||
}, [soundOn, isStalled, isPaused, ms]);
|
||||
|
||||
return <div className="timer">{formatNumber(ms / 1000, locale)}</div>;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import {
|
|||
SoundOnShape,
|
||||
SoundOffShape,
|
||||
RefreshShape,
|
||||
LoadingShape,
|
||||
} from "components/Shape";
|
||||
import * as Quran from "lib/Quran";
|
||||
import { Slice } from "lib/Quran/Slice";
|
||||
|
@ -179,6 +180,11 @@ function SurahStream({ node, reciters, locale, slice, paused, t }: Props) {
|
|||
)}
|
||||
{readyToRender && endOfStream && <RefreshShape onClick={() => setStream([])} />}
|
||||
</div>
|
||||
{readyToRender && soundOn && isStalled && (
|
||||
<div className="row justify-end">
|
||||
<LoadingShape />
|
||||
</div>
|
||||
)}
|
||||
{readyToRender && soundOn && (
|
||||
<audio ref={audioRef} src={getAudioURL(reciter, surah, stream)} />
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue