generated from goitacademy/vanilla-app-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created API folder, api-events.js, slider-events.js, class dark-theme
- Loading branch information
gladja
authored and
gladja
committed
Aug 17, 2023
1 parent
d96ee6d
commit edeafd0
Showing
5 changed files
with
49 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters