# Galileo thermometer loader

> The glass bulbs of a Galileo thermometer sink one by one as the liquid warms and float back up as it cools.

- Category: [Loaders](https://library.aimran.es/components/loaders)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-ld-galileo-thermometer
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A tall glass column with brass caps and five colored bulbs, each with a little gold tag showing its temperature. As the liquid warms, a pink tint rises and the heaviest bulbs sink first; then it cools and they float back in reverse order. It suits weather sites, home and climate apps, science shops and slow background tasks.

The main color sets the warm bulbs and the tint, the second the cool bulbs and the liquid, with a golden yellow in between. It is tall, so place it in a sidebar or next to a short vertical message.

## Code

### HTML

```html
<div class="uvq10-gal" role="status"><span class="sr">Loading</span><i class="cap t" aria-hidden="true"></i><div class="tb" aria-hidden="true"><span class="bl b0" style="--i:0"><i></i><b>26°</b></span><span class="bl b1" style="--i:1"><i></i><b>24°</b></span><span class="bl b2" style="--i:2"><i></i><b>22°</b></span><span class="bl b3" style="--i:3"><i></i><b>20°</b></span><span class="bl b4" style="--i:4"><i></i><b>18°</b></span><i class="gl"></i></div><i class="cap b" aria-hidden="true"></i></div>
```

### CSS

```css
.uvq10-gal {
  --c1: #ef476f;
  --c2: #118ab2;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq10-gal {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 4.4em;
}

.uvq10-gal .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-gal .cap {
  display: block;
  width: 3.4em;
  height: .7em;
  border-radius: .35em .35em .1em .1em;
  background: linear-gradient(90deg,#8a6a2f,#e9c46a 45%,#8a6a2f);
}

.uvq10-gal .cap.b {
  width: 3.9em;
  height: .9em;
  border-radius: .1em .1em .35em .35em;
  box-shadow: 0 .5em .8em -.4em rgba(0,0,0,.45);
}

.uvq10-gal .tb {
  position: relative;
  width: 2.7em;
  height: 11em;
  overflow: hidden;
  background: linear-gradient(90deg,color-mix(in srgb,var(--c2) 32%,transparent),color-mix(in srgb,var(--c2) 12%,transparent) 40%,color-mix(in srgb,var(--c2) 36%,transparent));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
}

.uvq10-gal .tb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%,color-mix(in srgb,var(--c1) 22%,transparent));
  opacity: 0;
  animation: uvq10-gal-h calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .gl {
  position: absolute;
  left: .4em;
  top: 0;
  bottom: 0;
  width: .22em;
  background: rgba(255,255,255,.4);
  filter: blur(1px);
}

.uvq10-gal .bl {
  position: absolute;
  left: 50%;
  top: calc(.3em + var(--i) * 1.25em);
  width: .86em;
  margin-left: -.43em;
}

.uvq10-gal .bl i {
  display: block;
  width: .86em;
  height: .86em;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%,rgba(255,255,255,.9) 0 .07em,transparent .2em),radial-gradient(circle at 50% 58%,var(--bc),color-mix(in srgb,var(--bc) 60%,#000));
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}

.uvq10-gal .bl b {
  display: block;
  width: 3.1em;
  margin: .1em 0 0 -.15em;
  border-radius: .2em;
  background: linear-gradient(#f6dc8c,#b8892b);
  color: #3b2b0b;
  font: 800 .3em/1.45 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  text-align: center;
}

.uvq10-gal .b0 {
  --bc: var(--c1);
  animation: uvq10-gal-0 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b1 {
  --bc: color-mix(in oklab,var(--c1) 60%,#ffd166);
  animation: uvq10-gal-1 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b2 {
  --bc: #ffd166;
  animation: uvq10-gal-2 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b3 {
  --bc: color-mix(in oklab,var(--c2) 60%,#ffd166);
  animation: uvq10-gal-3 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b4 {
  --bc: var(--c2);
  animation: uvq10-gal-4 calc(8s / var(--k)) ease-in-out infinite;
}

@keyframes uvq10-gal-0 {
  0%,38% {
    transform: translateY(0);
  }
  45%,54% {
    transform: translateY(4.15em);
  }
  61%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-1 {
  0%,30% {
    transform: translateY(0);
  }
  37%,62% {
    transform: translateY(4.15em);
  }
  69%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-2 {
  0%,22% {
    transform: translateY(0);
  }
  29%,70% {
    transform: translateY(4.15em);
  }
  77%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-3 {
  0%,14% {
    transform: translateY(0);
  }
  21%,78% {
    transform: translateY(4.15em);
  }
  85%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-4 {
  0%,6% {
    transform: translateY(0);
  }
  13%,86% {
    transform: translateY(4.15em);
  }
  93%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-h {
  0%,8% {
    opacity: 0;
  }
  45%,55% {
    opacity: 1;
  }
  92%,100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-gal,.uvq10-gal *,.uvq10-gal *::before,.uvq10-gal *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-gal .bl {
    animation: none!important;
  }
}
```

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uvq10-gal {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 4.4em;
}

.uvq10-gal .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-gal .cap {
  display: block;
  width: 3.4em;
  height: .7em;
  border-radius: .35em .35em .1em .1em;
  background: linear-gradient(90deg,#8a6a2f,#e9c46a 45%,#8a6a2f);
}

.uvq10-gal .cap.b {
  width: 3.9em;
  height: .9em;
  border-radius: .1em .1em .35em .35em;
  box-shadow: 0 .5em .8em -.4em rgba(0,0,0,.45);
}

.uvq10-gal .tb {
  position: relative;
  width: 2.7em;
  height: 11em;
  overflow: hidden;
  background: linear-gradient(90deg,color-mix(in srgb,var(--c2) 32%,transparent),color-mix(in srgb,var(--c2) 12%,transparent) 40%,color-mix(in srgb,var(--c2) 36%,transparent));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
}

.uvq10-gal .tb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%,color-mix(in srgb,var(--c1) 22%,transparent));
  opacity: 0;
  animation: uvq10-gal-h calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .gl {
  position: absolute;
  left: .4em;
  top: 0;
  bottom: 0;
  width: .22em;
  background: rgba(255,255,255,.4);
  filter: blur(1px);
}

.uvq10-gal .bl {
  position: absolute;
  left: 50%;
  top: calc(.3em + var(--i) * 1.25em);
  width: .86em;
  margin-left: -.43em;
}

.uvq10-gal .bl i {
  display: block;
  width: .86em;
  height: .86em;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%,rgba(255,255,255,.9) 0 .07em,transparent .2em),radial-gradient(circle at 50% 58%,var(--bc),color-mix(in srgb,var(--bc) 60%,#000));
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}

.uvq10-gal .bl b {
  display: block;
  width: 3.1em;
  margin: .1em 0 0 -.15em;
  border-radius: .2em;
  background: linear-gradient(#f6dc8c,#b8892b);
  color: #3b2b0b;
  font: 800 .3em/1.45 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  text-align: center;
}

.uvq10-gal .b0 {
  --bc: var(--c1);
  animation: uvq10-gal-0 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b1 {
  --bc: color-mix(in oklab,var(--c1) 60%,#ffd166);
  animation: uvq10-gal-1 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b2 {
  --bc: #ffd166;
  animation: uvq10-gal-2 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b3 {
  --bc: color-mix(in oklab,var(--c2) 60%,#ffd166);
  animation: uvq10-gal-3 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b4 {
  --bc: var(--c2);
  animation: uvq10-gal-4 calc(8s / var(--k)) ease-in-out infinite;
}

@keyframes uvq10-gal-0 {
  0%,38% {
    transform: translateY(0);
  }
  45%,54% {
    transform: translateY(4.15em);
  }
  61%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-1 {
  0%,30% {
    transform: translateY(0);
  }
  37%,62% {
    transform: translateY(4.15em);
  }
  69%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-2 {
  0%,22% {
    transform: translateY(0);
  }
  29%,70% {
    transform: translateY(4.15em);
  }
  77%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-3 {
  0%,14% {
    transform: translateY(0);
  }
  21%,78% {
    transform: translateY(4.15em);
  }
  85%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-4 {
  0%,6% {
    transform: translateY(0);
  }
  13%,86% {
    transform: translateY(4.15em);
  }
  93%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-h {
  0%,8% {
    opacity: 0;
  }
  45%,55% {
    opacity: 1;
  }
  92%,100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-gal,.uvq10-gal *,.uvq10-gal *::before,.uvq10-gal *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-gal .bl {
    animation: none!important;
  }
}
`;

export default function LdGalileoThermometer() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#ef476f",
          "--c2": "#118ab2",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-gal" role="status"><span className="sr">Loading</span><i className="cap t" aria-hidden="true"></i><div className="tb" aria-hidden="true"><span className="bl b0" style={{ "--i": "0" } as CSSProperties}><i></i><b>26°</b></span><span className="bl b1" style={{ "--i": "1" } as CSSProperties}><i></i><b>24°</b></span><span className="bl b2" style={{ "--i": "2" } as CSSProperties}><i></i><b>22°</b></span><span className="bl b3" style={{ "--i": "3" } as CSSProperties}><i></i><b>20°</b></span><span className="bl b4" style={{ "--i": "4" } as CSSProperties}><i></i><b>18°</b></span><i className="gl"></i></div><i className="cap b" aria-hidden="true"></i></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Galileo thermometer loader” block (Loaders) from AIMRAN Library to my project.

## What it is
The glass bulbs of a Galileo thermometer sink one by one as the liquid warms and float back up as it cools.

## Chosen settings
- Main color: #ef476f
- Secondary color: #118ab2
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import type { CSSProperties } from "react";

const css = `
.uvq10-gal {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 4.4em;
}

.uvq10-gal .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-gal .cap {
  display: block;
  width: 3.4em;
  height: .7em;
  border-radius: .35em .35em .1em .1em;
  background: linear-gradient(90deg,#8a6a2f,#e9c46a 45%,#8a6a2f);
}

.uvq10-gal .cap.b {
  width: 3.9em;
  height: .9em;
  border-radius: .1em .1em .35em .35em;
  box-shadow: 0 .5em .8em -.4em rgba(0,0,0,.45);
}

.uvq10-gal .tb {
  position: relative;
  width: 2.7em;
  height: 11em;
  overflow: hidden;
  background: linear-gradient(90deg,color-mix(in srgb,var(--c2) 32%,transparent),color-mix(in srgb,var(--c2) 12%,transparent) 40%,color-mix(in srgb,var(--c2) 36%,transparent));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
}

.uvq10-gal .tb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%,color-mix(in srgb,var(--c1) 22%,transparent));
  opacity: 0;
  animation: uvq10-gal-h calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .gl {
  position: absolute;
  left: .4em;
  top: 0;
  bottom: 0;
  width: .22em;
  background: rgba(255,255,255,.4);
  filter: blur(1px);
}

.uvq10-gal .bl {
  position: absolute;
  left: 50%;
  top: calc(.3em + var(--i) * 1.25em);
  width: .86em;
  margin-left: -.43em;
}

.uvq10-gal .bl i {
  display: block;
  width: .86em;
  height: .86em;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%,rgba(255,255,255,.9) 0 .07em,transparent .2em),radial-gradient(circle at 50% 58%,var(--bc),color-mix(in srgb,var(--bc) 60%,#000));
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}

.uvq10-gal .bl b {
  display: block;
  width: 3.1em;
  margin: .1em 0 0 -.15em;
  border-radius: .2em;
  background: linear-gradient(#f6dc8c,#b8892b);
  color: #3b2b0b;
  font: 800 .3em/1.45 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  text-align: center;
}

.uvq10-gal .b0 {
  --bc: var(--c1);
  animation: uvq10-gal-0 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b1 {
  --bc: color-mix(in oklab,var(--c1) 60%,#ffd166);
  animation: uvq10-gal-1 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b2 {
  --bc: #ffd166;
  animation: uvq10-gal-2 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b3 {
  --bc: color-mix(in oklab,var(--c2) 60%,#ffd166);
  animation: uvq10-gal-3 calc(8s / var(--k)) ease-in-out infinite;
}

.uvq10-gal .b4 {
  --bc: var(--c2);
  animation: uvq10-gal-4 calc(8s / var(--k)) ease-in-out infinite;
}

@keyframes uvq10-gal-0 {
  0%,38% {
    transform: translateY(0);
  }
  45%,54% {
    transform: translateY(4.15em);
  }
  61%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-1 {
  0%,30% {
    transform: translateY(0);
  }
  37%,62% {
    transform: translateY(4.15em);
  }
  69%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-2 {
  0%,22% {
    transform: translateY(0);
  }
  29%,70% {
    transform: translateY(4.15em);
  }
  77%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-3 {
  0%,14% {
    transform: translateY(0);
  }
  21%,78% {
    transform: translateY(4.15em);
  }
  85%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-4 {
  0%,6% {
    transform: translateY(0);
  }
  13%,86% {
    transform: translateY(4.15em);
  }
  93%,100% {
    transform: translateY(0);
  }
}

@keyframes uvq10-gal-h {
  0%,8% {
    opacity: 0;
  }
  45%,55% {
    opacity: 1;
  }
  92%,100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-gal,.uvq10-gal *,.uvq10-gal *::before,.uvq10-gal *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-gal .bl {
    animation: none!important;
  }
}
`;

export default function LdGalileoThermometer() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#ef476f",
          "--c2": "#118ab2",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-gal" role="status"><span className="sr">Loading</span><i className="cap t" aria-hidden="true"></i><div className="tb" aria-hidden="true"><span className="bl b0" style={{ "--i": "0" } as CSSProperties}><i></i><b>26°</b></span><span className="bl b1" style={{ "--i": "1" } as CSSProperties}><i></i><b>24°</b></span><span className="bl b2" style={{ "--i": "2" } as CSSProperties}><i></i><b>22°</b></span><span className="bl b3" style={{ "--i": "3" } as CSSProperties}><i></i><b>20°</b></span><span className="bl b4" style={{ "--i": "4" } as CSSProperties}><i></i><b>18°</b></span><i className="gl"></i></div><i className="cap b" aria-hidden="true"></i></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
