creativerse-collab / script.js
Camilo2025's picture
una red social centrada en la colaboración creativa, donde los usuarios puedan co-crear contenido en tiempo real, como música o arte, y luego compartirlo.
5dbc7da verified
Raw History Blame Contribute Delete
1.82 kB
// Sample live collaborations data
const liveCollabs = [
{
id: 1,
title: "Digital Mural Project",
type: "art",
users: 4,
thumb: "http://static.photos/art/320x240/1"
},
{
id: 2,
title: "Ambient Soundscape",
type: "music",
users: 3,
thumb: "http://static.photos/music/320x240/2"
},
{
id: 3,
title: "Poetry & Visuals",
type: "writing",
users: 2,
thumb: "http://static.photos/writing/320x240/3"
},
{
id: 4,
title: "Animation Collab",
type: "animation",
users: 5,
thumb: "http://static.photos/animation/320x240/4"
}
];
document.addEventListener('DOMContentLoaded', () => {
// Render live collaborations
const collabGrid = document.getElementById('liveCollabs');
liveCollabs.forEach(collab => {
const collabCard = document.createElement('div');
collabCard.className = 'collab-card';
collabCard.innerHTML = `
<div class="collab-thumbnail" style="background-image: url('${collab.thumb}')"></div>
<div class="collab-info">
<h3>${collab.title}</h3>
<p>${collab.type}</p>
<div class="collab-users">
${Array(collab.users).fill().map((_, i) =>
`<img src="https://i.pravatar.cc/150?img=${i+10}" class="user-avatar">`
).join('')}
<span class="user-count">+${collab.users}</span>
</div>
</div>
`;
collabCard.addEventListener('click', () => {
window.location.href = `/collab.html?id=${collab.id}`;
});
collabGrid.appendChild(collabCard);
});
// Add celebration effect to CTA buttons
document.querySelectorAll('.btn').forEach(btn => {
btn.addEventListener('click', (e) => {
party.confetti(e.target, {
count: 40,
size: 1.5,
spread: 20
});
});
});
});