@@ -227,12 +227,13 @@ function e(e,t,r,s){var i,a=arguments.length,o=a<3?t:null===s?s=Object.getOwnPro
}
.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);
@@ -243,12 +244,12 @@ function e(e,t,r,s){var i,a=arguments.length,o=a<3?t:null===s?s=Object.getOwnPro
}
.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;
@@ -259,8 +260,9 @@ function e(e,t,r,s){var i,a=arguments.length,o=a<3?t:null===s?s=Object.getOwnPro
/* === BEER LABEL === */
.beer-logo-area {
- width: 100px;
- height: 120px;
+ flex: 1;
+ width: 80%;
+ max-height: 55%;
display: flex;
align-items: center;
justify-content: center;
@@ -272,23 +274,23 @@ function e(e,t,r,s){var i,a=arguments.length,o=a<3?t:null===s?s=Object.getOwnPro
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;
}
@@ -299,8 +301,11 @@ function e(e,t,r,s){var i,a=arguments.length,o=a<3?t:null===s?s=Object.getOwnPro
gap: 2px;
justify-items: center;
align-items: center;
- max-width: 100%;
- padding: 0 8px;
+ width: 100%;
+ flex: 1;
+ align-content: center;
+ padding: 0;
+ font-size: min(4.5vw, 3.5em);
}
.glass {
line-height: 1;
@@ -311,27 +316,33 @@ function e(e,t,r,s){var i,a=arguments.length,o=a<3?t:null===s?s=Object.getOwnPro
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;
}
diff --git a/src/editor.ts b/src/editor.ts
index 6f05a6b..044af6c 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.2";
+const EDITOR_VERSION = "0.1.3";
interface DiscoveredDevice {
deviceId: string;
diff --git a/src/perfectdraft-card.ts b/src/perfectdraft-card.ts
index ea44a31..1628ebd 100644
--- a/src/perfectdraft-card.ts
+++ b/src/perfectdraft-card.ts
@@ -226,7 +226,6 @@ export class PerfectDraftCard extends LitElement {
private _renderEmojiGrid(count: number): TemplateResult {
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
@@ -235,7 +234,7 @@ export class PerfectDraftCard extends LitElement {
);
}
return html`
-
+
${slots}
`;
@@ -388,12 +387,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);
@@ -404,12 +404,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;
@@ -420,8 +420,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;
@@ -433,23 +434,23 @@ 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;
}
@@ -460,8 +461,11 @@ export class PerfectDraftCard extends LitElement {
gap: 2px;
justify-items: center;
align-items: center;
- max-width: 100%;
- padding: 0 8px;
+ width: 100%;
+ flex: 1;
+ align-content: center;
+ padding: 0;
+ font-size: min(4.5vw, 3.5em);
}
.glass {
line-height: 1;
@@ -472,27 +476,33 @@ export class PerfectDraftCard extends LitElement {
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;
}