// we ❤️ wokwi.com

#include <FastLED.h>
#include <avr/pgmspace.h>

#define NUM_LEDS (/*w*/ 5 * 16 + 4 * 12 + 2 * 10 + 2 * 13 \
                  /*o*/ + 64 + 56 \
                  /*k*/ + 16 + 4 * 10  + 4 * 12 \
                  /*w*/ + 2 * 22 + 6 * 20 \
                  /*i*/ + 2 * 18 + 16)
CRGBArray<NUM_LEDS> leds;

const CRGBSet sets[] = {
  // W
  leds(0, 12+16+12+1),    // up the LHS of left stroke of W, around ring1, back down RHS, 2 dots of ring2
  leds(56, 65),           // up the LHS shallow centre stroke
  leds(72, 77),           // up from join of LHS of the steep centre stroke
  leds(78, 93),           // around ring3
  leds(94, 105),          // down RHS of steep centre
  leds(106, 107),         // 2 dots around ring4
  leds(132, 144),         // up the LHS of right stroke
  leds(145, 160),         // around ring5
  leds(161, 173),         // down the RHS of right stroke
  leds(108, 121),         // remainder of ring4
  leds(66, 71),           // up to join of LHS of the steep centre stroke
  leds(122, 131),         // down RHS of shallow centre stroke
  leds(42, 55),           // around the remainder of ring2
  // o
  leds(174, 237),         // clockwise around outer ring
  leds(293, 238),         // anti-clockwise around inner ring
  // k
  leds(294, 296),         // 3 dots around ring
  leds(319, 310),         // up LHS of top vert
  leds(329, 320),         // down RHS of top vert
  leds(297, 299),         // 3 more dots of ring
  leds(341, 330),         // up LHS of top right
  leds(353, 342),         // down RHS of top right
  leds(300, 303),         // 4 more dots of ring
  leds(354, 365),         // down RHS of bottom right
  leds(366, 377),         // up LHS of bottom right
  leds(304, 307),         // 4 more dots of ring
  leds(387, 378),         // down RHS of bottom vert
  leds(397, 388),         // up LHS of bottom vert
  leds(308, 309),         // last 2 dots of ring
  // w
  leds(398, 561),
  // i
  leds(562, 613)
};


void setup() {
  FastLED.setCorrection(UncorrectedColor);
  FastLED.setTemperature(UncorrectedTemperature);
  FastLED.addLeds<WS2812B, 2, GRB>(&leds[0], 174);    // w
  FastLED.addLeds<WS2812B, 3, GRB>(&leds[174], 120);  // o
  FastLED.addLeds<WS2812B, 4, GRB>(&leds[294], 104);  // k
  FastLED.addLeds<WS2812B, 5, GRB>(&leds[398], 164);  // w
  FastLED.addLeds<WS2812B, 6, GRB>(&leds[562], 52);   // i
}


void loop() {
  static uint16_t frame;
  uint16_t offset = -frame++;
  uint8_t hue = frame;

  for (uint8_t set = 0; set < sizeof(sets) / sizeof(sets[0]); set++) {
    for (CRGBSet::iterator pixel=sets[set].begin(), end=sets[set].end(); pixel != end; ++pixel) {
      if (offset++ % 32 == 0) {
        *pixel = CHSV(hue, 255, 255);
        hue += 4;
      } else {
        (*pixel).fadeToBlackBy(8);
      }
    }
  }

  FastLED.show();
  delay(10);
}