Skip to content

Commit

Permalink
Merge pull request #5 from Robertw8/hero
Browse files Browse the repository at this point in the history
created API folder, api-events.js, slider-events.js, class dark-theme
  • Loading branch information
Robertw8 authored Aug 17, 2023
2 parents d96ee6d + edeafd0 commit 80b6d56
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
15 changes: 15 additions & 0 deletions src/js/API/api-events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import axios from 'axios';
// import Notiflix from 'notiflix';

const URL = 'https://tasty-treats-backend.p.goit.global/api/events';

const getEvents = async () => {
try {
return await axios.get(`${URL}`);
} catch (error) {
console.log(error);
// Notiflix.Notify.failure('Sorry ERROR. Please try again.');
}
};

export { getEvents };
16 changes: 16 additions & 0 deletions src/js/slider-events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { getEvents } from './API/api-events.js';

const galleryEl = document.querySelector('.hero-img-wrap');

getEvents().then(data => {
renderGallery(data.data);
// return data;
}).catch(error => console.log(error));


function renderGallery(data) {
// console.log(data);
const img = data.map(itm => {
// console.log(itm);
});
}
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ testFn();
import { filtersList, onFilterItemClick } from './js/search-filter';

filtersList?.addEventListener('click', onFilterItemClick);

import './js/slider-events.js'
4 changes: 2 additions & 2 deletions src/partials/hero.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section class='hero'>
<div class='container'>
<section class='hero container'>
<div class='hero-container'>
<div class='hero-text-wrap'>
<h1 class='hero-title'>
Learn to Cook <span class='hero-item'>Tasty Treats'</span> Customizable Masterclass
Expand Down
19 changes: 14 additions & 5 deletions src/scss/partials/_hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
padding-top: 90px;
}

.container
.hero-container
{
display: flex;
flex-direction: column;

@media screen and (min-width: $tablet) {

}

@media screen and (min-width: $desktop) {
flex-direction: row;
gap: 32px;
Expand Down Expand Up @@ -45,6 +41,10 @@
}
}

.dark-theme .hero-title {
color: $color-white;
}

.hero-text {
font-size: 14px;
font-weight: 400;
Expand All @@ -57,6 +57,10 @@
}
}

.dark-theme .hero-text {
color: $color-white;
}

.hero-btn {
width: 111px;
height: 37px;
Expand All @@ -83,6 +87,11 @@
}
}

.dark-theme .hero-btn {
color: $color-white;
background-color: $color-black;
}

.hero-img-wrap {
display: flex;
width: 200px;
Expand Down

0 comments on commit 80b6d56

Please sign in to comment.