Ramalan Cuaca Kampung oleh @belajarweb

Terminal hijau jadul di pos ronda mengetik ramalan cuaca Desa Sukamaju, lengkap dengan awan ASCII. Efek tabung CRT dari scanline repeating-linear-gradient…

Oleh @belajarweb · JavaScript

<!doctype html>
<html lang="id">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ramalan Cuaca Kampung</title>
<style>
:root {
  --fosfor: #7dff9b;
  --fosfor-redup: #3fbf62;
  --fosfor-gelap: #0f4a22;
  --kaca: #031208;
  --plastik: #ddd3ba;
  --plastik-gelap: #b9ad8e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse 70% 60% at 50% 48%, rgba(80, 255, 140, .10), transparent 70%),
    radial-gradient(ellipse at 50% 30%, #2b1f16, #120c08 75%);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  color: var(--fosfor);
}

.rc-ruang {
  height: 100%;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: 14px;
}

.rc-monitor {
  position: relative;
  min-width: 0;
  width: 100%;
  height: 100%;
  max-width: 1100px;
  max-height: 760px;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 0;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 14%),
    linear-gradient(180deg, var(--plastik), var(--plastik-gelap));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .6),
    inset 0 -6px 0 rgba(0, 0, 0, .12),
    0 30px 60px -20px rgba(0, 0, 0, .8),
    0 0 90px rgba(80, 255, 140, .10);
}

.rc-layar {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(14px, 2.4vw, 26px) clamp(14px, 2.8vw, 30px) 0;
  border-radius: 22px / 26px;
  background: radial-gradient(ellipse at 50% 45%, #0c3318 0%, #062010 55%, var(--kaca) 100%);
  box-shadow:
    0 0 0 3px #8f8468,
    0 0 0 9px #2a2620,
    inset 0 0 50px rgba(0, 0, 0, .85),
    inset 0 0 120px rgba(0, 0, 0, .5);
  cursor: pointer;
  font-size: clamp(11px, 1.72vw, 19px);
  line-height: 1.45;
  text-shadow: 0 0 2px var(--fosfor), 0 0 9px rgba(70, 255, 120, .55), 0 0 20px rgba(40, 255, 100, .25);
}

/* scanlines */
.rc-layar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .32) 0 1px, transparent 1px 3px);
}

/* the bright band rolling down the tube, and the glass glare */
.rc-layar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 30%;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(125, 255, 155, .06) 50%, transparent);
  animation: rc-gulung 7s linear infinite;
}

.rc-isi {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  animation: rc-kedip 5s steps(1) infinite;
}

.rc-layar.rc-kilat .rc-isi { filter: brightness(2.2) saturate(.6); }
.rc-layar.rc-kilat { background: radial-gradient(ellipse at 50% 45%, #1f6b36 0%, #0e3a1c 55%, #052010 100%); }

@keyframes rc-gulung {
  to { transform: translateY(440%); }
}

@keyframes rc-kedip {
  0%, 100% { opacity: 1; }
  23% { opacity: .93; }
  24% { opacity: 1; }
  61% { opacity: .96; }
  62% { opacity: 1; }
  87% { opacity: .9; }
  88% { opacity: 1; }
}

.rc-kepala {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 2ch;
  padding-bottom: .35em;
  border-bottom: 2px dashed var(--fosfor-redup);
  font-weight: 700;
  letter-spacing: .04em;
}

.rc-versi { color: var(--fosfor-redup); }

.rc-sumber {
  margin: .35em 0 .9em;
  color: var(--fosfor-redup);
}

.rc-sesi p { margin: 0; }

.rc-ps { color: var(--fosfor-redup); }

.rc-muat { color: var(--fosfor-redup); min-height: 1.45em; }

.rc-badan {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 3.5ch;
  margin: .9em 0;
}

.rc-gambar {
  margin: 0;
  font: inherit;
  font-size: 1.22em;
  line-height: 1.15;
  font-weight: 700;
  white-space: pre;
  color: #b4ffc4;
  text-shadow: 0 0 3px #b4ffc4, 0 0 12px rgba(90, 255, 140, .7), 0 0 28px rgba(40, 255, 100, .35);
}

.rc-judul {
  display: inline-block;
  margin-bottom: .45em;
  padding: 0 .6ch;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--kaca);
  background: var(--fosfor);
  text-shadow: none;
  box-shadow: 0 0 14px rgba(90, 255, 140, .55);
}

.rc-judul:empty { display: none; }

.rc-baris {
  display: grid;
  grid-template-columns: 7ch 1fr;
  column-gap: 1ch;
  min-height: 1.45em;
}

.rc-label { color: var(--fosfor-redup); white-space: pre; }

.rc-saran { margin-top: .4em; }

.rc-kursor {
  display: inline-block;
  width: .62em;
  height: 1.05em;
  margin-left: .1ch;
  vertical-align: -.15em;
  background: var(--fosfor);
  box-shadow: 0 0 10px rgba(90, 255, 140, .8);
  animation: rc-kursor 1s steps(1) infinite;
}

.rc-kursor.rc-sibuk { animation: none; }

@keyframes rc-kursor {
  50% { opacity: 0; }
}

.rc-info {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 1.5ch;
  align-items: center;
  margin-bottom: .6em;
  font-size: .85em;
  white-space: nowrap;
  overflow: hidden;
  color: var(--fosfor-redup);
}

.rc-info-label {
  flex: none;
  padding: 0 .6ch;
  font-weight: 700;
  color: var(--kaca);
  background: var(--fosfor-redup);
  text-shadow: none;
}

.rc-info-jalan {
  display: flex;
  min-width: 0;
  animation: rc-info 40s linear infinite;
}

.rc-info-jalan span { flex: none; padding-right: 1ch; }

@keyframes rc-info {
  to { transform: translateX(-50%); }
}

.rc-hari {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: .7em 0 clamp(12px, 2vw, 20px);
  border-top: 2px dashed var(--fosfor-gelap);
}

.rc-hari button {
  font: inherit;
  font-size: .82em;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--fosfor);
  text-shadow: inherit;
  background: transparent;
  border: 1px solid var(--fosfor-redup);
  border-radius: 3px;
  padding: .2em .7ch;
  cursor: pointer;
}

.rc-hari button:hover { background: rgba(125, 255, 155, .
…

Karya lain di Galeri