From e0c77fb7c6f02304664aa9b80955b7ec4c0bc487 Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Thu, 5 Oct 2023 21:31:46 +0530 Subject: [PATCH] Update audio player --- .../playback/audioPlayer/audioPlayer.module.scss | 5 +++++ src/components/playback/audioPlayer/index.jsx | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/playback/audioPlayer/audioPlayer.module.scss b/src/components/playback/audioPlayer/audioPlayer.module.scss index 9a220a9..f4526e8 100644 --- a/src/components/playback/audioPlayer/audioPlayer.module.scss +++ b/src/components/playback/audioPlayer/audioPlayer.module.scss @@ -19,6 +19,11 @@ #waveform { width: 100%; + transform: scaleY(0); + transition: transform $transition-time-default; + &[data-show="true"] { + transform: scaleY(1) !important; + } } &-controls { display: flex; diff --git a/src/components/playback/audioPlayer/index.jsx b/src/components/playback/audioPlayer/index.jsx index 688309b..fb2d5ae 100644 --- a/src/components/playback/audioPlayer/index.jsx +++ b/src/components/playback/audioPlayer/index.jsx @@ -1,5 +1,5 @@ /** @format */ -import { useEffect, useRef, useState } from "react"; +import React, { useEffect, useRef, useState } from "react"; import { motion } from "framer-motion"; @@ -96,13 +96,13 @@ const AudioPlayer = () => { if (display) { const waveSurfer = WaveSurfer.create({ container: waveSurferContainerRef.current, - barHeight: 0.8, dragToSeek: true, height: 35, cursorColor: "#fb2376", progressColor: "#fb2376", waveColor: "#ffffff2f", normalize: true, + barHeight: 0.6, }); waveSurfer.load(url); waveSurfer.on("load", () => { @@ -196,7 +196,7 @@ const AudioPlayer = () => { }; return ( - + {display && ( { )} - 10px)`, }} transition={{ - duration: 0.1, + duration: 0.2, ease: "easeInOut", }} className="audio-player" @@ -343,11 +343,8 @@ const AudioPlayer = () => {