Merge branch 'eggstra' into main

This commit is contained in:
Matt Isenhower 2023-04-13 10:45:36 -07:00
commit 3a2cb6335b
24 changed files with 194 additions and 27 deletions

View File

@ -0,0 +1,48 @@
import StatusGenerator from "./StatusGenerator.mjs";
import Media from "../Media.mjs";
import { useEggstraWorkSchedulesStore } from "../../../src/stores/schedules.mjs";
export default class EggstraWorkStatus extends StatusGenerator
{
key = 'eggstrawork';
name = 'Eggstra Work';
async getActiveSchedule() {
await this.preparePinia();
return useEggstraWorkSchedulesStore().activeSchedule;
}
async getDataTime() {
let schedule = await this.getActiveSchedule();
return Date.parse(schedule.startTime);
}
async _getStatus() {
let schedule = await this.getActiveSchedule();
let lines = [];
let mode = 'Eggstra Work'
lines.push(`${mode} is now open on ${schedule.settings.coopStage.name}! #salmonrun #splatoon3`);
lines.push('');
lines.push('Current weapons:');
lines.push(...schedule.settings.weapons.map(w => ` ${w.name}`));
return lines.join('\n');
}
/** @param {ScreenshotHelper} screenshotHelper */
async _getMedia(screenshotHelper) {
let media = new Media;
media.file = await screenshotHelper.capture('salmonrun', {
params: {eggstra: "true"}
});
return media;
}
}

View File

@ -0,0 +1,73 @@
import StatusGenerator from "./StatusGenerator.mjs";
import Media from "../Media.mjs";
import { useEggstraWorkSchedulesStore } from "../../../src/stores/schedules.mjs";
import { useTimeStore } from "../../../src/stores/time.mjs";
export default class EggstraWorkUpcomingStatus extends StatusGenerator
{
key = 'eggstrawork.upcoming';
name = 'Upcoming Eggstra Work';
async getActiveSchedule() {
await this.preparePinia();
// Look for any upcoming schedules
return useEggstraWorkSchedulesStore().upcomingSchedules[0];
}
async getDataTime() {
let schedule = await this.getActiveSchedule();
return schedule
? Date.parse(schedule.startTime)
: false;
}
_getDescription(schedule) {
let stageName = schedule.settings.coopStage.name || '???';
return `An Eggstra Work shift on ${stageName} has been added to the schedule! #salmonrun #splatoon3`;
}
async _getStatus() {
let schedule = await this.getActiveSchedule();
if (!schedule) {
return false;
}
let lines = [];
lines.push(this._getDescription(schedule));
lines.push('');
let startTime = Date.parse(schedule.startTime);
let now = useTimeStore().now;
let hours = Math.floor((startTime - now) / (1000 * 60 * 60));
let formattedTime;
if (hours >= 24) {
let days = Math.round(hours / 24);
formattedTime = days === 1 ? '1 day' : `${days} days`;
} else {
formattedTime = hours === 1 ? '1 hour' : `${hours} hours`;
}
lines.push(`This shift will start in ${formattedTime} with these weapons:`);
lines.push(...schedule.settings.weapons.map(w => ` ${w.name}`));
return lines.join('\n');
}
/** @param {ScreenshotHelper} screenshotHelper */
async _getMedia(screenshotHelper) {
let schedule = await this.getActiveSchedule();
let media = new Media;
media.file = await screenshotHelper.capture('salmonRun', {
params: { startTime: schedule?.startTime, eggstra: "true" },
});
return media;
}
}

View File

