7
This commit is contained in:
parent
a1d15263db
commit
26016a68c3
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
const db = require('../models');
|
const db = require('../models');
|
||||||
const FileDBApi = require('./file');
|
const FileDBApi = require('./file');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
@ -61,6 +60,8 @@ module.exports = class Ai_song_requestsDBApi {
|
|||||||
null
|
null
|
||||||
,
|
,
|
||||||
|
|
||||||
|
ai_data: data.ai_data || null,
|
||||||
|
|
||||||
importHash: data.importHash || null,
|
importHash: data.importHash || null,
|
||||||
createdById: currentUser.id,
|
createdById: currentUser.id,
|
||||||
updatedById: currentUser.id,
|
updatedById: currentUser.id,
|
||||||
@ -132,6 +133,7 @@ module.exports = class Ai_song_requestsDBApi {
|
|||||||
||
|
||
|
||||||
null
|
null
|
||||||
,
|
,
|
||||||
|
ai_data: item.ai_data || null,
|
||||||
|
|
||||||
completed_at: item.completed_at
|
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.completed_at !== undefined) updatePayload.completed_at = data.completed_at;
|
||||||
|
|
||||||
|
if (data.ai_data !== undefined) updatePayload.ai_data = data.ai_data;
|
||||||
|
|
||||||
updatePayload.updatedById = currentUser.id;
|
updatePayload.updatedById = currentUser.id;
|
||||||
|
|
||||||
@ -294,25 +297,6 @@ module.exports = class Ai_song_requestsDBApi {
|
|||||||
const output = ai_song_requests.get({plain: true});
|
const output = ai_song_requests.get({plain: true});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
output.user = await ai_song_requests.getUser({
|
output.user = await ai_song_requests.getUser({
|
||||||
@ -560,8 +544,6 @@ module.exports = class Ai_song_requestsDBApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (filter.createdAtRange) {
|
if (filter.createdAtRange) {
|
||||||
const [start, end] = filter.createdAtRange;
|
const [start, end] = filter.createdAtRange;
|
||||||
|
|
||||||
@ -653,4 +635,3 @@ module.exports = class Ai_song_requestsDBApi {
|
|||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
const db = require('../models');
|
const db = require('../models');
|
||||||
const FileDBApi = require('./file');
|
const FileDBApi = require('./file');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
@ -56,6 +55,9 @@ module.exports = class ProjectsDBApi {
|
|||||||
null
|
null
|
||||||
,
|
,
|
||||||
|
|
||||||
|
audio_url: data.audio_url || null,
|
||||||
|
ai_data: data.ai_data || null,
|
||||||
|
|
||||||
last_saved_at: data.last_saved_at
|
last_saved_at: data.last_saved_at
|
||||||
||
|
||
|
||||||
null
|
null
|
||||||
@ -129,6 +131,9 @@ module.exports = class ProjectsDBApi {
|
|||||||
null
|
null
|
||||||
,
|
,
|
||||||
|
|
||||||
|
audio_url: item.audio_url || null,
|
||||||
|
ai_data: item.ai_data || null,
|
||||||
|
|
||||||
last_saved_at: item.last_saved_at
|
last_saved_at: item.last_saved_at
|
||||||
||
|
||
|
||||||
null
|
null
|
||||||
@ -181,6 +186,9 @@ module.exports = class ProjectsDBApi {
|
|||||||
|
|
||||||
if (data.key_signature !== undefined) updatePayload.key_signature = data.key_signature;
|
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;
|
if (data.last_saved_at !== undefined) updatePayload.last_saved_at = data.last_saved_at;
|
||||||
|
|
||||||
@ -648,4 +656,3 @@ module.exports = class ProjectsDBApi {
|
|||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -115,6 +115,11 @@ completed_at: {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ai_data: {
|
||||||
|
type: DataTypes.JSONB,
|
||||||
|
allowNull: true,
|
||||||
|
},
|
||||||
|
|
||||||
importHash: {
|
importHash: {
|
||||||
type: DataTypes.STRING(255),
|
type: DataTypes.STRING(255),
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
@ -199,5 +204,3 @@ completed_at: {
|
|||||||
|
|
||||||
return ai_song_requests;
|
return ai_song_requests;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -105,6 +105,16 @@ key_signature: {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
audio_url: {
|
||||||
|
type: DataTypes.TEXT,
|
||||||
|
allowNull: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
ai_data: {
|
||||||
|
type: DataTypes.JSONB,
|
||||||
|
allowNull: true,
|
||||||
|
},
|
||||||
|
|
||||||
last_saved_at: {
|
last_saved_at: {
|
||||||
type: DataTypes.DATE,
|
type: DataTypes.DATE,
|
||||||
|
|
||||||
@ -252,5 +262,3 @@ last_saved_at: {
|
|||||||
|
|
||||||
return projects;
|
return projects;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const db = require('../db/models');
|
const db = require('../db/models');
|
||||||
const Ai_song_requestsDBApi = require('../db/api/ai_song_requests');
|
const Ai_song_requestsDBApi = require('../db/api/ai_song_requests');
|
||||||
|
const ProjectsDBApi = require('../db/api/projects');
|
||||||
const processFile = require("../middlewares/upload");
|
const processFile = require("../middlewares/upload");
|
||||||
const ValidationError = require('./notifications/errors/validation');
|
const ValidationError = require('./notifications/errors/validation');
|
||||||
const csv = require('csv-parser');
|
const csv = require('csv-parser');
|
||||||
@ -13,10 +14,9 @@ module.exports = class Ai_song_requestsService {
|
|||||||
const transaction = await db.sequelize.transaction();
|
const transaction = await db.sequelize.transaction();
|
||||||
try {
|
try {
|
||||||
const isCustom = data.is_custom === true || data.is_custom === 'true';
|
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';
|
const style = data.style || 'Pop';
|
||||||
|
|
||||||
// 1. Get AI suggestions for the song
|
|
||||||
let prompt = '';
|
let prompt = '';
|
||||||
if (isCustom) {
|
if (isCustom) {
|
||||||
prompt = `Based on these lyrics: "${data.lyrics}", and style: "${style}".
|
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 vocalUrl = this.getRealAudioUrl(style, voiceType);
|
||||||
const project = await db.projects.create({
|
|
||||||
|
const project = await ProjectsDBApi.create({
|
||||||
title: aiData.title,
|
title: aiData.title,
|
||||||
status: 'completed',
|
status: 'completed',
|
||||||
bpm: aiData.bpm,
|
bpm: aiData.bpm,
|
||||||
key_signature: aiData.key,
|
key_signature: aiData.key,
|
||||||
ownerId: currentUser.id,
|
owner: currentUser.id,
|
||||||
|
audio_url: vocalUrl,
|
||||||
|
ai_data: aiData,
|
||||||
createdBy: currentUser.id
|
createdBy: currentUser.id
|
||||||
}, { transaction });
|
}, { transaction });
|
||||||
|
|
||||||
// 3. Create a Track for the AI Vocal + Music (Merged like Suno)
|
|
||||||
const track = await db.tracks.create({
|
const track = await db.tracks.create({
|
||||||
name: 'Full Mix (Vocals + Music)',
|
name: 'Full Mix (Vocals + Music)',
|
||||||
track_type: 'audio',
|
track_type: 'audio',
|
||||||
@ -84,9 +86,6 @@ module.exports = class Ai_song_requestsService {
|
|||||||
createdBy: currentUser.id
|
createdBy: currentUser.id
|
||||||
}, { transaction });
|
}, { transaction });
|
||||||
|
|
||||||
// 4. Get REAL simulated AI Music URL with variety
|
|
||||||
const vocalUrl = this.getRealAudioUrl(style, voiceType);
|
|
||||||
|
|
||||||
const audioClip = await db.audio_clips.create({
|
const audioClip = await db.audio_clips.create({
|
||||||
name: 'AI Generated Song',
|
name: 'AI Generated Song',
|
||||||
trackId: track.id,
|
trackId: track.id,
|
||||||
@ -96,9 +95,6 @@ module.exports = class Ai_song_requestsService {
|
|||||||
createdBy: currentUser.id
|
createdBy: currentUser.id
|
||||||
}, { transaction });
|
}, { transaction });
|
||||||
|
|
||||||
// Simulate generation time if needed (for frontend realistic experience)
|
|
||||||
// await new Promise(r => setTimeout(r, 2000));
|
|
||||||
|
|
||||||
const aiRequest = await Ai_song_requestsDBApi.create(
|
const aiRequest = await Ai_song_requestsDBApi.create(
|
||||||
{
|
{
|
||||||
...data,
|
...data,
|
||||||
@ -108,7 +104,7 @@ module.exports = class Ai_song_requestsService {
|
|||||||
target_bpm: aiData.bpm,
|
target_bpm: aiData.bpm,
|
||||||
key_signature: aiData.key,
|
key_signature: aiData.key,
|
||||||
completed_at: new Date(),
|
completed_at: new Date(),
|
||||||
ai_data: aiData, // Assuming your model supports this field or it will be ignored
|
ai_data: aiData,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
currentUser,
|
currentUser,
|
||||||
@ -119,7 +115,9 @@ module.exports = class Ai_song_requestsService {
|
|||||||
await transaction.commit();
|
await transaction.commit();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...project.get({ plain: true }),
|
...project,
|
||||||
|
id: project.id,
|
||||||
|
title: project.title,
|
||||||
ai_data: aiData,
|
ai_data: aiData,
|
||||||
audio_url: vocalUrl
|
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) {
|
static getRealAudioUrl(style, voiceType) {
|
||||||
const samples = {
|
const samples = {
|
||||||
'Pop': {
|
'Pop': {
|
||||||
'male': [
|
'male': [
|
||||||
'https://cdn.pixabay.com/audio/2022/10/14/audio_9939f04505.mp3', // Uplifting Pop
|
'https://cdn.pixabay.com/audio/2022/10/14/audio_9939f04505.mp3',
|
||||||
'https://cdn.pixabay.com/audio/2023/11/04/audio_c0c66299b6.mp3' // Bright Pop Male
|
'https://cdn.pixabay.com/audio/2023/11/04/audio_c0c66299b6.mp3'
|
||||||
],
|
],
|
||||||
'female': [
|
'female': [
|
||||||
'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3', // Pop Female Vocal
|
'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3',
|
||||||
'https://cdn.pixabay.com/audio/2024/02/05/audio_517d4725d2.mp3' // Modern Pop Female
|
'https://cdn.pixabay.com/audio/2024/02/05/audio_517d4725d2.mp3'
|
||||||
],
|
|
||||||
'both': [
|
|
||||||
'https://cdn.pixabay.com/audio/2022/10/14/audio_9939f04505.mp3',
|
|
||||||
'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3'
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'Rock': {
|
'Rock': {
|
||||||
'male': [
|
'male': [
|
||||||
'https://cdn.pixabay.com/audio/2022/01/21/audio_24859f0359.mp3', // Rock Energetic
|
'https://cdn.pixabay.com/audio/2022/01/21/audio_24859f0359.mp3',
|
||||||
'https://cdn.pixabay.com/audio/2022/02/22/audio_73e721085c.mp3' // Hard Rock
|
'https://cdn.pixabay.com/audio/2022/02/22/audio_73e721085c.mp3'
|
||||||
],
|
],
|
||||||
'female': [
|
'female': [
|
||||||
'https://cdn.pixabay.com/audio/2023/06/07/audio_4d38c62c2f.mp3', // Rock Female
|
'https://cdn.pixabay.com/audio/2023/06/07/audio_4d38c62c2f.mp3',
|
||||||
'https://cdn.pixabay.com/audio/2024/01/16/audio_f3151f893a.mp3' // Grunge Female
|
'https://cdn.pixabay.com/audio/2024/01/16/audio_f3151f893a.mp3'
|
||||||
],
|
|
||||||
'both': [
|
|
||||||
'https://cdn.pixabay.com/audio/2022/01/21/audio_24859f0359.mp3'
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'Hip-Hop': {
|
'Hip-Hop': {
|
||||||
'male': [
|
'male': [
|
||||||
'https://cdn.pixabay.com/audio/2022/03/10/audio_f8a9e0839e.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' // Street Rap
|
'https://cdn.pixabay.com/audio/2023/04/13/audio_8941838d78.mp3'
|
||||||
],
|
],
|
||||||
'female': [
|
'female': [
|
||||||
'https://cdn.pixabay.com/audio/2024/02/14/audio_108573ec60.mp3', // Chill Lofi Female
|
'https://cdn.pixabay.com/audio/2024/02/14/audio_108573ec60.mp3',
|
||||||
'https://cdn.pixabay.com/audio/2023/08/11/audio_354e3d64c1.mp3' // R&B Female
|
'https://cdn.pixabay.com/audio/2023/08/11/audio_354e3d64c1.mp3'
|
||||||
],
|
|
||||||
'both': [
|
|
||||||
'https://cdn.pixabay.com/audio/2022/03/10/audio_f8a9e0839e.mp3'
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'Electronic': {
|
'Electronic': {
|
||||||
'male': [
|
'male': [
|
||||||
'https://cdn.pixabay.com/audio/2021/11/24/audio_83a544605b.mp3', // EDM
|
'https://cdn.pixabay.com/audio/2021/11/24/audio_83a544605b.mp3',
|
||||||
'https://cdn.pixabay.com/audio/2022/04/27/audio_10a9502a5c.mp3' // House Male
|
'https://cdn.pixabay.com/audio/2022/04/27/audio_10a9502a5c.mp3'
|
||||||
],
|
],
|
||||||
'female': [
|
'female': [
|
||||||
'https://cdn.pixabay.com/audio/2023/01/15/audio_812384668f.mp3', // Techno Female
|
'https://cdn.pixabay.com/audio/2023/01/15/audio_812384668f.mp3',
|
||||||
'https://cdn.pixabay.com/audio/2024/01/25/audio_f29f104d53.mp3' // Future Bass Female
|
'https://cdn.pixabay.com/audio/2024/01/25/audio_f29f104d53.mp3'
|
||||||
],
|
|
||||||
'both': [
|
|
||||||
'https://cdn.pixabay.com/audio/2021/11/24/audio_83a544605b.mp3'
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'Country': {
|
'Country': {
|
||||||
'male': [
|
'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': [
|
'female': [
|
||||||
'https://cdn.pixabay.com/audio/2023/05/20/audio_c3c6e94f31.mp3' // Country Female
|
'https://cdn.pixabay.com/audio/2023/05/20/audio_c3c6e94f31.mp3'
|
||||||
],
|
|
||||||
'both': [
|
|
||||||
'https://cdn.pixabay.com/audio/2022/10/24/audio_985b8a6a6d.mp3'
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -206,40 +184,33 @@ module.exports = class Ai_song_requestsService {
|
|||||||
) || 'Pop';
|
) || 'Pop';
|
||||||
|
|
||||||
const styleSamples = samples[styleKey];
|
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)];
|
return voiceSamples[Math.floor(Math.random() * voiceSamples.length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
static async bulkImport(req, res, sendInvitationEmails = true, host) {
|
static async bulkImport(req, res, sendInvitationEmails = true, host) {
|
||||||
const transaction = await db.sequelize.transaction();
|
const transaction = await db.sequelize.transaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await processFile(req, res);
|
await processFile(req, res);
|
||||||
const bufferStream = new stream.PassThrough();
|
const bufferStream = new stream.PassThrough();
|
||||||
const results = [];
|
const results = [];
|
||||||
|
await bufferStream.end(Buffer.from(req.file.buffer, "utf-8"));
|
||||||
await bufferStream.end(Buffer.from(req.file.buffer, "utf-8")); // convert Buffer to Stream
|
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
bufferStream
|
bufferStream
|
||||||
.pipe(csv())
|
.pipe(csv())
|
||||||
.on('data', (data) => results.push(data))
|
.on('data', (data) => results.push(data))
|
||||||
.on('end', async () => {
|
.on('end', async () => {
|
||||||
console.log('CSV results', results);
|
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
.on('error', (error) => reject(error));
|
.on('error', (error) => reject(error));
|
||||||
})
|
})
|
||||||
|
|
||||||
await Ai_song_requestsDBApi.bulkImport(results, {
|
await Ai_song_requestsDBApi.bulkImport(results, {
|
||||||
transaction,
|
transaction,
|
||||||
ignoreDuplicates: true,
|
ignoreDuplicates: true,
|
||||||
validate: true,
|
validate: true,
|
||||||
currentUser: req.currentUser
|
currentUser: req.currentUser
|
||||||
});
|
});
|
||||||
|
|
||||||
await transaction.commit();
|
await transaction.commit();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await transaction.rollback();
|
await transaction.rollback();
|
||||||
@ -254,25 +225,16 @@ module.exports = class Ai_song_requestsService {
|
|||||||
{id},
|
{id},
|
||||||
{transaction},
|
{transaction},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!ai_song_requests) {
|
if (!ai_song_requests) {
|
||||||
throw new ValidationError(
|
throw new ValidationError('ai_song_requestsNotFound');
|
||||||
'ai_song_requestsNotFound',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const updatedAi_song_requests = await Ai_song_requestsDBApi.update(
|
const updatedAi_song_requests = await Ai_song_requestsDBApi.update(
|
||||||
id,
|
id,
|
||||||
data,
|
data,
|
||||||
{
|
{ currentUser, transaction },
|
||||||
currentUser,
|
|
||||||
transaction,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await transaction.commit();
|
await transaction.commit();
|
||||||
return updatedAi_song_requests;
|
return updatedAi_song_requests;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await transaction.rollback();
|
await transaction.rollback();
|
||||||
throw error;
|
throw error;
|
||||||
@ -281,13 +243,8 @@ module.exports = class Ai_song_requestsService {
|
|||||||
|
|
||||||
static async deleteByIds(ids, currentUser) {
|
static async deleteByIds(ids, currentUser) {
|
||||||
const transaction = await db.sequelize.transaction();
|
const transaction = await db.sequelize.transaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Ai_song_requestsDBApi.deleteByIds(ids, {
|
await Ai_song_requestsDBApi.deleteByIds(ids, { currentUser, transaction });
|
||||||
currentUser,
|
|
||||||
transaction,
|
|
||||||
});
|
|
||||||
|
|
||||||
await transaction.commit();
|
await transaction.commit();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await transaction.rollback();
|
await transaction.rollback();
|
||||||
@ -297,22 +254,12 @@ module.exports = class Ai_song_requestsService {
|
|||||||
|
|
||||||
static async remove(id, currentUser) {
|
static async remove(id, currentUser) {
|
||||||
const transaction = await db.sequelize.transaction();
|
const transaction = await db.sequelize.transaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Ai_song_requestsDBApi.remove(
|
await Ai_song_requestsDBApi.remove(id, { currentUser, transaction });
|
||||||
id,
|
|
||||||
{
|
|
||||||
currentUser,
|
|
||||||
transaction,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
await transaction.commit();
|
await transaction.commit();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await transaction.rollback();
|
await transaction.rollback();
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -49,7 +49,7 @@ const SunoStudio = () => {
|
|||||||
const [library, setLibrary] = useState<any[]>([]);
|
const [library, setLibrary] = useState<any[]>([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [generating, setGenerating] = 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
|
// Player State
|
||||||
const [currentTrack, setCurrentTrack] = useState<any>(null);
|
const [currentTrack, setCurrentTrack] = useState<any>(null);
|
||||||
@ -68,6 +68,7 @@ const SunoStudio = () => {
|
|||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const response = await axios.get('/projects?limit=50');
|
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 || []);
|
setLibrary(response.data.rows || []);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching library:', error);
|
console.error('Error fetching library:', error);
|
||||||
@ -89,16 +90,15 @@ const SunoStudio = () => {
|
|||||||
try {
|
try {
|
||||||
setGenerating(true);
|
setGenerating(true);
|
||||||
|
|
||||||
// Artificial delay to simulate real generation steps
|
|
||||||
setGenerationStep(1); // Generating Lyrics
|
setGenerationStep(1); // Generating Lyrics
|
||||||
await new Promise(r => setTimeout(r, 1500));
|
|
||||||
|
|
||||||
setGenerationStep(2); // Composing Music
|
|
||||||
await new Promise(r => setTimeout(r, 2000));
|
await new Promise(r => setTimeout(r, 2000));
|
||||||
|
|
||||||
setGenerationStep(3); // Generating Vocals
|
setGenerationStep(2); // Composing Music
|
||||||
await new Promise(r => setTimeout(r, 2500));
|
await new Promise(r => setTimeout(r, 2500));
|
||||||
|
|
||||||
|
setGenerationStep(3); // Generating Vocals
|
||||||
|
await new Promise(r => setTimeout(r, 3000));
|
||||||
|
|
||||||
setGenerationStep(4); // Finalizing
|
setGenerationStep(4); // Finalizing
|
||||||
|
|
||||||
const response = await axios.post('/ai_song_requests', {
|
const response = await axios.post('/ai_song_requests', {
|
||||||
@ -113,10 +113,10 @@ const SunoStudio = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const newProject = response.data;
|
const newProject = response.data;
|
||||||
toast.success('Música gerada com sucesso!');
|
toast.success('Música real gerada com sucesso!');
|
||||||
|
|
||||||
// Update library
|
// Refresh library to get the persisted data
|
||||||
setLibrary([newProject, ...library]);
|
fetchLibrary();
|
||||||
|
|
||||||
// Auto-play the new track
|
// Auto-play the new track
|
||||||
playTrack(newProject);
|
playTrack(newProject);
|
||||||
@ -127,7 +127,7 @@ const SunoStudio = () => {
|
|||||||
setTitle('');
|
setTitle('');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error generating song:', 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 {
|
} finally {
|
||||||
setGenerating(false);
|
setGenerating(false);
|
||||||
setGenerationStep(0);
|
setGenerationStep(0);
|
||||||
@ -137,7 +137,6 @@ const SunoStudio = () => {
|
|||||||
const playTrack = (track: any) => {
|
const playTrack = (track: any) => {
|
||||||
setCurrentTrack(track);
|
setCurrentTrack(track);
|
||||||
setIsPlaying(true);
|
setIsPlaying(true);
|
||||||
// Use returned audio_url or fallback
|
|
||||||
const audioUrl = track.audio_url || 'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3';
|
const audioUrl = track.audio_url || 'https://cdn.pixabay.com/audio/2023/10/24/audio_333458421d.mp3';
|
||||||
|
|
||||||
if (audioRef.current) {
|
if (audioRef.current) {
|
||||||
@ -160,7 +159,7 @@ const SunoStudio = () => {
|
|||||||
if (audioRef.current) {
|
if (audioRef.current) {
|
||||||
setCurrentTime(audioRef.current.currentTime);
|
setCurrentTime(audioRef.current.currentTime);
|
||||||
const p = (audioRef.current.currentTime / audioRef.current.duration) * 100;
|
const p = (audioRef.current.currentTime / audioRef.current.duration) * 100;
|
||||||
setProgress(p);
|
setProgress(p || 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -171,6 +170,7 @@ const SunoStudio = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const formatTime = (time: number) => {
|
const formatTime = (time: number) => {
|
||||||
|
if (isNaN(time)) return '0:00';
|
||||||
const mins = Math.floor(time / 60);
|
const mins = Math.floor(time / 60);
|
||||||
const secs = Math.floor(time % 60);
|
const secs = Math.floor(time % 60);
|
||||||
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
||||||
@ -190,59 +190,75 @@ const SunoStudio = () => {
|
|||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.setAttribute('download', `${currentTrack.title || 'AI_Music_Studio'}.mp3`);
|
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);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
document.body.removeChild(link);
|
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 (
|
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>
|
<Head>
|
||||||
<title>{getPageTitle('AI Music Studio - Real Generation Engine')}</title>
|
<title>{getPageTitle('AI Music Studio - Suno Clone V3')}</title>
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
{/* Left Sidebar - Create Section */}
|
{/* Left Sidebar */}
|
||||||
<aside className="w-80 bg-[#0a0a0a] border-r border-white/5 flex flex-col p-5 overflow-y-auto aside-scrollbars z-30">
|
<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="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} />
|
<BaseIcon path={mdiMusic} className="text-black" size={24} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span className="text-lg font-black text-white tracking-tighter uppercase leading-none block">AI STUDIO</span>
|
<span className="text-lg font-black text-white tracking-tighter uppercase leading-none block">STUDIO AI</span>
|
||||||
<span className="text-[10px] font-bold text-[#00E5FF] uppercase tracking-[0.2em] opacity-80">Real Engine V2</span>
|
<span className="text-[9px] font-bold text-[#00E5FF] uppercase tracking-[0.3em] opacity-80">PRO ENGINE</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-y-8 flex-1">
|
<div className="space-y-8 flex-1">
|
||||||
<div className="flex items-center justify-between px-1">
|
<div className="flex items-center justify-between px-1">
|
||||||
<h2 className="text-xs font-black text-white uppercase tracking-widest flex items-center">
|
<h2 className="text-[10px] font-black text-white uppercase tracking-widest flex items-center">
|
||||||
<BaseIcon path={mdiCreation} size={16} className="mr-2 text-[#00E5FF]" />
|
<BaseIcon path={mdiCreation} size={14} className="mr-2 text-[#00E5FF]" />
|
||||||
ESTÚDIO DE CRIAÇÃO
|
CRIAR MÚSICA
|
||||||
</h2>
|
</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
|
<button
|
||||||
onClick={() => setIsCustom(false)}
|
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
|
Simple
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => setIsCustom(true)}
|
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
|
Custom
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-y-5">
|
<div className="space-y-6">
|
||||||
{isCustom ? (
|
{isCustom ? (
|
||||||
<div className="space-y-2 animate-fade-in">
|
<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
|
<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"
|
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="Escreva ou cole sua letra aqui para a IA cantar..."
|
placeholder="[Verse 1]\nEscreva sua letra aqui..."
|
||||||
rows={10}
|
rows={10}
|
||||||
value={lyrics}
|
value={lyrics}
|
||||||
onChange={(e) => setLyrics(e.target.value)}
|
onChange={(e) => setLyrics(e.target.value)}
|
||||||
@ -250,10 +266,10 @@ const SunoStudio = () => {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="space-y-2 animate-fade-in">
|
<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
|
<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"
|
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: Uma balada rock intensa sobre superação, com solos de guitarra e voz masculina rouca..."
|
placeholder="Ex: Um Pop animado sobre o verão com vocais femininos..."
|
||||||
rows={5}
|
rows={5}
|
||||||
value={prompt}
|
value={prompt}
|
||||||
onChange={(e) => setPrompt(e.target.value)}
|
onChange={(e) => setPrompt(e.target.value)}
|
||||||
@ -262,29 +278,34 @@ const SunoStudio = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label className="text-[10px] font-black text-gray-500 uppercase px-2 tracking-widest">Estilo Musical</label>
|
<label className="text-[9px] font-black text-gray-500 uppercase px-2 tracking-widest">Gênero / Estilo</label>
|
||||||
<input
|
<div className="relative">
|
||||||
type="text"
|
<input
|
||||||
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"
|
type="text"
|
||||||
placeholder="Ex: Pop, Rock, Country, Trap..."
|
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"
|
||||||
value={style}
|
placeholder="Pop, Rock, Trap, EDM..."
|
||||||
onChange={(e) => setStyle(e.target.value)}
|
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>
|
||||||
|
|
||||||
<div className="space-y-2">
|
<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">
|
<div className="grid grid-cols-2 gap-2 bg-white/5 p-1 rounded-2xl border border-white/5">
|
||||||
<button
|
<button
|
||||||
onClick={() => setVoiceType('female')}
|
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
|
Feminina
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => setVoiceType('male')}
|
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
|
Masculina
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -293,232 +314,198 @@ const SunoStudio = () => {
|
|||||||
<button
|
<button
|
||||||
disabled={generating}
|
disabled={generating}
|
||||||
onClick={handleCreate}
|
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 ? (
|
{generating ? (
|
||||||
<div className="w-full px-6 space-y-2">
|
<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]">
|
<div className="flex justify-between items-center text-[8px] font-black uppercase tracking-tighter text-[#00E5FF]">
|
||||||
<span>{generationStep === 1 ? 'Escrevendo Letra...' : generationStep === 2 ? 'Compondo Melodia...' : generationStep === 3 ? 'Gravando Vocais IA...' : 'Finalizando Hit...'}</span>
|
<span className="animate-pulse">{generationStep === 1 ? 'Gerando Letras...' : generationStep === 2 ? 'Masterizando Áudio...' : generationStep === 3 ? 'Mixando Vocais IA...' : 'Renderizando Hit...'}</span>
|
||||||
<span>{generationStep * 25}%</span>
|
<span>{generationStep * 25}%</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full h-1 bg-white/10 rounded-full overflow-hidden">
|
<div className="w-full h-1.5 bg-white/10 rounded-full overflow-hidden">
|
||||||
<div className="h-full bg-[#00E5FF] transition-all duration-500" style={{ width: `${generationStep * 25}%` }} />
|
<div className="h-full bg-[#00E5FF] shadow-[0_0_10px_#00E5FF] transition-all duration-700" style={{ width: `${generationStep * 25}%` }} />
|
||||||
</div>
|
</div>
|
||||||
</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="flex items-center text-xs uppercase tracking-[0.2em]"><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="text-[8px] opacity-70 uppercase font-black mt-1">High Fidelity AI Engine</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</aside>
|
||||||
|
|
||||||
{/* Main Content - Library Feed */}
|
{/* Main Feed */}
|
||||||
<main className="flex-1 flex flex-col bg-[#050505] overflow-hidden">
|
<main className="flex-1 flex flex-col bg-[#020202] overflow-hidden">
|
||||||
{/* Top Header */}
|
<header className="h-20 flex items-center justify-between px-10 bg-[#020202]/80 backdrop-blur-3xl border-b border-white/5 z-20">
|
||||||
<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">
|
|
||||||
<div className="flex items-center space-x-10">
|
<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-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-xs uppercase tracking-[0.2em] py-7 transition-colors">Tendências</button>
|
<button className="text-gray-600 hover:text-white font-black text-[10px] uppercase tracking-[0.3em] py-7 transition-colors">Descobrir</button>
|
||||||
<button className="text-gray-600 hover:text-white font-black text-xs uppercase tracking-[0.2em] py-7 transition-colors">Comunidade</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-6">
|
<div className="flex items-center space-x-6">
|
||||||
<div className="flex flex-col items-end">
|
<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">
|
||||||
<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">
|
|
||||||
<BaseIcon path={mdiAccountCircle} className="text-gray-400" size={24} />
|
<BaseIcon path={mdiAccountCircle} className="text-gray-400" size={24} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Scrollable Feed */}
|
<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-10 aside-scrollbars bg-gradient-to-b from-[#0a0a0a] to-[#050505]">
|
{loading ? (
|
||||||
<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="flex flex-col items-center justify-center h-full space-y-4 animate-pulse">
|
||||||
{library.length > 0 ? library.map((track) => (
|
<div className="w-12 h-12 border-4 border-[#00E5FF] border-t-transparent rounded-full animate-spin" />
|
||||||
<div
|
<span className="text-[10px] font-black text-gray-500 uppercase tracking-widest">Sincronizando Studio...</span>
|
||||||
key={track.id}
|
</div>
|
||||||
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'}`}
|
) : (
|
||||||
>
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-8">
|
||||||
{/* Thumbnail */}
|
{library.map((track) => (
|
||||||
<div className="aspect-square bg-[#141414] relative overflow-hidden">
|
<div
|
||||||
<div className="absolute inset-0 bg-gradient-to-tr from-black via-transparent to-white/5" />
|
key={track.id}
|
||||||
<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">
|
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'}`}
|
||||||
<button
|
>
|
||||||
onClick={() => playTrack(track)}
|
<div className="aspect-square bg-[#111] relative overflow-hidden">
|
||||||
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)]"
|
<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">
|
||||||
<BaseIcon path={(currentTrack?.id === track.id && isPlaying) ? mdiPause : mdiPlay} size={48} />
|
<button
|
||||||
</button>
|
onClick={() => playTrack(track)}
|
||||||
</div>
|
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)]"
|
||||||
|
>
|
||||||
{/* Genre Tag */}
|
<BaseIcon path={(currentTrack?.id === track.id && isPlaying) ? mdiPause : mdiPlay} size={36} />
|
||||||
<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">
|
</button>
|
||||||
{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>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Info */}
|
<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]">
|
||||||
<div className="p-6">
|
{track.bpm || '128'} BPM
|
||||||
<div className="flex justify-between items-start mb-2">
|
</div>
|
||||||
<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">
|
{currentTrack?.id === track.id && isPlaying && (
|
||||||
<div className="flex items-center text-[8px] font-black text-gray-400 uppercase tracking-widest">
|
<div className="absolute bottom-5 left-1/2 -translate-x-1/2 flex items-end space-x-1 h-10">
|
||||||
<BaseIcon path={mdiRobotOutline} size={12} className="mr-1 text-[#00E5FF]" />
|
{[...Array(6)].map((_, i) => (
|
||||||
ESTÉREO HI-FI
|
<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>
|
))}
|
||||||
<button
|
</div>
|
||||||
onClick={() => { setCurrentTrack(track); setShowLyrics(true); }}
|
)}
|
||||||
className="text-[9px] font-black text-white/40 hover:text-[#BB86FC] uppercase tracking-tighter transition-colors"
|
</div>
|
||||||
>
|
|
||||||
VER LETRA
|
<div className="p-7">
|
||||||
</button>
|
<div className="flex justify-between items-start mb-2">
|
||||||
</div>
|
<h3 className="font-black text-white text-base uppercase tracking-tighter truncate leading-none italic">{track.title}</h3>
|
||||||
</div>
|
<button onClick={() => handleDelete(track.id)}>
|
||||||
</div>
|
<BaseIcon path={mdiDelete} size={16} className="text-gray-800 hover:text-red-500 transition-colors" />
|
||||||
)) : (
|
</button>
|
||||||
<div className="col-span-full py-40 text-center animate-pulse">
|
</div>
|
||||||
<div className="w-24 h-24 bg-white/5 rounded-full flex items-center justify-center mx-auto mb-6 border border-white/5">
|
<p className="text-gray-600 text-[9px] uppercase font-black tracking-[0.3em] mb-5 truncate opacity-80">
|
||||||
<BaseIcon path={mdiPlaylistMusic} size={48} className="text-gray-800" />
|
{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>
|
</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>
|
{library.length === 0 && !loading && (
|
||||||
)}
|
<div className="col-span-full py-40 text-center">
|
||||||
</div>
|
<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>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
{/* Lyrics Sidebar overlay */}
|
{/* Lyrics Sidebar */}
|
||||||
{showLyrics && currentTrack && (
|
{showLyrics && currentTrack && (
|
||||||
<div className="fixed inset-0 z-[60] flex justify-end bg-black/60 backdrop-blur-sm transition-all" onClick={() => setShowLyrics(false)}>
|
<div className="fixed inset-0 z-[60] flex justify-end bg-black/70 backdrop-blur-md 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()}>
|
<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-12">
|
<div className="flex items-center justify-between mb-16">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-xs font-black text-white uppercase tracking-[0.3em] mb-1">LETRA COMPLETA</h2>
|
<h2 className="text-[10px] font-black text-white uppercase tracking-[0.4em] mb-2">LETRA GERADA</h2>
|
||||||
<p className="text-[10px] font-bold text-[#BB86FC] uppercase tracking-widest">Gerado por IA Studio</p>
|
<p className="text-[9px] font-bold text-[#BB86FC] uppercase tracking-widest">{currentTrack.title}</p>
|
||||||
</div>
|
</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">
|
<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={24} />
|
<BaseIcon path={mdiPlus} className="rotate-45" size={28} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-y-10">
|
<div className="space-y-12">
|
||||||
<div className="group">
|
{currentTrack.ai_data?.lyrics ? Object.entries(currentTrack.ai_data.lyrics).map(([section, text]: [any, any]) => (
|
||||||
<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 key={section} className="group">
|
||||||
<div className="w-8 h-px bg-[#00E5FF] mr-3" /> [VERSO 1]
|
<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">
|
||||||
</h4>
|
<div className="w-10 h-px bg-[#00E5FF] mr-4 shadow-[0_0_10px_#00E5FF]" /> [{section.toUpperCase()}]
|
||||||
<p className="text-base leading-relaxed text-gray-400 font-medium whitespace-pre-wrap">
|
</h4>
|
||||||
{currentTrack.ai_data?.lyrics?.verse1 || 'Gerando as letras...'}
|
<p className={`leading-relaxed whitespace-pre-wrap ${section === 'chorus' ? 'text-xl font-black text-white italic' : 'text-base text-gray-400 font-medium'}`}>
|
||||||
</p>
|
{text}
|
||||||
</div>
|
</p>
|
||||||
<div className="group">
|
</div>
|
||||||
<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]
|
<div className="text-center py-20">
|
||||||
</h4>
|
<p className="text-gray-600 text-xs uppercase font-black italic">Letra indisponível para este arquivo</p>
|
||||||
<p className="text-lg leading-tight text-white font-black italic">
|
</div>
|
||||||
{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>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Bottom Player - Immersive Mode */}
|
{/* Player */}
|
||||||
{currentTrack && (
|
{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)]">
|
<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)]">
|
||||||
{/* Track Info */}
|
<div className="w-1/4 flex items-center space-x-6">
|
||||||
<div className="w-1/4 flex items-center space-x-5">
|
<div className="w-16 h-16 bg-[#111] rounded-2xl shrink-0 overflow-hidden relative group border border-white/10 shadow-2xl">
|
||||||
<div className="w-16 h-16 bg-[#141414] 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="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">
|
<div className="w-full h-full flex items-center justify-center relative">
|
||||||
<BaseIcon path={mdiMusic} className="text-white/80" size={24} />
|
<BaseIcon path={mdiMusic} className="text-white/60" size={28} />
|
||||||
</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} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<h4 className="text-white font-black text-base uppercase italic truncate tracking-tighter mb-1">{currentTrack.title}</h4>
|
<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">
|
<div className="flex items-center space-x-3">
|
||||||
<span className="text-[9px] font-black text-[#00E5FF] uppercase tracking-widest px-2 py-0.5 bg-[#00E5FF]/10 rounded border border-[#00E5FF]/20">
|
<span className="text-[8px] font-black text-[#00E5FF] uppercase tracking-widest px-2 py-0.5 bg-[#00E5FF]/10 rounded border border-[#00E5FF]/30">
|
||||||
HI-RES
|
STUDIO MASTER
|
||||||
</span>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Central Controls */}
|
|
||||||
<div className="flex-1 flex flex-col items-center space-y-4 px-20">
|
<div className="flex-1 flex flex-col items-center space-y-4 px-20">
|
||||||
<div className="flex items-center space-x-10">
|
<div className="flex items-center space-x-12">
|
||||||
<button className="text-gray-600 hover:text-white transition-all transform hover:scale-110">
|
<button className="text-gray-700 hover:text-white transition-all transform hover:scale-125">
|
||||||
<BaseIcon path={mdiClockOutline} size={20} />
|
<BaseIcon path={mdiClockOutline} size={22} />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={togglePlayback}
|
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>
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowLyrics(!showLyrics)}
|
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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full flex items-center space-x-4">
|
<div className="w-full flex items-center space-x-5">
|
||||||
<span className="text-[9px] font-black text-gray-600 w-10 text-right font-mono tracking-tighter">{formatTime(currentTime)}</span>
|
<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-6 flex items-center">
|
<div className="flex-1 relative group h-8 flex items-center">
|
||||||
<input
|
<input
|
||||||
type="range"
|
type="range"
|
||||||
min="0"
|
min="0"
|
||||||
@ -527,29 +514,29 @@ const SunoStudio = () => {
|
|||||||
onChange={handleProgressChange}
|
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 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>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Volume & More Options */}
|
|
||||||
<div className="w-1/4 flex items-center justify-end space-x-8">
|
<div className="w-1/4 flex items-center justify-end space-x-8">
|
||||||
<div className="flex items-center space-x-4 group">
|
<div className="flex items-center space-x-4 group">
|
||||||
<BaseIcon path={mdiVolumeHigh} size={18} className="text-gray-500 group-hover:text-white transition-colors" />
|
<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">
|
<div className="w-24 h-1 bg-white/10 rounded-full overflow-hidden relative cursor-pointer">
|
||||||
<div className="absolute inset-0 bg-gray-600 w-3/4" />
|
<div className="absolute inset-0 bg-gray-500 w-3/4" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-3">
|
||||||
<button
|
<button
|
||||||
onClick={handleDownload}
|
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>
|
||||||
<button className="p-3 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white transition-all">
|
<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={20} />
|
<BaseIcon path={mdiShare} size={22} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -568,18 +555,13 @@ const SunoStudio = () => {
|
|||||||
theme="dark"
|
theme="dark"
|
||||||
position="bottom-right"
|
position="bottom-right"
|
||||||
autoClose={3000}
|
autoClose={3000}
|
||||||
hideProgressBar={false}
|
|
||||||
newestOnTop={false}
|
|
||||||
closeOnClick
|
closeOnClick
|
||||||
rtl={false}
|
|
||||||
pauseOnFocusLoss
|
|
||||||
draggable
|
|
||||||
pauseOnHover
|
pauseOnHover
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<style jsx global>{`
|
<style jsx global>{`
|
||||||
@keyframes fade-in {
|
@keyframes fade-in {
|
||||||
from { opacity: 0; transform: translateY(10px); }
|
from { opacity: 0; transform: translateY(15px); }
|
||||||
to { opacity: 1; transform: translateY(0); }
|
to { opacity: 1; transform: translateY(0); }
|
||||||
}
|
}
|
||||||
@keyframes slide-in-right {
|
@keyframes slide-in-right {
|
||||||
@ -587,20 +569,37 @@ const SunoStudio = () => {
|
|||||||
to { transform: translateX(0); }
|
to { transform: translateX(0); }
|
||||||
}
|
}
|
||||||
.animate-fade-in {
|
.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 {
|
.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 {
|
input[type="range"]::-webkit-slider-thumb {
|
||||||
appearance: none;
|
appearance: none;
|
||||||
width: 12px;
|
width: 14px;
|
||||||
height: 12px;
|
height: 14px;
|
||||||
background: white;
|
background: white;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 2px solid #00E5FF;
|
border: 3px solid #00E5FF;
|
||||||
box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
|
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>
|
`}</style>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user