Initial commit of counter

This commit is contained in:
2026-11-14 17:16:57 +00:00
commit a397c2d3a7
27 changed files with 5196 additions and 0 deletions
+833
View File
@@ -0,0 +1,833 @@
*,
*::before,
*::after {
box-sizing: border-box;
}
:root {
color-scheme: dark;
--bg: #0b0f14;
--card: #121a23;
--card-top: #152029;
--line: #22303c;
--text: #e6edf3;
--muted: #8b98a5;
--accent: #5ddb92;
--accent-strong: #33a974;
--blue: #6cb6ff;
--warn: #f0a35e;
--danger: #ff7b72;
--radius: 18px;
}
html,
body {
margin: 0;
}
body {
min-height: 100dvh;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
color: var(--text);
background:
radial-gradient(1100px 520px at 50% -10%, #16212b 0%, rgba(11, 15, 20, 0) 60%) no-repeat,
var(--bg);
-webkit-tap-highlight-color: transparent;
-webkit-font-smoothing: antialiased;
}
[hidden] {
display: none !important;
}
h1,
h2,
h3,
p {
margin-top: 0;
}
h2 {
margin-bottom: 0;
font-size: 14px;
letter-spacing: 0.02em;
color: #cbd5e1;
}
h3 {
margin-bottom: 4px;
font-size: 16px;
}
.topbar {
position: sticky;
top: 0;
z-index: 20;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
background: rgba(11, 15, 20, 0.86);
backdrop-filter: blur(16px);
border-bottom: 1px solid var(--line);
}
.brand {
display: flex;
align-items: center;
gap: 8px;
font-weight: 700;
letter-spacing: -0.01em;
}
.brand-mark {
width: 22px;
height: 22px;
color: var(--accent);
}
.date-nav {
display: flex;
align-items: center;
gap: 6px;
}
.icon-btn {
display: grid;
place-items: center;
width: 32px;
height: 32px;
padding: 0;
font-size: 18px;
line-height: 1;
color: var(--text);
background: #121a22;
border: 1px solid var(--line);
border-radius: 10px;
cursor: pointer;
}
.icon-btn:disabled {
opacity: 0.35;
cursor: not-allowed;
}
.date-label {
min-width: 108px;
padding: 6px 4px;
font-size: 14px;
font-weight: 600;
color: var(--text);
background: none;
border: 0;
cursor: pointer;
}
main {
max-width: 560px;
margin: 0 auto;
padding: 16px 16px calc(92px + env(safe-area-inset-bottom, 0px));
}
.view {
display: grid;
gap: 14px;
}
.view-head h1 {
margin-bottom: 6px;
font-size: 24px;
letter-spacing: -0.02em;
}
.view-head p {
margin-bottom: 2px;
}
.card {
padding: 16px;
background: linear-gradient(180deg, var(--card-top), var(--card));
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.muted {
color: var(--muted);
}
.small {
font-size: 13px;
}
.hint {
margin: 10px 0 0;
font-size: 12.5px;
line-height: 1.5;
color: #75828f;
}
.error {
color: var(--danger);
}
.row {
display: flex;
align-items: center;
gap: 10px;
}
.between {
justify-content: space-between;
}
.pill {
padding: 4px 9px;
font-size: 12px;
font-variant-numeric: tabular-nums;
color: var(--accent);
white-space: nowrap;
background: #15241c;
border: 1px solid #23402f;
border-radius: 999px;
}
.banner {
width: 100%;
padding: 12px 14px;
font-size: 14px;
color: #bfe8ce;
text-align: left;
cursor: pointer;
background: linear-gradient(180deg, #1d2f24, #15241c);
border: 1px solid #2b4a36;
border-radius: 14px;
}
/* Hero ------------------------------------------------------------------ */
.hero {
display: flex;
flex-direction: column;
gap: 16px;
align-items: center;
padding: 22px 16px 18px;
}
.hero-ring {
position: relative;
display: grid;
place-items: center;
width: 168px;
height: 168px;
}
.ring {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
transform: rotate(-90deg);
}
.ring circle {
fill: none;
stroke-width: 10;
stroke-linecap: round;
}
.ring-bg {
stroke: #1d2833;
}
.ring-fg {
stroke: var(--accent);
transition: stroke-dashoffset 0.45s ease;
}
.ring-fg.over {
stroke: var(--warn);
}
.hero-center {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
}
.hero-num {
font-size: 38px;
font-weight: 700;
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: tabular-nums;
}
.hero-label {
font-size: 11px;
letter-spacing: 0.08em;
color: var(--muted);
text-transform: uppercase;
}
.hero-stats {
display: flex;
gap: 26px;
}
.hero-stats div {
display: flex;
flex-direction: column;
gap: 2px;
align-items: center;
}
.hero-stats span {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.hero-stats strong {
font-size: 15px;
font-variant-numeric: tabular-nums;
}
/* Macros ---------------------------------------------------------------- */
.macro + .macro {
margin-top: 12px;
}
.macro .row {
margin-bottom: 6px;
font-size: 13px;
}
.track {
height: 8px;
overflow: hidden;
background: #1b2530;
border-radius: 999px;
}
.track span {
display: block;
height: 100%;
background: linear-gradient(90deg, var(--accent-strong), var(--accent));
border-radius: 999px;
transition: width 0.4s ease;
}
.track.carbs span {
background: linear-gradient(90deg, #3b7bbf, var(--blue));
}
.track.fat span {
background: linear-gradient(90deg, #b3813c, var(--warn));
}
.micro {
margin: 14px 0 0;
font-size: 12px;
}
/* Entries --------------------------------------------------------------- */
.entry-list {
margin: 8px 0 0;
padding: 0;
list-style: none;
}
.entry {
display: flex;
gap: 10px;
align-items: center;
padding: 10px 0;
border-top: 1px solid var(--line);
}
.entry:first-child {
border-top: 0;
}
.entry-main {
flex: 1;
min-width: 0;
}
.entry-name {
display: block;
overflow: hidden;
font-size: 14px;
font-weight: 600;
text-overflow: ellipsis;
white-space: nowrap;
}
.entry-meta {
display: block;
margin-top: 2px;
font-size: 12px;
color: var(--muted);
}
.entry-kcal {
font-size: 14px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.x {
padding: 2px 6px;
font-size: 20px;
line-height: 1;
color: #5f6d7a;
background: none;
border: 0;
cursor: pointer;
}
.empty {
margin: 10px 0 0;
font-size: 14px;
}
.meal h2 {
margin: 0;
}
.steps-row {
margin-top: 10px;
}
/* Forms ----------------------------------------------------------------- */
.row-form {
display: flex;
gap: 8px;
align-items: center;
margin-top: 10px;
}
.row-form input,
.row-form select {
flex: 1;
min-width: 0;
}
input,
select,
button {
font: inherit;
}
input,
select {
width: 100%;
padding: 11px 12px;
font-size: 16px;
color: var(--text);
background: #0d141b;
border: 1px solid var(--line);
border-radius: 12px;
outline: none;
}
input:focus,
select:focus {
border-color: var(--accent);
}
select {
padding-right: 34px;
appearance: none;
background-image:
linear-gradient(45deg, transparent 50%, var(--muted) 50%),
linear-gradient(135deg, var(--muted) 50%, transparent 50%);
background-repeat: no-repeat;
background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
background-size: 5px 5px, 5px 5px;
}
.btn {
padding: 11px 14px;
font-weight: 600;
color: var(--text);
white-space: nowrap;
cursor: pointer;
background: #1b2530;
border: 1px solid #26333f;
border-radius: 12px;
}
.btn.primary {
color: #062014;
background: linear-gradient(180deg, #48c98a, var(--accent-strong));
border-color: #3fbc82;
}
.btn.ghost {
color: var(--accent);
background: transparent;
border-color: #2a4a39;
}
.btn.small {
padding: 8px 12px;
font-size: 14px;
}
.btn.block {
width: 100%;
margin-top: 10px;
}
.btn:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 8px;
}
.chip {
padding: 7px 11px;
font-size: 13px;
color: var(--text);
cursor: pointer;
background: #16202a;
border: 1px solid var(--line);
border-radius: 999px;
}
.form-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.field {
display: flex;
flex-direction: column;
gap: 6px;
font-size: 13px;
color: var(--muted);
}
.span-2 {
grid-column: span 2;
}
/* Scan ------------------------------------------------------------------ */
.segmented {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 4px;
padding: 4px;
background: #121a22;
border: 1px solid var(--line);
border-radius: 14px;
}
.segmented button {
padding: 9px;
font-weight: 600;
color: var(--muted);
cursor: pointer;
background: transparent;
border: 0;
border-radius: 11px;
}
.segmented button.is-active {
color: var(--text);
background: #1d2a35;
}
.scan-pane {
display: grid;
gap: 12px;
}
.camera-box {
display: grid;
gap: 8px;
margin-bottom: 10px;
}
.camera-box video {
width: 100%;
aspect-ratio: 4 / 3;
object-fit: cover;
background: #000;
border-radius: 12px;
}
.or {
display: flex;
align-items: center;
gap: 10px;
margin: 12px 0 2px;
font-size: 12px;
color: var(--muted);
}
.or::before,
.or::after {
flex: 1;
height: 1px;
content: "";
background: var(--line);
}
.product {
display: grid;
gap: 12px;
}
.product-head {
display: flex;
gap: 12px;
align-items: flex-start;
}
.product-img {
flex: none;
width: 64px;
height: 64px;
object-fit: cover;
background: #0d141b;
border-radius: 12px;
}
.product h3 {
margin: 0 0 4px;
}
.product-kcal {
margin-left: auto;
font-weight: 600;
white-space: nowrap;
font-variant-numeric: tabular-nums;
}
.unit {
font-size: 13px;
color: var(--muted);
}
#searchResults {
display: grid;
gap: 8px;
}
.result {
display: flex;
gap: 10px;
align-items: center;
padding: 10px;
color: inherit;
text-align: left;
cursor: pointer;
background: #121a22;
border: 1px solid var(--line);
border-radius: 14px;
}
.result img,
.result-placeholder {
flex: none;
width: 46px;
height: 46px;
object-fit: cover;
background: #0d141b;
border-radius: 10px;
}
.result-main {
display: flex;
flex-direction: column;
gap: 3px;
min-width: 0;
}
.result strong {
overflow: hidden;
font-size: 14px;
font-weight: 600;
text-overflow: ellipsis;
white-space: nowrap;
}
.pad {
padding: 8px 2px;
}
/* Plan ------------------------------------------------------------------ */
.plan-summary h2 {
margin: 0;
}
.plan-summary p {
margin: 8px 0 10px;
font-size: 13px;
}
.ingredients {
margin: 8px 0 12px;
font-size: 13px;
line-height: 1.5;
color: var(--muted);
}
/* Profile --------------------------------------------------------------- */
.stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin: 12px 0 0;
}
.stats div {
padding: 10px;
background: #0f161d;
border: 1px solid var(--line);
border-radius: 12px;
}
.stats dt {
font-size: 12px;
color: var(--muted);
}
.stats dd {
margin: 3px 0 0;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.small-print h2 {
margin-bottom: 10px;
}
.small-print p {
font-size: 13px;
line-height: 1.55;
}
.small-print p.small {
margin-bottom: 0;
}
code {
padding: 1px 5px;
font-size: 0.92em;
background: #0d141b;
border-radius: 6px;
}
pre {
padding: 12px;
overflow-x: auto;
font-size: 12.5px;
line-height: 1.5;
background: #0d141b;
border: 1px solid var(--line);
border-radius: 12px;
}
pre code {
padding: 0;
}
/* Tab bar + toast ------------------------------------------------------- */
.tabbar {
position: fixed;
right: 0;
bottom: 0;
left: 0;
z-index: 30;
display: flex;
justify-content: space-around;
gap: 4px;
padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
background: rgba(12, 17, 23, 0.94);
backdrop-filter: blur(16px);
border-top: 1px solid var(--line);
}
.tab {
display: flex;
flex-direction: column;
gap: 3px;
align-items: center;
min-width: 64px;
padding: 6px 14px;
font-size: 11px;
font-weight: 600;
color: var(--muted);
cursor: pointer;
background: none;
border: 0;
border-radius: 12px;
}
.tab svg {
width: 22px;
height: 22px;
fill: none;
stroke: currentColor;
stroke-width: 1.8;
stroke-linecap: round;
stroke-linejoin: round;
}
.tab.is-active {
color: var(--accent);
}
.toast {
position: fixed;
bottom: calc(84px + env(safe-area-inset-bottom, 0px));
left: 50%;
z-index: 50;
max-width: calc(100vw - 32px);
padding: 10px 16px;
font-size: 14px;
text-align: center;
pointer-events: none;
opacity: 0;
background: #1d2a35;
border: 1px solid #2b3b48;
border-radius: 12px;
transform: translate(-50%, 16px);
transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
opacity: 1;
transform: translate(-50%, 0);
}
.toast.error {
background: #2a1717;
border-color: #5a2a2a;
}
@media (min-width: 640px) {
main {
padding-top: 28px;
}
}