trackStyleConfig.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. export type TrackDisplayMode = 'none' | 'full' | 'tail'
  2. export type TrackStyleProfile = 'classic' | 'neon'
  3. export type TrackTailLengthPreset = 'short' | 'medium' | 'long'
  4. export type TrackColorPreset =
  5. | 'mint'
  6. | 'cyan'
  7. | 'sky'
  8. | 'blue'
  9. | 'violet'
  10. | 'pink'
  11. | 'orange'
  12. | 'yellow'
  13. export interface TrackColorPresetEntry {
  14. colorHex: string
  15. headColorHex: string
  16. }
  17. export const TRACK_TAIL_LENGTH_METERS: Record<TrackTailLengthPreset, number> = {
  18. short: 32,
  19. medium: 52,
  20. long: 78,
  21. }
  22. export const TRACK_COLOR_PRESET_MAP: Record<TrackColorPreset, TrackColorPresetEntry> = {
  23. mint: {
  24. colorHex: '#15a38d',
  25. headColorHex: '#63fff0',
  26. },
  27. cyan: {
  28. colorHex: '#18b8c9',
  29. headColorHex: '#7cf4ff',
  30. },
  31. sky: {
  32. colorHex: '#4a9cff',
  33. headColorHex: '#c9eeff',
  34. },
  35. blue: {
  36. colorHex: '#3a63ff',
  37. headColorHex: '#9fb4ff',
  38. },
  39. violet: {
  40. colorHex: '#7c4dff',
  41. headColorHex: '#d0b8ff',
  42. },
  43. pink: {
  44. colorHex: '#ff4fb3',
  45. headColorHex: '#ffc0ec',
  46. },
  47. orange: {
  48. colorHex: '#ff8a2b',
  49. headColorHex: '#ffd0a3',
  50. },
  51. yellow: {
  52. colorHex: '#f0c419',
  53. headColorHex: '#fff0a8',
  54. },
  55. }
  56. export interface TrackVisualizationConfig {
  57. mode: TrackDisplayMode
  58. style: TrackStyleProfile
  59. tailLength: TrackTailLengthPreset
  60. colorPreset: TrackColorPreset
  61. tailMeters: number
  62. tailMaxSeconds: number
  63. fadeOutWhenStill: boolean
  64. stillSpeedKmh: number
  65. fadeOutDurationMs: number
  66. colorHex: string
  67. headColorHex: string
  68. widthPx: number
  69. headWidthPx: number
  70. glowStrength: number
  71. }
  72. export const DEFAULT_TRACK_VISUALIZATION_CONFIG: TrackVisualizationConfig = {
  73. mode: 'full',
  74. style: 'neon',
  75. tailLength: 'medium',
  76. colorPreset: 'mint',
  77. tailMeters: TRACK_TAIL_LENGTH_METERS.medium,
  78. tailMaxSeconds: 30,
  79. fadeOutWhenStill: true,
  80. stillSpeedKmh: 0.6,
  81. fadeOutDurationMs: 3000,
  82. colorHex: TRACK_COLOR_PRESET_MAP.mint.colorHex,
  83. headColorHex: TRACK_COLOR_PRESET_MAP.mint.headColorHex,
  84. widthPx: 4.2,
  85. headWidthPx: 6.8,
  86. glowStrength: 0.2,
  87. }