Skip to content

Commit

Permalink
Add button setting app time to system time if it's within our slider …
Browse files Browse the repository at this point in the history
…time range.
  • Loading branch information
Carifio24 committed Apr 5, 2024
1 parent 264dee5 commit 45b2bb8
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions src/SolarEclipse2024.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1075,14 +1075,16 @@

<div>
<v-btn
class="splash-get-started"
@click="closeSplashScreen"
:color="accentColor"
:density="xSmallSize ? 'compact' : 'default'"
size="x-large"
variant="elevated"
rounded="lg"
>Get Started</v-btn>
class="splash-get-started"
@click="closeSplashScreen"
:color="accentColor"
:density="xSmallSize ? 'compact' : 'default'"
size="x-large"
variant="elevated"
rounded="lg"
>
Get Started
</v-btn>
</div>

<div v-if="narrow">
Expand Down Expand Up @@ -1532,6 +1534,12 @@
<div id="tools">
<span class="tool-container">
<div style="position: relative">
<v-btn
:disabled="nowOutsideTimeRange"
@click="selectedTime = Math.max(minTime, Math.min(maxTime, Date.now()))"
>
Now
</v-btn>
<div id="speed-control">
<icon-button
id="reverse-speed"
Expand Down Expand Up @@ -2245,10 +2253,11 @@ export default defineComponent({
toggleTrackSun: true,
times: times,
minTime: minTime,
maxTime: maxTime,
times,
minTime,
maxTime,
millisecondsPerInterval: MILLISECONDS_PER_INTERVAL,
nowOutsideTimeRange: false,
accentColor: "#eac402",
moonColor: "#CFD8DC",
Expand Down Expand Up @@ -2341,6 +2350,10 @@ export default defineComponent({
mounted() {
setInterval(() => {
this.nowOutsideTimeRange = Date.now() < this.minTime || Date.now() > this.maxTime;
}, 1000);
if (queryData.latitudeDeg !== undefined && queryData.longitudeDeg !== undefined) {
this.selectedTimezone = tzlookup(...[queryData.latitudeDeg, queryData.longitudeDeg]);
this.updateSelectedLocationText();
Expand Down Expand Up @@ -2885,6 +2898,7 @@ export default defineComponent({
this.showNewMobileUI = !value;
},
},
},
methods: {
Expand Down Expand Up @@ -4208,7 +4222,7 @@ export default defineComponent({
nearTotality(near: boolean, oldNear: boolean) {
if (near) {
this.forceRate = (Math.abs(this.playbackRate) > 10) && this.playing;
this.forceRate = (Math.abs(this.playbackRate) > 10) && this.playing;
}
// if leaving eclipse reset speed to previous
Expand Down

0 comments on commit 45b2bb8

Please sign in to comment.