Skip to content

Commit

Permalink
chore: add progress
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzeTT committed Nov 22, 2023
1 parent 75aebef commit 590753f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,13 @@ a {
.fillsvg-white * {
fill: #ffffff
}

/* Thumb: Chrome, Safari, Opera, Edge Chromium */
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
height: 15px;
width: 15px;
background-color: #2563EB;
border-radius: 50%;
}
11 changes: 9 additions & 2 deletions src/pages/tools/music.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function Rseg() {
const [isSmall, setIsSmall] = useState(false);
const [tr, setTr] = useState(false);
const [isRounded, setIsRounded] = useState(true);
const [progress, setProgress] = useState(50)

const handleImage1Change = (e: ChangeEvent<HTMLInputElement>) => {
const file = e.target.files && e.target.files[0];
Expand Down Expand Up @@ -131,6 +132,11 @@ export default function Rseg() {
<div className='text-sm text-red-500 text-center mb-2'>文件较大({formatBytes(image1Size)}) 导出可能需要 1-3分钟</div> : ''
}
</div>
<div className='mb-4'>
<div className='text-sm op50'>歌曲进度条(点击操作以防止触发返回手势)</div>
<input type="range" value={progress} onChange={(v)=>setProgress(parseInt(v.target.value))
} className="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer"/>
</div>
<div className='mb-4'>
<table className='mx-auto'>
<tbody>
Expand All @@ -147,7 +153,7 @@ export default function Rseg() {
</td>
</tr>
<tr>
<td className='text-sm op70'>圆角</td>
<td className='text-sm op70'>圆角(印刷推荐关闭)</td>
<td>
<Switch id='line3' size='sm' isChecked={isRounded} onChange={(v) => { setIsRounded(v.target.checked) }} />
</td>
Expand All @@ -160,6 +166,7 @@ export default function Rseg() {
</tr>
</tbody>
</table>

</div>
<div className='text-xs text-center mb-4 text-orange-600'>
<span className='text-[0.7rem] text-white bg-orange-600 px-1 py-0.5 rounded mr-1'>提示</span>
Expand Down Expand Up @@ -200,7 +207,7 @@ export default function Rseg() {
<HighText show={highLight} text='播放' eg='1:21' />
</div>
<div className="w-full h-[6px] mx-2 bg-white/50 rounded-full relative">
<div className="h-[6px] w-1/2 absolute bg-white/80 rounded-full"></div>
<div className="h-[6px] absolute bg-white/80 rounded-full" style={{width: progress+'%'}}></div>
</div>
<div className="text-[0.6rem] flex-1 op80">
<HighText show={highLight} text='剩余' eg='-1:22' />
Expand Down

0 comments on commit 590753f

Please sign in to comment.