apps/phoenix_duskmoon/assets/css/components/atom.css

@layer components {
  .dm-fun-atom {
    --atom-size: 360px;
    --atom-color: #00d8ff;
    --nucleus-size: calc(var(--atom-size) / 5);
    --electron-color: #99f8ff;
    --electron-size : calc(var(--atom-size) / 25);
    --electron-orbit-size : calc(var(--atom-size) / 2.5);
    --electron-speed : 1.2s;
    --electron-speed-alpha : 1s;
    --electron-speed-omega : .8s;
    position: relative;
    width: var(--atom-size);
    height: var(--atom-size);
    animation: 8s dm-fun-atom infinite cubic-bezier(1, .25, 0, .75);
    box-sizing: border-box;
    overflow: hidden;

    *, *:before, *::after {
      box-sizing: border-box;
    }

    &::before {
      content: '';
      display: block;
      position: absolute;
      top: 50%;
      left: 50%;
      width: var(--nucleus-size);
      height: var(--nucleus-size);
      margin-top: calc(var(--nucleus-size) / -2);
      margin-left: calc(var(--nucleus-size) / -2);
      background: color-mix(in srgb, var(--atom-color) 70%, transparent);
      border-radius: 100%;
      box-shadow: 0 0 3px 0 color-mix(in srgb, var(--atom-color) 70%, transparent);
      animation: 2s dm-fun-nucleus infinite cubic-bezier(.65, 0, .35, 1);
    }

    & > [class^="electron"] {
      border-top: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 1px;
      border-right: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 2px;
      border-bottom: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 4px;
      border-left: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 2px;
      border-radius: 100%;
      width: 100%;
      height: var(--electron-orbit-size);
      position: absolute;
      top: 50%;
      margin-top: calc(var(--electron-orbit-size) / -2);
      animation: var(--electron-speed) dm-fun-electron-orbit infinite linear;
    }

    & > .electron-alpha {
      transform: rotate(60deg);
      animation: var(--electron-speed-alpha) dm-fun-electron-orbit infinite linear;
    }
    & > .electron-omega {
      transform: rotate(-60deg);
      animation: var(--electron-speed-omega) dm-fun-electron-orbit infinite linear;
    }

   [class^="electron"]::after {
      content: '';
      display: block;
      width: var(--electron-size);
      height: var(--electron-size);
      background: var(--electron-color);
      border-radius: 50%;
      margin-top: calc(var(--electron-size) / -2);
      position: absolute;
      top: 50%;
      left: calc(var(--electron-size) / -1);
      transform: scale(1);
      animation: calc(var(--electron-speed) * 2) dm-fun-electron infinite ease-in-out;
    }
    .electron-alpha::after { animation: calc(var(--electron-speed-alpha) * 2) dm-fun-electron infinite ease-in-out; }
    .electron-omega::after { animation: calc(var(--electron-speed-omega) * 2) dm-fun-electron infinite ease-in-out; }

  }

  @keyframes dm-fun-electron-orbit {
    0% {
        border-top: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 1px;
        border-right: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 2px;
        border-bottom: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 4px;
        border-left: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 2px;
    }
    25% {
        border-top: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 1px;
        border-right: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 2px;
        border-bottom: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 4px;
        border-left: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 2px;
    }
    50% {
        border-top: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 1px;
        border-right: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 2px;
        border-bottom: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 4px;
        border-left: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 2px;
    }
    75% {
        border-top: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 1px;
        border-right: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 2px;
        border-bottom: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 4px;
        border-left: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 2px;
    }
    100% {
        border-top: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 1px;
        border-right: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 2px;
        border-bottom: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 4px;
        border-left: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 2px;
    }
  }

  @keyframes dm-fun-atom {
    0% {    transform: rotate(0deg) scale(1); }
    12.5% { transform: rotate(-45deg) scale(.9); }
    25% {   transform: rotate(-90deg) scale(1); }
    37.5% { transform: rotate(-135deg) scale(.9); }
    50% {   transform: rotate(-180deg) scale(1); }
    62.5% { transform: rotate(-225deg) scale(.9); }
    75% {   transform: rotate(-270deg) scale(1); }
    87.5% { transform: rotate(-315deg) scale(.9); }
    100% {  transform: rotate(-360deg) scale(1); }
  }

  @keyframes dm-fun-nucleus {
    0% { transform: scale(1); }
    25% { transform: scale(.9); }
    50% { transform: scale(1); }
    75% { transform: scale(.85); }
    100% { transform: scale(1); }
  }

  @keyframes dm-fun-electron {
    0% {
        left: calc(var(--electron-size) / -1);
        transform: scale(1);
    }
    12.5% {
        top: 100%;
        transform: scale(1.5);
    }
    25% {
        left: 100%;
        transform: scale(1);
    }
    37.5% {
        top: 0%;
        transform: scale(.25);
    }
    50% {
        left: calc(var(--electron-size) / -1);
        transform: scale(1);
    }
    62.5% {
        top: 100%;
        transform: scale(1.5);
    }
    75% {
        left: 100%;
        transform: scale(1);
    }
    87.5% {
        top: 0%;
        transform: scale(.25);
    }
    100% {
        left: calc(var(--electron-size) / -1);
        transform: scale(1);
    }
  }
}