@ -11,6 +11,8 @@ import SplatfestStatus from "./generators/SplatfestStatus.mjs";
import SplatfestResultsStatus from "./generators/SplatfestResultsStatus.mjs";
import StatusGeneratorManager from "./StatusGeneratorManager.mjs"
import SalmonRunUpcomingStatus from "./generators/SalmonRunUpcomingStatus.mjs";
import EggstraWorkStatus from "./generators/EggstraWorkStatus.mjs";
import EggstraWorkUpcomingStatus from "./generators/EggstraWorkUpcomingStatus.mjs";
function defaultStatusGenerators() {
return [
@ -22,6 +24,8 @@ function defaultStatusGenerators() {
new SalmonRunGearStatus,
new SplatfestStatus,
new SplatfestResultsStatus,
new EggstraWorkStatus,
new EggstraWorkUpcomingStatus,
];
}

View File

@ -35,7 +35,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Verfügbare Waffen",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Team-Wettkampf"
},
"festival": {
"title": "Splatfeste",

View File

@ -34,7 +34,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Supplied Weapons",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Eggstra Work",
},
"festival": {
"title": "Splatfests",

View File

@ -39,7 +39,8 @@
"kings": {
"maybe-cohozuna": "Maybe: Cohozuna?",
"maybe-horrorboros": "Maybe: Horrorboros?"
}
},
"eggstrawork": "Eggstra Work"
},
"festival": {
"title": "Splatfests",

View File

@ -33,7 +33,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Armas asignadas",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Alianza alevínica"
},
"festival": {
"title": "Festivales",

View File

@ -33,7 +33,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Armas disponibles",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Recolección extra"
},
"festival": {
"title": "Festivales",

View File

@ -34,7 +34,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Armes fournies",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Défi œuf sup'"
},
"festival": {
"title": "Festivals",

View File

@ -35,7 +35,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Armes fournies",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Défi œuf sup'"
},
"festival": {
"title": "Festivals",

View File

@ -33,7 +33,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Armi fornite",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Sfida tra colleghi"
},
"festival": {
"title": "Festival",

View File

@ -33,7 +33,8 @@
"salmonrun": {
"title": "サーモンラン",
"weapons": "支給ブキ",
"bigrun": "ビッグラン"
"bigrun": "ビッグラン",
"eggstrawork": "バイトチームコンテスト"
},
"festival": {
"title": "フェス",

View File

@ -33,7 +33,8 @@
"salmonrun": {
"title": "새먼 런",
"weapons": "지급 무기",
"bigrun": "빅 런"
"bigrun": "빅 런",
"eggstrawork": "아르바이트 팀 콘테스트"
},
"festival": {
"title": "페스티벌",

View File

@ -33,7 +33,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Beschikbare wapens",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Bedrijfseitje"
},
"festival": {
"title": "Splatfests",

View File

@ -33,7 +33,8 @@
"salmonrun": {
"title": "Salmon Run",
"weapons": "Табельное оружие",
"bigrun": "Big Run"
"bigrun": "Big Run",
"eggstrawork": "Икорный овертайм"
},
"festival": {
"title": "Сплатфест",

View File

@ -34,7 +34,8 @@
"salmonrun": {
"title": "鲑鱼跑",
"weapons": "发放武器",
"bigrun": "大型跑"
"bigrun": "大型跑",
"eggstrawork": "团队打工竞赛"
},
"festival": {
"title": "祭典",

View File

@ -33,7 +33,8 @@
"salmonrun": {
"title": "SALMON RUN",
"weapons": "派發武器",
"bigrun": "大型跑"
"bigrun": "大型跑",
"eggstrawork": "團隊打工競賽"
},
"festival": {
"title": "祭典",

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 KiB

View File

@ -8,7 +8,7 @@
</div>
<div class="hidden ss:block text-shadow text-white text-xl">
<KingSalmonid :schedule="schedule" class="inline-block -mb-1 mr-2" />
<KingSalmonid :schedule="schedule" class="inline-block -mb-1 mr-2" v-if="!eggstra"/>
<div class="inline-block" v-if="time.isUpcoming(schedule.startTime)">
Shift opens
@ -27,8 +27,8 @@
</div>
</div>
<div class="text-shadow text-zinc-300 ss:hidden">
<KingSalmonid :schedule="schedule" class="inline-block align-middle" />
<div class="text-shadow text-zinc-300 ss:hidden" v-if="!time.isUpcoming(schedule.startTime)">
<KingSalmonid :schedule="schedule" class="inline-block align-middle" v-if="!eggstra" />
{{ $t('time.remaining', { time: formatDurationFromNow(schedule.endTime) }) }}
</div>
@ -61,6 +61,7 @@ import SalmonRunWeapons from './SalmonRunWeapons.vue';
defineProps({
schedule: Object,
eggstra: Boolean,
});
const time = useTimeStore();

View File

@ -1,13 +1,17 @@
<template>
<ProductContainer bg="bg-splatoon-salmonRun bg-monsters" class="pt-8 overflow-hidden rounded-2xl">
<ProductContainer :bg="eggstra ? 'bg-splatoon-eggstraWork bg-monsters' : 'bg-splatoon-salmonRun bg-monsters'" class="pt-8 overflow-hidden rounded-2xl">
<div class="space-y-2">
<div class="font-splatoon1 text-3xl mx-4 text-shadow">
<div class="font-splatoon1 text-3xl mx-4 text-shadow" v-if="eggstra">
{{ $t('salmonrun.eggstrawork') }}
</div>
<div class="font-splatoon1 text-3xl mx-4 text-shadow" v-else>
{{ $t('salmonrun.title') }}
</div>
<div class="flex">
<!-- Character graphic -->
<div class="flex-1 bg-character hidden md:block"></div>
<div class="flex-1 bg-eggstra hidden md:block" v-if="eggstra"></div>
<div class="flex-1 bg-character hidden md:block" v-else></div>
<!-- Main content -->
<div class="md:w-2/3 mx-2 pb-2">
@ -16,7 +20,7 @@
<div class="px-2">{{ $t('times.now') }}</div>
</SquidTape>
<ExpandedSalmonRunRow :schedule="activeSchedule" />
<ExpandedSalmonRunRow :schedule="activeSchedule" :eggstra="eggstra"/>
</div>
<div class="py-1 bg-zinc-900 bg-opacity-70 rounded-lg backdrop-blur-sm" v-if="upcomingSchedules.length">
@ -26,7 +30,7 @@
<div class="mx-2 divide-y-2 divide-dashed divide-zinc-400">
<div v-for="schedule in upcomingSchedules" :key="schedule.startTime">
<ExpandedSalmonRunRow class="my-3" :schedule="schedule" v-if="isScreenshot" />
<ExpandedSalmonRunRow class="my-3" :schedule="schedule" v-if="isScreenshot || eggstra" :eggstra="eggstra"/>
<SalmonRunRow class="my-2" :schedule="schedule" v-else />
</div>
</div>
@ -39,7 +43,7 @@
<script setup>
import { computed } from 'vue';
import { useSalmonRunSchedulesStore } from '@/stores/schedules.mjs';
import { useSalmonRunSchedulesStore, useEggstraWorkSchedulesStore } from '@/stores/schedules.mjs';
import ProductContainer from '../ProductContainer.vue';
import SquidTape from '../SquidTape.vue';
import SalmonRunRow from './SalmonRunRow.vue';
@ -48,20 +52,22 @@ import ExpandedSalmonRunRow from './ExpandedSalmonRunRow.vue';
const props = defineProps({
isScreenshot: Boolean,
startTime: String,
eggstra: Boolean,
});
const store = useSalmonRunSchedulesStore();
const SRstore = useSalmonRunSchedulesStore();
const EWstore = useEggstraWorkSchedulesStore();
function filterSchedules(schedules) {
return schedules.filter(s => !props.startTime || s?.startTime === props.startTime);
}
const activeSchedule = computed(() => filterSchedules([store.activeSchedule])[0]);
const activeSchedule = computed(() => filterSchedules([props.eggstra ? EWstore.activeSchedule : SRstore.activeSchedule])[0]);
const upcomingSchedules = computed(() => {
if (props.isScreenshot && !props.startTime) {
return [];
}
return filterSchedules(store.upcomingSchedules);
return filterSchedules(props.eggstra ? EWstore.upcomingSchedules : SRstore.upcomingSchedules);
});
</script>
@ -73,6 +79,13 @@ const upcomingSchedules = computed(() => {
background-repeat: no-repeat;
}
.bg-eggstra {
background-image: url('@/assets/img/eggstra-work.png');
background-size: cover;
background-position: top, center;
background-repeat: no-repeat;
}
:deep(.bg-monsters) {
background-image: url('@/assets/img/monsters-transparent-bg.png'),
linear-gradient(180deg, rgba(2, 0, 36, 0.10) 0%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.2) 100%);

View File

@ -29,6 +29,7 @@ function defineScheduleStore(id, options) {
const activeSchedule = computed(() => schedules.value?.find(s => time.isActive(s.startTime, s.endTime)));
const upcomingSchedules = computed(() => schedules.value?.filter(s => time.isUpcoming(s.startTime)));
return { schedules, currentSchedules, activeSchedule, upcomingSchedules };
});
}
@ -90,6 +91,12 @@ export const useSalmonRunSchedulesStore = defineScheduleStore('salmonRun', {
settings: node => node.setting,
});
// Eggstra Work
export const useEggstraWorkSchedulesStore = defineScheduleStore('eggstraWork', {
nodes: () => useSchedulesDataStore().data?.coopGroupingSchedule.teamContestSchedules.nodes || [],
settings: node => node.setting,
});
if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useRegularSchedulesStore, import.meta.hot));
import.meta.hot.accept(acceptHMRUpdate(useAnarchySeriesSchedulesStore, import.meta.hot));
@ -97,4 +104,5 @@ if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useXSchedulesStore, import.meta.hot));
import.meta.hot.accept(acceptHMRUpdate(useSplatfestSchedulesStore, import.meta.hot));
import.meta.hot.accept(acceptHMRUpdate(useSalmonRunSchedulesStore, import.meta.hot));
import.meta.hot.accept(acceptHMRUpdate(useEggstraWorkSchedulesStore, import.meta.hot));
}

