yihong0618 / running_page

Make your own running home page
https://running-page.vercel.app
MIT License
3.4k stars 977 forks source link

Feat: lights switch #591

Closed ben-29 closed 5 months ago

ben-29 commented 6 months ago

Add a light switch button, when turned off, displays only the routes and blacks out the entire map. These features come with some other changes.

  1. In the Easter Egg map, display both the China boundary and the running routes, not just the China boundary.
  2. In lights-off mode, turn off dash lines and line transparency, and enhance the line to emphasize the route.
vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
running-page ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2024 8:05am
yihong0618 commented 5 months ago

cool let us make default lights on or close configurable

NaturezzZ commented 5 months ago

Can we add an option to only show the shape of the track without displaying the location in the map? ie, keeping lights-off mode and not showing the switch button.

orionna319 commented 5 months ago

Sorry, I may have misunderstood, I reset my code... I tried to add the defaultLights attribute in the site-metadata.ts file. When it is false, the LightsControl is hidden. Maybe a configuration is needed to control whether the lights attribute is enabled by default? Can you describe it in detail?

cool let us make default lights on or close configurable

yihong0618 commented 5 months ago

Sorry, I may have misunderstood, I reset my code...

I tried to add the defaultLights attribute in the site-metadata.ts file. When it is false, the LightsControl is hidden. Maybe a configuration is needed to control whether the lights attribute is enabled by default?

Can you describe it in detail?

cool let us make default lights on or close configurable

for now lights on is default, we can make lights off default the other logic are the same as ben_29 did

yihong0618 commented 5 months ago

Can we add an option to only show the shape of the track without displaying the location in the map? ie, keeping lights-off mode and not showing the switch button.

Yes, but this can be in a separate PR

zhaohongxuan commented 5 months ago

Can we add an option to only show the shape of the track without displaying the location in the map? ie, keeping lights-off mode and not showing the switch button.

Surely agree. for some privacy reasons, I think it's a essential feature, and the location should not displayed in the track detail page either.

yihong0618 commented 5 months ago

Can we add an option to only show the shape of the track without displaying the location in the map? ie, keeping lights-off mode and not showing the switch button.

Surely agree. for some privacy reasons, I think it's a essential feature, and the location should not displayed in the track detail page either.

yep that is what I thought about

ben-29 commented 5 months ago

cool let us make default lights on or close configurable

@orionna319 @yihong0618 for this part, I think is easy, I will change this first

Can we add an option to only show the shape of the track without displaying the location in the map? ie, keeping lights-off mode and not showing the switch button.

@NaturezzZ @zhaohongxuan @yihong0618 for the privacy part that displaying only routes without the map. If we continue using the current map style, we'll need to wait for all layers (such as 'road-label,' 'poi-label,' 'country-label,' etc.) to render and then disable them (turn off the visibility), which could take several seconds(show the map for a few seconds and then black out).

I suggest creating a custom map style using Mapbox. I'll do this in a different pr

NaturezzZ commented 5 months ago

Cool! BTW in the private mode, is the geo info completely hidden or accessible via F12 console?

ben-29 commented 5 months ago

@yihong0618 @NaturezzZ @orionna319 @zhaohongxuan Done both changes, I found a way to bypass rendering, so there's no need for a new custom map style. Introduce a PRIVACY_MODE that displays only the routes without showing the map. You can click the links below to preview: privacy mode on: https://running-page-njxnvrye5-yihong0618.vercel.app/ privacy mode off & default lights on: https://running-page-ilo6qlcuw-yihong0618.vercel.app/

NaturezzZ commented 5 months ago

@yihong0618 @NaturezzZ @orionna319 @zhaohongxuan Done both changes, I found a way to bypass rendering, so there's no need for a new custom map style. Introduce a PRIVACY_MODE that displays only the routes without showing the map. You can click the links below to preview: privacy mode on: https://running-page-njxnvrye5-yihong0618.vercel.app/ privacy mode off & default lights on: https://running-page-njxnvrye5-yihong0618.vercel.app/

privacy mode off & default lights on should be https://running-page-ilo6qlcuw-yihong0618.vercel.app/ 😂

ben-29 commented 5 months ago

Cool! BTW in the private mode, is the geo info completely hidden or accessible via F12 console?

For now, it is accessible via the console. If completely hidden, it would also break the Easter egg page.

NaturezzZ commented 5 months ago

Cool! BTW in the private mode, is the geo info completely hidden or accessible via F12 console?

For now, is accessible via console @NaturezzZ

It will be better to provide an annotation in README.

ben-29 commented 5 months ago

Cool! BTW in the private mode, is the geo info completely hidden or accessible via F12 console?

For now, is accessible via console @NaturezzZ

It will be better to provide an annotation in README.

doc added #594