Add fish easter egg
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { API_BASE, ENABLE_POLLING } from './config';
|
||||
import { getBuildHistory, getCiStatus, getMenu, getPrices } from './services/api';
|
||||
import { prettify } from './utils/text';
|
||||
import { fly, fade } from 'svelte/transition';
|
||||
|
||||
let menu = null;
|
||||
let prices = [];
|
||||
@@ -13,6 +14,16 @@
|
||||
let loadingCiStatus = true;
|
||||
let buildHistory = [];
|
||||
let loadingHistory = true;
|
||||
let showFishToast = false;
|
||||
|
||||
function onFishClick() {
|
||||
if (showFishToast) return;
|
||||
|
||||
showFishToast = true;
|
||||
setTimeout(() => {
|
||||
showFishToast = false;
|
||||
}, 2800);
|
||||
}
|
||||
|
||||
async function fetchMenu() {
|
||||
loadingMenu = true;
|
||||
@@ -129,7 +140,9 @@
|
||||
</div>
|
||||
|
||||
{#if menu}
|
||||
<div class={`menu-layout ${menu?.alternative?.items?.length ? 'with-alternative' : ''}`}>
|
||||
<div
|
||||
class={`menu-layout ${menu?.alternative?.items?.length ? 'with-alternative' : ''}`}
|
||||
>
|
||||
<div class="menu-primary">
|
||||
<div class="menu-grid">
|
||||
<div>
|
||||
@@ -144,7 +157,37 @@
|
||||
<p class="section-title">Segundos</p>
|
||||
<ul>
|
||||
{#each menu.mains as main}
|
||||
<li class:fish={main.toLowerCase().includes('pescado') || main.toLowerCase().includes('pedro')}>{main}</li>
|
||||
<li
|
||||
class:fish={main.toLowerCase().includes('pescado') ||
|
||||
main.toLowerCase().includes('pedro')}
|
||||
on:click={() => {
|
||||
if (
|
||||
main.toLowerCase().includes('pescado') ||
|
||||
main.toLowerCase().includes('pedro')
|
||||
) {
|
||||
onFishClick();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{main}
|
||||
</li>
|
||||
{#if showFishToast}
|
||||
<div
|
||||
class="toast"
|
||||
in:fly={{ y: 20, duration: 200 }}
|
||||
out:fade={{ duration: 150 }}
|
||||
>
|
||||
<div class="toast-icon">🐟</div>
|
||||
<div class="toast-content">
|
||||
<div class="toast-title">Legacy feature</div>
|
||||
<div class="toast-text">
|
||||
A día de hoy, lleva habiendo pescado al
|
||||
vapor (y/o variantes) diariamente desde hace
|
||||
varios años.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -185,7 +228,9 @@
|
||||
<li>{alternativeItem}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
<span class="chip subtle">Mira si te estás planteando esto, mejor quédate sin comer</span>
|
||||
<span class="chip subtle"
|
||||
>Mira si te estás planteando esto, mejor quédate sin comer</span
|
||||
>
|
||||
</aside>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -276,7 +321,10 @@
|
||||
{#if buildHistory.length}
|
||||
<div class="history-list">
|
||||
{#each buildHistory as build}
|
||||
<details class={`history-item ${build.status}`} open={build === buildHistory[0]}>
|
||||
<details
|
||||
class={`history-item ${build.status}`}
|
||||
open={build === buildHistory[0]}
|
||||
>
|
||||
<summary>
|
||||
<div class="summary-left">
|
||||
<span class={`status-dot ${build.status}`}></span>
|
||||
@@ -306,9 +354,7 @@
|
||||
{build.fun_message}
|
||||
</p>
|
||||
{:else}
|
||||
<p class="history-message success">
|
||||
Correcto
|
||||
</p>
|
||||
<p class="history-message success">Correcto</p>
|
||||
{/if}
|
||||
</div>
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user