feat: shuffle icon on AudioPlayer, New Home Screen
This commit is contained in:
@@ -1 +1 @@
|
|||||||
NEXT_PUBLIC_COMMIT_SHA=e43dbbf
|
NEXT_PUBLIC_COMMIT_SHA=e88d8b2
|
||||||
|
|||||||
39
.idx/dev.nix
Normal file
39
.idx/dev.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
# Which nixpkgs channel to use.
|
||||||
|
channel = "stable-23.11"; # or "unstable"
|
||||||
|
|
||||||
|
# Use https://search.nixos.org/packages to find packages
|
||||||
|
packages = [
|
||||||
|
pkgs.corepack
|
||||||
|
];
|
||||||
|
|
||||||
|
# Sets environment variables in the workspace
|
||||||
|
# env = {
|
||||||
|
# SOME_ENV_VAR = "hello";
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
|
||||||
|
# idx.extensions = [
|
||||||
|
# "angular.ng-template"
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# Enable previews and customize configuration
|
||||||
|
idx.previews = {
|
||||||
|
enable = true;
|
||||||
|
previews = {
|
||||||
|
web = {
|
||||||
|
command = [
|
||||||
|
"pnpm"
|
||||||
|
"run"
|
||||||
|
"dev"
|
||||||
|
"--port"
|
||||||
|
"$PORT"
|
||||||
|
];
|
||||||
|
manager = "web";
|
||||||
|
# Optionally, specify a directory that contains your web app
|
||||||
|
# cwd = "app/client";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"IDX.aI.enableInlineCompletion": true,
|
||||||
|
"IDX.aI.enableCodebaseIndexing": true
|
||||||
|
}
|
||||||
@@ -4,13 +4,13 @@ import Image from 'next/image';
|
|||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import { useAudioPlayer } from '@/app/components/AudioPlayerContext';
|
import { useAudioPlayer } from '@/app/components/AudioPlayerContext';
|
||||||
import { FullScreenPlayer } from '@/app/components/FullScreenPlayer';
|
import { FullScreenPlayer } from '@/app/components/FullScreenPlayer';
|
||||||
import { FaPlay, FaPause, FaVolumeHigh, FaForward, FaBackward, FaCompress, FaVolumeXmark, FaExpand } from "react-icons/fa6";
|
import { FaPlay, FaPause, FaVolumeHigh, FaForward, FaBackward, FaCompress, FaVolumeXmark, FaExpand, FaShuffle } from "react-icons/fa6";
|
||||||
import { Progress } from '@/components/ui/progress';
|
import { Progress } from '@/components/ui/progress';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { useLastFmScrobbler } from '@/hooks/use-lastfm-scrobbler';
|
import { useLastFmScrobbler } from '@/hooks/use-lastfm-scrobbler';
|
||||||
|
|
||||||
export const AudioPlayer: React.FC = () => {
|
export const AudioPlayer: React.FC = () => {
|
||||||
const { currentTrack, playPreviousTrack, addToQueue, playNextTrack, clearQueue, queue } = useAudioPlayer();
|
const { currentTrack, playPreviousTrack, addToQueue, playNextTrack, clearQueue, queue, toggleShuffle, shuffle } = useAudioPlayer();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const audioRef = useRef<HTMLAudioElement>(null);
|
const audioRef = useRef<HTMLAudioElement>(null);
|
||||||
const preloadAudioRef = useRef<HTMLAudioElement>(null);
|
const preloadAudioRef = useRef<HTMLAudioElement>(null);
|
||||||
@@ -377,8 +377,13 @@ export const AudioPlayer: React.FC = () => {
|
|||||||
<p className="font-semibold truncate text-sm">{currentTrack.name}</p>
|
<p className="font-semibold truncate text-sm">{currentTrack.name}</p>
|
||||||
<p className="text-xs text-muted-foreground truncate">{currentTrack.artist}</p>
|
<p className="text-xs text-muted-foreground truncate">{currentTrack.artist}</p>
|
||||||
</div>
|
</div>
|
||||||
|
{/* faviorte icon or smthing here */}
|
||||||
</div>
|
</div>
|
||||||
{/* Control buttons */}
|
{/* Control buttons */}
|
||||||
|
<button
|
||||||
|
onClick={toggleShuffle} className={`p-1.5 hover:bg-gray-700/50 rounded-full transition-colors ${ shuffle ? 'text-primary bg-primary/20' : '' }`} title={shuffle ? 'Shuffle On - Queue is shuffled' : 'Shuffle Off - Click to shuffle queue'}>
|
||||||
|
<FaShuffle className="w-3 h-3" />
|
||||||
|
</button>
|
||||||
<div className="flex items-center justify-center space-x-2">
|
<div className="flex items-center justify-center space-x-2">
|
||||||
<button className="p-1.5 hover:bg-gray-700/50 rounded-full transition-colors" onClick={playPreviousTrack}>
|
<button className="p-1.5 hover:bg-gray-700/50 rounded-full transition-colors" onClick={playPreviousTrack}>
|
||||||
<FaBackward className="w-3 h-3" />
|
<FaBackward className="w-3 h-3" />
|
||||||
|
|||||||
13
app/page.tsx
13
app/page.tsx
@@ -39,7 +39,18 @@ export default function MusicPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full px-4 py-6 lg:px-8 pb-24">
|
<div className="h-full px-4 py-6 lg:px-8 pb-24">
|
||||||
<h1 className="text-3xl font-bold mb-4">{greeting}{userName ? `, ${userName}` : ''}!</h1>
|
<div className="relative rounded-lg p-8">
|
||||||
|
<div className="relative rounded-sm p-10">
|
||||||
|
<div
|
||||||
|
className="absolute inset-0 bg-center bg-cover bg-no-repeat blur-xl bg-gradient-to-r from-primary to-secondary"
|
||||||
|
/>
|
||||||
|
<div className="relative z-10 flex items-center space-x-6">
|
||||||
|
<div className="flex-1">
|
||||||
|
<h1 className="text-3xl font-bold mb-4">{greeting}{userName ? `, ${userName}` : ''}!</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<>
|
<>
|
||||||
<Tabs defaultValue="music" className="h-full space-y-6">
|
<Tabs defaultValue="music" className="h-full space-y-6">
|
||||||
<TabsContent value="music" className="border-none p-0 outline-none">
|
<TabsContent value="music" className="border-none p-0 outline-none">
|
||||||
|
|||||||
Reference in New Issue
Block a user