• 01 - Critter Models 02
  • 02 - VantaJS Shaders
  • 03 - App Bundle 02
  • 04 - Cathedrals
  • 05 - App Bundle 01
  • 06 - Retroscopic
  • 07 - Games
  • 08 - Voronoi
  • 09 - Terrain
  • 10 - Critter Models 01
  • 11 - Chromatophores
  • 12 - Conformal Maps
  • 13 - Echo Logix
  • 14 - Music
  • 15 - Colour Theory
MIKE'S NOTEBOOK
Notes
Number:
Project:
01Critter Models 02
└ Locust└ Butterfly└ Cockroach└ Spider└ Scorpion└ Dragon└ Brazilian Treehopper└ Tardigrade└ Diatoms└ Bumblebee└ Wasp└ Hammerhead Worm└ Giraffe Weevil└ Trilobite Beetle
02VantaJS Shaders
└ Clouds└ Waves└ Cells└ Rings└ Halo└ Globe└ Net└ Dots└ Birds└ Trunk└ Topology└ About VantaJS
03App Bundle 02
└ Gutindex└ Insect Builder└ OpenLayers
04Cathedrals
└ Lattice└ Lost└ Lucent└ Lumen└ Glass└ Disco└ Hyperion└ Latent
05App Bundle 01
└ Robohash└ PrismJS└ Horoscope└ Binary Jazz└ Morse Code└ URL Extractor└ Entity Escaper└ Phonetic Alphabet└ Toki Pona└ Semaphore└ Cut Up Machine└ Text Mixer└ Currency Freaks└ Host IO└ CrUX API└ Logo Dev└ Web Speech API└ GEO DB
06Retroscopic
└ Galaxy└ Ocean└ Slime└ 24-Cell└ Unicorn└ Polyp└ Oneiric 1└ Oneiric 2└ Node└ Torus Knot└ GLSL Grid└ Liquid Crystal└ Silky└ Butterfly└ Ocean 2└ Icosahedron└ Luma└ Swarm└ Broken Solid└ Hypersphere└ Constraints└ Psycho Killer
01 / 03

