🫗
Keg Empty
@@ -291,12 +295,21 @@ function e(e,t,r,s){var i,a=arguments.length,o=a<3?t:null===s?s=Object.getOwnPro
/* === KEG EMOJI GRID === */
.emoji-grid {
- text-align: center;
- line-height: 1.25;
- word-break: break-all;
+ display: grid;
+ gap: 2px;
+ justify-items: center;
+ align-items: center;
max-width: 100%;
padding: 0 8px;
}
+ .glass {
+ line-height: 1;
+ text-align: center;
+ }
+ .glass.empty {
+ opacity: 0.15;
+ filter: grayscale(1);
+ }
.count-label {
margin-top: 12px;
font-size: 1.1em;
diff --git a/src/beer-catalog.ts b/src/beer-catalog.ts
index f741caf..9f35ca9 100644
--- a/src/beer-catalog.ts
+++ b/src/beer-catalog.ts
@@ -25,6 +25,7 @@ const CATALOG: BeerEntry[] = [
{ slug: "leffe-ruby", name: "Leffe Ruby", brewery: "Abbaye de Leffe", style: "Belgian Fruit Beer", abv: 5.0, colors: { primary: "#8B1A4A", secondary: "#FFE6F0", text: "#FFFFFF" }, imagePath: kegImage("leffe-ruby") },
{ slug: "leffe-blanche", name: "Leffe Blanche", brewery: "Abbaye de Leffe", style: "Belgian Witbier", abv: 5.0, colors: { primary: "#E8DCC8", secondary: "#FFFDF5", text: "#2C2C2C" }, imagePath: kegImage("leffe-blanche") },
{ slug: "leffe-winter", name: "Leffe Winter", brewery: "Abbaye de Leffe", style: "Belgian Winter Ale", abv: 6.6, colors: { primary: "#1B3A5C", secondary: "#E0ECF8", text: "#FFFFFF" }, imagePath: kegImage("leffe-winter") },
+ { slug: "leffe-noel", name: "Leffe Noël", brewery: "Abbaye de Leffe", style: "Belgian Winter Ale", abv: 6.6, colors: { primary: "#1B3A5C", secondary: "#E0ECF8", text: "#FFFFFF" }, imagePath: kegImage("leffe-winter") },
{ slug: "leffe-dete", name: "Leffe d'Été", brewery: "Abbaye de Leffe", style: "Belgian Summer Ale", abv: 5.2, colors: { primary: "#F5C242", secondary: "#FFFBE6", text: "#1A0F00" }, imagePath: kegImage("leffe-dete") },
{ slug: "leffe-rituel", name: "Leffe Rituel 9°", brewery: "Abbaye de Leffe", style: "Belgian Strong Ale", abv: 9.0, colors: { primary: "#2C1A00", secondary: "#F5E6D0", text: "#C8922A" }, imagePath: kegImage("leffe-rituel") },
{ slug: "leffe-prestige", name: "Leffe Prestige 1240", brewery: "Abbaye de Leffe", style: "Belgian Strong Blonde", abv: 8.5, colors: { primary: "#1A3366", secondary: "#E0E8F5", text: "#C8922A" }, imagePath: kegImage("leffe-prestige") },
diff --git a/src/editor.ts b/src/editor.ts
index efc3025..6f05a6b 100644
--- a/src/editor.ts
+++ b/src/editor.ts
@@ -5,7 +5,7 @@ import type { PerfectDraftCardConfig } from "./types.js";
import { GLASS_SIZES, DEFAULT_GLASS_SIZE, DOMAIN } from "./const.js";
import { getAllBeers } from "./beer-catalog.js";
-const EDITOR_VERSION = "0.1.0-b2";
+const EDITOR_VERSION = "0.1.2";
interface DiscoveredDevice {
deviceId: string;
diff --git a/src/perfectdraft-card.ts b/src/perfectdraft-card.ts
index 3a67143..ea44a31 100644
--- a/src/perfectdraft-card.ts
+++ b/src/perfectdraft-card.ts
@@ -224,12 +224,21 @@ export class PerfectDraftCard extends LitElement {
}
private _renderEmojiGrid(count: number): TemplateResult {
- if (count === 0) {
- return html`
🍺
`;
+ const maxGlasses = Math.floor(KEG_TOTAL_VOLUME_ML / this._glassSize);
+ const cols = maxGlasses <= 10 ? 5 : 6;
+ const size = maxGlasses <= 10 ? 3.2 : maxGlasses <= 12 ? 2.8 : maxGlasses <= 18 ? 2.4 : 2;
+ const slots = [];
+ for (let i = 0; i < maxGlasses; i++) {
+ slots.push(i < count
+ ? html`
🍺`
+ : html`
🍺`
+ );
}
- const size = count <= 5 ? 4 : count <= 10 ? 3 : count <= 18 ? 2.2 : 1.8;
- const emojis = "🍺".repeat(count);
- return html`
${emojis}
`;
+ return html`
+
+ ${slots}
+
+ `;
}
private _renderEmptyKeg(): TemplateResult {
@@ -447,12 +456,21 @@ export class PerfectDraftCard extends LitElement {
/* === KEG EMOJI GRID === */
.emoji-grid {
- text-align: center;
- line-height: 1.25;
- word-break: break-all;
+ display: grid;
+ gap: 2px;
+ justify-items: center;
+ align-items: center;
max-width: 100%;
padding: 0 8px;
}
+ .glass {
+ line-height: 1;
+ text-align: center;
+ }
+ .glass.empty {
+ opacity: 0.15;
+ filter: grayscale(1);
+ }
.count-label {
margin-top: 12px;
font-size: 1.1em;