Skip to content

Commit e37d021

Browse files
committed
2 parents b99066c + d84f0aa commit e37d021

File tree

7 files changed

+1507
-1209
lines changed

7 files changed

+1507
-1209
lines changed

package-lock.json

Lines changed: 1390 additions & 1098 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/chart/percentageChange/percentageChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const PercentageChart: React.FC<IProps> = React.memo((props: IProps) => {
125125
fill={progressChartColours[0]}
126126
>
127127
{sortedData.map((entry, index) => (
128-
<Cell key={`cell-${index}`} fill={weekDayColours[index % weekDayColours.length]} />
128+
<Cell key={`cell-${index}`} fill={weekDayColours[(new Date(entry.daySinceEpochInterval * 86400000)).getDay()]} />
129129
))}
130130
</Bar>
131131
</BarChart>

src/components/chart/progress/progressChart.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const ProgressChart: React.FC<IProps> = React.memo((props: IProps) => {
8585
}
8686

8787
const handleData = (sortedData: Array<CommunityMissionTrackedViewModel>, dataSetsToMap: Array<any>): Array<CommunityMissionTrackedViewModel> => {
88+
const maxPercentLookup: any = {};
8889
try {
8990
const dataWithMultiplDataSetMappings: Array<CommunityMissionTrackedViewModel> = [];
9091
for (let sortedDataItemIndex = 0; sortedDataItemIndex < sortedData.length; sortedDataItemIndex++) {
@@ -98,7 +99,13 @@ export const ProgressChart: React.FC<IProps> = React.memo((props: IProps) => {
9899
// newObj[dataSetToMap.key] = 0;
99100
}
100101
else {
101-
if (newObj.percentage > 0 && newObj.percentage <= 100) {
102+
if (newObj.percentage > 0) {
103+
if (newObj.percentage >= 100) {
104+
if (maxPercentLookup[newObj.missionId]) {
105+
continue;
106+
}
107+
maxPercentLookup[newObj.missionId] = true;
108+
}
102109
newObj[dataSetToMap.key] = newObj.percentage;
103110
}
104111
}

src/components/incidentReports.tsx

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ interface IProps {
99

1010
export const IncidentReports: React.FC<IProps> = (props: IProps) => {
1111

12-
const defaultDateTextFromUtc = (dateString: string) => formatDate((new Date(dateString)).toLocaleString(), 'YYYY-MM-DD HH:mm (Z)');
13-
const friendlyDateTextFromUtc = (dateString: string) => formatDate((new Date(dateString)).toLocaleString(), 'HH:mm on YYYY-MM-DD (Z)');
12+
const shortDateTextFromUtc = (date: number) => formatDate((new Date(date)), 'YYYY-MM-DD');
13+
const defaultDateTextFromUtc = (date: number) => formatDate((new Date(date)), 'YYYY-MM-DD HH:mm (Z)');
14+
const friendlyDateTextFromUtc = (date: number) => formatDate((new Date(date)), 'HH:mm on YYYY-MM-DD (Z)');
1415

1516
return (
1617
<>
@@ -19,6 +20,18 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
1920
<button className="hidden-in-desktop mb2" style={{ width: '100%', backgroundColor: '#7d76e3' }} onClick={props.setIncidentsOpen}>
2021
Close
2122
</button>
23+
<div className="report">
24+
<div className="heading-row noselect">
25+
<img src="./assets/img/error.svg" alt="error" />
26+
<div className="info-container">
27+
<p className="title">Progress tracking error</p>
28+
</div>
29+
</div>
30+
<div className="body-container">
31+
<p className="body">The AssistantNMS tracker did not detect that Community Mission 77 had started for the Singularity Expedition. The data has also been altered for this period to reflect what was approximately displayed in game.</p>
32+
<p className="time">{shortDateTextFromUtc(Date.UTC(2023, 6, 7))} &nbsp; → &nbsp; {defaultDateTextFromUtc(Date.UTC(2023, 6, 7, 7, 57))}</p>
33+
</div>
34+
</div>
2235
<div className="report">
2336
<div className="heading-row noselect">
2437
<img src="./assets/img/error.svg" alt="error" />
@@ -28,7 +41,7 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
2841
</div>
2942
<div className="body-container">
3043
<p className="body">The AssistantNMS tracker did not detect that Community Mission 71 had already started for several days. Extra logic has been added to try prevent this issue occurring again. The data has also been altered for this period to reflect what was approximately displayed in game.</p>
31-
<p className="time">{formatDate((new Date('2023-01-20')).toLocaleString(), 'YYYY-MM-DD')} &nbsp; → &nbsp; {formatDate((new Date('2023-01-23')).toLocaleString(), 'YYYY-MM-DD')}</p>
44+
<p className="time">{shortDateTextFromUtc(Date.UTC(2023, 1, 20))} &nbsp; → &nbsp; {shortDateTextFromUtc(Date.UTC(2023, 1, 23))}</p>
3245
</div>
3346
</div>
3447
<div className="report">
@@ -39,8 +52,8 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
3952
</div>
4053
</div>
4154
<div className="body-container">
42-
<p className="body">A large amount of progress was mysteriously made at around {friendlyDateTextFromUtc('2022-08-05T08:57Z')}. The cause of this sudden spike in progress has not been officially been commented on.</p>
43-
<p className="time">{defaultDateTextFromUtc('2022-08-05T08:57Z')}</p>
55+
<p className="body">A large amount of progress was mysteriously made at around {friendlyDateTextFromUtc(Date.UTC(2022, 8, 5, 8, 57))}. The cause of this sudden spike in progress has not been officially been commented on.</p>
56+
<p className="time">{defaultDateTextFromUtc(Date.UTC(2022, 8, 5, 8, 57))}</p>
4457
</div>
4558
</div>
4659
<div className="report">
@@ -51,8 +64,8 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
5164
</div>
5265
</div>
5366
<div className="body-container">
54-
<p className="body">First noticed at {friendlyDateTextFromUtc('2022-07-24T21:55Z')} by <BasicLink href="https://twitter.com/bomber_that/status/1551433207387750405" title="ThatBomberBoi">ThatBomberBoi on Twitter</BasicLink>. The <BasicLink href="https://nomanssky.com">website</BasicLink> was confirmed to be down.</p>
55-
<p className="time">{defaultDateTextFromUtc('2022-07-24T21:55Z')} &nbsp; → &nbsp; {defaultDateTextFromUtc('2022-07-24T22:10Z')}</p>
67+
<p className="body">First noticed at {friendlyDateTextFromUtc(Date.UTC(2022, 7, 24, 21, 55))} by <BasicLink href="https://twitter.com/bomber_that/status/1551433207387750405" title="ThatBomberBoi">ThatBomberBoi on Twitter</BasicLink>. The <BasicLink href="https://nomanssky.com">website</BasicLink> was confirmed to be down.</p>
68+
<p className="time">{defaultDateTextFromUtc(Date.UTC(2022, 7, 24, 21, 55))} &nbsp; → &nbsp; {defaultDateTextFromUtc(Date.UTC(2022, 7, 24, 22, 10))}</p>
5669
</div>
5770
</div>
5871
<div className="report">
@@ -63,8 +76,8 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
6376
</div>
6477
</div>
6578
<div className="body-container">
66-
<p className="body">First noticed at {friendlyDateTextFromUtc('2022-06-03T09:54Z')} by <BasicLink href='https://twitter.com/ProceduralTRV/status/1532661985279631360' title='ProceduralTraveller'>Procedural Traveller on Twitter</BasicLink>. The <BasicLink href="https://nomanssky.com">website</BasicLink> was confirmed to be down by multiple players.</p>
67-
<p className="time">{defaultDateTextFromUtc('2022-06-03T09:54Z')} &nbsp; → &nbsp; {defaultDateTextFromUtc('2022-06-06T09:31Z')}</p>
79+
<p className="body">First noticed at {friendlyDateTextFromUtc(Date.UTC(2022, 6, 3, 9, 54))} by <BasicLink href='https://twitter.com/ProceduralTRV/status/1532661985279631360' title='ProceduralTraveller'>Procedural Traveller on Twitter</BasicLink>. The <BasicLink href="https://nomanssky.com">website</BasicLink> was confirmed to be down by multiple players.</p>
80+
<p className="time">{defaultDateTextFromUtc(Date.UTC(2022, 6, 3, 9, 54))} &nbsp; → &nbsp; {defaultDateTextFromUtc(Date.UTC(2022, 6, 6, 9, 31))}</p>
6881
</div>
6982
</div>
7083
<div className="report">
@@ -75,8 +88,8 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
7588
</div>
7689
</div>
7790
<div className="body-container">
78-
<p className="body">First detected at around {friendlyDateTextFromUtc('2022-05-30T23:00Z')}, the Galactic Atlas API (the service which reports the progress to the Galactic Atlas website) stopped responding to Assistant for No Man's Sky trackers. The issue seems to have been resolved by HelloGames and the problem Tier was skipped.</p>
79-
<p className="time">{defaultDateTextFromUtc('2022-05-30T09:00Z')} &nbsp; → &nbsp; {defaultDateTextFromUtc('2022-05-30T23:00Z')}</p>
91+
<p className="body">First detected at around {friendlyDateTextFromUtc(Date.UTC(2022, 5, 30, 23, 0))}, the Galactic Atlas API (the service which reports the progress to the Galactic Atlas website) stopped responding to Assistant for No Man's Sky trackers. The issue seems to have been resolved by HelloGames and the problem Tier was skipped.</p>
92+
<p className="time">{defaultDateTextFromUtc(Date.UTC(2022, 5, 30, 9, 0))} &nbsp; → &nbsp; {defaultDateTextFromUtc(Date.UTC(2022, 5, 30, 23, 0))}</p>
8093
</div>
8194
</div>
8295
<div className="report">
@@ -87,8 +100,8 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
87100
</div>
88101
</div>
89102
<div className="body-container">
90-
<p className="body">First detected at around {friendlyDateTextFromUtc('2022-05-30T09:00Z')}, the Community Mission progress percentage started decreasing for the first time ever recorded. This caused a lot of confusion in the NMS community and lead to a lot of speculation.</p>
91-
<p className="time">{defaultDateTextFromUtc('2022-05-30T09:00Z')} &nbsp; → &nbsp; {defaultDateTextFromUtc('2022-05-30T23:00Z')}</p>
103+
<p className="body">First detected at around {friendlyDateTextFromUtc(Date.UTC(2022, 5, 30, 9, 0))}, the Community Mission progress percentage started decreasing for the first time ever recorded. This caused a lot of confusion in the NMS community and lead to a lot of speculation.</p>
104+
<p className="time">{defaultDateTextFromUtc(Date.UTC(2022, 5, 30, 9, 0))} &nbsp; → &nbsp; {defaultDateTextFromUtc(Date.UTC(2022, 5, 30, 23, 0))}</p>
92105
</div>
93106
</div>
94107
<div className="report">
@@ -99,8 +112,8 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
99112
</div>
100113
</div>
101114
<div className="body-container">
102-
<p className="body">A large amount of progress was mysteriously made at around {friendlyDateTextFromUtc('2022-04-30T16:00Z')}. The cause of this sudden spike in progress has not been officially been commented on.</p>
103-
<p className="time">{defaultDateTextFromUtc('2022-04-30T16:00Z')}</p>
115+
<p className="body">A large amount of progress was mysteriously made at around {friendlyDateTextFromUtc(Date.UTC(2022, 4, 30, 16, 0))}. The cause of this sudden spike in progress has not been officially been commented on.</p>
116+
<p className="time">{defaultDateTextFromUtc(Date.UTC(2022, 4, 30, 16, 0))}</p>
104117
</div>
105118
</div>
106119
<div className="report">
@@ -111,8 +124,8 @@ export const IncidentReports: React.FC<IProps> = (props: IProps) => {
111124
</div>
112125
</div>
113126
<div className="body-container">
114-
<p className="body">A large amount of progress was mysteriously made at around {friendlyDateTextFromUtc('2022-04-04T09:00Z')}. The cause of this sudden spike in progress has not been officially been commented on.</p>
115-
<p className="time">{defaultDateTextFromUtc('2022-04-04T09:00Z')}</p>
127+
<p className="body">A large amount of progress was mysteriously made at around {friendlyDateTextFromUtc(Date.UTC(2022, 4, 4, 9, 0))}. The cause of this sudden spike in progress has not been officially been commented on.</p>
128+
<p className="time">{defaultDateTextFromUtc(Date.UTC(2022, 4, 4, 9, 0))}</p>
116129
</div>
117130
</div>
118131
</div>

src/helper/dateHelper.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,3 @@ export const dateIsBefore = (firstDate: Date, secondDate: Date): boolean => {
2727
return false;
2828
}
2929
}
30-
31-
export const friendlyTimeLeft = (startDate: Date, endDate: Date): string => {
32-
if (endDate < (new Date())) {
33-
return 'Complete';
34-
}
35-
36-
dayjs.extend(relativeTime);
37-
return dayjs(startDate).to(endDate, true);
38-
}

src/sass/layout/_header.scss

Lines changed: 69 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,106 @@
1+
/* Header */
12

3+
#header {
4+
@include padding(5em, 5em, (0, 0, -2em, 0));
5+
text-align: center;
26

3-
/* Header */
7+
h1 {
8+
margin: 0 0 (_size(element-margin) * 0.125) 0;
9+
}
410

5-
#header {
6-
@include padding(5em, 5em, (0, 0, -2em, 0));
7-
text-align: center;
11+
p {
12+
font-size: 1.25em;
13+
letter-spacing: _font(letter-spacing);
14+
}
15+
16+
&.alt {
17+
@include padding(6em, 5em, (1em, 0, 0, 0));
818

919
h1 {
10-
margin: 0 0 (_size(element-margin) * 0.125) 0;
20+
font-size: 3.25em;
1121
}
1222

13-
p {
14-
font-size: 1.25em;
15-
letter-spacing: _font(letter-spacing);
23+
> * {
24+
@include vendor("transition", "opacity 3s ease");
25+
@include vendor("transition-delay", "0.5s");
26+
opacity: 1;
1627
}
1728

18-
&.alt {
19-
@include padding(6em, 5em, (1em, 0, 0, 0));
20-
21-
h1 {
22-
font-size: 3.25em;
23-
}
29+
.logo {
30+
@include vendor("transition", ("opacity 1.25s ease", "transform 0.5s ease"));
31+
@include vendor("transition-delay", "0s");
32+
display: block;
33+
margin: 0 0 (_size(element-margin) * 0.75) 0;
2434

25-
> * {
26-
@include vendor('transition', 'opacity 3s ease');
27-
@include vendor('transition-delay', '0.5s');
28-
opacity: 1;
29-
}
30-
31-
.logo {
32-
@include vendor('transition', (
33-
'opacity 1.25s ease',
34-
'transform 0.5s ease'
35-
));
36-
@include vendor('transition-delay', '0s');
35+
img {
3736
display: block;
38-
margin: 0 0 (_size(element-margin) * 0.75) 0;
39-
40-
img {
41-
display: block;
42-
margin: 0 auto;
43-
max-width: 75%;
44-
}
37+
margin: 0 auto;
4538
}
4639
}
40+
}
4741

48-
@include breakpoint('<=large') {
49-
@include padding(4em, 4em, (0, 0, -2em, 0));
42+
@include breakpoint("<=large") {
43+
@include padding(4em, 4em, (0, 0, -2em, 0));
5044

51-
&.alt {
52-
@include padding(5em, 4em, (1em, 0, 0, 0));
53-
}
45+
&.alt {
46+
@include padding(5em, 4em, (1em, 0, 0, 0));
5447
}
48+
}
5549

56-
@include breakpoint('<=medium') {
57-
@include padding(4em, 3em, (0, 0, -2em, 0));
50+
@include breakpoint("<=medium") {
51+
@include padding(4em, 3em, (0, 0, -2em, 0));
5852

59-
&.alt {
60-
@include padding(4em, 3em, (1em, 0, 0, 0));
61-
}
53+
&.alt {
54+
@include padding(4em, 3em, (1em, 0, 0, 0));
6255
}
56+
}
6357

64-
@include breakpoint('<=small') {
65-
@include padding(3em, 2em, (0, 0, -1em, 0));
58+
@include breakpoint("<=small") {
59+
@include padding(3em, 2em, (0, 0, -1em, 0));
6660

67-
p {
68-
font-size: 1em;
69-
letter-spacing: 0;
61+
p {
62+
font-size: 1em;
63+
letter-spacing: 0;
7064

71-
br {
72-
display: none;
73-
}
65+
br {
66+
display: none;
7467
}
68+
}
7569

76-
&.alt {
77-
@include padding(3em, 2em, (1em, 0, 0, 0));
70+
&.alt {
71+
@include padding(3em, 2em, (1em, 0, 0, 0));
7872

79-
h1 {
80-
font-size: 2.5em;
81-
}
73+
h1 {
74+
font-size: 2.5em;
8275
}
8376
}
77+
}
8478

85-
@include breakpoint('<=xsmall') {
86-
@include padding(3em, 1.5em, (0, 0, -1em, 0));
79+
@include breakpoint("<=xsmall") {
80+
@include padding(3em, 1.5em, (0, 0, -1em, 0));
8781

88-
&.alt {
89-
@include padding(3em, 1.5em, (1em, 0, 0, 0));
90-
}
82+
&.alt {
83+
@include padding(3em, 1.5em, (1em, 0, 0, 0));
9184
}
85+
}
9286

93-
@include breakpoint('<=xxsmall') {
94-
@include padding(2.5em, 1em, (0, 0, -1em, 0));
87+
@include breakpoint("<=xxsmall") {
88+
@include padding(2.5em, 1em, (0, 0, -1em, 0));
9589

96-
&.alt {
97-
@include padding(2.5em, 1em, (1em, 0, 0, 0));
98-
}
90+
&.alt {
91+
@include padding(2.5em, 1em, (1em, 0, 0, 0));
9992
}
93+
}
10094

101-
body.is-preload & {
102-
&.alt {
103-
> * {
104-
opacity: 0;
105-
}
95+
body.is-preload & {
96+
&.alt {
97+
> * {
98+
opacity: 0;
99+
}
106100

107-
.logo {
108-
@include vendor('transform', 'scale(0.8) rotate(-30deg)');
109-
}
101+
.logo {
102+
@include vendor("transform", "scale(0.8) rotate(-30deg)");
110103
}
111104
}
112-
}
105+
}
106+
}

src/viewerApp.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import React, { useEffect, useState } from 'react';
22
import { ToastContainer } from 'react-toastify';
3-
import { BasicImage } from './components/core/image';
4-
import { ChartSection } from './components/section/chartSection';
5-
import { DataSection } from './components/section/dataSection';
3+
4+
import { Footer } from './components/common/footer';
65
import { Header } from './components/common/header';
76
import { Navbar } from './components/common/navbar';
8-
import { Footer } from './components/common/footer';
97
import { TimeLoopParallax } from './components/common/parallax';
10-
11-
import './sass/main.scss';
12-
import './sass/custom.scss';
13-
import 'react-toastify/dist/ReactToastify.css';
8+
import { BasicImage } from './components/core/image';
149
import { IncidentReports } from './components/incidentReports';
10+
import { ChartSection } from './components/section/chartSection';
11+
import { DataSection } from './components/section/dataSection';
1512
import { shouldHaveHtmlNodeClass } from './helper/documentHelper';
1613

14+
import 'react-toastify/dist/ReactToastify.css';
15+
import './sass/custom.scss';
16+
import './sass/main.scss';
17+
1718
export const ViewerApp: React.FC = () => {
1819
const [incidentsOpen, setIncidentsOpen] = useState<boolean>(false);
1920

0 commit comments

Comments
 (0)