mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
Radically simplify the Spinner public API from 6 parameters to 3. Remove SpinnerSpeed, BouncingTrackWidth, and BouncingTrailLength enums. Hardcode calibrated intervals (dots 110ms, line 140ms, bouncing 100ms), fixed track width (9), and trail opacities with edge overshoot for smooth fade-in/fade-out at track edges.
36 lines
850 B
Swift
36 lines
850 B
Swift
//
|
|
// SpinnersPage.swift
|
|
// TUIkitExample
|
|
//
|
|
// Demo page showcasing the Spinner view with all three styles.
|
|
//
|
|
|
|
import TUIkit
|
|
|
|
/// A demo page showing all Spinner styles.
|
|
struct SpinnersPage: View {
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 1) {
|
|
HeaderView(title: "Spinners")
|
|
|
|
DemoSection("Dots (Braille Rotation)") {
|
|
Spinner("Loading data...")
|
|
}
|
|
|
|
DemoSection("Line (ASCII Rotation)") {
|
|
Spinner("Compiling...", style: .line)
|
|
}
|
|
|
|
DemoSection("Bouncing (Knight Rider)") {
|
|
Spinner("Processing...", style: .bouncing)
|
|
}
|
|
|
|
DemoSection("Custom Color") {
|
|
Spinner("Installing...", style: .bouncing, color: .green)
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
}
|
|
}
|