← back to Model Arena

data/artifacts/17f6791645f9/qwen3-14b.html

467 lines

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Relic Viewer: The Codex of Maelis</title>
  <style>
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: "Georgia", serif;
      background: #1a1a1a;
      color: #e0e0e0;
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      overflow: hidden;
    }

    header {
      padding: 1rem 2rem;
      background: #2a2a2a;
      color: #fff;
      text-align: center;
      font-size: 1.2rem;
      border-bottom: 2px solid #444;
    }

    main {
      flex: 1;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
    }

    .scene {
      width: 100%;
      height: 100%;
      perspective: 800px;
      position: relative;
    }

    .container {
      width: 100%;
      height: 100%;
      position: absolute;
      transform-style: preserve-3d;
      transition: transform 0.4s ease-out;
    }

    .artifact {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
    }

    .face {
      position: absolute;
      width: 200px;
      height: 200px;
      background: #444;
      border: 4px solid #666;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      font-size: 1.2rem;
      color: #fff;
      user-select: none;
      cursor: pointer;
      transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
      will-change: transform;
    }

    .face:hover {
      background: #555;
      box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    }

    .front { transform: rotateY(0deg) translateZ(100px); }
    .back { transform: rotateY(180deg) translateZ(100px); }
    .left { transform: rotateY(-90deg) translateZ(100px); }
    .right { transform: rotateY(90deg) translateZ(100px); }
    .top { transform: rotateX(90deg) translateZ(100px); }
    .bottom { transform: rotateX(-90deg) translateZ(100px); }

    .controls {
      position: absolute;
      top: 20px;
      left: 20px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      background: rgba(0, 0, 0, 0.5);
      padding: 10px 12px;
      border-radius: 8px;
    }

    .controls button,
    .controls input,
    .controls select,
    .controls a {
      background: #333;
      color: #fff;
      border: 1px solid #555;
      padding: 6px 12px;
      font-size: 14px;
      border-radius: 6px;
      cursor: pointer;
      transition: background 0.2s, box-shadow 0.2s;
      will-change: background;
      box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
    }

    .controls button:hover,
    .controls a:hover,
    .controls input:focus,
    .controls select:focus {
      background: #555;
      box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
    }

    .info {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0, 0, 0, 0.7);
      padding: 12px 20px;
      border-radius: 8px;
      max-width: 80%;
      font-size: 14px;
      text-align: center;
      display: none;
      animation: fadeIn 0.3s ease-in;
    }

    .info.show {
      display: block;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateX(-50%) scale(0.9); }
      to { opacity: 1; transform: translateX(-50%) scale(1); }
    }

    .facet-selected {
      background: #888;
      box-shadow: 0 0 30px rgba(255, 140, 0, 0.6);
    }

    .toggle-group {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-top: 10px;
    }

    .toggle-group input[type="checkbox"] {
      transform: scale(1.5);
    }

    .error-state,
    .empty-state,
    .complete-state {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      padding: 20px;
      background: rgba(0, 0, 0, 0.8);
      border-radius: 10px;
      text-align: center;
      color: #fff;
      display: none;
    }

    .error-state.show,
    .empty-state.show,
    .complete-state.show {
      display: block;
    }

    footer {
      padding: 1rem 2rem;
      background: #222;
      color: #aaa;
      font-size: 0.9rem;
      text-align: center;
    }

    @media (max-width: 768px) {
      .controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        left: 10px;
        top: 10px;
        padding: 6px 10px;
      }

      .controls button,
      .controls input,
      .controls select,
      .controls a {
        font-size: 12px;
      }
    }

    @media (prefers-reduced-motion: no-preference) {
      .container {
        transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .container {
        transition: none;
      }
    }

    .info img {
      width: 100%;
      max-width: 300px;
      margin-top: 10px;
      border-radius: 6px;
    }
  </style>
</head>
<body>
  <header>
    Relic Viewer: The Codex of Maelis – A Forgotten Language of Stars
  </header>
  <main>
    <div class="scene">
      <div id="container" class="container" tabindex="0">
        <div class="artifact">
          <div class="face front" data-name="front" data-era="Era of Celestial Dawn (457 BCE)">Front</div>
          <div class="face back" data-name="back" data-era="Era of Celestial Dawn (457 BCE)">Back</div>
          <div class="face left" data-name="left" data-era="Era of Celestial Dawn (457 BCE)">Left</div>
          <div class="face right" data-name="right" data-era="Era of Celestial Dawn (457 BCE)">Right</div>
          <div class="face top" data-name="top" data-era="Era of Celestial Dawn (457 BCE)">Top</div>
          <div class="face bottom" data-name="bottom" data-era="Era of Celestial Dawn (457 BCE)">Bottom</div>
        </div>
      </div>
    </div>
    <div class="controls">
      <button id="prev">◀ Previous</button>
      <button id="next">Next ▶</button>
      <div class="toggle-group">
        <label>
          <input type="checkbox" id="toggle-restore" />
          <span>Restore vs Weathered</span>
        </label>
      </div>
      <button id="info" aria-label="Show facet details">🔍 Info</button>
    </div>
    <div class="info" id="info-box" role="dialog" aria-labelledby="info-title">
      <h3 id="info-title">Facet Info</h3>
      <div id="info-content">
        <p>Click a face to see its provenance and context.</p>
      </div>
      <img id="info-image" src="" alt="Facet Image" />
    </div>
    <div class="error-state show" id="error-state">
      <p>⚠️ Oops! Something went wrong. Please refresh the page.</p>
    </div>
    <div class="empty-state show" id="empty-state">
      <p>🚫 No facet selected yet. Click a face to view its information.</p>
    </div>
    <div class="complete-state show" id="complete-state">
      <p>🎉 You've viewed all facets! The Codex of Maelis speaks of forgotten constellations and a lost language that once mapped the heavens.</p>
      <img src="" alt="Celestial Map" />
    </div>
  </main>
  <footer>
    &copy; 2025 The Museum of Lost Cosmology
  </footer>

  <script>
    const container = document.getElementById("container");
    const faces = document.querySelectorAll(".face");
    const infoBox = document.getElementById("info-box");
    const infoContent = document.getElementById("info-content");
    const infoImage = document.getElementById("info-image");
    const infoButton = document.getElementById("info");
    const toggleRestore = document.getElementById("toggle-restore");
    const prevButton = document.getElementById("prev");
    const nextButton = document.getElementById("next");
    const errorState = document.getElementById("error-state");
    const emptyState = document.getElementById("empty-state");
    const completeState = document.getElementById("complete-state");
    const infoTitle = document.getElementById("info-title");

    const faceData = {
      front: {
        name: "Front",
        era: "Era of Celestial Dawn (457 BCE)",
        provenance: "Found in the ruins of Xyphara, now buried under the Andromeda Nebula. Inscribed with the original star maps of the Maelian constellation cluster.",
        image: "https://source.unsplash.com/400x400/?star,map"
      },
      back: {
        name: "Back",
        era: "Era of Celestial Dawn (457 BCE)",
        provenance: "Etched with a celestial calendar that aligned with the cycles of the Maelian Star. Used to predict eclipses and celestial events.",
        image: "https://source.unsplash.com/400x400/?calendar,star"
      },
      left: {
        name: "Left",
        era: "Era of Celestial Dawn (457 BCE)",
        provenance: "Carved with the names of the Maelian priest-astronomers. Their writings are believed to be the first recorded use of trigonometric geometry.",
        image: "https://source.unsplash.com/400x400/?person,star"
      },
      right: {
        name: "Right",
        era: "Era of Celestial Dawn (457 BCE)",
        provenance: "Features a mysterious, unreadable script, possibly a variant of Maelian. It may predate even the first known Maelian texts.",
        image: "https://source.unsplash.com/400x400/?script,star"
      },
      top: {
        name: "Top",
        era: "Era of Celestial Dawn (457 BCE)",
        provenance: "Marked with the sigil of the Maelian Order of Astral Seers. The Order was said to have deciphered the constellations of the Maelian Empire.",
        image: "https://source.unsplash.com/400x400/?symbol,star"
      },
      bottom: {
        name: "Bottom",
        era: "Era of Celestial Dawn (457 BCE)",
        provenance: "Contains what appears to be a star chart of a lost galaxy, Maelis. This may be the origin of the Maelian name.",
        image: "https://source.unsplash.com/400x400/?galaxy,star"
      }
    };

    let currentFaceIndex = 0;
    let faceOrder = ["front", "back", "left", "right", "top", "bottom"];
    let selectedFace = null;
    let toggleState = false;

    function rotateTo(index) {
      const faceName = faceOrder[index % faceOrder.length];
      const face = document.querySelector(`.face[data-name="${faceName}"]`);
      const currentFace = faceOrder[currentFaceIndex];
      const currentElement = document.querySelector(`.face[data-name="${currentFace}"]`);

      // Rotate using CSS transforms
      container.style.transform = `rotateY(${(index * 60) % 360}deg)`;

      currentFaceIndex = index;
      if (face) {
        face.classList.add("facet-selected");
      }
      if (currentElement) {
        currentElement.classList.remove("facet-selected");
      }
    }

    function showInfo(face) {
      if (!face) {
        infoBox.classList.remove("show");
        infoContent.innerHTML = "<p>Click a face to see its provenance and context.</p>";
        infoImage.src = "";
        infoTitle.textContent = "Facet Info";
        return;
      }

      const { name, era, provenance, image } = faceData[face.dataset.name];

      infoTitle.textContent = `${name} - ${era}`;
      infoContent.innerHTML = `
        <p><strong>Era:</strong> ${era}</p>
        <p><strong>Provenance:</strong> ${provenance}</p>
      `;

      infoImage.src = image;
      infoBox.classList.add("show");
    }

    function updateStates() {
      if (selectedFace) {
        emptyState.classList.remove("show");
        completeState.classList.remove("show");
      } else {
        emptyState.classList.add("show");
        completeState.classList.remove("show");
      }

      if (currentFaceIndex === 6) {
        completeState.classList.add("show");
        completeState.querySelector("img").src = "https://source.unsplash.com/400x400/?celestial,map";
      } else {
        completeState.classList.remove("show");
      }
    }

    function init() {
      faces.forEach(face => {
        face.addEventListener("click", () => {
          selectedFace = face;
          showInfo(face);
        });
      });

      toggleRestore.addEventListener("change", () => {
        const faces = document.querySelectorAll(".face");
        const state = toggleRestore.checked ? "restored" : "weathered";
        faces.forEach(face => {
          face.style.filter = state === "restored" ? "none" : "brightness(0.7) contrast(1.5)";
        });
        toggleState = state === "restored";
      });

      prevButton.addEventListener("click", () => {
        rotateTo(currentFaceIndex - 1);
      });

      nextButton.addEventListener("click", () => {
        rotateTo(currentFaceIndex + 1);
      });

      infoButton.addEventListener("click", () => {
        if (selectedFace) {
          showInfo(selectedFace);
        } else {
          infoBox.classList.remove("show");
          infoContent.innerHTML = "<p>Click a face to see its provenance and context.</p>";
          infoImage.src = "";
        }
      });

      document.addEventListener("keydown", (e) => {
        if (e.key === "ArrowLeft") {
          e.preventDefault();
          rotateTo(currentFaceIndex - 1);
        } else if (e.key === "ArrowRight") {
          e.preventDefault();
          rotateTo(currentFaceIndex + 1);
        } else if (e.key === "Enter" && selectedFace) {
          showInfo(selectedFace);
        }
      });

      container.addEventListener("focus", () => {
        container.classList.add("focus");
      });

      container.addEventListener("blur", () => {
        container.classList.remove("focus");
      });

      // Initial setup
      rotateTo(0);
      updateStates();
    }

    window.addEventListener("load", init);
  </script>
</body>
</html>