BINARYJAZZ - INTERACTIVE APP SOURCE CODE

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Binary Jazz API</title>
  <meta name="description" content="Generate random musical genres from the Binary Jazz API">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  <style>
    :root {
      --black: #000000;
      --dark-gray: #1a1a1a;
      --medium-gray: #333333;
      --light-gray: #666666;
      --white: #ffffff;
      --accent: #ffffff;
      --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      background-color: var(--black);
      color: var(--white);
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      line-height: 1.6;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    .container {
      flex: 1;
      padding: 2rem 1.5rem;
      max-width: 1200px;
      margin: 0 auto;
      width: 100%;
    }

    .header {
      margin-bottom: 3rem;
      text-align: left;
    }

    .subtitle {
      font-size: 1.1rem;
      color: var(--light-gray);
      margin-bottom: 1.5rem;
      max-width: 600px;
    }

    a {
      color: var(--accent);
      text-decoration: none;
      font-weight: 500;
      position: relative;
      transition: var(--transition);
    }

    a:hover {
      color: var(--white);
    }

    a::after {
      content: '';
      position: absolute;
      width: 100%;
      height: 1px;
      bottom: -2px;
      left: 0;
      background-color: var(--accent);
      transform: scaleX(0);
      transform-origin: bottom right;
      transition: transform 0.3s ease;
    }

    a:hover::after {
      transform: scaleX(1);
      transform-origin: bottom left;
    }

    .genre-card {
      background-color: var(--dark-gray);
      border-radius: 12px;
      padding: 2.5rem 2rem;
      margin-bottom: 2.5rem;
      max-width: 800px;
      font-size: 1.8rem;
      font-weight: 600;
      line-height: 1.5;
      border-left: 4px solid var(--accent);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
      transition: var(--transition);
      position: relative;
      overflow: hidden;
    }

    .genre-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    }

    .genre-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
      transform: translateX(-100%);
      transition: transform 0.7s ease;
    }

    .genre-card:hover::before {
      transform: translateX(100%);
    }

    .genre-text {
      color: var(--white);
      text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .button-container {
      margin-bottom: 3rem;
      max-width: 800px;
      text-align: left;
    }

    .generate-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      background-color: var(--white);
      color: var(--black);
      border: none;
      border-radius: 8px;
      padding: 1rem 2rem;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
      position: relative;
      overflow: hidden;
      z-index: 1;
      box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    }

    .generate-btn::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: var(--medium-gray);
      transform: scaleX(0);
      transform-origin: right;
      transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
      z-index: -1;
    }

    .generate-btn:hover {
      color: var(--white);
      box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
      transform: translateY(-3px);
    }

    .generate-btn:hover::before {
      transform: scaleX(1);
      transform-origin: left;
    }

    .generate-btn:active {
      transform: translateY(-1px);
    }

    .generate-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    .generate-btn:disabled:hover::before {
      transform: scaleX(0);
    }

    .generate-btn:disabled:hover {
      color: var(--black);
      box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    }

    .btn-icon {
      font-size: 1.1rem;
      transition: var(--transition);
    }

    .generate-btn:hover .btn-icon {
      transform: rotate(90deg);
    }

    .status {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 1rem;
      color: var(--light-gray);
      font-size: 0.9rem;
      font-weight: 500;
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background-color: #4CAF50;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0% { opacity: 1; }
      50% { opacity: 0.5; }
      100% { opacity: 1; }
    }

    .links {
      display: flex;
      flex-wrap: wrap;
      gap: 1.5rem;
      margin-top: 2rem;
    }

    .link-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.95rem;
    }

    .footer {
      margin-top: 3rem;
      padding-top: 2rem;
      border-top: 1px solid var(--medium-gray);
    }

    .attribution {
      color: var(--light-gray);
      font-size: 0.9rem;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .fade-in {
      animation: fadeIn 0.5s ease forwards;
    }

    @media (max-width: 768px) {
      .container {
        padding: 1.5rem 1rem;
      }

      .genre-card {
        font-size: 1.5rem;
        padding: 2rem 1.5rem;
      }

      .generate-btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
      }

      .links {
        flex-direction: column;
        gap: 1rem;
      }
    }

    @media (min-width: 1200px) {
      .container {
        padding: 3rem 2rem;
      }
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="header">
      <div class="subtitle">
        <p>Generate random, totally-made-up musical genres from the Binary Jazz API with a single click.</p>
      </div>

      <div class="links">
        <div class="link-item">
          <i class="fas fa-external-link-alt"></i>
          <a href="https://binaryjazz.us/genrenator-api/" target="_blank" rel="noopener">BinaryJazz API</a>
        </div>
      </div>
    </div>

    <div id="genre-card" class="genre-card fade-in">
      <span id="genre-text">Click generate to get a random musical genre</span>
    </div>

    <div class="button-container">
      <button id="generate-btn" class="generate-btn">
        <i class="fas fa-random btn-icon"></i>
        Generate Random Genre
      </button>

      <div class="status">
        <span class="status-dot"></span>
        <span id="status-text">Ready to generate</span>
      </div>
    </div>

    <div class="footer">
      <p class="attribution">Built with the <a href="https://binaryjazz.us/genrenator-api/" target="_blank" rel="noopener">BinaryJazz API</a></p>
    </div>
  </div>

  <script>
    document.addEventListener("DOMContentLoaded", () => {
      const btn = document.getElementById("generate-btn");
      const card = document.getElementById("genre-card");
      const text = document.getElementById("genre-text");
      const statusText = document.getElementById("status-text");

      function updateStatus(message, type = 'info') {
        statusText.textContent = message;

        const statusDot = document.querySelector('.status-dot');
        if (type === 'loading') {
          statusDot.style.backgroundColor = '#FF9800';
          statusDot.style.animation = 'pulse 1s infinite';
        } else if (type === 'error') {
          statusDot.style.backgroundColor = '#F44336';
          statusDot.style.animation = 'none';
        } else {
          statusDot.style.backgroundColor = '#4CAF50';
          statusDot.style.animation = 'pulse 2s infinite';
        }
      }

      function animateCard() {
        card.classList.remove('fade-in');
        void card.offsetWidth;
        card.classList.add('fade-in');
      }

      async function fetchGenre() {
        btn.disabled = true;
        updateStatus('Fetching genre from API...', 'loading');

        try {
          const res = await fetch("https://binaryjazz.us/wp-json/genrenator/v1/genre/1/");

          if (!res.ok) {
            throw new Error(\`API error: \${res.status}\`);
          }

          const data = await res.json();
          const genre = Array.isArray(data) ? data[0] : data;

          setTimeout(() => {
            text.textContent = genre;
            animateCard();
            updateStatus('Genre generated successfully');
            btn.disabled = false;
          }, 300);

        } catch (err) {
          console.error("Error fetching genre:", err);
          text.textContent = "⚠️ Could not fetch genre. Please try again.";
          updateStatus('Failed to fetch genre', 'error');

          setTimeout(() => {
            btn.disabled = false;
            updateStatus('Ready to generate');
          }, 2000);
        }
      }

      btn.addEventListener("click", fetchGenre);

      btn.addEventListener("keydown", (e) => {
        if (e.key === "Enter" || e.key === " ") {
          e.preventDefault();
          if (!btn.disabled) {
            fetchGenre();
          }
        }
      });

      updateStatus('Ready to generate');
    });
  </script>
</body>
</html>
MikeHiggins.me.uk LinkedIn GitHub Bluesky Contra Upwork
© 2026 Mike Higgins. All rights reserved.