diff --git a/.github/workflows/run_data_sync.yml b/.github/workflows/run_data_sync.yml index 7123f4ad0e3..d92962ba97c 100644 --- a/.github/workflows/run_data_sync.yml +++ b/.github/workflows/run_data_sync.yml @@ -27,17 +27,17 @@ env: # please change to your own config. RUN_TYPE: strava # support strava/nike/garmin/coros/garmin_cn/garmin_sync_cn_global/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/tcx_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon/oppo, Please change the 'pass' it to your own ATHLETE: chensoul - TITLE: Running - MIN_GRID_DISTANCE: 10 # change min distance here - TITLE_GRID: Over 10km Runs # also here + TITLE: Exercise + MIN_GRID_DISTANCE: 5 # change min distance here + TITLE_GRID: Over 5km Exercises # also here GITHUB_NAME: chensoul # change to yours - GITHUB_EMAIL: chensoul.eth@gmail.com # change to yours + GITHUB_EMAIL: ichensoul@gmail.com # change to yours # IGNORE_BEFORE_SAVING: True # if you want to ignore some data before saving, set this to True - IGNORE_START_END_RANGE: 10 # Unit meter + IGNORE_START_END_RANGE: 5 # Unit meter # Dont making this huge, just picking points you needing. https://developers.google.com/maps/documentation/utilities/polylineutility using this tool to making your polyline IGNORE_POLYLINE: 'ktjrFoemeU~IorGq}DeB' - IGNORE_RANGE: 10 # Unit meter + IGNORE_RANGE: 5 # Unit meter SAVE_DATA_IN_GITHUB_CACHE: false # if you deploy in the vercal, check the README DATA_CACHE_PREFIX: 'track_data' BUILD_GH_PAGES: true # If you do not need GitHub Page please set it to `false` diff --git a/index.html b/index.html index cfffd39e33e..e0bd5189043 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Running Page + Exercise Page
diff --git a/src/static/site-metadata.ts b/src/static/site-metadata.ts index c5f0865aeec..4341a84743a 100644 --- a/src/static/site-metadata.ts +++ b/src/static/site-metadata.ts @@ -10,8 +10,8 @@ interface ISiteMetadataResult { } const data: ISiteMetadataResult = { - siteTitle: 'ChenSoul Run', - siteUrl: 'https://run.chensou.cc', + siteTitle: 'ChenSoul Exercise', + siteUrl: 'https://run.chensoul.cc', logo: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQTtc69JxHNcmN1ETpMUX4dozAgAN6iPjWalQ&usqp=CAU', description: 'Personal site and blog', navLinks: [ diff --git a/src/utils/const.ts b/src/utils/const.ts index 2d7e7136107..3968b0a9390 100644 --- a/src/utils/const.ts +++ b/src/utils/const.ts @@ -48,7 +48,7 @@ const IS_CHINESE = true; const USE_ANIMATION_FOR_GRID = false; const CHINESE_INFO_MESSAGE = (yearLength: number, year: string): string => { const yearStr = year === 'Total' ? '所有' : ` ${year} `; - return `我用 App 记录自己跑步 ${yearLength} 年了,下面列表展示的是${yearStr}的数据`; + return `我用 App 记录自己的运动(跑步、骑行)已经 ${yearLength} 年了,下面列表展示的是${yearStr}的数据`; }; const ENGLISH_INFO_MESSAGE = (yearLength: number, year: string): string => `Running Journey with ${yearLength} Years, the table shows year ${year} data`; @@ -66,6 +66,12 @@ const MIDDAY_RUN_TITLE = IS_CHINESE ? '午间跑步' : 'Midday Run'; const AFTERNOON_RUN_TITLE = IS_CHINESE ? '午后跑步' : 'Afternoon Run'; const EVENING_RUN_TITLE = IS_CHINESE ? '傍晚跑步' : 'Evening Run'; const NIGHT_RUN_TITLE = IS_CHINESE ? '夜晚跑步' : 'Night Run'; +const MORNING_RIDE_TITLE = IS_CHINESE ? '清晨骑行' : 'Morning Ride'; +const MIDDAY_RIDE_TITLE = IS_CHINESE ? '午间骑行' : 'Midday Ride'; +const AFTERNOON_RIDE_TITLE = IS_CHINESE ? '午后骑行' : 'Afternoon Ride'; +const EVENING_RIDE_TITLE = IS_CHINESE ? '傍晚骑行' : 'Evening Ride'; +const NIGHT_RIDE_TITLE = IS_CHINESE ? '夜晚骑行' : 'Night Ride'; +const DEFAULT_TITLE = IS_CHINESE ? '运动' : 'Exercise'; const RUN_TITLES = { FULL_MARATHON_RUN_TITLE, @@ -75,6 +81,12 @@ const RUN_TITLES = { AFTERNOON_RUN_TITLE, EVENING_RUN_TITLE, NIGHT_RUN_TITLE, + MORNING_RIDE_TITLE, + MIDDAY_RIDE_TITLE, + AFTERNOON_RIDE_TITLE, + EVENING_RIDE_TITLE, + NIGHT_RIDE_TITLE, + DEFAULT_TITLE }; export { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index ce6e7f03adc..cb64bec4922 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -190,25 +190,41 @@ const geoJsonForMap = (): FeatureCollection => ({ const titleForRun = (run: Activity): string => { const runDistance = run.distance / 1000; const runHour = +run.start_date_local.slice(11, 13); - if (runDistance > 20 && runDistance < 40) { - return RUN_TITLES.HALF_MARATHON_RUN_TITLE; - } - if (runDistance >= 40) { - return RUN_TITLES.FULL_MARATHON_RUN_TITLE; - } - if (runHour >= 0 && runHour <= 10) { - return RUN_TITLES.MORNING_RUN_TITLE; - } - if (runHour > 10 && runHour <= 14) { - return RUN_TITLES.MIDDAY_RUN_TITLE; - } - if (runHour > 14 && runHour <= 18) { - return RUN_TITLES.AFTERNOON_RUN_TITLE; - } - if (runHour > 18 && runHour <= 21) { - return RUN_TITLES.EVENING_RUN_TITLE; + + if (run.type == 'Run'){ + if (runDistance > 20 && runDistance < 40) { + return RUN_TITLES.HALF_MARATHON_RUN_TITLE; + } + if (runDistance >= 40) { + return RUN_TITLES.FULL_MARATHON_RUN_TITLE; + } + if (runHour >= 0 && runHour <= 10) { + return RUN_TITLES.MORNING_RUN_TITLE; + } + if (runHour > 10 && runHour <= 14) { + return RUN_TITLES.MIDDAY_RUN_TITLE; + } + if (runHour > 14 && runHour <= 18) { + return RUN_TITLES.AFTERNOON_RUN_TITLE; + } + if (runHour > 18 && runHour <= 21) { + return RUN_TITLES.EVENING_RUN_TITLE; + } + } else if (run.type == 'Ride'){ + if (runHour >= 0 && runHour <= 10) { + return RUN_TITLES.MORNING_RIDE_TITLE; + } + if (runHour > 10 && runHour <= 14) { + return RUN_TITLES.MIDDAY_RIDE_TITLE; + } + if (runHour > 14 && runHour <= 18) { + return RUN_TITLES.AFTERNOON_RIDE_TITLE; + } + if (runHour > 18 && runHour <= 21) { + return RUN_TITLES.EVENING_RIDE_TITLE; + } } - return RUN_TITLES.NIGHT_RUN_TITLE; + return RUN_TITLES.DEFAULT_TITLE; }; export interface IViewState {