File size: 1,817 Bytes
5dbc7da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// 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
      });
    });
  });
});