adding summary

This commit is contained in:
Chris Smith
2025-02-20 17:54:15 +01:00
parent c9533688ba
commit 02a0243acb
8 changed files with 129 additions and 34 deletions

View File

@@ -1,6 +1,5 @@
<?php
use common\models\Meal;
use frontend\assets\ConfettiAsset;
/* @var $this yii\web\View */
@@ -9,7 +8,6 @@ $this->title = Yii::$app->name;
ConfettiAsset::register($this);
$this->registerJs("
var end = Date.now() + (2 * 1000);
var scalar = 2;
@@ -57,24 +55,57 @@ var isMobile = window.innerWidth < 768; // Adjust as needed for tablets
and your food. But also you. 🤖🍕
</p>
<div class="card mx-auto p-3" style="max-width: 400px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 200;">
<h4 class="mb-3 text-center">🍽️ <strong><?= $model->food_name ?></strong></h4>
<div class="row">
<div class="col-6 text-right">
<p class="mb-0"><strong>🔥 Calories</strong></p>
<p class="mb-0"><strong>🍗 Protein</strong></p>
<p class="mb-0"><strong>🥑 Fat</strong></p>
<p class="mb-0"><strong>🍞 Carbs</strong></p>
<div class="container text-center mt-4">
<div class="row justify-content-center">
<!-- Food Item Card -->
<div class="col-md-6 d-flex">
<div class="card p-3 w-100 h-100 d-flex flex-column" style="max-width: 400px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 200;">
<h4 class="mb-3 text-center">🍽️ <strong><?= $model->food_name ?></strong></h4>
<div class="row flex-grow-1">
<div class="col-6 text-end">
<p class="mb-0"><strong>🔥 Calories</strong></p>
<p class="mb-0"><strong>🍗 Protein</strong></p>
<p class="mb-0"><strong>🥑 Fat</strong></p>
<p class="mb-0"><strong>🍞 Carbs</strong></p>
<p class="mb-0"><strong>🌾 Fiber</strong></p>
</div>
<div class="col-6 text-start">
<p class="mb-0"><?= $model->calories ?> kcal</p>
<p class="mb-0"><?= $model->protein ?> g</p>
<p class="mb-0"><?= $model->fat ?> g</p>
<p class="mb-0"><?= $model->carbohydrates ?> g</p>
<p class="mb-0"><?= $model->fiber ?> g</p>
</div>
</div>
</div>
</div>
<div class="col-6">
<p class="mb-0"><?= $model->calories ?> kcal</p>
<p class="mb-0"><?= $model->protein ?> g</p>
<p class="mb-0"><?= $model->fat ?> g</p>
<p class="mb-0"><?= $model->carbohydrates ?> g</p>
<!-- Daily Totals Section -->
<div class="col-md-6 d-flex mt-3 mt-md-0">
<div class="card p-3 w-100 h-100 d-flex flex-column" style="max-width: 400px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);">
<h4 class="card-title text-center">📊 <strong>Today So Far</strong></h4>
<div class="row flex-grow-1">
<div class="col-6 text-end">
<p class="mb-0"><strong>🔥 Calories</strong></p>
<p class="mb-0"><strong>🍗 Protein</strong></p>
<p class="mb-0"><strong>🥑 Fat</strong></p>
<p class="mb-0"><strong>🍞 Carbs</strong></p>
<p class="mb-0"><strong>🌾 Fiber</strong></p>
</div>
<div class="col-6 text-start">
<p class="mb-0"><?= $today['calories']; ?> kcal</p>
<p class="mb-0"><?= $today['protein']; ?> g</p>
<p class="mb-0"><?= $today['fat']; ?> g</p>
<p class="mb-0"><?= $today['carbohydrates']; ?> g</p>
<p class="mb-0"><?= $today['fiber']; ?> g</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="p-5 mb-4 bg-transparent rounded-3">
<div class="container-fluid py-5 text-center">
<p><a class="btn btn-lg btn-primary" href="/meal/upload" style="z-index: 200;">Feed me more data! 🍔</a></p>