Weekly Diet Menu App
About this app
A fun and interactive app offering a weekly diet menu with calculated calories.
Weekly Diet Menu App
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Weekly Diet Menu App</title>
<meta name="description" content="A fun and interactive app offering a weekly diet menu with calculated calories.">
<meta name="keywords" content="diet, calories, menu, health, nutrition, app">
<link href="https://fonts.googleapis.com/css?family=Amatic+SC|Permanent+Marker|Playfair+Display&display=swap" rel="stylesheet">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<style>
body {
font-family: 'Amatic SC', cursive;
background: linear-gradient(to right, #fbc2eb, #a18cd1);
}
#main-container {
margin-top: 50px;
text-align: center;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 15px;
text-align: left;
border-bottom: 1px solid #ddd;
}
</style>
<script>
try {
const weeklyMenu = [
{day: 'Monday', meal: 'Oatmeal and berries', calories: 300},
{day: 'Tuesday', meal: 'Salmon and quinoa', calories: 450},
{day: 'Wednesday', meal: 'Chicken salad', calories: 350},
{day: 'Thursday', meal: 'Avocado toast', calories: 250},
{day: 'Friday', meal: 'Egg white omelette', calories: 200},
{day: 'Saturday', meal: 'Vegetable stir fry', calories: 400},
{day: 'Sunday', meal: 'Greek yogurt and granola', calories: 275},
];
document.addEventListener("DOMContentLoaded", function() {
let menuTable = '<table>';
menuTable += '<tr><th>Day</th><th>Meal</th><th>Calories</th></tr>';
let totalCalories = 0;
weeklyMenu.forEach(function(dayMenu) {
menuTable += '<tr><td>' + dayMenu.day + '</td><td>' + dayMenu.meal + '</td><td>' + dayMenu.calories + '</td></tr>';
totalCalories += dayMenu.calories;
});
menuTable += '<tr><td colspan="2">Total Calories</td><td>' + totalCalories + '</td></tr>';
menuTable += '</table>';
document.querySelector('#main-container').innerHTML = menuTable;
});
} catch (error) {
throw error;
}
</script>
</head>
<body>
<div id="main-container" class="container">
<!-- The weekly menu will be dynamically inserted here -->
</div>
</body>
</html>
NEW APPS
These are apps made by the community!