Gamelan Saku oleh @belajarweb

Saron tujuh bilah berlaras slendro: tiap nada adalah dua osilator Web Audio yang sedikit sumbang lalu cepat meredup, dan bilahnya berpendar serta beriak saat…

Oleh @belajarweb · JavaScript

<!doctype html>
<html lang="id">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Gamelan Saku</title>
<style>
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 50% 78%, rgba(224,150,60,.22), rgba(224,150,60,0) 70%),
    radial-gradient(ellipse 90% 70% at 50% 25%, #3d1e10, #1d0e07 70%, #130804);
  color: #f6e7c8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
.kawung { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .085; pointer-events: none; }

.pendopo {
  position: relative;
  max-width: 1000px; min-height: 100vh; margin: 0 auto;
  padding: 26px clamp(16px, 5vw, 56px) 22px;
  display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "judul gong" "notasi gong" "saron saron";
  align-content: center; column-gap: 24px; row-gap: 14px;
}

/* judul */
.judul { grid-area: judul; }
.kecil { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: #e0b25a; }
.judul h1 {
  margin: .08em 0 .16em;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: clamp(34px, 6.4vw, 64px); line-height: 1; font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(#fff3c9, #e8bb62 52%, #b07a2c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #4a2208);
}
.cara span { white-space: nowrap; }
.cara { margin: 0; max-width: 34em; font-size: 14.5px; line-height: 1.55; color: rgba(246,231,200,.75); }
kbd {
  display: inline-block; min-width: 1.6em; padding: .05em .4em; border-radius: 5px;
  font: 700 .85em/1.4 ui-monospace, Menlo, Consolas, monospace; text-align: center;
  color: #2a1206; background: #f3dca8; box-shadow: 0 2px 0 #9a6a2a;
}

/* notasi */
.notasi { grid-area: notasi; align-self: end; }
.notasi-kepala { display: flex; align-items: center; gap: 14px; }
.notasi-kepala > span { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-style: italic; font-size: 18px; color: #f3cf83; }
.main {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px 9px 14px; border: 0; border-radius: 99px; cursor: pointer;
  font: 800 15px/1 system-ui, -apple-system, "Segoe UI", sans-serif; color: #2a1206;
  background: linear-gradient(#f9dc96, #d39a45);
  box-shadow: 0 4px 0 #6e3f15, 0 8px 18px rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .08s;
}
.main:active { transform: translateY(3px); box-shadow: 0 1px 0 #6e3f15; }
.main:focus-visible, .gong:focus-visible, .bilah:focus-visible { outline: 3px solid #fff1c4; outline-offset: 3px; }
.main svg { width: 16px; height: 16px; fill: currentColor; }
.ikon-henti, .main[aria-pressed="true"] .ikon-main { display: none; }
.main[aria-pressed="true"] .ikon-henti { display: inline; }
.notasi-baris { display: grid; grid-template-columns: repeat(3, max-content); gap: 6px 18px; margin-top: 12px; }
.gatra { display: flex; gap: 2px; padding: 2px 8px 2px 4px; border-right: 2px solid rgba(224,178,90,.3); }
.not {
  position: relative; width: 1.35em; border-radius: 6px; text-align: center;
  font: 700 21px/1.45 "Iowan Old Style", Palatino, Georgia, serif;
  color: rgba(246,231,200,.6);
  transition: background .15s, color .15s;
}
.not.aktif { color: #2a1206; background: #f3cf83; box-shadow: 0 0 16px rgba(243,207,131,.7); }
.not.tanda-gong::after { content: ""; position: absolute; inset: -1px -2px; border: 2px solid rgba(243,207,131,.8); border-radius: 50%; }
.rendah, .tinggi { position: relative; }
.rendah::before, .tinggi::before { content: ""; position: absolute; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.rendah::before { bottom: .05em; }
.tinggi::before { top: .08em; }

/* gong */
.gong { grid-area: gong; position: relative; align-self: start; width: clamp(110px, 21vw, 210px); padding: 0; border: 0; background: none; cursor: pointer; color: inherit; }
.gong svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 12px 16px rgba(0,0,0,.45)); }
.gong-label { display: block; margin-top: 6px; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: #e0b25a; }
#gongAyun { transform-box: view-box; transform-origin: 110px 40px; }
.gong-riak { opacity: 0; transform-box: fill-box; transform-origin: center; }
.gong.kena #gongAyun { animation: ayun-gong 2.6s ease-out; }
.gong.kena .gong-riak { animation: riak-gong 1.6s ease-out; }
@keyframes ayun-gong { 0% { transform: rotate(0); } 10% { transform: rotate(4deg); } 25% { transform: rotate(-3deg); } 42% { transform: rotate(2deg); } 60% { transform: rotate(-1deg); } 78% { transform: rotate(.4deg); } 100% { transform: rotate(0); } }
@keyframes riak-gong { from { opacity: .9; transform: scale(.5); } to { opacity: 0; transform: scale(1.9); } }

/* saron */
.saron { grid-area: saron; position: relative; height: clamp(230px, 46vh, 310px); margin-top: 6px; }
.rancak {
  position: absolute; left: 1%; right: 1%; top: 9%; bottom: 0;
  border-radius: 22px 22px 16px 16px;
  background: linear-gradient(#2c0805, #4a0e09 60%, #3a0905);
  box-shadow: inset 0 6px 14px rgba(0,0,0,.6), 0 18px 30px rgba(0,0,0,.5);
}
.rancak::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 14%; height: 52%;
  border-top: 7px solid #8a5a2b; border-bottom: 7px solid #8a5a2b;
  opacity: .9;
}
.rancak::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  border-radius: 0 0 16px 16px; border-top: 3px solid #d9a441;
  background:
    linear-gradient(135deg, rgba(0,0,0,0) 42%, #d9a441 42% 50%, rgba(0,0,0,0) 50%) 0 100% / 18px 9px repeat-x,
    linear-gradient(#9b2219, #6f1610);
}
.ujung {
  position: absolute; top: -6%; bottom: 1
…

Karya lain di Galeri