courseStyleConfig.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. export type ControlPointStyleId = 'classic-ring' | 'solid-dot' | 'double-ring' | 'badge' | 'pulse-core'
  2. export type CourseLegStyleId = 'classic-leg' | 'dashed-leg' | 'glow-leg' | 'progress-leg'
  3. export interface ControlPointStyleEntry {
  4. style: ControlPointStyleId
  5. colorHex: string
  6. sizeScale?: number
  7. accentRingScale?: number
  8. glowStrength?: number
  9. labelScale?: number
  10. labelColorHex?: string
  11. }
  12. export interface CourseLegStyleEntry {
  13. style: CourseLegStyleId
  14. colorHex: string
  15. widthScale?: number
  16. glowStrength?: number
  17. }
  18. export interface ScoreBandStyleEntry extends ControlPointStyleEntry {
  19. min: number
  20. max: number
  21. }
  22. export interface SequentialCourseStyleConfig {
  23. controls: {
  24. default: ControlPointStyleEntry
  25. current: ControlPointStyleEntry
  26. completed: ControlPointStyleEntry
  27. skipped: ControlPointStyleEntry
  28. start: ControlPointStyleEntry
  29. finish: ControlPointStyleEntry
  30. }
  31. legs: {
  32. default: CourseLegStyleEntry
  33. completed: CourseLegStyleEntry
  34. }
  35. }
  36. export interface ScoreOCourseStyleConfig {
  37. controls: {
  38. default: ControlPointStyleEntry
  39. focused: ControlPointStyleEntry
  40. collected: ControlPointStyleEntry
  41. start: ControlPointStyleEntry
  42. finish: ControlPointStyleEntry
  43. scoreBands: ScoreBandStyleEntry[]
  44. }
  45. }
  46. export interface CourseStyleConfig {
  47. sequential: SequentialCourseStyleConfig
  48. scoreO: ScoreOCourseStyleConfig
  49. }
  50. export const DEFAULT_COURSE_STYLE_CONFIG: CourseStyleConfig = {
  51. sequential: {
  52. controls: {
  53. default: { style: 'classic-ring', colorHex: '#cc006b', sizeScale: 1, labelScale: 1 },
  54. current: { style: 'pulse-core', colorHex: '#38fff2', sizeScale: 1.08, accentRingScale: 1.28, glowStrength: 0.9, labelScale: 1.08, labelColorHex: '#fff4fb' },
  55. completed: { style: 'solid-dot', colorHex: '#7e838a', sizeScale: 0.88, labelScale: 0.96 },
  56. skipped: { style: 'badge', colorHex: '#8a9198', sizeScale: 0.9, accentRingScale: 1.12, labelScale: 0.94 },
  57. start: { style: 'double-ring', colorHex: '#cc006b', sizeScale: 1.04, accentRingScale: 1.3, labelScale: 1.02 },
  58. finish: { style: 'double-ring', colorHex: '#cc006b', sizeScale: 1.08, accentRingScale: 1.34, glowStrength: 0.32, labelScale: 1.06, labelColorHex: '#fff4de' },
  59. },
  60. legs: {
  61. default: { style: 'classic-leg', colorHex: '#cc006b', widthScale: 1 },
  62. completed: { style: 'progress-leg', colorHex: '#7a8088', widthScale: 0.92, glowStrength: 0.24 },
  63. },
  64. },
  65. scoreO: {
  66. controls: {
  67. default: { style: 'badge', colorHex: '#cc006b', sizeScale: 0.96, accentRingScale: 1.1, labelScale: 1.02, labelColorHex: '#ffffff' },
  68. focused: { style: 'badge', colorHex: '#cc006b', sizeScale: 1.1, accentRingScale: 1.34, glowStrength: 0.92, labelScale: 1.08, labelColorHex: '#ffffff' },
  69. collected: { style: 'badge', colorHex: '#9aa3ad', sizeScale: 0.86, accentRingScale: 1.08, labelScale: 0.94, labelColorHex: '#ffffff' },
  70. start: { style: 'double-ring', colorHex: '#cc006b', sizeScale: 1.02, accentRingScale: 1.24, labelScale: 1.02 },
  71. finish: { style: 'double-ring', colorHex: '#cc006b', sizeScale: 1.06, accentRingScale: 1.28, glowStrength: 0.26, labelScale: 1.04, labelColorHex: '#fff4de' },
  72. scoreBands: [
  73. { min: 0, max: 19, style: 'badge', colorHex: '#56ccf2', sizeScale: 0.96, accentRingScale: 1.1, labelScale: 1.02, labelColorHex: '#ffffff' },
  74. { min: 20, max: 49, style: 'badge', colorHex: '#f2c94c', sizeScale: 0.96, accentRingScale: 1.1, labelScale: 1.02, labelColorHex: '#ffffff' },
  75. { min: 50, max: 999999, style: 'badge', colorHex: '#eb5757', sizeScale: 0.96, accentRingScale: 1.1, glowStrength: 0.72, labelScale: 1.02, labelColorHex: '#ffffff' },
  76. ],
  77. },
  78. },
  79. }