mirror of
https://github.com/misenhower/splatoon2.ink.git
synced 2026-09-08 10:35:20 -05:00
Update the site to use Salmon Run schedule data from SplatNet
This commit is contained in:
@@ -198,16 +198,6 @@ body.has-modal #main {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-attribution {
|
||||
background: rgba(0,0,0,0.5);
|
||||
font-family: $family-sans-serif;
|
||||
font-size: 0.7rem;
|
||||
padding: 2px 20px;
|
||||
a {
|
||||
color: mix($green, $white-ter, 25%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.splatfest {
|
||||
|
||||
BIN
src/img/salmon-run-random-weapon.png
Normal file
BIN
src/img/salmon-run-random-weapon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -88,10 +88,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column" v-if="coop || coopCalendar">
|
||||
<div class="column" v-if="coopSchedules">
|
||||
<div class="salmon-run tilt-left">
|
||||
<div class="hook-box">
|
||||
<SalmonRunBox :coop="coop" :coopCalendar="coopCalendar" :now="now"></SalmonRunBox>
|
||||
<SalmonRunBox :coop="coop" :coopSchedules="coopSchedules" :now="now"></SalmonRunBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -177,11 +177,11 @@ export default {
|
||||
now: null,
|
||||
splatnet: {
|
||||
schedules: null,
|
||||
coopSchedules: null,
|
||||
timeline: null,
|
||||
merchandises: null,
|
||||
festivals: null,
|
||||
},
|
||||
salmonruncalendar: null,
|
||||
aboutOpen: false,
|
||||
splatNetGearOpen: false,
|
||||
};
|
||||
@@ -229,11 +229,11 @@ export default {
|
||||
if (this.splatnet.timeline && this.splatnet.timeline.coop && this.splatnet.timeline.coop.schedule.end_time > this.now)
|
||||
return this.splatnet.timeline.coop;
|
||||
},
|
||||
coopCalendar() {
|
||||
if (this.salmonruncalendar) {
|
||||
let schedules = this.salmonruncalendar.schedules.filter(this.filterEndTime);
|
||||
if (schedules.length > 0)
|
||||
return schedules;
|
||||
coopSchedules() {
|
||||
if (this.splatnet.coopSchedules) {
|
||||
let details = this.splatnet.coopSchedules.details.filter(this.filterEndTime);
|
||||
let schedules = this.splatnet.coopSchedules.schedules.filter(this.filterEndTime);
|
||||
return { details, schedules };
|
||||
}
|
||||
},
|
||||
|
||||
@@ -257,7 +257,7 @@ export default {
|
||||
|
||||
// Other
|
||||
bottomRowHasThreeColumns() {
|
||||
return this.selectedFestival && !this.isSelectedFestivalActive && (this.coop || this.coopCalendar) && this.newWeapons;
|
||||
return this.selectedFestival && !this.isSelectedFestivalActive && (this.coop || this.coopSchedules) && this.newWeapons;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -306,7 +306,12 @@ export default {
|
||||
.then(response => this.splatnet.schedules = response.data)
|
||||
.catch(e => console.error(e));
|
||||
|
||||
// Co-op (Salmon Run) data
|
||||
// Co-op schedules
|
||||
axios.get('/data/coop-schedules.json')
|
||||
.then(response => this.splatnet.coopSchedules = response.data)
|
||||
.catch(e => console.error(e));
|
||||
|
||||
// Timeline data (Salmon Run weapon of the month and new weapon availability)
|
||||
axios.get('/data/timeline.json')
|
||||
.then(response => this.splatnet.timeline = response.data)
|
||||
.catch(e => console.error(e));
|
||||
@@ -320,11 +325,6 @@ export default {
|
||||
axios.get('/data/merchandises.json')
|
||||
.then(response => this.splatnet.merchandises = response.data)
|
||||
.catch(e => console.error(e));
|
||||
|
||||
// Salmon Run calendar data (upcoming Salmon Run schedules)
|
||||
axios.get('/data/salmonruncalendar.json')
|
||||
.then(response => this.salmonruncalendar = response.data)
|
||||
.catch(e => console.error(e));
|
||||
},
|
||||
updateNow() {
|
||||
this.now = Math.trunc((new Date).getTime() / 1000);
|
||||
|
||||
@@ -57,9 +57,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
schedules: null,
|
||||
coopSchedules: null,
|
||||
merchandises: null,
|
||||
timeline: null,
|
||||
salmonruncalendar: null,
|
||||
festivals: null,
|
||||
};
|
||||
},
|
||||
@@ -79,11 +79,8 @@ export default {
|
||||
return this.merchandises[this.merchandises.length - 1];
|
||||
},
|
||||
latestSalmonRun() {
|
||||
if (this.salmonruncalendar)
|
||||
return this.salmonruncalendar.schedules[0];
|
||||
|
||||
if (this.timeline && this.timeline.coop)
|
||||
return this.timeline.coop;
|
||||
if (this.coopSchedules)
|
||||
return this.coopSchedules.details[0];
|
||||
},
|
||||
newWeaponAvailability() {
|
||||
if (this.timeline && this.timeline.weapon_availability && this.timeline.weapon_availability.availabilities) {
|
||||
@@ -108,12 +105,12 @@ export default {
|
||||
created() {
|
||||
axios.get('data/schedules.json')
|
||||
.then(response => this.schedules = response.data);
|
||||
axios.get('data/coop-schedules.json')
|
||||
.then(response => this.coopSchedules = response.data);
|
||||
axios.get('data/merchandises.json')
|
||||
.then(response => this.merchandises = response.data.merchandises);
|
||||
axios.get('data/timeline.json')
|
||||
.then(response => this.timeline = response.data);
|
||||
axios.get('data/salmonruncalendar.json')
|
||||
.then(response => this.salmonruncalendar = response.data);
|
||||
axios.get('data/festivals.json')
|
||||
.then(response => this.festivals = response.data);
|
||||
},
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
<div class="salmon-run tilt-left">
|
||||
<div class="hook-box">
|
||||
<SalmonRunBox
|
||||
v-if="coopSchedules"
|
||||
:coop="coop"
|
||||
:coopCalendar="coopCalendar"
|
||||
:coopSchedules="coopSchedules"
|
||||
:now="now"
|
||||
:screenshotMode="true"
|
||||
></SalmonRunBox>
|
||||
@@ -23,8 +24,8 @@ export default {
|
||||
props: ['startTime'],
|
||||
data() {
|
||||
return {
|
||||
coopSchedules: null,
|
||||
timeline: null,
|
||||
salmonruncalendar: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -35,19 +36,19 @@ export default {
|
||||
if (this.timeline && this.timeline.coop && this.timeline.coop.schedule.end_time > this.now)
|
||||
return this.timeline.coop;
|
||||
},
|
||||
coopCalendar() {
|
||||
if (this.salmonruncalendar) {
|
||||
let schedules = this.salmonruncalendar.schedules.filter(s => s.start_time == this.now);
|
||||
if (schedules.length > 0)
|
||||
return schedules;
|
||||
coopSchedules() {
|
||||
if (this.coopSchedules) {
|
||||
let details = this.splatnet.coopSchedules.details.filter(s => s.start_time == this.now);
|
||||
let schedules = this.splatnet.coopSchedules.schedules.filter(s => s.start_time == this.now);
|
||||
return { details, schedules };
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
axios.get('data/coop-schedules.json')
|
||||
.then(response => this.coopSchedules = response.data)
|
||||
axios.get('data/timeline.json')
|
||||
.then(response => this.timeline = response.data)
|
||||
axios.get('data/salmonruncalendar.json')
|
||||
.then(response => this.salmonruncalendar = response.data)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -90,11 +90,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="showSourceBar" class="has-text-right calendar-attribution">
|
||||
Salmon Run schedule courtesy of
|
||||
<a href="https://www.reddit.com/r/splatoon/comments/6pgqy4/i_couldnt_find_a_calendar_online_with_a_list_of/" target="_blank">thejellydude</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -112,7 +107,7 @@ import SalmonRunGearDialog from './SalmonRunGearDialog.vue';
|
||||
|
||||
export default {
|
||||
components: { SalmonRunDetailsBar, SalmonRunGearDialog },
|
||||
props: ['coop', 'coopCalendar', 'now', 'screenshotMode'],
|
||||
props: ['coop', 'coopSchedules', 'now', 'screenshotMode'],
|
||||
data() {
|
||||
return {
|
||||
gearDialogOpen: false,
|
||||
@@ -120,17 +115,16 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
allSchedules() {
|
||||
// Combine the "schedules" and "details" sections into one list of schedules
|
||||
let results = {};
|
||||
|
||||
// "Official" schedule from SplatNet
|
||||
if (this.coop && this.coop.schedule.end_time > this.now)
|
||||
results[this.coop.schedule.start_time] = this.coop.schedule;
|
||||
// Add the less-detailed schedules in first
|
||||
for (let schedule of this.coopSchedules.schedules)
|
||||
results[schedule.start_time] = schedule;
|
||||
|
||||
// Other schedules
|
||||
if (this.coopCalendar) {
|
||||
for (let schedule of this.coopCalendar)
|
||||
results[schedule.start_time] = schedule;
|
||||
}
|
||||
// Add/replace the schedules that have map/weapon details
|
||||
for (let schedule of this.coopSchedules.details)
|
||||
results[schedule.start_time] = schedule;
|
||||
|
||||
return Object.values(results).sort((a, b) => { return a.start_time - b.start_time });
|
||||
},
|
||||
@@ -139,9 +133,6 @@ export default {
|
||||
if (this.allSchedules.length > 0 && this.allSchedules[0].start_time <= this.now)
|
||||
return this.allSchedules[0];
|
||||
},
|
||||
showSourceBar() {
|
||||
return this.upcomingSchedules && this.upcomingSchedules.find(s => s.source == 'thejellydude');
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
<div class="columns is-mobile is-slimmer">
|
||||
<div class="column" v-for="weapon in schedule.weapons">
|
||||
<div class="image is-square weapon">
|
||||
<img :src="weapon.image | localSplatNetImageUrl" :title="weapon.name" />
|
||||
<img :src="weapon.image | localSplatNetImageUrl" :title="weapon.name" v-if="weapon" />
|
||||
<img src="~@/img/salmon-run-random-weapon.png" title="Random" style="padding: 8px" v-else />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -47,21 +47,4 @@ export default [
|
||||
image: '/images/stage/96fd8c0492331a30e60a217c94fd1d4c73a966cc.png',
|
||||
largeImage: require('@/img/stages/turf-wars-stage-8_2x.jpg'),
|
||||
},
|
||||
|
||||
// Salmon Run stages with fake IDs for tracking purposes
|
||||
{
|
||||
id: '999901',
|
||||
name: 'Spawning Grounds',
|
||||
image: require('@/img/stages/turf-wars-stage-5_2x.jpg'),
|
||||
},
|
||||
{
|
||||
id: '999902',
|
||||
name: 'Marooner\'s Bay',
|
||||
image: require('@/img/stages/marooners-bay.jpg'),
|
||||
},
|
||||
{
|
||||
id: '999903',
|
||||
name: 'Lost Outpost',
|
||||
image: require('@/img/stages/lost-outpost.jpg'),
|
||||
},
|
||||
]
|
||||
|
||||
@@ -7,19 +7,16 @@ class SalmonRunTweet extends TwitterPostBase {
|
||||
getName() { return 'Salmon Run'; }
|
||||
|
||||
getSalmonRunSchedules() {
|
||||
let schedules = {};
|
||||
let results = {};
|
||||
let coopSchedules = readData('coop-schedules.json');
|
||||
|
||||
let timeline = readData('timeline.json').coop;
|
||||
if (timeline)
|
||||
schedules[timeline.start_time] = timeline;
|
||||
for (let schedule of coopSchedules.schedules)
|
||||
results[schedule.start_time] = schedule;
|
||||
|
||||
let calendar = readData('salmonruncalendar.json').schedules;
|
||||
if (calendar) {
|
||||
for (let schedule of calendar)
|
||||
schedules[schedule.start_time] = schedule;
|
||||
}
|
||||
for (let schedule of coopSchedules.details)
|
||||
results[schedule.start_time] = schedule;
|
||||
|
||||
return Object.values(schedules);
|
||||
return Object.values(results);
|
||||
}
|
||||
|
||||
getData() {
|
||||
|
||||
Reference in New Issue
Block a user