diff --git a/src/app/styles/globals.css b/src/app/styles/globals.css index 93d0c38..cb3df2a 100644 --- a/src/app/styles/globals.css +++ b/src/app/styles/globals.css @@ -22,4 +22,61 @@ a { @apply transition-all active:opacity-60; } + + /*Input Range*/ + /* Custom styles for the range input */ + input[type="range"] { + -webkit-appearance: none; /* Remove default appearance */ + width: 100%; /* Full width */ + height: 2px; /* Track height */ + background: linear-gradient( + to right, + white 0%, /* Start color of passed track */ + white var(--value-percentage, 0%), /* End color of passed track */ + gray var(--value-percentage, 0%), /* Start color of remaining track */ + gray 100% /* End color of remaining track */ + ); + border-radius: 9999px; /* Rounded-full track */ + outline: none; /* Remove outline */ + transition: background 0.3s; + } + + /* Style the thumb (toggle) */ + input[type="range"]::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 9px; /* Thumb width */ + height: 9px; /* Thumb height */ + background: #fff; /* Thumb color (blue-500) */ + border-radius: 9999px; /* Rounded-full thumb */ + cursor: pointer; /* Pointer cursor on hover */ + transition: background 0.3s; + } + + /* For Firefox */ + input[type="range"]::-moz-range-thumb { + appearance: none; + width: 9px; /* Thumb width */ + height: 9px; /* Thumb height */ + background: #fff; /* Thumb color (blue-500) */ + border-radius: 9999px; /* Rounded-full thumb */ + cursor: pointer; /* Pointer cursor on hover */ + transition: background 0.3s; + } + + input[type="range"]::-moz-range-track { + -webkit-appearance: none; /* Remove default appearance */ + width: 100%; /* Full width */ + height: 2px; /* Track height */ + background: linear-gradient( + to right, + white 0%, /* Start color of passed track */ + white var(--value-percentage, 0%), /* End color of passed track */ + gray var(--value-percentage, 0%), /* Start color of remaining track */ + gray 100% /* End color of remaining track */ + ); + border-radius: 9999px; /* Rounded-full track */ + outline: none; /* Remove outline */ + transition: background 0.3s; + } } diff --git a/src/pages/root/steps/data-step/index.tsx b/src/pages/root/steps/data-step/index.tsx index 4ebba75..b72fd6c 100644 --- a/src/pages/root/steps/data-step/index.tsx +++ b/src/pages/root/steps/data-step/index.tsx @@ -12,6 +12,7 @@ import { CoverButton } from "~/pages/root/steps/data-step/components/cover-butto import { HiddenFileInput } from "~/shared/ui/hidden-file-input"; import { useRootStore } from "~/shared/stores/root"; import { Checkbox } from "~/shared/ui/checkbox"; +import { AudioPlayer } from "~/shared/ui/audio-player"; type DataStepProps = { nextStep(): void; @@ -47,6 +48,7 @@ export const DataStep = ({ nextStep }: DataStepProps) => { if (values.author) { rootStore.setAuthor(values.author); } + nextStep(); } catch (error) { console.error("Error:", error); @@ -55,112 +57,114 @@ export const DataStep = ({ nextStep }: DataStepProps) => { }; return ( -
-
- /Заполните информацию о контенте -
- 1/5 +
+
+ /Заполните информацию о контенте +
+ 1/5 +
-
-
- - - +
+ + + - - - + + + - - { - rootStore.setFile(file); - rootStore.setFileSrc(URL.createObjectURL(file)); - }} - /> - - {!rootStore.fileSrc && } - - {rootStore.fileSrc && ( -
- - - - -
- )} -
- -
- rootStore.setAllowCover(!rootStore.allowCover)} - checked={rootStore.allowCover} - /> - } - /> - - {rootStore.allowCover && ( - - { - rootStore.setCover(cover); + + { + rootStore.setFile(file); + rootStore.setFileSrc(URL.createObjectURL(file)); + rootStore.setFileType(file.type); // Save the file type for conditional rendering }} - /> + /> - {rootStore.cover ? ( - { - rootStore.setCover(null); - }} - /> - ) : ( - - )} - - )} + {!rootStore.fileSrc && } + + {rootStore.fileSrc && ( +
+ {rootStore.fileType?.startsWith("audio") ? ( + + ) : ( + + )} +
+ )} +
+ +
+ rootStore.setAllowCover(!rootStore.allowCover)} + checked={rootStore.allowCover} + /> + } + /> + + {rootStore.allowCover && ( + + { + rootStore.setCover(cover); + }} + /> + + {rootStore.cover ? ( + { + rootStore.setCover(null); + }} + /> + ) : ( + + )} + + )} +
-
-
+ - + {uploadFile.isUploading && uploadFile.isLoading && ( + + )} - )} - {rootStore.royalty.map((royalty, index) => ( -
-
-
- +
- {royalty.address} -
- -
+ {rootStore.cover && !uploadCover.isUploading && ( + {"cover"} + )} -
- -
+ )} +
+ +
-
-
-
-
- ))} + {!isCoverExpanded && ( + + + + + )} - {/*{rootStore.authors.map((author, index) => (*/} - {/* */} - {/* */} - {/* {author}*/} - {/* */} - {/* */} - {/*))}*/} + {isCoverExpanded && ( + + + + + )} + + + + )} + + {rootStore.royalty.map((royalty, index) => ( +
+
+
+ +
+ {royalty.address} +
+
+
+ +
+ +
+ {royalty.value.toString()} +
+
+
+
+
+ ))} + + {/*{rootStore.authors.map((author, index) => (*/} + {/* */} + {/* */} + {/* {author}*/} + {/* */} + {/* */} + {/*))}*/} + + + + +
+ + +
+ {formatTime(currentTime)} + {formatTime(duration)} +
+
+ + ); +};