View File

@ -6,6 +6,9 @@
<div class="w-full max-w-2xl">
<SalmonRunBox class="md:-rotate-1" />
</div>
<div class="w-full max-w-2xl" v-if="eggstraWork.schedules.length">
<SalmonRunBox class="md:rotate-1" eggstra/>
</div>
</div>
</div>
</div>
@ -13,6 +16,8 @@
</template>
<script setup>
import { useEggstraWorkSchedulesStore } from '@/stores/schedules.mjs';
import MainLayout from '@/layouts/MainLayout.vue'
import SalmonRunBox from '../components/salmonrun/SalmonRunBox.vue';
const eggstraWork = useEggstraWorkSchedulesStore();
</script>

View File

@ -2,7 +2,7 @@
<ScreenshotLayout header="Salmon Run">
<div class="grow flex items-center justify-center">
<div class="max-w-2xl scale-[1.6]">
<SalmonRunBox class="-rotate-1" is-screenshot :startTime="route.query.startTime" />
<SalmonRunBox class="-rotate-1" is-screenshot :startTime="route.query.startTime" :eggstra="route.query.eggstra=='true'"/>
</div>
</div>
</ScreenshotLayout>

View File

@ -26,6 +26,7 @@ module.exports = {
salmonRun: '#ff5600',
bigRun: '#b322ff',
eggstraWork: '#be8800'
},
},
fontFamily: {