CUI

Components / Motion

Gradient text and spotlight cards

Text filled with a gradient, and a card with a glow that follows the pointer.

Functions: cui_gradient_text, cui_spotlight

Usage

cui_gradient_text(ui, "Kiln 2.4", .font = CUI_FONT_DISPLAY, .size = 38);   /* a tonal blend of the accent */
cui_spotlight(ui, "gl", .width = CUI_PX(270)) {
    cui_text(ui, "OpenGL 3.3", .font = CUI_FONT_MEDIUM);
    /* ... */
}

Gradient text blends across its width, by default between two tones of the accent; pass from and to for other colors, and animate to let the blend drift. Keep it for a single brand moment: headings and numbers read better in one solid color. A spotlight card catches a soft light under the pointer, and the stretch of its border nearest the pointer lights up. With beam, a light also travels around the edge. Use it for the one card that is live, such as a running deploy, never for a whole row.

Keyboard

  • These are surfaces and text. What you put inside a spotlight card takes Tab, Enter and Space as usual.

Options of cui_gradient_text

OptionTypeDefaultDescription
.fontcui_font`CUI_FONT_BODY` (0)default CUI_FONT_BODY (0)
.sizefloatSize in points; 0 uses the component's own.
.fromcui_colorthe accent, or the text color under the neutral accentcolor at the left edge; default the accent, or the text color under the neutral accent
.tocui_color`from` blended toward the foreground colorcolor at the right edge, default from blended toward the foreground color
.animateboolthe gradient drifts along the text
.widthcui_sizeWidth: CUI_FILL, CUI_FIT, CUI_PX(n) or CUI_PCT(n); unset uses the component's own.

Options of cui_spotlight

OptionTypeDefaultDescription
.widthcui_sizeWidth: CUI_FILL, CUI_FIT, CUI_PX(n) or CUI_PCT(n); unset uses the component's own.
.heightcui_sizeHeight: CUI_FILL, CUI_FIT, CUI_PX(n) or CUI_PCT(n); unset uses the component's own.
.padfloatPadding inside, in points.
.gapfloatSpace between the items, in points.
.colorcui_colorA theme color such as CUI_COLOR_ACCENT, or CUI_RGB(0x7747ff); unset uses the theme's.
.beamboola light travels around the card's edge all the time

Related

  • Loaders: Animated indicators for work in progress, in five styles.
  • Rolling numbers: A number whose changed digits roll into place.
  • Dock: A row of icons that grow under the pointer, as in a desktop dock.
  • Text effects: Animated text: a shimmer, a typewriter, words that rotate in place and text that reveals itself.