Skip to content

Commit

Permalink
feat: kugin_page 初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
Kugin committed Nov 5, 2023
1 parent ccb1db1 commit 4ffa3d7
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/run_data_sync.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run Data Sync

on:
workflow_dispatch:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
push:
Expand All @@ -21,13 +21,13 @@ on:

env:
# please change to your own config.
RUN_TYPE: pass # support strava/nike/garmin/garmin_cn/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon, Please change the 'pass' it to your own
ATHLETE: yihong0618
TITLE: Yihong0618 Running
RUN_TYPE: keep # support strava/nike/garmin/garmin_cn/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon, Please change the 'pass' it to your own
ATHLETE: Kugin
TITLE: Kugin's Running
MIN_GRID_DISTANCE: 10 # change min distance here
TITLE_GRID: Over 10km Runs # also here
GITHUB_NAME: yihong0618 # change to yours
GITHUB_EMAIL: zouzou0208@gmail.com # change to yours
GITHUB_NAME: Kugin # change to yours
GITHUB_EMAIL: ctkugin@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
Expand Down
2 changes: 1 addition & 1 deletion assets/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/grid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions run_page/keep_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ def login(session, mobile, password):
def get_to_download_runs_ids(session, headers):
last_date = 0
result = []
runStartTime = 1672502400000
while 1:
r = session.get(RUN_DATA_API.format(last_date=last_date), headers=headers)
if r.ok:
run_logs = r.json()["data"]["records"]

for i in run_logs:
logs = [j["stats"] for j in i["logs"]]
if logs[0]["startTime"] < runStartTime:
continue
result.extend(k["id"] for k in logs if not k["isDoubtful"])
last_date = r.json()["data"]["lastTimestamp"]
since_time = datetime.utcfromtimestamp(last_date / 1000)
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout/style.module.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
@import '../../styles/variables.scss';

.body {
background-color: $dark;
color: $nike;
background-color: $green;
color: $dark;

p,
h1,
h3,
h4,
a {
color: $nike;
color: $dark;
text-decoration: none;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/RunMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const RunMap = ({
{ ...viewState }
onMove={onMove}
style={style}
mapStyle="mapbox://styles/mapbox/dark-v10"
mapStyle="mapbox://styles/mapbox/light-v10"
ref={mapRefCallback}
mapboxAccessToken={MAPBOX_TOKEN}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/RunTable/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

&:hover {
background-color: lighten($dark, 3%);
background-color: lighten($white, 3%);
}
}

Expand All @@ -51,5 +51,5 @@
}

.runDate {
color: $light;
color: $dark;
}
2 changes: 1 addition & 1 deletion src/static/activities.json

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions src/static/site-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ interface ISiteMetadataResult {

const data: ISiteMetadataResult = {
siteTitle: 'Running Page',
siteUrl: 'https://yihong.run',
siteUrl: 'https://kugin.top',
logo: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQTtc69JxHNcmN1ETpMUX4dozAgAN6iPjWalQ&usqp=CAU',
description: 'Personal site and blog',
description: 'Personal run site',
navLinks: [
{
name: 'Blog',
url: 'https://github.com/yihong0618/gitblog',
},
{
name: 'About',
url: 'https://github.com/yihong0618/running_page/blob/master/README-CN.md',
url: 'https://github.com/Kugin/running_page/blob/kugin_pages/README-CN.md',
},
],
};
Expand Down
2 changes: 2 additions & 0 deletions src/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ $nike: rgb(224, 237, 94);
$light: rgb(204, 204, 204);
$dark: rgb(26, 26, 26);
$map-box-line-color: rgb(71, 184, 224);
$white: rgb(252,252,252);
$green: rgb(116, 182, 102);
5 changes: 3 additions & 2 deletions src/utils/const.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// const
const MAPBOX_TOKEN =
'pk.eyJ1IjoieWlob25nMDYxOCIsImEiOiJja2J3M28xbG4wYzl0MzJxZm0ya2Fua2p2In0.PNKfkeQwYuyGOTT_x9BJ4Q';
'pk.eyJ1IjoiY3RrdWdpbiIsImEiOiJjbG9rdTltZWQwOHdyMmxzNnByMWp0dDV6In0.g1I0Xy6JqqlD7ZFv98xVpQ';
const MUNICIPALITY_CITIES_ARR = [
'北京市',
'上海市',
Expand Down Expand Up @@ -83,7 +83,8 @@ export {
MAP_HEIGHT,
};

const nike = 'rgb(224,237,94)'; // if you want change the main color change here src/styles/variables.scss
// 224,237,94
const nike = 'rgb(27,193,7)'; // if you want change the main color change here src/styles/variables.scss

// If your map has an offset please change this line
// issues #92 and #198
Expand Down

0 comments on commit 4ffa3d7

Please sign in to comment.