Skip to content

Commit

Permalink
add markup
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenVlass committed Mar 26, 2021
1 parent 3ba732e commit 81b5934
Show file tree
Hide file tree
Showing 8 changed files with 12,471 additions and 23 deletions.
Binary file modified .DS_Store
Binary file not shown.
12,437 changes: 12,416 additions & 21 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
},
"dependencies": {
"core-js": "^3.6.5",
"handlebars": "^4.7.6"
"handlebars": "^4.7.7"
}
}
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</div>
</div>

<!-- В этот список рендери разметку меню -->
<!-- В этот список рендерит разметку меню -->
<ul class="menu js-menu"></ul>
</body>
</html>
17 changes: 17 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
import initialMenu from './menu.json';
import templateCardList from './templates/cards-list.hbs';
import refs from './refs.js';


import './styles.css';



// const Theme = {
// LIGHT: 'light-theme',
// DARK: 'dark-theme',
// };


const menuMarkup = templateCardList(initialMenu);

refs.dishes.insertAdjacentHTML('beforeend', menuMarkup);
5 changes: 5 additions & 0 deletions src/refs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
dishes: document.querySelector('.js-menu'),
themeSwitcher: document.querySelector('.theme-switch-toggle'),
body: document.querySelector('body'),
}
28 changes: 28 additions & 0 deletions src/templates/card.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<li class="menu__item">
<article class="card">
<img src={{image}} alt={{name}} class="card__image" />
<div class="card__content">
<h2 class="card__name">{{name}}</h2>
<p class="card__price">
<i class="material-icons"> monetization_on </i>
{{price}} кредитов
</p>

<p class="card__descr">
{{description}}
</p>

<ul class="tag-list">
{{#each ingredients}}
<li class="tag-list__item">{{this}}</li>
{{/each}}

</ul>
</div>

<button class="card__button button">
<i class="material-icons button__icon"> shopping_cart </i>
В корзину
</button>
</article>
</li>
3 changes: 3 additions & 0 deletions src/templates/cards-list.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#each this}}
{{> ./card.hbs this}}
{{/each}}

0 comments on commit 81b5934

Please sign in to comment.