Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #633

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- name: Upload HTML report(backstop data)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: backstop_data
37 changes: 21 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
"keywords": [],
"author": "Mate Academy",
"license": "GPL-3.0",
"dependencies": {},
"devDependencies": {
"@linthtml/linthtml": "^0.9.6",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"jest": "^29.7.0",
Expand Down
65 changes: 63 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,72 @@
<title>Title</title>
<link
rel="stylesheet"
href="./styles/main.scss"
href="./styles/utils/main.scss"
/>
</head>
<body>
<h1>Hello Mate Academy</h1>
<script src="scripts/main.js"></script>
<script src="scripts/lib/main.js"></script>
</body>
</html>
<section class="hero">
<div class="hero__content">
<h2 class="hero__title">Welcome to Creative Bakery</h2>
<p class="hero__subtitle">Freshly baked goods delivered to your door</p>
<a href="#products" class="hero__cta">Shop Now</a>
</div>
</section>

<section class="products" id="products">
<h2 class="products__title">Our Products</h2>
<div class="products__list">
<div class="product">
<img src="images/gitkeep/product1.jpg"
alt="Product 1"
class="product__image">
<h3 class="product__name">Product 1</h3>
<p class="product__description">Description of product 1</p>
<span class="product__price">$10.00</span>
</div>
<div class="product">
<img src="images/product2.jpg"
alt="Product 2"
class="product__image">
<h3 class="product__name">Product 2</h3>
<p class="product__description">Description of product 2</p>
<span class="product__price">$15.00</span>
</div>
<!-- Add more products as needed -->
</div>
</section>

<section class="about">
<h2 class="about__title">About Us</h2>
<p class="about__description">We are a bakery that specializes in fresh, handmade goods. Our mission is to bring the best baked products to your table.</p>
</section>

<section class="contact">
<h2 class="contact__title">Contact Us</h2>
<form class="contact__form">
<label for="name" class="contact__label">Name</label>
<input type="text"
id="name"
class="contact__input"
required>

<label for="email" class="contact__label">Email</label>
<input type="email"
id="email"
class="contact__input"
required>

<label for="message" class="contact__label">Message</label>
<textarea
id="message"
class="contact__textarea"
required
></textarea>

<button type="submit" class="contact__button">Send</button>
</form>
</section>
43 changes: 43 additions & 0 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
import '../styles/main.scss';

'use strict';
document.addEventListener('DOMContentLoaded', () => {
const header = document.createElement('header');
header.className = 'header';

const nav = document.createElement('nav');
nav.className = 'header__nav';

const logo = document.createElement('div');
logo.className = 'header__logo';
logo.textContent = 'Creative Bakery';

const menu = document.createElement('ul');
menu.className = 'header__menu';

const menuItems = ['Home', 'About', 'Products', 'Contact'];
menuItems.forEach(item => {
const menuItem = document.createElement('li');
menuItem.className = 'header__menu-item';
menuItem.textContent = item;
menu.appendChild(menuItem);
});

nav.appendChild(logo);
nav.appendChild(menu);
header.appendChild(nav);
document.body.appendChild(header);

const main = document.createElement('main');
main.className = 'main-content';

const heroSection = document.createElement('section');
heroSection.className = 'hero';

const heroText = document.createElement('div');
heroText.className = 'hero__text';
heroText.textContent = 'Welcome to Creative Bakery';

heroSection.appendChild(heroText);
main.appendChild(heroSection);
document.body.appendChild(main);
});
Loading