A dark, mysterious five-act ARG built around hidden archives and forgotten witnesses.

Viewing files at commit a02fe2fc8753Commit detailsView latest

assets/js/pages/inventory.js 41 lines · 1.1 KB · javascript
1
// Inventory management system
2
3
const InventoryPage = {
4
  render() {
5
    const items = Array.from(GameState.inventory.items.values());
6
    
7
    if (items.length === 0) {
8
      return `
9
        <section class="hero">
10
          <h1>INVENTORY</h1>
11
          <p class="lead">Nothing collected yet.</p>
12
        </section>
13
        <section class="panel">
14
          <p>As you progress through the archive, you will collect artifacts and fragments of knowledge. They will appear here.</p>
15
        </section>
16
      `;
17
    }
18
    
19
    let html = `
20
      <section class="hero">
21
        <h1>INVENTORY</h1>
22
        <p class="lead">${items.length} item(s) collected</p>
23
      </section>
24
      <div class="inventory-grid">
25
    `;
26
    
27
    items.forEach(item => {
28
      html += `
29
        <div class="inventory-item">
30
          <div class="item-icon">${item.icon || '📦'}</div>
31
          <div class="item-name">${item.name}</div>
32
          <div class="item-desc">${item.description}</div>
33
          ${item.notes ? `<div class="item-notes">${item.notes}</div>` : ''}
34
        </div>
35
      `;
36
    });
37
    
38
    html += '</div>';
39
    return html;
40
  }
41
};