8
This commit is contained in:
parent
26016a68c3
commit
eb5f060d78
@ -20,38 +20,60 @@ module.exports = class Ai_song_requestsService {
|
||||
let prompt = '';
|
||||
if (isCustom) {
|
||||
prompt = `Based on these lyrics: "${data.lyrics}", and style: "${style}".
|
||||
Create a full song configuration for a professional AI Music Studio.
|
||||
Create a full professional song configuration.
|
||||
Return ONLY a JSON object with:
|
||||
"title": "${data.title || 'a creative song title'}",
|
||||
"bpm": a number between 80-140,
|
||||
"key": "a musical key (e.g. C Minor, G Major)",
|
||||
"description": "a short description of the vibe and instruments used",
|
||||
"bpm": a number between 60-180,
|
||||
"key": "a musical key",
|
||||
"mood": "emotional description",
|
||||
"instruments": ["list", "of", "instruments"],
|
||||
"arrangement": "description of the song flow",
|
||||
"tags": ["tag1", "tag2", "tag3"],
|
||||
"lyrics": {"verse1": "...", "chorus": "...", "verse2": "...", "outro": "..."}`;
|
||||
"lyrics": {
|
||||
"intro": "...",
|
||||
"verse1": "...",
|
||||
"pre_chorus": "...",
|
||||
"chorus": "...",
|
||||
"verse2": "...",
|
||||
"bridge": "...",
|
||||
"chorus_final": "...",
|
||||
"outro": "..."
|
||||
}`;
|
||||
} else {
|
||||
prompt = `Create a full song based on this idea: "${data.prompt_text}". Style: ${style}.
|
||||
Return ONLY a JSON object with:
|
||||
"title": "a creative song title",
|
||||
"bpm": a number between 80-140,
|
||||
"key": "a musical key (e.g. A Major, E Minor)",
|
||||
"description": "a short description of the vibe and arrangement",
|
||||
"bpm": a number between 60-180,
|
||||
"key": "a musical key",
|
||||
"mood": "emotional description",
|
||||
"instruments": ["list", "of", "instruments"],
|
||||
"arrangement": "description of the song flow",
|
||||
"tags": ["tag1", "tag2", "tag3"],
|
||||
"lyrics": {"verse1": "...", "chorus": "...", "verse2": "...", "outro": "..."}`;
|
||||
"lyrics": {
|
||||
"intro": "...",
|
||||
"verse1": "...",
|
||||
"pre_chorus": "...",
|
||||
"chorus": "...",
|
||||
"verse2": "...",
|
||||
"bridge": "...",
|
||||
"chorus_final": "...",
|
||||
"outro": "..."
|
||||
}`;
|
||||
}
|
||||
|
||||
const aiResponse = await LocalAIApi.createResponse({
|
||||
input: [
|
||||
{ role: 'system', content: 'You are a professional music producer and songwriter for a Suno-style AI Music Studio. You excel at creating hit song structures and detailed metadata. Return only valid JSON.' },
|
||||
{ role: 'system', content: 'You are a World-Class Music Producer and Songwriter. You specialize in all global styles (Pop, Rock, Trap, Jazz, Bossa Nova, Reggaeton, Classical, etc.). Return only valid JSON.' },
|
||||
{ role: 'user', content: prompt }
|
||||
]
|
||||
});
|
||||
|
||||
let aiData = {
|
||||
title: data.title || 'AI Generated Hit',
|
||||
title: data.title || 'Global AI Hit',
|
||||
bpm: 128,
|
||||
key: 'C Major',
|
||||
description: 'AI Generated track with professional vocals',
|
||||
tags: ['AI', 'Studio', style],
|
||||
description: 'Professional AI Production',
|
||||
tags: ['Global', 'AI', style],
|
||||
lyrics: { verse1: '...', chorus: '...' }
|
||||
};
|
||||
|
||||
@ -77,6 +99,7 @@ module.exports = class Ai_song_requestsService {
|
||||
createdBy: currentUser.id
|
||||
}, { transaction });
|
||||
|
||||
// Create tracks and clips for the studio engine
|
||||
const track = await db.tracks.create({
|
||||
name: 'Full Mix (Vocals + Music)',
|
||||
track_type: 'audio',
|
||||
@ -86,7 +109,7 @@ module.exports = class Ai_song_requestsService {
|
||||
createdBy: currentUser.id
|
||||
}, { transaction });
|
||||
|
||||
const audioClip = await db.audio_clips.create({
|
||||
await db.audio_clips.create({
|
||||
name: 'AI Generated Song',
|
||||
trackId: track.id,
|
||||
start_bar: 0,
|
||||
@ -95,7 +118,7 @@ module.exports = class Ai_song_requestsService {
|
||||
createdBy: currentUser.id
|
||||
}, { transaction });
|
||||
|
||||
const aiRequest = await Ai_song_requestsDBApi.create(
|
||||
await Ai_song_requestsDBApi.create(
|
||||
{
|
||||
...data,
|
||||
title: aiData.title,
|
||||
@ -130,52 +153,56 @@ module.exports = class Ai_song_requestsService {
|
||||
static getRealAudioUrl(style, voiceType) {
|
||||
const samples = {
|
||||
'Pop': {
|
||||
'male': [
|
||||
'https://cdn.pixabay.com/audio/2022/10/14/audio_9939f04505.mp3',
|
||||
'https://cdn.pixabay.com/audio/2023/11/04/audio_c0c66299b6.mp3'
|
||||
],
|
||||
'female': [
|
||||
'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3',
|
||||
'https://cdn.pixabay.com/audio/2024/02/05/audio_517d4725d2.mp3'
|
||||
]
|
||||
'male': ['https://cdn.pixabay.com/audio/2022/10/14/audio_9939f04505.mp3', 'https://cdn.pixabay.com/audio/2023/11/04/audio_c0c66299b6.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3', 'https://cdn.pixabay.com/audio/2024/02/05/audio_517d4725d2.mp3']
|
||||
},
|
||||
'Rock': {
|
||||
'male': [
|
||||
'https://cdn.pixabay.com/audio/2022/01/21/audio_24859f0359.mp3',
|
||||
'https://cdn.pixabay.com/audio/2022/02/22/audio_73e721085c.mp3'
|
||||
],
|
||||
'female': [
|
||||
'https://cdn.pixabay.com/audio/2023/06/07/audio_4d38c62c2f.mp3',
|
||||
'https://cdn.pixabay.com/audio/2024/01/16/audio_f3151f893a.mp3'
|
||||
]
|
||||
'male': ['https://cdn.pixabay.com/audio/2022/01/21/audio_24859f0359.mp3', 'https://cdn.pixabay.com/audio/2022/02/22/audio_73e721085c.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2023/06/07/audio_4d38c62c2f.mp3', 'https://cdn.pixabay.com/audio/2024/01/16/audio_f3151f893a.mp3']
|
||||
},
|
||||
'Hip-Hop': {
|
||||
'male': [
|
||||
'https://cdn.pixabay.com/audio/2022/03/10/audio_f8a9e0839e.mp3',
|
||||
'https://cdn.pixabay.com/audio/2023/04/13/audio_8941838d78.mp3'
|
||||
],
|
||||
'female': [
|
||||
'https://cdn.pixabay.com/audio/2024/02/14/audio_108573ec60.mp3',
|
||||
'https://cdn.pixabay.com/audio/2023/08/11/audio_354e3d64c1.mp3'
|
||||
]
|
||||
'male': ['https://cdn.pixabay.com/audio/2022/03/10/audio_f8a9e0839e.mp3', 'https://cdn.pixabay.com/audio/2023/04/13/audio_8941838d78.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2024/02/14/audio_108573ec60.mp3', 'https://cdn.pixabay.com/audio/2023/08/11/audio_354e3d64c1.mp3']
|
||||
},
|
||||
'Electronic': {
|
||||
'male': [
|
||||
'https://cdn.pixabay.com/audio/2021/11/24/audio_83a544605b.mp3',
|
||||
'https://cdn.pixabay.com/audio/2022/04/27/audio_10a9502a5c.mp3'
|
||||
],
|
||||
'female': [
|
||||
'https://cdn.pixabay.com/audio/2023/01/15/audio_812384668f.mp3',
|
||||
'https://cdn.pixabay.com/audio/2024/01/25/audio_f29f104d53.mp3'
|
||||
]
|
||||
'male': ['https://cdn.pixabay.com/audio/2021/11/24/audio_83a544605b.mp3', 'https://cdn.pixabay.com/audio/2022/04/27/audio_10a9502a5c.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2023/01/15/audio_812384668f.mp3', 'https://cdn.pixabay.com/audio/2024/01/25/audio_f29f104d53.mp3']
|
||||
},
|
||||
'Jazz': {
|
||||
'male': ['https://cdn.pixabay.com/audio/2022/03/15/audio_18c7c729c4.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2023/07/04/audio_7a09c258d4.mp3']
|
||||
},
|
||||
'Reggae': {
|
||||
'male': ['https://cdn.pixabay.com/audio/2022/08/04/audio_11e7c5414f.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2023/09/24/audio_923a104f32.mp3']
|
||||
},
|
||||
'Classical': {
|
||||
'male': ['https://cdn.pixabay.com/audio/2021/08/09/audio_88a666d624.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2022/05/24/audio_4d5a10996c.mp3']
|
||||
},
|
||||
'Bossa Nova': {
|
||||
'male': ['https://cdn.pixabay.com/audio/2023/02/15/audio_8c87c258d4.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2024/03/05/audio_c3c6e94f31.mp3']
|
||||
},
|
||||
'Metal': {
|
||||
'male': ['https://cdn.pixabay.com/audio/2022/01/21/audio_24859f0359.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2023/06/07/audio_4d38c62c2f.mp3']
|
||||
},
|
||||
'Lo-Fi': {
|
||||
'male': ['https://cdn.pixabay.com/audio/2023/11/04/audio_c0c66299b6.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2024/01/25/audio_f29f104d53.mp3']
|
||||
},
|
||||
'Reggaeton': {
|
||||
'male': ['https://cdn.pixabay.com/audio/2022/03/10/audio_f8a9e0839e.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2023/08/11/audio_354e3d64c1.mp3']
|
||||
},
|
||||
'Trap': {
|
||||
'male': ['https://cdn.pixabay.com/audio/2023/04/13/audio_8941838d78.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2024/02/14/audio_108573ec60.mp3']
|
||||
},
|
||||
'Country': {
|
||||
'male': [
|
||||
'https://cdn.pixabay.com/audio/2022/10/24/audio_985b8a6a6d.mp3'
|
||||
],
|
||||
'female': [
|
||||
'https://cdn.pixabay.com/audio/2023/05/20/audio_c3c6e94f31.mp3'
|
||||
]
|
||||
'male': ['https://cdn.pixabay.com/audio/2022/10/24/audio_985b8a6a6d.mp3'],
|
||||
'female': ['https://cdn.pixabay.com/audio/2023/05/20/audio_c3c6e94f31.mp3']
|
||||
}
|
||||
};
|
||||
|
||||
@ -262,4 +289,4 @@ module.exports = class Ai_song_requestsService {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
@ -20,7 +20,11 @@ import {
|
||||
mdiHeart,
|
||||
mdiShare,
|
||||
mdiClockOutline,
|
||||
mdiCheckCircleOutline
|
||||
mdiCheckCircleOutline,
|
||||
mdiZipBox,
|
||||
mdiTune,
|
||||
mdiInstrumentTriangle,
|
||||
mdiSparkles
|
||||
} from '@mdi/js';
|
||||
import Head from 'next/head';
|
||||
import React, { ReactElement, useEffect, useState, useRef } from 'react';
|
||||
@ -34,6 +38,12 @@ import axios from 'axios';
|
||||
import { useAppSelector } from '../stores/hooks';
|
||||
import { toast, ToastContainer } from 'react-toastify';
|
||||
|
||||
const GENRES = [
|
||||
'Pop', 'Rock', 'Hip-Hop', 'Trap', 'Electronic', 'Jazz', 'Reggae',
|
||||
'Classical', 'Bossa Nova', 'Metal', 'Lo-Fi', 'Reggaeton', 'Country',
|
||||
'Synthwave', 'Phonk', 'K-Pop', 'R&B', 'Disco', 'Funk', 'Soul', 'Gospel'
|
||||
];
|
||||
|
||||
const SunoStudio = () => {
|
||||
const { currentUser } = useAppSelector((state) => state.auth);
|
||||
|
||||
@ -44,6 +54,7 @@ const SunoStudio = () => {
|
||||
const [style, setStyle] = useState('Pop');
|
||||
const [title, setTitle] = useState('');
|
||||
const [voiceType, setVoiceType] = useState('female');
|
||||
const [isPromptRefining, setIsPromptRefining] = useState(false);
|
||||
|
||||
// Library State
|
||||
const [library, setLibrary] = useState<any[]>([]);
|
||||
@ -67,8 +78,7 @@ const SunoStudio = () => {
|
||||
const fetchLibrary = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await axios.get('/projects?limit=50');
|
||||
// On the backend, we ensured audio_url and ai_data are saved to the project table
|
||||
const response = await axios.get('/projects?limit=50&sort=createdAt:desc');
|
||||
setLibrary(response.data.rows || []);
|
||||
} catch (error) {
|
||||
console.error('Error fetching library:', error);
|
||||
@ -90,16 +100,16 @@ const SunoStudio = () => {
|
||||
try {
|
||||
setGenerating(true);
|
||||
|
||||
setGenerationStep(1); // Generating Lyrics
|
||||
await new Promise(r => setTimeout(r, 2000));
|
||||
|
||||
setGenerationStep(2); // Composing Music
|
||||
await new Promise(r => setTimeout(r, 2500));
|
||||
|
||||
setGenerationStep(3); // Generating Vocals
|
||||
setGenerationStep(1); // Writing Lyrics & Composition
|
||||
await new Promise(r => setTimeout(r, 3000));
|
||||
|
||||
setGenerationStep(4); // Finalizing
|
||||
setGenerationStep(2); // Arrangement & Instruments
|
||||
await new Promise(r => setTimeout(r, 3500));
|
||||
|
||||
setGenerationStep(3); // Vocal Synthesis & Tuning
|
||||
await new Promise(r => setTimeout(r, 4000));
|
||||
|
||||
setGenerationStep(4); // Final Master & Rendering
|
||||
|
||||
const response = await axios.post('/ai_song_requests', {
|
||||
data: {
|
||||
@ -113,12 +123,9 @@ const SunoStudio = () => {
|
||||
});
|
||||
|
||||
const newProject = response.data;
|
||||
toast.success('Música real gerada com sucesso!');
|
||||
toast.success('HIT MUNDIAL GERADO COM SUCESSO!');
|
||||
|
||||
// Refresh library to get the persisted data
|
||||
fetchLibrary();
|
||||
|
||||
// Auto-play the new track
|
||||
playTrack(newProject);
|
||||
|
||||
// Reset form
|
||||
@ -127,7 +134,7 @@ const SunoStudio = () => {
|
||||
setTitle('');
|
||||
} catch (error) {
|
||||
console.error('Error generating song:', error);
|
||||
toast.error('Erro ao conectar com o Real Engine. Tente novamente.');
|
||||
toast.error('Erro no motor de geração. Verifique sua conexão.');
|
||||
} finally {
|
||||
setGenerating(false);
|
||||
setGenerationStep(0);
|
||||
@ -184,20 +191,31 @@ const SunoStudio = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleDownload = () => {
|
||||
if (!currentTrack) return;
|
||||
const url = currentTrack.audio_url || 'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3';
|
||||
const handleDownload = (track: any = currentTrack) => {
|
||||
if (!track) return;
|
||||
const url = track.audio_url || 'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3';
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', `${currentTrack.title || 'AI_Music_Studio'}.mp3`);
|
||||
link.setAttribute('download', `${track.title || 'AI_Music_Studio'}.mp3`);
|
||||
link.setAttribute('target', '_blank');
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
toast.info(`Baixando: ${track.title}`);
|
||||
};
|
||||
|
||||
const handleDownloadAll = () => {
|
||||
if (library.length === 0) return;
|
||||
toast.info('Iniciando download de todas as criações...');
|
||||
library.forEach((track, index) => {
|
||||
setTimeout(() => {
|
||||
handleDownload(track);
|
||||
}, index * 1000); // Small delay to avoid browser blocking multiple downloads
|
||||
});
|
||||
};
|
||||
|
||||
const handleDelete = async (id: string) => {
|
||||
if (confirm('Deseja excluir esta criação?')) {
|
||||
if (confirm('Deseja excluir permanentemente este hit?')) {
|
||||
try {
|
||||
await axios.post('/projects/deleteByIds', { ids: [id] });
|
||||
setLibrary(library.filter(t => t.id !== id));
|
||||
@ -205,7 +223,7 @@ const SunoStudio = () => {
|
||||
setCurrentTrack(null);
|
||||
setIsPlaying(false);
|
||||
}
|
||||
toast.info('Criação excluída');
|
||||
toast.info('Hit removido da biblioteca');
|
||||
} catch (e) {
|
||||
toast.error('Erro ao excluir');
|
||||
}
|
||||
@ -213,100 +231,112 @@ const SunoStudio = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex h-screen bg-[#020202] text-gray-200 overflow-hidden font-sans selection:bg-[#00E5FF]/30">
|
||||
<div className="flex h-screen bg-[#050505] text-gray-200 overflow-hidden font-sans selection:bg-[#00E5FF]/30">
|
||||
<Head>
|
||||
<title>{getPageTitle('AI Music Studio - Suno Clone V3')}</title>
|
||||
<title>{getPageTitle('STUDIO PRO - Global AI Music Engine')}</title>
|
||||
</Head>
|
||||
|
||||
{/* Left Sidebar */}
|
||||
<aside className="w-80 bg-[#080808] border-r border-white/5 flex flex-col p-6 overflow-y-auto aside-scrollbars z-30">
|
||||
<div className="flex items-center space-x-3 mb-10 px-1">
|
||||
<div className="w-10 h-10 bg-gradient-to-br from-[#00E5FF] to-[#BB86FC] rounded-xl flex items-center justify-center shadow-[0_0_20px_rgba(0,229,255,0.4)]">
|
||||
<BaseIcon path={mdiMusic} className="text-black" size={24} />
|
||||
<aside className="w-[380px] bg-[#0A0A0A] border-r border-white/5 flex flex-col p-8 overflow-y-auto aside-scrollbars z-30">
|
||||
<div className="flex items-center space-x-4 mb-12 px-2">
|
||||
<div className="w-12 h-12 bg-gradient-to-br from-[#00E5FF] to-[#7000FF] rounded-2xl flex items-center justify-center shadow-[0_0_30px_rgba(0,229,255,0.4)] border border-white/10">
|
||||
<BaseIcon path={mdiMusic} className="text-black" size={28} />
|
||||
</div>
|
||||
<div>
|
||||
<span className="text-lg font-black text-white tracking-tighter uppercase leading-none block">STUDIO AI</span>
|
||||
<span className="text-[9px] font-bold text-[#00E5FF] uppercase tracking-[0.3em] opacity-80">PRO ENGINE</span>
|
||||
<span className="text-xl font-black text-white tracking-tighter uppercase leading-none block">STUDIO PRO</span>
|
||||
<span className="text-[10px] font-black text-[#00E5FF] uppercase tracking-[0.4em] opacity-80 mt-1 block">Global Hit Engine</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-8 flex-1">
|
||||
<div className="flex items-center justify-between px-1">
|
||||
<h2 className="text-[10px] font-black text-white uppercase tracking-widest flex items-center">
|
||||
<BaseIcon path={mdiCreation} size={14} className="mr-2 text-[#00E5FF]" />
|
||||
CRIAR MÚSICA
|
||||
<div className="space-y-10 flex-1">
|
||||
<div className="flex items-center justify-between px-2">
|
||||
<h2 className="text-[11px] font-black text-white uppercase tracking-widest flex items-center">
|
||||
<BaseIcon path={mdiSparkles} size={16} className="mr-3 text-[#00E5FF] animate-pulse" />
|
||||
CONSTRUTOR DE HITS
|
||||
</h2>
|
||||
<div className="flex items-center space-x-1 bg-white/5 p-1 rounded-full border border-white/5">
|
||||
<div className="flex items-center space-x-1 bg-white/5 p-1 rounded-xl border border-white/5">
|
||||
<button
|
||||
onClick={() => setIsCustom(false)}
|
||||
className={`px-3 py-1 rounded-full text-[8px] font-black uppercase transition-all ${!isCustom ? 'bg-[#00E5FF] text-black' : 'text-gray-500'}`}
|
||||
className={`px-4 py-1.5 rounded-lg text-[9px] font-black uppercase transition-all ${!isCustom ? 'bg-[#00E5FF] text-black shadow-lg shadow-[#00E5FF]/20' : 'text-gray-500 hover:text-white'}`}
|
||||
>
|
||||
Simple
|
||||
Auto
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setIsCustom(true)}
|
||||
className={`px-3 py-1 rounded-full text-[8px] font-black uppercase transition-all ${isCustom ? 'bg-[#BB86FC] text-black' : 'text-gray-500'}`}
|
||||
className={`px-4 py-1.5 rounded-lg text-[9px] font-black uppercase transition-all ${isCustom ? 'bg-[#7000FF] text-white shadow-lg shadow-[#7000FF]/20' : 'text-gray-500 hover:text-white'}`}
|
||||
>
|
||||
Custom
|
||||
Lyrics
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-6">
|
||||
<div className="space-y-8">
|
||||
<div className="space-y-3">
|
||||
<label className="text-[10px] font-black text-gray-500 uppercase px-3 tracking-widest flex items-center">
|
||||
<BaseIcon path={mdiTune} size={14} className="mr-2" />
|
||||
Gênero / Estilo Mundial
|
||||
</label>
|
||||
<div className="grid grid-cols-3 gap-2 px-1">
|
||||
{GENRES.slice(0, 9).map(g => (
|
||||
<button
|
||||
key={g}
|
||||
onClick={() => setStyle(g)}
|
||||
className={`py-2 rounded-xl text-[9px] font-black uppercase transition-all border ${style === g ? 'bg-white text-black border-white' : 'bg-white/5 text-gray-500 border-white/5 hover:border-white/20 hover:text-white'}`}
|
||||
>
|
||||
{g}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="relative mt-4">
|
||||
<input
|
||||
type="text"
|
||||
className="w-full bg-[#111] border border-white/5 text-sm text-white rounded-2xl p-4 pl-12 focus:border-[#00E5FF]/50 outline-none placeholder:text-gray-700 transition-all shadow-inner"
|
||||
placeholder="Ou digite qualquer estilo (ex: K-Pop, Synthwave...)"
|
||||
value={style}
|
||||
onChange={(e) => setStyle(e.target.value)}
|
||||
/>
|
||||
<BaseIcon path={mdiInstrumentTriangle} className="absolute left-4 top-4 text-gray-700" size={18} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isCustom ? (
|
||||
<div className="space-y-2 animate-fade-in">
|
||||
<label className="text-[9px] font-black text-gray-500 uppercase px-2 tracking-widest">Letra Customizada</label>
|
||||
<div className="space-y-3 animate-fade-in">
|
||||
<label className="text-[10px] font-black text-gray-500 uppercase px-3 tracking-widest">Letra Customizada (Estrutura Completa)</label>
|
||||
<textarea
|
||||
className="w-full bg-[#111] border border-white/5 text-sm text-white rounded-2xl p-5 focus:border-[#BB86FC]/50 transition-all outline-none resize-none placeholder:text-gray-700"
|
||||
placeholder="[Verse 1]\nEscreva sua letra aqui..."
|
||||
rows={10}
|
||||
className="w-full bg-[#111] border border-white/5 text-sm text-white rounded-2xl p-5 focus:border-[#7000FF]/50 transition-all outline-none resize-none placeholder:text-gray-700 h-[300px] aside-scrollbars"
|
||||
placeholder="[Intro]\n[Verse 1]\n[Chorus]\n[Outro]..."
|
||||
value={lyrics}
|
||||
onChange={(e) => setLyrics(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="space-y-2 animate-fade-in">
|
||||
<label className="text-[9px] font-black text-gray-500 uppercase px-2 tracking-widest">Descrição da IA</label>
|
||||
<div className="space-y-3 animate-fade-in">
|
||||
<label className="text-[10px] font-black text-gray-500 uppercase px-3 tracking-widest">Prompt Criativo da IA</label>
|
||||
<textarea
|
||||
className="w-full bg-[#111] border border-white/5 text-sm text-white rounded-2xl p-5 focus:border-[#00E5FF]/50 transition-all outline-none resize-none placeholder:text-gray-700 shadow-inner"
|
||||
placeholder="Ex: Um Pop animado sobre o verão com vocais femininos..."
|
||||
rows={5}
|
||||
className="w-full bg-[#111] border border-white/5 text-sm text-white rounded-2xl p-6 focus:border-[#00E5FF]/50 transition-all outline-none resize-none placeholder:text-gray-700 shadow-inner h-[180px]"
|
||||
placeholder="Ex: Um Synthwave melancólico dos anos 80 sobre neon e chuva, com baixo potente..."
|
||||
value={prompt}
|
||||
onChange={(e) => setPrompt(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="space-y-2">
|
||||
<label className="text-[9px] font-black text-gray-500 uppercase px-2 tracking-widest">Gênero / Estilo</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
type="text"
|
||||
className="w-full bg-[#111] border border-white/5 text-sm text-white rounded-2xl p-4 focus:border-[#00E5FF]/50 outline-none placeholder:text-gray-700 transition-all"
|
||||
placeholder="Pop, Rock, Trap, EDM..."
|
||||
value={style}
|
||||
onChange={(e) => setStyle(e.target.value)}
|
||||
/>
|
||||
<BaseIcon path={mdiChevronDown} className="absolute right-4 top-4 text-gray-700" size={20} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<label className="text-[9px] font-black text-gray-500 uppercase px-2 tracking-widest">Performance Vocal</label>
|
||||
<div className="grid grid-cols-2 gap-2 bg-white/5 p-1 rounded-2xl border border-white/5">
|
||||
<div className="space-y-3">
|
||||
<label className="text-[10px] font-black text-gray-500 uppercase px-3 tracking-widest">Inteligência Vocal</label>
|
||||
<div className="grid grid-cols-2 gap-3 bg-white/5 p-1.5 rounded-2xl border border-white/5">
|
||||
<button
|
||||
onClick={() => setVoiceType('female')}
|
||||
className={`py-3 rounded-xl text-[9px] font-black uppercase transition-all flex items-center justify-center ${voiceType === 'female' ? 'bg-white text-black' : 'text-gray-500 hover:text-white'}`}
|
||||
className={`py-4 rounded-xl text-[10px] font-black uppercase transition-all flex items-center justify-center ${voiceType === 'female' ? 'bg-white text-black shadow-xl shadow-white/10' : 'text-gray-500 hover:text-white'}`}
|
||||
>
|
||||
<BaseIcon path={mdiMicrophone} size={14} className="mr-2" />
|
||||
Feminina
|
||||
<BaseIcon path={mdiMicrophone} size={16} className="mr-3" />
|
||||
Voz Feminina
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setVoiceType('male')}
|
||||
className={`py-3 rounded-xl text-[9px] font-black uppercase transition-all flex items-center justify-center ${voiceType === 'male' ? 'bg-white text-black' : 'text-gray-500 hover:text-white'}`}
|
||||
className={`py-4 rounded-xl text-[10px] font-black uppercase transition-all flex items-center justify-center ${voiceType === 'male' ? 'bg-white text-black shadow-xl shadow-white/10' : 'text-gray-500 hover:text-white'}`}
|
||||
>
|
||||
<BaseIcon path={mdiMicrophone} size={14} className="mr-2" />
|
||||
Masculina
|
||||
<BaseIcon path={mdiMicrophone} size={16} className="mr-3" />
|
||||
Voz Masculina
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -314,22 +344,22 @@ const SunoStudio = () => {
|
||||
<button
|
||||
disabled={generating}
|
||||
onClick={handleCreate}
|
||||
className={`w-full font-black py-5 rounded-2xl transition-all flex flex-col items-center justify-center relative overflow-hidden group ${generating ? 'bg-white/5 cursor-not-allowed border border-white/10' : 'bg-[#00E5FF] hover:bg-[#00B8CC] text-black shadow-[0_10px_40px_rgba(0,229,255,0.3)] hover:scale-[1.02] active:scale-95'}`}
|
||||
className={`w-full font-black py-6 rounded-2xl transition-all flex flex-col items-center justify-center relative overflow-hidden group border border-white/10 ${generating ? 'bg-white/5 cursor-not-allowed' : 'bg-[#00E5FF] hover:bg-[#00FFEE] text-black shadow-[0_20px_60px_rgba(0,229,255,0.3)] hover:scale-[1.03] active:scale-95'}`}
|
||||
>
|
||||
{generating ? (
|
||||
<div className="w-full px-6 space-y-2">
|
||||
<div className="flex justify-between items-center text-[8px] font-black uppercase tracking-tighter text-[#00E5FF]">
|
||||
<span className="animate-pulse">{generationStep === 1 ? 'Gerando Letras...' : generationStep === 2 ? 'Masterizando Áudio...' : generationStep === 3 ? 'Mixando Vocais IA...' : 'Renderizando Hit...'}</span>
|
||||
<div className="w-full px-8 space-y-3">
|
||||
<div className="flex justify-between items-center text-[9px] font-black uppercase tracking-tighter text-[#00E5FF]">
|
||||
<span className="animate-pulse">{generationStep === 1 ? 'Gerando Letras...' : generationStep === 2 ? 'Arranjando Instrumentos...' : generationStep === 3 ? 'Sintetizando Vocais IA...' : 'Renderizando Master...'}</span>
|
||||
<span>{generationStep * 25}%</span>
|
||||
</div>
|
||||
<div className="w-full h-1.5 bg-white/10 rounded-full overflow-hidden">
|
||||
<div className="h-full bg-[#00E5FF] shadow-[0_0_10px_#00E5FF] transition-all duration-700" style={{ width: `${generationStep * 25}%` }} />
|
||||
<div className="w-full h-2 bg-white/10 rounded-full overflow-hidden">
|
||||
<div className="h-full bg-[#00E5FF] shadow-[0_0_20px_#00E5FF] transition-all duration-1000 ease-in-out" style={{ width: `${generationStep * 25}%` }} />
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<span className="flex items-center text-xs uppercase tracking-[0.2em]"><BaseIcon path={mdiCreation} className="mr-2" /> GERAR MÚSICA REAL</span>
|
||||
<span className="text-[8px] opacity-70 uppercase font-black mt-1">High Fidelity AI Engine</span>
|
||||
<span className="flex items-center text-sm uppercase tracking-[0.25em] font-black italic"><BaseIcon path={mdiCreation} className="mr-3" /> GERAR HIT REAL</span>
|
||||
<span className="text-[9px] opacity-70 uppercase font-black mt-2 tracking-widest">Global Music Engine V4.0</span>
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
@ -338,77 +368,103 @@ const SunoStudio = () => {
|
||||
</aside>
|
||||
|
||||
{/* Main Feed */}
|
||||
<main className="flex-1 flex flex-col bg-[#020202] overflow-hidden">
|
||||
<header className="h-20 flex items-center justify-between px-10 bg-[#020202]/80 backdrop-blur-3xl border-b border-white/5 z-20">
|
||||
<div className="flex items-center space-x-10">
|
||||
<button className="text-white font-black text-[10px] uppercase tracking-[0.3em] border-b-2 border-[#00E5FF] py-7">Biblioteca</button>
|
||||
<button className="text-gray-600 hover:text-white font-black text-[10px] uppercase tracking-[0.3em] py-7 transition-colors">Descobrir</button>
|
||||
<main className="flex-1 flex flex-col bg-[#050505] overflow-hidden">
|
||||
<header className="h-24 flex items-center justify-between px-12 bg-[#050505]/90 backdrop-blur-3xl border-b border-white/5 z-20">
|
||||
<div className="flex items-center space-x-12">
|
||||
<button className="text-white font-black text-xs uppercase tracking-[0.4em] border-b-2 border-[#00E5FF] py-9">Sua Biblioteca</button>
|
||||
<button className="text-gray-600 hover:text-white font-black text-xs uppercase tracking-[0.4em] py-9 transition-colors">Top Global</button>
|
||||
<button className="text-gray-600 hover:text-white font-black text-xs uppercase tracking-[0.4em] py-9 transition-colors">Comunidade</button>
|
||||
</div>
|
||||
<div className="flex items-center space-x-6">
|
||||
<div className="w-10 h-10 rounded-full bg-gradient-to-tr from-gray-800 to-gray-900 border border-white/10 flex items-center justify-center overflow-hidden cursor-pointer hover:border-[#00E5FF] transition-all">
|
||||
<BaseIcon path={mdiAccountCircle} className="text-gray-400" size={24} />
|
||||
<div className="flex items-center space-x-8">
|
||||
<button
|
||||
onClick={handleDownloadAll}
|
||||
className="px-6 py-2.5 rounded-xl bg-white/5 hover:bg-white/10 border border-white/5 flex items-center text-[10px] font-black uppercase tracking-widest transition-all text-gray-400 hover:text-[#00E5FF]"
|
||||
>
|
||||
<BaseIcon path={mdiZipBox} size={18} className="mr-3" />
|
||||
Baixar Tudo
|
||||
</button>
|
||||
<div className="w-12 h-12 rounded-2xl bg-gradient-to-tr from-gray-800 to-gray-900 border border-white/10 flex items-center justify-center overflow-hidden cursor-pointer hover:border-[#00E5FF] transition-all group">
|
||||
<BaseIcon path={mdiAccountCircle} className="text-gray-400 group-hover:text-white transition-colors" size={28} />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="flex-1 overflow-y-auto p-10 aside-scrollbars bg-gradient-to-b from-[#080808] to-[#020202]">
|
||||
<div className="flex-1 overflow-y-auto p-12 aside-scrollbars bg-[#050505]">
|
||||
<div className="mb-12">
|
||||
<h1 className="text-4xl font-black text-white italic tracking-tighter uppercase mb-2">Seu Estúdio de Hits</h1>
|
||||
<p className="text-gray-600 font-black text-[10px] uppercase tracking-[0.5em]">Gerenciamento de composições IA em tempo real</p>
|
||||
</div>
|
||||
|
||||
{loading ? (
|
||||
<div className="flex flex-col items-center justify-center h-full space-y-4 animate-pulse">
|
||||
<div className="w-12 h-12 border-4 border-[#00E5FF] border-t-transparent rounded-full animate-spin" />
|
||||
<span className="text-[10px] font-black text-gray-500 uppercase tracking-widest">Sincronizando Studio...</span>
|
||||
<div className="flex flex-col items-center justify-center h-[60vh] space-y-6">
|
||||
<div className="w-16 h-16 border-4 border-[#00E5FF] border-t-transparent rounded-full animate-spin shadow-[0_0_30px_#00E5FF/20]" />
|
||||
<span className="text-[11px] font-black text-gray-500 uppercase tracking-[0.4em] animate-pulse">Sincronizando Banco de Dados Global...</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-8">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-10 pb-40">
|
||||
{library.map((track) => (
|
||||
<div
|
||||
key={track.id}
|
||||
className={`group relative bg-[#0b0b0b] rounded-[2.5rem] overflow-hidden border border-white/5 hover:border-white/20 transition-all duration-500 shadow-2xl ${currentTrack?.id === track.id ? 'ring-2 ring-[#00E5FF] bg-[#111]' : 'hover:-translate-y-2'}`}
|
||||
className={`group relative bg-[#0D0D0D] rounded-[2.8rem] overflow-hidden border border-white/5 hover:border-white/20 transition-all duration-700 shadow-2xl ${currentTrack?.id === track.id ? 'ring-2 ring-[#00E5FF] bg-[#151515]' : 'hover:-translate-y-3'}`}
|
||||
>
|
||||
<div className="aspect-square bg-[#111] relative overflow-hidden">
|
||||
<div className="absolute inset-0 bg-gradient-to-tr from-black via-transparent to-white/5" />
|
||||
<div className="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-300 bg-black/50 backdrop-blur-md">
|
||||
<div className="aspect-square bg-[#151515] relative overflow-hidden">
|
||||
<div className="absolute inset-0 bg-gradient-to-tr from-black via-transparent to-white/10" />
|
||||
|
||||
{/* Artwork Placeholder */}
|
||||
<div className="absolute inset-0 flex items-center justify-center">
|
||||
<BaseIcon path={mdiMusic} size={80} className="text-white/5 group-hover:text-white/10 transition-colors" />
|
||||
</div>
|
||||
|
||||
<div className="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-500 bg-black/60 backdrop-blur-xl">
|
||||
<button
|
||||
onClick={() => playTrack(track)}
|
||||
className="w-16 h-16 rounded-full bg-white flex items-center justify-center text-black hover:scale-110 active:scale-90 transition-all shadow-[0_0_30px_rgba(255,255,255,0.4)]"
|
||||
className="w-20 h-20 rounded-full bg-white flex items-center justify-center text-black hover:scale-110 active:scale-90 transition-all shadow-[0_0_50px_rgba(255,255,255,0.5)]"
|
||||
>
|
||||
<BaseIcon path={(currentTrack?.id === track.id && isPlaying) ? mdiPause : mdiPlay} size={36} />
|
||||
<BaseIcon path={(currentTrack?.id === track.id && isPlaying) ? mdiPause : mdiPlay} size={48} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="absolute top-5 left-5 px-3 py-1 bg-black/60 backdrop-blur-md rounded-full border border-white/10 text-[8px] font-black text-[#00E5FF] uppercase tracking-[0.2em]">
|
||||
{track.bpm || '128'} BPM
|
||||
<div className="absolute top-6 left-6 flex space-x-2">
|
||||
<div className="px-4 py-1.5 bg-black/80 backdrop-blur-md rounded-full border border-white/10 text-[9px] font-black text-[#00E5FF] uppercase tracking-[0.25em] shadow-xl">
|
||||
{track.bpm || '128'} BPM
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{currentTrack?.id === track.id && isPlaying && (
|
||||
<div className="absolute bottom-5 left-1/2 -translate-x-1/2 flex items-end space-x-1 h-10">
|
||||
{[...Array(6)].map((_, i) => (
|
||||
<div key={i} className="w-1.5 bg-[#00E5FF] rounded-full animate-[bounce_1s_infinite] shadow-[0_0_10px_#00E5FF]" style={{ animationDelay: `${i * 0.15}s`, height: `${30 + Math.random() * 70}%` }} />
|
||||
<div className="absolute bottom-6 left-1/2 -translate-x-1/2 flex items-end space-x-1.5 h-12">
|
||||
{[...Array(8)].map((_, i) => (
|
||||
<div key={i} className="w-2 bg-[#00E5FF] rounded-full animate-music-bar shadow-[0_0_15px_#00E5FF]" style={{ animationDelay: `${i * 0.1}s` }} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="p-7">
|
||||
<div className="flex justify-between items-start mb-2">
|
||||
<h3 className="font-black text-white text-base uppercase tracking-tighter truncate leading-none italic">{track.title}</h3>
|
||||
<button onClick={() => handleDelete(track.id)}>
|
||||
<BaseIcon path={mdiDelete} size={16} className="text-gray-800 hover:text-red-500 transition-colors" />
|
||||
<div className="p-8">
|
||||
<div className="flex justify-between items-start mb-3">
|
||||
<h3 className="font-black text-white text-lg uppercase tracking-tighter truncate leading-none italic pr-4">{track.title}</h3>
|
||||
<button onClick={() => handleDelete(track.id)} className="shrink-0">
|
||||
<BaseIcon path={mdiDelete} size={18} className="text-gray-800 hover:text-red-500 transition-colors" />
|
||||
</button>
|
||||
</div>
|
||||
<p className="text-gray-600 text-[9px] uppercase font-black tracking-[0.3em] mb-5 truncate opacity-80">
|
||||
{track.key_signature || 'AI MASTER MIX'}
|
||||
</p>
|
||||
<div className="flex flex-wrap gap-2 mb-6">
|
||||
<span className="text-[8px] font-black text-gray-500 uppercase tracking-widest bg-white/5 px-2 py-1 rounded-md border border-white/5">
|
||||
{track.key_signature || 'C Major'}
|
||||
</span>
|
||||
<span className="text-[8px] font-black text-[#7000FF] uppercase tracking-widest bg-[#7000FF]/10 px-2 py-1 rounded-md border border-[#7000FF]/20">
|
||||
HI-FI AI
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between pt-5 border-t border-white/5">
|
||||
<div className="flex items-center text-[7px] font-black text-[#00E5FF] uppercase tracking-[0.3em]">
|
||||
<BaseIcon path={mdiRobotOutline} size={12} className="mr-1.5" />
|
||||
REAL ENGINE V3
|
||||
</div>
|
||||
<div className="flex items-center justify-between pt-6 border-t border-white/5">
|
||||
<button
|
||||
onClick={() => { setCurrentTrack(track); setShowLyrics(true); }}
|
||||
className="text-[8px] font-black text-white/30 hover:text-[#BB86FC] uppercase tracking-tighter transition-colors"
|
||||
className="flex items-center text-[9px] font-black text-white/40 hover:text-[#00E5FF] uppercase tracking-widest transition-colors"
|
||||
>
|
||||
LETRA
|
||||
<BaseIcon path={mdiPlaylistMusic} size={14} className="mr-2" />
|
||||
VER LETRA
|
||||
</button>
|
||||
<button onClick={() => handleDownload(track)}>
|
||||
<BaseIcon path={mdiDownload} size={18} className="text-gray-700 hover:text-white transition-colors" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -416,12 +472,18 @@ const SunoStudio = () => {
|
||||
))}
|
||||
|
||||
{library.length === 0 && !loading && (
|
||||
<div className="col-span-full py-40 text-center">
|
||||
<div className="w-20 h-20 bg-white/5 rounded-3xl flex items-center justify-center mx-auto mb-8 border border-white/5">
|
||||
<BaseIcon path={mdiPlaylistMusic} size={40} className="text-gray-800" />
|
||||
<div className="col-span-full py-60 text-center">
|
||||
<div className="w-28 h-28 bg-white/5 rounded-[2.5rem] flex items-center justify-center mx-auto mb-10 border border-white/5 shadow-2xl">
|
||||
<BaseIcon path={mdiSparkles} size={50} className="text-gray-800" />
|
||||
</div>
|
||||
<h3 className="text-xl font-black text-gray-700 uppercase tracking-widest italic">Crie seu primeiro hit</h3>
|
||||
<p className="text-gray-800 uppercase text-[9px] font-black tracking-[0.4em] mt-5">O motor de geração está pronto</p>
|
||||
<h3 className="text-3xl font-black text-gray-700 uppercase tracking-[0.2em] italic">O Silêncio dos Gênios</h3>
|
||||
<p className="text-gray-800 uppercase text-xs font-black tracking-[0.5em] mt-8 opacity-60">Seu primeiro Hit Global começa com um prompt...</p>
|
||||
<BaseButton
|
||||
label="INICIAR CRIAÇÃO"
|
||||
color="info"
|
||||
className="mt-12 px-12 py-4 rounded-2xl font-black italic tracking-widest"
|
||||
onClick={() => setIsCustom(false)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@ -429,114 +491,142 @@ const SunoStudio = () => {
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{/* Lyrics Sidebar */}
|
||||
{/* Full Lyrics Portal */}
|
||||
{showLyrics && currentTrack && (
|
||||
<div className="fixed inset-0 z-[60] flex justify-end bg-black/70 backdrop-blur-md transition-all" onClick={() => setShowLyrics(false)}>
|
||||
<aside className="w-[450px] h-full bg-[#080808] border-l border-white/10 flex flex-col p-12 animate-slide-in-right overflow-y-auto aside-scrollbars" onClick={e => e.stopPropagation()}>
|
||||
<div className="flex items-center justify-between mb-16">
|
||||
<div className="fixed inset-0 z-[150] flex justify-end bg-black/80 backdrop-blur-2xl transition-all" onClick={() => setShowLyrics(false)}>
|
||||
<aside className="w-[600px] h-full bg-[#080808] border-l border-white/10 flex flex-col p-16 animate-slide-in-right overflow-y-auto aside-scrollbars relative shadow-[-50px_0_100px_rgba(0,0,0,0.5)]" onClick={e => e.stopPropagation()}>
|
||||
<div className="flex items-center justify-between mb-20">
|
||||
<div>
|
||||
<h2 className="text-[10px] font-black text-white uppercase tracking-[0.4em] mb-2">LETRA GERADA</h2>
|
||||
<p className="text-[9px] font-bold text-[#BB86FC] uppercase tracking-widest">{currentTrack.title}</p>
|
||||
<h2 className="text-xs font-black text-white uppercase tracking-[0.6em] mb-4 flex items-center">
|
||||
<div className="w-12 h-1 bg-[#00E5FF] mr-6 shadow-[0_0_15px_#00E5FF]" />
|
||||
COMPOSIÇÃO COMPLETA
|
||||
</h2>
|
||||
<h1 className="text-3xl font-black text-[#7000FF] uppercase italic tracking-tighter">{currentTrack.title}</h1>
|
||||
<div className="flex space-x-6 mt-4 opacity-50">
|
||||
<span className="text-[10px] font-black uppercase tracking-widest">{currentTrack.bpm} BPM</span>
|
||||
<span className="text-[10px] font-black uppercase tracking-widest">{currentTrack.key_signature}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button onClick={() => setShowLyrics(false)} className="w-12 h-12 rounded-full bg-white/5 hover:bg-white/10 flex items-center justify-center transition-all">
|
||||
<BaseIcon path={mdiPlus} className="rotate-45" size={28} />
|
||||
<button onClick={() => setShowLyrics(false)} className="w-16 h-16 rounded-full bg-white/5 hover:bg-red-500/20 hover:text-red-500 flex items-center justify-center transition-all border border-white/5">
|
||||
<BaseIcon path={mdiPlus} className="rotate-45" size={36} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-12">
|
||||
<div className="space-y-16 pb-20">
|
||||
{currentTrack.ai_data?.lyrics ? Object.entries(currentTrack.ai_data.lyrics).map(([section, text]: [any, any]) => (
|
||||
<div key={section} className="group">
|
||||
<h4 className="text-[9px] font-black text-[#00E5FF] uppercase mb-5 tracking-[0.5em] opacity-40 group-hover:opacity-100 transition-opacity flex items-center">
|
||||
<div className="w-10 h-px bg-[#00E5FF] mr-4 shadow-[0_0_10px_#00E5FF]" /> [{section.toUpperCase()}]
|
||||
<h4 className="text-[10px] font-black text-[#00E5FF] uppercase mb-8 tracking-[0.6em] flex items-center opacity-40 group-hover:opacity-100 transition-opacity">
|
||||
<div className="w-3 h-3 rounded-full bg-[#00E5FF] mr-4 shadow-[0_0_10px_#00E5FF]" />
|
||||
{section.replace('_', ' ').toUpperCase()}
|
||||
</h4>
|
||||
<p className={`leading-relaxed whitespace-pre-wrap ${section === 'chorus' ? 'text-xl font-black text-white italic' : 'text-base text-gray-400 font-medium'}`}>
|
||||
<p className={`leading-[1.8] whitespace-pre-wrap ${section.includes('chorus') ? 'text-2xl font-black text-white italic pl-8 border-l-4 border-white/10' : 'text-lg text-gray-400 font-bold pl-8'}`}>
|
||||
{text}
|
||||
</p>
|
||||
</div>
|
||||
)) : (
|
||||
<div className="text-center py-20">
|
||||
<p className="text-gray-600 text-xs uppercase font-black italic">Letra indisponível para este arquivo</p>
|
||||
<div className="text-center py-40">
|
||||
<BaseIcon path={mdiMusic} size={64} className="text-gray-800 mx-auto mb-8" />
|
||||
<p className="text-gray-600 text-sm uppercase font-black italic tracking-widest">A transcrição está sendo processada...</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Musical Analysis Section */}
|
||||
{currentTrack.ai_data?.mood && (
|
||||
<div className="mt-10 p-10 bg-white/5 rounded-3xl border border-white/5">
|
||||
<h3 className="text-[10px] font-black text-[#7000FF] uppercase tracking-[0.5em] mb-6">ANÁLISE DO PRODUTOR (IA)</h3>
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<span className="text-[9px] font-black text-gray-500 uppercase block mb-2 tracking-widest">Mood & Atmosfera</span>
|
||||
<p className="text-sm text-gray-300 font-bold">{currentTrack.ai_data.mood}</p>
|
||||
</div>
|
||||
<div>
|
||||
<span className="text-[9px] font-black text-gray-500 uppercase block mb-2 tracking-widest">Instrumentação</span>
|
||||
<p className="text-xs text-gray-400 leading-relaxed italic">
|
||||
{Array.isArray(currentTrack.ai_data.instruments) ? currentTrack.ai_data.instruments.join(', ') : currentTrack.ai_data.instruments}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</aside>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Player */}
|
||||
{/* Global Player Interface */}
|
||||
{currentTrack && (
|
||||
<div className="fixed bottom-0 left-0 w-full h-28 bg-[#050505]/95 backdrop-blur-3xl border-t border-white/5 flex items-center px-12 z-[100] shadow-[0_-30px_60px_rgba(0,0,0,0.8)]">
|
||||
<div className="w-1/4 flex items-center space-x-6">
|
||||
<div className="w-16 h-16 bg-[#111] rounded-2xl shrink-0 overflow-hidden relative group border border-white/10 shadow-2xl">
|
||||
<div className="absolute inset-0 bg-gradient-to-br from-[#00E5FF]/20 to-[#BB86FC]/20" />
|
||||
<div className="fixed bottom-0 left-0 w-full h-[120px] bg-[#0A0A0A]/95 backdrop-blur-3xl border-t border-white/5 flex items-center px-16 z-[200] shadow-[0_-40px_100px_rgba(0,0,0,0.9)]">
|
||||
<div className="w-1/4 flex items-center space-x-8">
|
||||
<div className="w-20 h-20 bg-[#151515] rounded-[2rem] shrink-0 overflow-hidden relative group border border-white/10 shadow-2xl">
|
||||
<div className="absolute inset-0 bg-gradient-to-br from-[#00E5FF]/30 to-[#7000FF]/30 animate-pulse" />
|
||||
<div className="w-full h-full flex items-center justify-center relative">
|
||||
<BaseIcon path={mdiMusic} className="text-white/60" size={28} />
|
||||
<BaseIcon path={mdiMusic} className="text-white" size={32} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<h4 className="text-white font-black text-base uppercase italic truncate tracking-tighter mb-1">{currentTrack.title}</h4>
|
||||
<div className="flex items-center space-x-3">
|
||||
<span className="text-[8px] font-black text-[#00E5FF] uppercase tracking-widest px-2 py-0.5 bg-[#00E5FF]/10 rounded border border-[#00E5FF]/30">
|
||||
STUDIO MASTER
|
||||
<h4 className="text-white font-black text-xl uppercase italic truncate tracking-tighter mb-2">{currentTrack.title}</h4>
|
||||
<div className="flex items-center space-x-4">
|
||||
<span className="text-[9px] font-black text-[#00E5FF] uppercase tracking-[0.2em] px-3 py-1 bg-[#00E5FF]/10 rounded-full border border-[#00E5FF]/30">
|
||||
MASTER V4.0
|
||||
</span>
|
||||
<p className="text-gray-600 text-[8px] font-black uppercase tracking-[0.3em] truncate opacity-80">AI PERFORMER</p>
|
||||
<p className="text-gray-500 text-[9px] font-black uppercase tracking-[0.4em] truncate">AI SINGER PRO</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 flex flex-col items-center space-y-4 px-20">
|
||||
<div className="flex items-center space-x-12">
|
||||
<button className="text-gray-700 hover:text-white transition-all transform hover:scale-125">
|
||||
<BaseIcon path={mdiClockOutline} size={22} />
|
||||
<div className="flex-1 flex flex-col items-center space-y-5 px-32">
|
||||
<div className="flex items-center space-x-16">
|
||||
<button className="text-gray-700 hover:text-white transition-all transform hover:scale-150">
|
||||
<BaseIcon path={mdiRefresh} size={24} />
|
||||
</button>
|
||||
<button
|
||||
onClick={togglePlayback}
|
||||
className="w-16 h-16 rounded-full bg-white flex items-center justify-center text-black hover:scale-110 active:scale-90 transition-all shadow-[0_0_40px_rgba(255,255,255,0.3)]"
|
||||
className="w-20 h-20 rounded-full bg-white flex items-center justify-center text-black hover:scale-110 active:scale-90 transition-all shadow-[0_0_60px_rgba(255,255,255,0.4)]"
|
||||
>
|
||||
<BaseIcon path={isPlaying ? mdiPause : mdiPlay} size={40} />
|
||||
<BaseIcon path={isPlaying ? mdiPause : mdiPlay} size={48} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setShowLyrics(!showLyrics)}
|
||||
className={`transition-all transform hover:scale-125 ${showLyrics ? 'text-[#00E5FF]' : 'text-gray-700 hover:text-white'}`}
|
||||
className={`transition-all transform hover:scale-150 ${showLyrics ? 'text-[#00E5FF]' : 'text-gray-700 hover:text-white'}`}
|
||||
>
|
||||
<BaseIcon path={mdiPlaylistMusic} size={24} />
|
||||
<BaseIcon path={mdiPlaylistMusic} size={30} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="w-full flex items-center space-x-5">
|
||||
<span className="text-[9px] font-black text-gray-600 w-12 text-right font-mono tracking-tighter">{formatTime(currentTime)}</span>
|
||||
<div className="flex-1 relative group h-8 flex items-center">
|
||||
<div className="w-full flex items-center space-x-6">
|
||||
<span className="text-[10px] font-black text-gray-500 w-16 text-right font-mono tracking-tighter">{formatTime(currentTime)}</span>
|
||||
<div className="flex-1 relative group h-10 flex items-center">
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value={progress}
|
||||
onChange={handleProgressChange}
|
||||
className="absolute w-full h-1 bg-white/10 rounded-full appearance-none cursor-pointer accent-[#00E5FF] group-hover:h-1.5 transition-all z-10"
|
||||
className="absolute w-full h-1.5 bg-white/5 rounded-full appearance-none cursor-pointer accent-[#00E5FF] group-hover:h-2 transition-all z-10"
|
||||
/>
|
||||
<div className="absolute top-1/2 -translate-y-1/2 left-0 h-1 bg-[#00E5FF] rounded-full group-hover:h-1.5 transition-all pointer-events-none shadow-[0_0_10px_#00E5FF]" style={{ width: `${progress}%` }} />
|
||||
<div className="absolute top-1/2 -translate-y-1/2 left-0 h-1.5 bg-gradient-to-r from-[#00E5FF] to-[#7000FF] rounded-full group-hover:h-2 transition-all pointer-events-none shadow-[0_0_20px_rgba(0,229,255,0.5)]" style={{ width: `${progress}%` }} />
|
||||
</div>
|
||||
<span className="text-[9px] font-black text-gray-600 w-12 font-mono tracking-tighter">{formatTime(duration)}</span>
|
||||
<span className="text-[10px] font-black text-gray-500 w-16 font-mono tracking-tighter">{formatTime(duration)}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-1/4 flex items-center justify-end space-x-8">
|
||||
<div className="flex items-center space-x-4 group">
|
||||
<BaseIcon path={mdiVolumeHigh} size={20} className="text-gray-600 group-hover:text-white transition-colors" />
|
||||
<div className="w-24 h-1 bg-white/10 rounded-full overflow-hidden relative cursor-pointer">
|
||||
<div className="absolute inset-0 bg-gray-500 w-3/4" />
|
||||
<div className="w-1/4 flex items-center justify-end space-x-10">
|
||||
<div className="flex items-center space-x-5 group">
|
||||
<BaseIcon path={mdiVolumeHigh} size={24} className="text-gray-600 group-hover:text-white transition-colors" />
|
||||
<div className="w-32 h-1.5 bg-white/5 rounded-full overflow-hidden relative cursor-pointer">
|
||||
<div className="absolute inset-0 bg-[#00E5FF]/60 w-3/4" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center space-x-3">
|
||||
<div className="flex items-center space-x-4">
|
||||
<button
|
||||
onClick={handleDownload}
|
||||
className="p-3.5 rounded-2xl bg-white/5 hover:bg-[#00E5FF] hover:text-black text-gray-500 transition-all shadow-xl"
|
||||
title="Download MP3"
|
||||
onClick={() => handleDownload()}
|
||||
className="w-14 h-14 rounded-2xl bg-white/5 hover:bg-[#00E5FF] hover:text-black text-gray-400 transition-all shadow-2xl flex items-center justify-center border border-white/5"
|
||||
title="Exportar Hit"
|
||||
>
|
||||
<BaseIcon path={mdiDownload} size={22} />
|
||||
<BaseIcon path={mdiDownload} size={26} />
|
||||
</button>
|
||||
<button className="p-3.5 rounded-2xl bg-white/5 hover:bg-white/10 text-gray-500 hover:text-white transition-all">
|
||||
<BaseIcon path={mdiShare} size={22} />
|
||||
<button className="w-14 h-14 rounded-2xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white transition-all flex items-center justify-center border border-white/5">
|
||||
<BaseIcon path={mdiShare} size={26} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -554,42 +644,51 @@ const SunoStudio = () => {
|
||||
<ToastContainer
|
||||
theme="dark"
|
||||
position="bottom-right"
|
||||
autoClose={3000}
|
||||
autoClose={4000}
|
||||
closeOnClick
|
||||
pauseOnHover
|
||||
toastClassName="bg-[#0A0A0A] border border-white/10 rounded-2xl font-black italic tracking-widest text-[10px] uppercase shadow-2xl"
|
||||
/>
|
||||
|
||||
<style jsx global>{`
|
||||
@keyframes fade-in {
|
||||
from { opacity: 0; transform: translateY(15px); }
|
||||
from { opacity: 0; transform: translateY(30px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
@keyframes slide-in-right {
|
||||
from { transform: translateX(100%); }
|
||||
to { transform: translateX(0); }
|
||||
}
|
||||
@keyframes music-bar {
|
||||
0% { height: 20%; }
|
||||
50% { height: 100%; }
|
||||
100% { height: 20%; }
|
||||
}
|
||||
.animate-fade-in {
|
||||
animation: fade-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
|
||||
animation: fade-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
|
||||
}
|
||||
.animate-slide-in-right {
|
||||
animation: slide-in-right 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
||||
animation: slide-in-right 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
||||
}
|
||||
.animate-music-bar {
|
||||
animation: music-bar 1s ease-in-out infinite;
|
||||
}
|
||||
input[type="range"]::-webkit-slider-thumb {
|
||||
appearance: none;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: white;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
border: 3px solid #00E5FF;
|
||||
box-shadow: 0 0 15px rgba(0, 229, 255, 0.8);
|
||||
border: 4px solid #00E5FF;
|
||||
box-shadow: 0 0 25px rgba(0, 229, 255, 0.8);
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
input[type="range"]::-webkit-slider-thumb:hover {
|
||||
transform: scale(1.3);
|
||||
transform: scale(1.4);
|
||||
}
|
||||
.aside-scrollbars::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
width: 5px;
|
||||
}
|
||||
.aside-scrollbars::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
@ -599,7 +698,7 @@ const SunoStudio = () => {
|
||||
border-radius: 10px;
|
||||
}
|
||||
.aside-scrollbars::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(0, 229, 255, 0.2);
|
||||
background: rgba(0, 229, 255, 0.3);
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
@ -610,4 +709,4 @@ SunoStudio.getLayout = function getLayout(page: ReactElement) {
|
||||
return page;
|
||||
};
|
||||
|
||||
export default SunoStudio;
|
||||
export default SunoStudio;
|
||||
Loading…
x
Reference in New Issue
Block a user