fogón

← Fiestas y NavidadObjeto 3Dfogon/cartel-feliz-cumple

Cartel de feliz cumple

de fogonCC01790 bloques
Cartel de feliz cumpleArrastrá para girarlo
// «Cartel de feliz cumple» · gpt-6-sol (medium)
// A festive birthday banner between two thin colorful poles: a string of triangular flags in bright alternating colors, each flag with a big white letter so they read FELIZ CUMPLE, with small balloons tied to the tops of the poles.

const gold = "#f5bc43";
const cream = "#fffaf0";

// Weighted toy-like feet and candy-striped poles.
for (const x of [2, 45]) {
  box(x - 1, 22, 0, x + 2, 25, 2, "#b94b59");
  box(x, 22, 2, x + 1, 24, 3, gold);

  for (let z = 4; z <= 37; z++) {
    const stripe = Math.floor(z / 4) % 2;
    box(x, 23, z, x + 1, 24, z, stripe ? "#ee525c" : "#f9f0db");
    set(x, 23, z, stripe ? "#ff7680" : "#ffffff");
  }
  box(x - 1, 22, 37, x + 2, 25, 38, gold);
  box(x, 22, 39, x + 1, 24, 39, "#ffe28a");
}

// The cord runs behind the pennants.
line(3, 21, 33, 44, 21, 33, 0, "#9c7148");
for (let x = 5; x <= 43; x += 5) {
  set(x, 20, 33, "#ffe59b");
}

// Balloon strings and knots.
const balloons = [
  { x: 3,  y: 20, z: 42, c: "#ff667f", light: "#ff9cac", dark: "#c94061", pole: 2 },
  { x: 7,  y: 23, z: 43, c: "#5fd8cf", light: "#a0f2e7", dark: "#329d9f", pole: 2 },
  { x: 5,  y: 26, z: 40, c: "#b993ed", light: "#dbc0ff", dark: "#8768bb", pole: 2 },
  { x: 44, y: 20, z: 42, c: "#f8a9cc", light: "#ffd0e2", dark: "#c576a1", pole: 45 },
  { x: 40, y: 23, z: 43, c: "#ffcf54", light: "#ffe68c", dark: "#d69b33", pole: 45 },
  { x: 42, y: 26, z: 40, c: "#70cf83", light: "#a5ebad", dark: "#449c62", pole: 45 }
];

for (const b of balloons) {
  line(b.pole, 23, 38, b.x, b.y, b.z - 4, 0, "#d9bc88");
  set(b.x, b.y, b.z - 3, b.dark);
  ellipsoid(b.x, b.y, b.z, 2, 2, 2, b.c);
  set(b.x, b.y - 2, b.z, b.light);
  set(b.x - 1, b.y - 1, b.z + 1, b.light);
  set(b.x, b.y, b.z + 2, b.light);
}

// Three-pixel-wide, five-pixel-tall lettering, read from the front (-y).
const glyphs = {
  F: ["111", "100", "110", "100", "100"],
  E: ["111", "100", "110", "100", "111"],
  L: ["100", "100", "100", "100", "111"],
  I: ["111", "010", "010", "010", "111"],
  Z: ["111", "001", "010", "100", "111"],
  C: ["111", "100", "100", "100", "111"],
  U: ["101", "101", "101", "101", "111"],
  M: ["101", "111", "111", "101", "101"],
  P: ["111", "101", "111", "100", "100"]
};

const message = "FELIZCUMPLE";
const colors = [
  ["#ed4757", "#b52d48", "#ff7980"],
  ["#38bfb5", "#258e91", "#79e3d7"],
  ["#a575dc", "#7653aa", "#c6a1f1"],
  ["#eb9b30", "#b86b27", "#ffd073"],
  ["#df579f", "#ab397a", "#f394c4"],
  ["#4cbd71", "#318f58", "#89e2a0"],
  ["#6686e4", "#445eb1", "#9bb1ff"],
  ["#ed6856", "#b9443d", "#ffa18e"],
  ["#bd70ce", "#8e4fa5", "#dfa5ec"],
  ["#32b9c2", "#22858e", "#80e0dc"],
  ["#e94c65", "#b72e4e", "#ff8a9a"]
];

for (let i = 0; i < message.length; i++) {
  const x0 = 3 + Math.round(i * 3.8);
  const [face, shade, highlight] = colors[i];
  part("flag" + i, [x0 + 1.5, 20, 33]);

  // Broad shoulders and a tapered, pointed pennant.
  for (let z = 24; z <= 31; z++) {
    for (let dx = 0; dx < 4; dx++) {
      set(x0 + dx, 20, z, face);
      set(x0 + dx, 21, z, shade);
    }
  }
  for (let dx = 0; dx < 3; dx++) {
    set(x0 + dx, 20, 23, face);
    set(x0 + dx, 21, 23, shade);
  }
  for (let dx = 1; dx <= 2; dx++) {
    set(x0 + dx, 20, 22, face);
    set(x0 + dx, 21, 22, shade);
  }
  set(x0 + 1, 20, 21, face);
  set(x0 + 1, 21, 21, shade);

  for (let dx = 0; dx < 4; dx++) set(x0 + dx, 19, 31, highlight);
  set(x0 + 3, 19, 29, highlight);
  set(x0 + 3, 19, 25, shade);

  const pixels = glyphs[message[i]];
  for (let row = 0; row < 5; row++) {
    for (let col = 0; col < 3; col++) {
      if (pixels[row][col] === "1") {
        set(x0 + col, 19, 30 - row, "#fffdf5");
        set(x0 + col, 18, 30 - row, "#ffffff");
      }
    }
  }

  animate("flag" + i, {
    type: "swing",
    axis: "x",
    speed: 2,
    amplitude: 0.15
  });
}