跳转至

ui/components/material/token/animation_token_literals.h

Material Design 3 Animation Token String Literals. More...

Namespaces

Name
cf
cf::ui
cf::ui::components
cf::ui::components::material
cf::ui::components::material::token_literals

Detailed Description

Material Design 3 Animation Token String Literals.

Author: Charliechen114514 (chengh1922@mails.jlu.edu.cn)

Version: 0.1

Date: 2026-02-28

Copyright: Copyright © 2026

Compile-time string constants for Material Design 3 animation tokens. These literals are used throughout the animation system to ensure consistency and avoid string duplication.

Animation tokens follow the naming pattern: "md.animation." where type is "fade", "slide", "scale", etc. and direction is "In", "Out".

Source code

#pragma once

#include <cstdint>

namespace cf::ui::components::material::token_literals {

// =============================================================================
// Animation Token Literals - Fade Animations
// =============================================================================

inline constexpr const char ANIMATION_FADE_IN[] = "md.animation.fadeIn";

inline constexpr const char ANIMATION_FADE_OUT[] = "md.animation.fadeOut";

// =============================================================================
// Animation Token Literals - Slide Animations
// =============================================================================

inline constexpr const char ANIMATION_SLIDE_UP[] = "md.animation.slideUp";

inline constexpr const char ANIMATION_SLIDE_DOWN[] = "md.animation.slideDown";

inline constexpr const char ANIMATION_SLIDE_LEFT[] = "md.animation.slideLeft";

inline constexpr const char ANIMATION_SLIDE_RIGHT[] = "md.animation.slideRight";

// =============================================================================
// Animation Token Literals - Scale Animations
// =============================================================================

inline constexpr const char ANIMATION_SCALE_UP[] = "md.animation.scaleUp";

inline constexpr const char ANIMATION_SCALE_DOWN[] = "md.animation.scaleDown";

// =============================================================================
// Animation Token Literals - Rotate Animations
// =============================================================================

inline constexpr const char ANIMATION_ROTATE_IN[] = "md.animation.rotateIn";

inline constexpr const char ANIMATION_ROTATE_OUT[] = "md.animation.rotateOut";

// =============================================================================
// Animation Token Literals - Ripple Animations
// =============================================================================

inline constexpr const char ANIMATION_RIPPLE_EXPAND[] = "md.animation.rippleExpand";

inline constexpr const char ANIMATION_RIPPLE_FADE[] = "md.animation.rippleFade";

// =============================================================================
// All Animation Tokens Array (for iteration)
// =============================================================================

inline constexpr const char* const ALL_ANIMATION_TOKENS[] = {
    // Fade
    ANIMATION_FADE_IN, ANIMATION_FADE_OUT,
    // Slide
    ANIMATION_SLIDE_UP, ANIMATION_SLIDE_DOWN, ANIMATION_SLIDE_LEFT, ANIMATION_SLIDE_RIGHT,
    // Scale
    ANIMATION_SCALE_UP, ANIMATION_SCALE_DOWN,
    // Rotate
    ANIMATION_ROTATE_IN, ANIMATION_ROTATE_OUT,
    // Ripple
    ANIMATION_RIPPLE_EXPAND, ANIMATION_RIPPLE_FADE};

inline constexpr size_t ANIMATION_TOKEN_COUNT = 12;

} // namespace cf::ui::components::material::token_literals

Updated on 2026-03-09 at 10:14:01 +0000