-
Notifications
You must be signed in to change notification settings - Fork 1
/
compositor.json
99 lines (99 loc) 路 5.37 KB
/
compositor.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
"name": "claudiovallejo/meal-app",
"version": "0.1.4",
"libraries": {
"xv": "^1.1.25"
},
"title": "Project Test",
"branch": "",
"style": {
"name": "Brutalist",
"componentSet": {
"nav": "nav/BasicNav",
"header": "header/BasicHeader",
"article": "article/MarkdownArticle",
"footer": "footer/BasicFooter"
},
"fontFamily": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace",
"heading": {},
"typeScale": [
48,
32,
20,
18,
16,
14,
12
],
"layout": {
"maxWidth": 1024,
"fluid": true
},
"colors": {
"text": "#333",
"background": "#fff",
"primary": "#666",
"secondary": "#888",
"highlight": "#1f80ff",
"muted": "#f6f6f6",
"border": "#eee"
}
},
"content": [
{
"component": "nav",
"links": [
{
"href": "https://meals.netlify.com",
"text": "Home"
},
{
"href": "https://github.com/claudiovallejo/meal-app",
"text": "GitHub"
},
{
"href": "https://npmjs.com/package/meal-app",
"text": "npm"
}
]
},
{
"component": "header",
"heading": "meal-app",
"subhead": "馃崕 Meal Plan Generator (Beta)",
"children": [
{
"component": "ui/TweetButton",
"text": "meal-app: 馃崕 Meal Plan Generator (Beta)",
"url": "https://meals.netlify.com"
},
{
"component": "ui/GithubButton",
"user": "claudiovallejo",
"repo": "meal-app"
}
],
"text": "v1.0.0"
},
{
"component": "article",
"metadata": {
"source": "github.readme"
},
"html": "<h1>Meal Plan Generator</h1>\n<p>Over the weekend (Fri Mar 3 -> Sun Mar 5) my brother and I worked on a simple site that generates random, daily meal plans. My brother is currently following a specific diet and the diet is composed of a very limited set of foods. My brother came up with the idea of creating a site/app that randomly selected a meal to automate his meal selection process and to make his diet less monotonous.</p>\n<p>This project is currently a simple static site built with HTML/CSS/JS. My brother's meal plan is stored in a JSON file that feeds the site's content. Unfortunately the site doesn't save any data, so it makes the site quite useless right now. I've been doing some research about service workers to store the site's data on the device, which would make the app useful.</p>\n<p>I learned several new things while building the app, and building this app peaked my curiosity to build a more complex app where my brother can add new meals through the app, save favorite meal plans, among other things.</p>\n<h1>Personalizing the App</h1>\n<p>If you're interested in having the app generate random meals based on your diet, follow the next 5 steps—</p>\n<ol>\n<li><p>Clone the repository</p>\n</li>\n<li><p>Update <code>data/meals.json</code> with your own meals</p>\n</li>\n<li><p>In <code>scripts/app.js</code> update <code>mealTypes</code> and <code>mealGuide</code>. <code>mealTypes</code> is a list of the available meal types. <code>mealGuide</code> defines the order and type of meals the generator creates for your daily meals.</p>\n</li>\n<li><p>Update the <code>XMLHttpRequest().open</code> path in <code>scripts/app.js</code>. I'm currently using GitHub's raw data file path (you find this path after cloning the project and hosting on your GitHub account, opening the project's <code>data/meals.json</code> file, and selecting 'Raw' next to the 'Blame' and 'History' buttons.)</p>\n</li>\n<li><p>Publish site</p>\n</li>\n</ol>\n<p>PS — I highly recommend hosting on <a href=\"https://www.netlify.com/\">Netlify</a>. All you have to do is create an account, create a new project, and link the GitHub repo with your Netlify project. The site will automatically update with <code>git push origin master</code>.</p>\n<p>If you have any questions or suggestions let me know <a href=\"https://twitter.com/claudiovallejop\">@claudiovallejop</a>.</p>\n<h1>Sample Meal API</h1>\n<pre>{\n <span class=\"hljs-attr\">"name"</span>: <span class=\"hljs-string\">"Banana Pancakes"</span>,\n <span class=\"hljs-attr\">"type"</span>: <span class=\"hljs-string\">"Breakfast"</span>,\n <span class=\"hljs-attr\">"macros"</span>: {\n <span class=\"hljs-attr\">"fat"</span>: <span class=\"hljs-number\">15.50</span>,\n <span class=\"hljs-attr\">"protein"</span>: <span class=\"hljs-number\">34.00</span>,\n <span class=\"hljs-attr\">"carbs"</span>: <span class=\"hljs-number\">21.00</span>\n },\n <span class=\"hljs-attr\">"ingredients"</span>: [\n <span class=\"hljs-string\">"1 Tbsp of Peanut Butter"</span>,\n <span class=\"hljs-string\">"1 Cup of Almond Milk"</span>,\n <span class=\"hljs-string\">"33g of Whey Protein"</span>\n ]\n}</pre>"
},
{
"component": "footer",
"links": [
{
"href": "https://github.com/claudiovallejo/meal-app",
"text": "GitHub"
},
{
"href": "https://github.com/claudiovallejo",
"text": "claudiovallejo"
}
]
}
]
}