Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a44f5ab9cf | ||
|
|
d1b64fd9c7 | ||
|
|
7493721d4a | ||
|
|
6de5f6a960 | ||
|
|
42147366ae | ||
|
|
63be469bb2 |
Vendored
+51
-24
File diff suppressed because one or more lines are too long
@@ -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") },
|
||||
|
||||
+1
-1
@@ -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.4";
|
||||
|
||||
interface DiscoveredDevice {
|
||||
deviceId: string;
|
||||
|
||||
+58
-26
@@ -224,12 +224,21 @@ export class PerfectDraftCard extends LitElement {
|
||||
}
|
||||
|
||||
private _renderEmojiGrid(count: number): TemplateResult {
|
||||
if (count === 0) {
|
||||
return html`<div class="emoji-grid" style="font-size: 3em; opacity: 0.3;">🍺</div>`;
|
||||
const maxGlasses = Math.floor(KEG_TOTAL_VOLUME_ML / this._glassSize);
|
||||
const cols = maxGlasses <= 10 ? 5 : 6;
|
||||
const rows = Math.ceil(maxGlasses / cols);
|
||||
const slots = [];
|
||||
for (let i = 0; i < maxGlasses; i++) {
|
||||
slots.push(i < count
|
||||
? html`<span class="glass full">🍺</span>`
|
||||
: html`<span class="glass empty">🍺</span>`
|
||||
);
|
||||
}
|
||||
const size = count <= 5 ? 4 : count <= 10 ? 3 : count <= 18 ? 2.2 : 1.8;
|
||||
const emojis = "🍺".repeat(count);
|
||||
return html`<div class="emoji-grid" style="font-size: ${size}em;">${emojis}</div>`;
|
||||
return html`
|
||||
<div class="emoji-grid" style="grid-template-columns: repeat(${cols}, 1fr); grid-template-rows: repeat(${rows}, 1fr);">
|
||||
${slots}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
private _renderEmptyKeg(): TemplateResult {
|
||||
@@ -379,12 +388,13 @@ export class PerfectDraftCard extends LitElement {
|
||||
}
|
||||
|
||||
.label-zone {
|
||||
flex: 1;
|
||||
flex: 1 1 25%;
|
||||
max-width: 30%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px 16px;
|
||||
padding: 24px 20px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
border-radius: var(--ha-card-border-radius, 12px) 0 0 var(--ha-card-border-radius, 12px);
|
||||
@@ -395,12 +405,12 @@ export class PerfectDraftCard extends LitElement {
|
||||
}
|
||||
|
||||
.keg-zone {
|
||||
flex: 2;
|
||||
flex: 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px 16px;
|
||||
padding: 16px 20px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
position: relative;
|
||||
@@ -411,8 +421,9 @@ export class PerfectDraftCard extends LitElement {
|
||||
|
||||
/* === BEER LABEL === */
|
||||
.beer-logo-area {
|
||||
width: 100px;
|
||||
height: 120px;
|
||||
flex: 1;
|
||||
width: 80%;
|
||||
max-height: 55%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -424,57 +435,78 @@ export class PerfectDraftCard extends LitElement {
|
||||
object-fit: contain;
|
||||
}
|
||||
.beer-logo-text {
|
||||
font-size: 4em;
|
||||
font-size: 5em;
|
||||
font-weight: bold;
|
||||
opacity: 0.4;
|
||||
}
|
||||
.temperature {
|
||||
font-size: 2.4em;
|
||||
font-size: 3em;
|
||||
font-weight: 300;
|
||||
margin-bottom: 4px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.beer-name {
|
||||
font-size: 1.3em;
|
||||
font-size: 1.6em;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.beer-style {
|
||||
font-size: 0.8em;
|
||||
font-size: 0.95em;
|
||||
margin-top: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* === KEG EMOJI GRID === */
|
||||
.emoji-grid {
|
||||
text-align: center;
|
||||
line-height: 1.25;
|
||||
word-break: break-all;
|
||||
max-width: 100%;
|
||||
padding: 0 8px;
|
||||
display: grid;
|
||||
justify-items: center;
|
||||
align-items: center;
|
||||
align-content: stretch;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
padding: 0;
|
||||
}
|
||||
.glass {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: min(7vw, 5em);
|
||||
}
|
||||
.glass.empty {
|
||||
opacity: 0.15;
|
||||
filter: grayscale(1);
|
||||
}
|
||||
.count-label {
|
||||
margin-top: 12px;
|
||||
font-size: 1.1em;
|
||||
margin-top: 8px;
|
||||
font-size: 1.3em;
|
||||
opacity: 0.6;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* === EMPTY KEG === */
|
||||
.empty-keg {
|
||||
text-align: center;
|
||||
opacity: 0.7;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.empty-icon {
|
||||
font-size: 5em;
|
||||
font-size: 6em;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.empty-title {
|
||||
font-size: 1.6em;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
color: #db4437;
|
||||
}
|
||||
.empty-subtitle {
|
||||
font-size: 1em;
|
||||
font-size: 1.2em;
|
||||
opacity: 0.6;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user