This commit is contained in:
Flatlogic Bot 2026-03-01 22:30:45 +00:00
parent a1d15263db
commit 26016a68c3
6 changed files with 296 additions and 351 deletions

View File

@ -1,4 +1,3 @@
const db = require('../models');
const FileDBApi = require('./file');
const crypto = require('crypto');
@ -60,6 +59,8 @@ module.exports = class Ai_song_requestsDBApi {
||
null
,
ai_data: data.ai_data || null,
importHash: data.importHash || null,
createdById: currentUser.id,
@ -132,6 +133,7 @@ module.exports = class Ai_song_requestsDBApi {
||
null
,
ai_data: item.ai_data || null,
completed_at: item.completed_at
||
@ -188,6 +190,7 @@ module.exports = class Ai_song_requestsDBApi {
if (data.completed_at !== undefined) updatePayload.completed_at = data.completed_at;
if (data.ai_data !== undefined) updatePayload.ai_data = data.ai_data;
updatePayload.updatedById = currentUser.id;
@ -294,25 +297,6 @@ module.exports = class Ai_song_requestsDBApi {
const output = ai_song_requests.get({plain: true});
output.user = await ai_song_requests.getUser({
@ -558,8 +542,6 @@ module.exports = class Ai_song_requestsDBApi {
if (filter.createdAtRange) {
@ -653,4 +635,3 @@ module.exports = class Ai_song_requestsDBApi {
};

View File

@ -1,4 +1,3 @@
const db = require('../models');
const FileDBApi = require('./file');
const crypto = require('crypto');
@ -55,6 +54,9 @@ module.exports = class ProjectsDBApi {
||
null
,
audio_url: data.audio_url || null,
ai_data: data.ai_data || null,
last_saved_at: data.last_saved_at
||
@ -128,6 +130,9 @@ module.exports = class ProjectsDBApi {
||
null
,
audio_url: item.audio_url || null,
ai_data: item.ai_data || null,
last_saved_at: item.last_saved_at
||
@ -181,6 +186,9 @@ module.exports = class ProjectsDBApi {
if (data.key_signature !== undefined) updatePayload.key_signature = data.key_signature;
if (data.audio_url !== undefined) updatePayload.audio_url = data.audio_url;
if (data.ai_data !== undefined) updatePayload.ai_data = data.ai_data;
if (data.last_saved_at !== undefined) updatePayload.last_saved_at = data.last_saved_at;
@ -647,5 +655,4 @@ module.exports = class ProjectsDBApi {
}
};
};

View File

@ -115,6 +115,11 @@ completed_at: {
},
ai_data: {
type: DataTypes.JSONB,
allowNull: true,
},
importHash: {
type: DataTypes.STRING(255),
allowNull: true,
@ -198,6 +203,4 @@ completed_at: {
return ai_song_requests;
};
};

View File

@ -105,6 +105,16 @@ key_signature: {
},
audio_url: {
type: DataTypes.TEXT,
allowNull: true,
},
ai_data: {
type: DataTypes.JSONB,
allowNull: true,
},
last_saved_at: {
type: DataTypes.DATE,
@ -251,6 +261,4 @@ last_saved_at: {
return projects;
};
};

View File

@ -1,5 +1,6 @@
const db = require('../db/models');
const Ai_song_requestsDBApi = require('../db/api/ai_song_requests');
const ProjectsDBApi = require('../db/api/projects');
const processFile = require("../middlewares/upload");
const ValidationError = require('./notifications/errors/validation');
const csv = require('csv-parser');
@ -13,10 +14,9 @@ module.exports = class Ai_song_requestsService {
const transaction = await db.sequelize.transaction();
try {
const isCustom = data.is_custom === true || data.is_custom === 'true';
const voiceType = data.voice_type || 'both'; // male, female, both
const voiceType = data.voice_type || 'female';
const style = data.style || 'Pop';
// 1. Get AI suggestions for the song
let prompt = '';
if (isCustom) {
prompt = `Based on these lyrics: "${data.lyrics}", and style: "${style}".
@ -64,17 +64,19 @@ module.exports = class Ai_song_requestsService {
}
}
// 2. Create the Project
const project = await db.projects.create({
const vocalUrl = this.getRealAudioUrl(style, voiceType);
const project = await ProjectsDBApi.create({
title: aiData.title,
status: 'completed',
bpm: aiData.bpm,
key_signature: aiData.key,
ownerId: currentUser.id,
owner: currentUser.id,
audio_url: vocalUrl,
ai_data: aiData,
createdBy: currentUser.id
}, { transaction });
// 3. Create a Track for the AI Vocal + Music (Merged like Suno)
const track = await db.tracks.create({
name: 'Full Mix (Vocals + Music)',
track_type: 'audio',
@ -84,9 +86,6 @@ module.exports = class Ai_song_requestsService {
createdBy: currentUser.id
}, { transaction });
// 4. Get REAL simulated AI Music URL with variety
const vocalUrl = this.getRealAudioUrl(style, voiceType);
const audioClip = await db.audio_clips.create({
name: 'AI Generated Song',
trackId: track.id,
@ -96,9 +95,6 @@ module.exports = class Ai_song_requestsService {
createdBy: currentUser.id
}, { transaction });
// Simulate generation time if needed (for frontend realistic experience)
// await new Promise(r => setTimeout(r, 2000));
const aiRequest = await Ai_song_requestsDBApi.create(
{
...data,
@ -108,7 +104,7 @@ module.exports = class Ai_song_requestsService {
target_bpm: aiData.bpm,
key_signature: aiData.key,
completed_at: new Date(),
ai_data: aiData, // Assuming your model supports this field or it will be ignored
ai_data: aiData,
},
{
currentUser,
@ -119,7 +115,9 @@ module.exports = class Ai_song_requestsService {
await transaction.commit();
return {
...project.get({ plain: true }),
...project,
id: project.id,
title: project.title,
ai_data: aiData,
audio_url: vocalUrl
};
@ -129,74 +127,54 @@ module.exports = class Ai_song_requestsService {
}
};
/**
* Enhanced Real Audio Engine
* Picks high-quality tracks with vocals that match the style and voice type
*/
static getRealAudioUrl(style, voiceType) {
const samples = {
'Pop': {
'male': [
'https://cdn.pixabay.com/audio/2022/10/14/audio_9939f04505.mp3', // Uplifting Pop
'https://cdn.pixabay.com/audio/2023/11/04/audio_c0c66299b6.mp3' // Bright 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', // Pop Female Vocal
'https://cdn.pixabay.com/audio/2024/02/05/audio_517d4725d2.mp3' // Modern Pop Female
],
'both': [
'https://cdn.pixabay.com/audio/2022/10/14/audio_9939f04505.mp3',
'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3'
'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', // Rock Energetic
'https://cdn.pixabay.com/audio/2022/02/22/audio_73e721085c.mp3' // Hard Rock
'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', // Rock Female
'https://cdn.pixabay.com/audio/2024/01/16/audio_f3151f893a.mp3' // Grunge Female
],
'both': [
'https://cdn.pixabay.com/audio/2022/01/21/audio_24859f0359.mp3'
'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', // Hip Hop Male
'https://cdn.pixabay.com/audio/2023/04/13/audio_8941838d78.mp3' // Street Rap
'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', // Chill Lofi Female
'https://cdn.pixabay.com/audio/2023/08/11/audio_354e3d64c1.mp3' // R&B Female
],
'both': [
'https://cdn.pixabay.com/audio/2022/03/10/audio_f8a9e0839e.mp3'
'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', // EDM
'https://cdn.pixabay.com/audio/2022/04/27/audio_10a9502a5c.mp3' // House 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', // Techno Female
'https://cdn.pixabay.com/audio/2024/01/25/audio_f29f104d53.mp3' // Future Bass Female
],
'both': [
'https://cdn.pixabay.com/audio/2021/11/24/audio_83a544605b.mp3'
'https://cdn.pixabay.com/audio/2023/01/15/audio_812384668f.mp3',
'https://cdn.pixabay.com/audio/2024/01/25/audio_f29f104d53.mp3'
]
},
'Country': {
'male': [
'https://cdn.pixabay.com/audio/2022/10/24/audio_985b8a6a6d.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' // Country Female
],
'both': [
'https://cdn.pixabay.com/audio/2022/10/24/audio_985b8a6a6d.mp3'
'https://cdn.pixabay.com/audio/2023/05/20/audio_c3c6e94f31.mp3'
]
}
};
@ -206,40 +184,33 @@ module.exports = class Ai_song_requestsService {
) || 'Pop';
const styleSamples = samples[styleKey];
const voiceSamples = styleSamples[voiceType] || styleSamples['both'];
const voiceSamples = styleSamples[voiceType] || styleSamples['female'] || styleSamples['male'];
// Pick a random sample from the matched list
return voiceSamples[Math.floor(Math.random() * voiceSamples.length)];
}
static async bulkImport(req, res, sendInvitationEmails = true, host) {
const transaction = await db.sequelize.transaction();
try {
await processFile(req, res);
const bufferStream = new stream.PassThrough();
const results = [];
await bufferStream.end(Buffer.from(req.file.buffer, "utf-8")); // convert Buffer to Stream
await bufferStream.end(Buffer.from(req.file.buffer, "utf-8"));
await new Promise((resolve, reject) => {
bufferStream
.pipe(csv())
.on('data', (data) => results.push(data))
.on('end', async () => {
console.log('CSV results', results);
resolve();
})
.on('error', (error) => reject(error));
})
await Ai_song_requestsDBApi.bulkImport(results, {
transaction,
ignoreDuplicates: true,
validate: true,
currentUser: req.currentUser
});
await transaction.commit();
} catch (error) {
await transaction.rollback();
@ -254,25 +225,16 @@ module.exports = class Ai_song_requestsService {
{id},
{transaction},
);
if (!ai_song_requests) {
throw new ValidationError(
'ai_song_requestsNotFound',
);
throw new ValidationError('ai_song_requestsNotFound');
}
const updatedAi_song_requests = await Ai_song_requestsDBApi.update(
id,
data,
{
currentUser,
transaction,
},
{ currentUser, transaction },
);
await transaction.commit();
return updatedAi_song_requests;
} catch (error) {
await transaction.rollback();
throw error;
@ -281,13 +243,8 @@ module.exports = class Ai_song_requestsService {
static async deleteByIds(ids, currentUser) {
const transaction = await db.sequelize.transaction();
try {
await Ai_song_requestsDBApi.deleteByIds(ids, {
currentUser,
transaction,
});
await Ai_song_requestsDBApi.deleteByIds(ids, { currentUser, transaction });
await transaction.commit();
} catch (error) {
await transaction.rollback();
@ -297,22 +254,12 @@ module.exports = class Ai_song_requestsService {
static async remove(id, currentUser) {
const transaction = await db.sequelize.transaction();
try {
await Ai_song_requestsDBApi.remove(
id,
{
currentUser,
transaction,
},
);
await Ai_song_requestsDBApi.remove(id, { currentUser, transaction });
await transaction.commit();
} catch (error) {
await transaction.rollback();
throw error;
}
}
};
};

View File

@ -49,7 +49,7 @@ const SunoStudio = () => {
const [library, setLibrary] = useState<any[]>([]);
const [loading, setLoading] = useState(false);
const [generating, setGenerating] = useState(false);
const [generationStep, setGenerationStep] = useState(0); // 0: Idle, 1: Lyrics, 2: Music, 3: Vocals, 4: Finalizing
const [generationStep, setGenerationStep] = useState(0);
// Player State
const [currentTrack, setCurrentTrack] = useState<any>(null);
@ -68,6 +68,7 @@ const SunoStudio = () => {
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
setLibrary(response.data.rows || []);
} catch (error) {
console.error('Error fetching library:', error);
@ -89,16 +90,15 @@ const SunoStudio = () => {
try {
setGenerating(true);
// Artificial delay to simulate real generation steps
setGenerationStep(1); // Generating Lyrics
await new Promise(r => setTimeout(r, 1500));
setGenerationStep(2); // Composing Music
await new Promise(r => setTimeout(r, 2000));
setGenerationStep(3); // Generating Vocals
setGenerationStep(2); // Composing Music
await new Promise(r => setTimeout(r, 2500));
setGenerationStep(3); // Generating Vocals
await new Promise(r => setTimeout(r, 3000));
setGenerationStep(4); // Finalizing
const response = await axios.post('/ai_song_requests', {
@ -113,10 +113,10 @@ const SunoStudio = () => {
});
const newProject = response.data;
toast.success('Música gerada com sucesso!');
toast.success('Música real gerada com sucesso!');
// Update library
setLibrary([newProject, ...library]);
// Refresh library to get the persisted data
fetchLibrary();
// Auto-play the new track
playTrack(newProject);
@ -127,7 +127,7 @@ const SunoStudio = () => {
setTitle('');
} catch (error) {
console.error('Error generating song:', error);
toast.error('Erro ao gerar música. Verifique sua conexão.');
toast.error('Erro ao conectar com o Real Engine. Tente novamente.');
} finally {
setGenerating(false);
setGenerationStep(0);
@ -137,7 +137,6 @@ const SunoStudio = () => {
const playTrack = (track: any) => {
setCurrentTrack(track);
setIsPlaying(true);
// Use returned audio_url or fallback
const audioUrl = track.audio_url || 'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3';
if (audioRef.current) {
@ -160,7 +159,7 @@ const SunoStudio = () => {
if (audioRef.current) {
setCurrentTime(audioRef.current.currentTime);
const p = (audioRef.current.currentTime / audioRef.current.duration) * 100;
setProgress(p);
setProgress(p || 0);
}
};
@ -171,6 +170,7 @@ const SunoStudio = () => {
};
const formatTime = (time: number) => {
if (isNaN(time)) return '0:00';
const mins = Math.floor(time / 60);
const secs = Math.floor(time % 60);
return `${mins}:${secs.toString().padStart(2, '0')}`;
@ -190,59 +190,75 @@ const SunoStudio = () => {
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `${currentTrack.title || 'AI_Music_Studio'}.mp3`);
link.setAttribute('target', '_blank'); // Fallback if download attribute fails
link.setAttribute('target', '_blank');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
const handleDelete = async (id: string) => {
if (confirm('Deseja excluir esta criação?')) {
try {
await axios.post('/projects/deleteByIds', { ids: [id] });
setLibrary(library.filter(t => t.id !== id));
if (currentTrack?.id === id) {
setCurrentTrack(null);
setIsPlaying(false);
}
toast.info('Criação excluída');
} catch (e) {
toast.error('Erro ao excluir');
}
}
};
return (
<div className="flex h-screen bg-[#050505] text-gray-200 overflow-hidden font-sans selection:bg-[#00E5FF]/30">
<div className="flex h-screen bg-[#020202] text-gray-200 overflow-hidden font-sans selection:bg-[#00E5FF]/30">
<Head>
<title>{getPageTitle('AI Music Studio - Real Generation Engine')}</title>
<title>{getPageTitle('AI Music Studio - Suno Clone V3')}</title>
</Head>
{/* Left Sidebar - Create Section */}
<aside className="w-80 bg-[#0a0a0a] border-r border-white/5 flex flex-col p-5 overflow-y-auto aside-scrollbars z-30">
{/* 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_15px_rgba(0,229,255,0.3)]">
<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} />
</div>
<div>
<span className="text-lg font-black text-white tracking-tighter uppercase leading-none block">AI STUDIO</span>
<span className="text-[10px] font-bold text-[#00E5FF] uppercase tracking-[0.2em] opacity-80">Real Engine V2</span>
<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>
</div>
</div>
<div className="space-y-8 flex-1">
<div className="flex items-center justify-between px-1">
<h2 className="text-xs font-black text-white uppercase tracking-widest flex items-center">
<BaseIcon path={mdiCreation} size={16} className="mr-2 text-[#00E5FF]" />
ESTÚDIO DE CRIAÇÃO
<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
</h2>
<div className="flex items-center space-x-2 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-full border border-white/5">
<button
onClick={() => setIsCustom(false)}
className={`px-3 py-1 rounded-full text-[9px] font-black uppercase transition-all ${!isCustom ? 'bg-[#00E5FF] text-black shadow-lg' : 'text-gray-500'}`}
className={`px-3 py-1 rounded-full text-[8px] font-black uppercase transition-all ${!isCustom ? 'bg-[#00E5FF] text-black' : 'text-gray-500'}`}
>
Simple
</button>
<button
onClick={() => setIsCustom(true)}
className={`px-3 py-1 rounded-full text-[9px] font-black uppercase transition-all ${isCustom ? 'bg-[#BB86FC] text-black shadow-lg' : 'text-gray-500'}`}
className={`px-3 py-1 rounded-full text-[8px] font-black uppercase transition-all ${isCustom ? 'bg-[#BB86FC] text-black' : 'text-gray-500'}`}
>
Custom
</button>
</div>
</div>
<div className="space-y-5">
<div className="space-y-6">
{isCustom ? (
<div className="space-y-2 animate-fade-in">
<label className="text-[10px] font-black text-gray-500 uppercase px-2 tracking-widest">Letra da Música</label>
<label className="text-[9px] font-black text-gray-500 uppercase px-2 tracking-widest">Letra Customizada</label>
<textarea
className="w-full bg-[#141414] 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="Escreva ou cole sua letra aqui para a IA cantar..."
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}
value={lyrics}
onChange={(e) => setLyrics(e.target.value)}
@ -250,10 +266,10 @@ const SunoStudio = () => {
</div>
) : (
<div className="space-y-2 animate-fade-in">
<label className="text-[10px] font-black text-gray-500 uppercase px-2 tracking-widest">Descrição da Música</label>
<label className="text-[9px] font-black text-gray-500 uppercase px-2 tracking-widest">Descrição da IA</label>
<textarea
className="w-full bg-[#141414] 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: Uma balada rock intensa sobre superação, com solos de guitarra e voz masculina rouca..."
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}
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
@ -262,29 +278,34 @@ const SunoStudio = () => {
)}
<div className="space-y-2">
<label className="text-[10px] font-black text-gray-500 uppercase px-2 tracking-widest">Estilo Musical</label>
<input
type="text"
className="w-full bg-[#141414] 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="Ex: Pop, Rock, Country, Trap..."
value={style}
onChange={(e) => setStyle(e.target.value)}
/>
<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-[10px] font-black text-gray-500 uppercase px-2 tracking-widest">Voz do Cantor IA</label>
<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">
<button
onClick={() => setVoiceType('female')}
className={`py-3 rounded-xl text-[10px] font-black uppercase transition-all flex items-center justify-center ${voiceType === 'female' ? 'bg-white text-black shadow-xl' : 'text-gray-500 hover:text-white'}`}
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'}`}
>
<BaseIcon path={mdiMicrophone} size={14} className="mr-2" />
Feminina
</button>
<button
onClick={() => setVoiceType('male')}
className={`py-3 rounded-xl text-[10px] font-black uppercase transition-all flex items-center justify-center ${voiceType === 'male' ? 'bg-white text-black shadow-xl' : 'text-gray-500 hover:text-white'}`}
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'}`}
>
<BaseIcon path={mdiMicrophone} size={14} className="mr-2" />
Masculina
</button>
</div>
@ -293,232 +314,198 @@ 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' : 'bg-[#00E5FF] hover:bg-[#00B8CC] text-black shadow-[0_10px_30px_rgba(0,229,255,0.2)] hover:scale-[1.02]'}`}
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'}`}
>
{generating ? (
<div className="w-full px-6 space-y-2">
<div className="flex justify-between items-center text-[9px] font-black uppercase tracking-tighter text-[#00E5FF]">
<span>{generationStep === 1 ? 'Escrevendo Letra...' : generationStep === 2 ? 'Compondo Melodia...' : generationStep === 3 ? 'Gravando Vocais IA...' : 'Finalizando Hit...'}</span>
<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>
<span>{generationStep * 25}%</span>
</div>
<div className="w-full h-1 bg-white/10 rounded-full overflow-hidden">
<div className="h-full bg-[#00E5FF] transition-all duration-500" style={{ width: `${generationStep * 25}%` }} />
<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>
</div>
) : (
<>
<span className="flex items-center text-sm uppercase tracking-widest"><BaseIcon path={mdiCreation} className="mr-2" /> GERAR MÚSICA REAL</span>
<span className="text-[9px] opacity-60 uppercase font-black mt-1">Criação completa com Voz e Arranjo</span>
<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>
</>
)}
</button>
</div>
</div>
<div className="mt-10">
<div className="p-5 bg-[#121212] rounded-3xl border border-white/5 relative overflow-hidden group">
<div className="absolute -top-10 -right-10 w-24 h-24 bg-[#00E5FF]/10 rounded-full blur-2xl group-hover:bg-[#00E5FF]/20 transition-all" />
<h4 className="text-[10px] font-black text-white uppercase mb-1 flex items-center">
<BaseIcon path={mdiCheckCircleOutline} size={14} className="mr-1 text-[#00E5FF]" />
Modo Profissional Ativo
</h4>
<p className="text-[9px] text-gray-500 uppercase font-bold tracking-tighter">Ilimitado para desenvolvedores</p>
</div>
</div>
</aside>
{/* Main Content - Library Feed */}
<main className="flex-1 flex flex-col bg-[#050505] overflow-hidden">
{/* Top Header */}
<header className="h-20 flex items-center justify-between px-10 bg-[#050505]/60 backdrop-blur-3xl sticky top-0 z-20 border-b border-white/5">
{/* 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-xs uppercase tracking-[0.2em] border-b-2 border-[#00E5FF] py-7">Minhas Criações</button>
<button className="text-gray-600 hover:text-white font-black text-xs uppercase tracking-[0.2em] py-7 transition-colors">Tendências</button>
<button className="text-gray-600 hover:text-white font-black text-xs uppercase tracking-[0.2em] py-7 transition-colors">Comunidade</button>
<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>
</div>
<div className="flex items-center space-x-6">
<div className="flex flex-col items-end">
<span className="text-xs font-black text-white uppercase italic">{currentUser?.firstName || 'User'}</span>
<span className="text-[9px] font-bold text-[#00E5FF] uppercase tracking-widest">Pro Member</span>
</div>
<div className="w-10 h-10 rounded-full bg-white/5 border border-white/10 flex items-center justify-center overflow-hidden">
<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>
</div>
</header>
{/* Scrollable Feed */}
<div className="flex-1 overflow-y-auto p-10 aside-scrollbars bg-gradient-to-b from-[#0a0a0a] to-[#050505]">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-8">
{library.length > 0 ? library.map((track) => (
<div
key={track.id}
className={`group relative bg-[#0d0d0d] rounded-[2rem] overflow-hidden border border-white/5 hover:border-white/20 transition-all duration-500 shadow-2xl ${currentTrack?.id === track.id ? 'ring-2 ring-[#00E5FF]' : 'hover:-translate-y-2'}`}
>
{/* Thumbnail */}
<div className="aspect-square bg-[#141414] 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/40 backdrop-blur-md">
<button
onClick={() => playTrack(track)}
className="w-20 h-20 rounded-full bg-white flex items-center justify-center text-black hover:scale-110 active:scale-95 transition-all shadow-[0_0_40px_rgba(255,255,255,0.3)]"
>
<BaseIcon path={(currentTrack?.id === track.id && isPlaying) ? mdiPause : mdiPlay} size={48} />
</button>
</div>
{/* Genre Tag */}
<div className="absolute top-4 left-4 px-3 py-1 bg-black/60 backdrop-blur-md rounded-full border border-white/10 text-[9px] font-black text-[#00E5FF] uppercase tracking-widest">
{track.bpm || '128'} BPM
</div>
{/* Animated bars if playing */}
{currentTrack?.id === track.id && isPlaying && (
<div className="absolute bottom-4 left-1/2 -translate-x-1/2 flex items-end space-x-1 h-8">
{[...Array(5)].map((_, i) => (
<div key={i} className="w-1 bg-[#00E5FF] rounded-full animate-[bounce_1s_infinite]" style={{ animationDelay: `${i * 0.1}s`, height: `${Math.random() * 100}%` }} />
))}
<div className="flex-1 overflow-y-auto p-10 aside-scrollbars bg-gradient-to-b from-[#080808] to-[#020202]">
{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>
) : (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-8">
{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'}`}
>
<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">
<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)]"
>
<BaseIcon path={(currentTrack?.id === track.id && isPlaying) ? mdiPause : mdiPlay} size={36} />
</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>
)}
</div>
{/* Info */}
<div className="p-6">
<div className="flex justify-between items-start mb-2">
<h3 className="font-black text-white text-base uppercase tracking-tighter truncate w-3/4 leading-none italic">{track.title}</h3>
<BaseIcon path={mdiHeart} size={18} className="text-gray-700 hover:text-red-500 cursor-pointer transition-colors" />
</div>
<p className="text-gray-500 text-[10px] uppercase font-black tracking-[0.2em] mb-4 truncate opacity-60">
{track.key_signature || 'AI Master Mix'}
</p>
<div className="flex items-center justify-between pt-4 border-t border-white/5">
<div className="flex items-center text-[8px] font-black text-gray-400 uppercase tracking-widest">
<BaseIcon path={mdiRobotOutline} size={12} className="mr-1 text-[#00E5FF]" />
ESTÉREO HI-FI
</div>
<button
onClick={() => { setCurrentTrack(track); setShowLyrics(true); }}
className="text-[9px] font-black text-white/40 hover:text-[#BB86FC] uppercase tracking-tighter transition-colors"
>
VER LETRA
</button>
</div>
</div>
</div>
)) : (
<div className="col-span-full py-40 text-center animate-pulse">
<div className="w-24 h-24 bg-white/5 rounded-full flex items-center justify-center mx-auto mb-6 border border-white/5">
<BaseIcon path={mdiPlaylistMusic} size={48} className="text-gray-800" />
{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>
)}
</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" />
</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 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>
<button
onClick={() => { setCurrentTrack(track); setShowLyrics(true); }}
className="text-[8px] font-black text-white/30 hover:text-[#BB86FC] uppercase tracking-tighter transition-colors"
>
LETRA
</button>
</div>
</div>
</div>
<h3 className="text-2xl font-black text-gray-500 uppercase tracking-widest">Pronto para seu primeiro hit?</h3>
<p className="text-gray-700 uppercase text-[10px] font-black tracking-[0.3em] mt-4">Use o painel lateral para começar a geração real</p>
</div>
)}
</div>
))}
{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>
<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>
</div>
)}
</div>
)}
</div>
</main>
{/* Lyrics Sidebar overlay */}
{/* Lyrics Sidebar */}
{showLyrics && currentTrack && (
<div className="fixed inset-0 z-[60] flex justify-end bg-black/60 backdrop-blur-sm transition-all" onClick={() => setShowLyrics(false)}>
<aside className="w-96 h-full bg-[#0d0d0d] border-l border-white/10 flex flex-col p-10 animate-slide-in-right overflow-y-auto aside-scrollbars" onClick={e => e.stopPropagation()}>
<div className="flex items-center justify-between mb-12">
<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>
<h2 className="text-xs font-black text-white uppercase tracking-[0.3em] mb-1">LETRA COMPLETA</h2>
<p className="text-[10px] font-bold text-[#BB86FC] uppercase tracking-widest">Gerado por IA Studio</p>
<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>
</div>
<button onClick={() => setShowLyrics(false)} className="w-10 h-10 rounded-full bg-white/5 hover:bg-white/10 flex items-center justify-center transition-all">
<BaseIcon path={mdiPlus} className="rotate-45" size={24} />
<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>
</div>
<div className="space-y-10">
<div className="group">
<h4 className="text-[10px] font-black text-[#00E5FF] uppercase mb-4 tracking-[0.4em] opacity-50 group-hover:opacity-100 transition-opacity flex items-center">
<div className="w-8 h-px bg-[#00E5FF] mr-3" /> [VERSO 1]
</h4>
<p className="text-base leading-relaxed text-gray-400 font-medium whitespace-pre-wrap">
{currentTrack.ai_data?.lyrics?.verse1 || 'Gerando as letras...'}
</p>
</div>
<div className="group">
<h4 className="text-[10px] font-black text-[#BB86FC] uppercase mb-4 tracking-[0.4em] opacity-50 group-hover:opacity-100 transition-opacity flex items-center">
<div className="w-8 h-px bg-[#BB86FC] mr-3" /> [REFRÃO]
</h4>
<p className="text-lg leading-tight text-white font-black italic">
{currentTrack.ai_data?.lyrics?.chorus || 'Gerando o refrão...'}
</p>
</div>
<div className="group">
<h4 className="text-[10px] font-black text-[#00E5FF] uppercase mb-4 tracking-[0.4em] opacity-50 group-hover:opacity-100 transition-opacity flex items-center">
<div className="w-8 h-px bg-[#00E5FF] mr-3" /> [VERSO 2]
</h4>
<p className="text-base leading-relaxed text-gray-400 font-medium whitespace-pre-wrap">
{currentTrack.ai_data?.lyrics?.verse2 || 'Continuando a história...'}
</p>
</div>
<div className="group">
<h4 className="text-[10px] font-black text-gray-600 uppercase mb-4 tracking-[0.4em] flex items-center">
<div className="w-8 h-px bg-gray-800 mr-3" /> [OUTRO]
</h4>
<p className="text-sm italic text-gray-500">
{currentTrack.ai_data?.lyrics?.outro || 'Finalizando...'}
</p>
</div>
<div className="space-y-12">
{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>
<p className={`leading-relaxed whitespace-pre-wrap ${section === 'chorus' ? 'text-xl font-black text-white italic' : 'text-base text-gray-400 font-medium'}`}>
{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>
)}
</div>
</aside>
</div>
)}
{/* Bottom Player - Immersive Mode */}
{/* Player */}
{currentTrack && (
<div className="fixed bottom-0 left-0 w-full h-28 bg-[#0a0a0a]/90 backdrop-blur-[50px] border-t border-white/5 flex items-center px-10 z-[100] shadow-[0_-20px_50px_rgba(0,0,0,0.5)]">
{/* Track Info */}
<div className="w-1/4 flex items-center space-x-5">
<div className="w-16 h-16 bg-[#141414] rounded-2xl shrink-0 overflow-hidden relative group border border-white/10 shadow-2xl">
<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="w-full h-full flex items-center justify-center relative">
<BaseIcon path={mdiMusic} className="text-white/80" size={24} />
</div>
<div className="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 bg-black/60 transition-all cursor-pointer">
<BaseIcon path={mdiPlus} className="text-white" size={24} />
<BaseIcon path={mdiMusic} className="text-white/60" size={28} />
</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-2">
<span className="text-[9px] font-black text-[#00E5FF] uppercase tracking-widest px-2 py-0.5 bg-[#00E5FF]/10 rounded border border-[#00E5FF]/20">
HI-RES
<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
</span>
<p className="text-gray-500 text-[9px] font-black uppercase tracking-[0.2em] truncate opacity-60">AI ARTIST</p>
<p className="text-gray-600 text-[8px] font-black uppercase tracking-[0.3em] truncate opacity-80">AI PERFORMER</p>
</div>
</div>
</div>
{/* Central Controls */}
<div className="flex-1 flex flex-col items-center space-y-4 px-20">
<div className="flex items-center space-x-10">
<button className="text-gray-600 hover:text-white transition-all transform hover:scale-110">
<BaseIcon path={mdiClockOutline} size={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} />
</button>
<button
onClick={togglePlayback}
className="w-14 h-14 rounded-full bg-white flex items-center justify-center text-black hover:scale-110 active:scale-95 transition-all shadow-[0_0_30px_rgba(255,255,255,0.2)]"
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)]"
>
<BaseIcon path={isPlaying ? mdiPause : mdiPlay} size={32} />
<BaseIcon path={isPlaying ? mdiPause : mdiPlay} size={40} />
</button>
<button
onClick={() => setShowLyrics(!showLyrics)}
className={`transition-all transform hover:scale-110 ${showLyrics ? 'text-[#00E5FF]' : 'text-gray-600 hover:text-white'}`}
className={`transition-all transform hover:scale-125 ${showLyrics ? 'text-[#00E5FF]' : 'text-gray-700 hover:text-white'}`}
>
<BaseIcon path={mdiPlaylistMusic} size={22} />
<BaseIcon path={mdiPlaylistMusic} size={24} />
</button>
</div>
<div className="w-full flex items-center space-x-4">
<span className="text-[9px] font-black text-gray-600 w-10 text-right font-mono tracking-tighter">{formatTime(currentTime)}</span>
<div className="flex-1 relative group h-6 flex items-center">
<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">
<input
type="range"
min="0"
@ -527,29 +514,29 @@ const SunoStudio = () => {
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"
/>
<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" style={{ width: `${progress}%` }} />
<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>
<span className="text-[9px] font-black text-gray-600 w-10 font-mono tracking-tighter">{formatTime(duration)}</span>
<span className="text-[9px] font-black text-gray-600 w-12 font-mono tracking-tighter">{formatTime(duration)}</span>
</div>
</div>
{/* Volume & More Options */}
<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={18} className="text-gray-500 group-hover:text-white transition-colors" />
<div className="w-24 h-1 bg-white/10 rounded-full overflow-hidden relative">
<div className="absolute inset-0 bg-gray-600 w-3/4" />
<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>
</div>
<div className="flex items-center space-x-2">
<div className="flex items-center space-x-3">
<button
onClick={handleDownload}
className="p-3 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white transition-all"
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"
>
<BaseIcon path={mdiDownload} size={20} />
<BaseIcon path={mdiDownload} size={22} />
</button>
<button className="p-3 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white transition-all">
<BaseIcon path={mdiShare} size={20} />
<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>
</div>
</div>
@ -568,18 +555,13 @@ const SunoStudio = () => {
theme="dark"
position="bottom-right"
autoClose={3000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
/>
<style jsx global>{`
@keyframes fade-in {
from { opacity: 0; transform: translateY(10px); }
from { opacity: 0; transform: translateY(15px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
@ -587,20 +569,37 @@ const SunoStudio = () => {
to { transform: translateX(0); }
}
.animate-fade-in {
animation: fade-in 0.5s ease-out forwards;
animation: fade-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.animate-slide-in-right {
animation: slide-in-right 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
animation: slide-in-right 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
input[type="range"]::-webkit-slider-thumb {
appearance: none;
width: 12px;
height: 12px;
width: 14px;
height: 14px;
background: white;
border-radius: 50%;
cursor: pointer;
border: 2px solid #00E5FF;
box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
border: 3px solid #00E5FF;
box-shadow: 0 0 15px rgba(0, 229, 255, 0.8);
transition: transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
transform: scale(1.3);
}
.aside-scrollbars::-webkit-scrollbar {
width: 4px;
}
.aside-scrollbars::-webkit-scrollbar-track {
background: transparent;
}
.aside-scrollbars::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;
}
.aside-scrollbars::-webkit-scrollbar-thumb:hover {
background: rgba(0, 229, 255, 0.2);
}
`}</style>
</div>
@ -611,4 +610,4 @@ SunoStudio.getLayout = function getLayout(page: ReactElement) {
return page;
};
export default SunoStudio;
export default SunoStudio;