diff --git a/404.html b/404.html index d7f6cc4..be0626c 100644 --- a/404.html +++ b/404.html @@ -3,12 +3,20 @@ + + + + + + + + 404 - Página não encontrada diff --git a/assets/img/favicon/android-chrome-192x192.png b/assets/img/favicon/android-chrome-192x192.png new file mode 100644 index 0000000..17ac83f Binary files /dev/null and b/assets/img/favicon/android-chrome-192x192.png differ diff --git a/assets/img/favicon/android-chrome-512x512.png b/assets/img/favicon/android-chrome-512x512.png new file mode 100644 index 0000000..c752c01 Binary files /dev/null and b/assets/img/favicon/android-chrome-512x512.png differ diff --git a/assets/img/favicon/apple-touch-icon.png b/assets/img/favicon/apple-touch-icon.png new file mode 100644 index 0000000..3183767 Binary files /dev/null and b/assets/img/favicon/apple-touch-icon.png differ diff --git a/assets/img/favicon/favicon-16x16.png b/assets/img/favicon/favicon-16x16.png new file mode 100644 index 0000000..42335ec Binary files /dev/null and b/assets/img/favicon/favicon-16x16.png differ diff --git a/assets/img/favicon/favicon-32x32.png b/assets/img/favicon/favicon-32x32.png new file mode 100644 index 0000000..81054e2 Binary files /dev/null and b/assets/img/favicon/favicon-32x32.png differ diff --git a/assets/img/favicon/favicon.ico b/assets/img/favicon/favicon.ico new file mode 100644 index 0000000..e8d345a Binary files /dev/null and b/assets/img/favicon/favicon.ico differ diff --git a/assets/img/favicon/favicon.svg b/assets/img/favicon/favicon.svg new file mode 100644 index 0000000..4482d22 --- /dev/null +++ b/assets/img/favicon/favicon.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + { } + + + v + + diff --git a/assets/img/favicon/site.webmanifest b/assets/img/favicon/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/assets/img/favicon/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/index.html b/index.html index 8afca50..486a7b8 100644 --- a/index.html +++ b/index.html @@ -10,6 +10,11 @@ + + + + + Vanessa Ribeiro - Front-End Developer diff --git a/js/components/alura-section.js b/js/components/alura-section.js index bf24e55..2a9a16c 100644 --- a/js/components/alura-section.js +++ b/js/components/alura-section.js @@ -1,4 +1,5 @@ -import { fetchAluraDashboardData } from "../service/api.js"; +import { fetchData } from "../service/api.js"; +import endpoint from "../service/config.js"; import { aluraStudyngTemplate } from "./../templates/index.js"; import { aluraCardContainer } from "./elements.js"; @@ -24,9 +25,9 @@ const aluraSection = async () => { const isEmpty = (data) => data.length === 0 || data === undefined || data === null; - return await fetchAluraDashboardData() - .then(values => { - const [ response, result ] = values; + return await fetchData(endpoint.ALURA, '?collection=progresso') + .then(data => { + const { response, result } = data; isEmpty(result) ? setMessageWhenNoCourseIsInProgress() diff --git a/js/components/dev-to-section.js b/js/components/dev-to-section.js index 9583ded..17036cb 100644 --- a/js/components/dev-to-section.js +++ b/js/components/dev-to-section.js @@ -1,6 +1,7 @@ import { devToPostsCardTemplate } from "../templates/index.js"; -import { fetchDevToData } from "../service/api.js"; +import { fetchData } from "../service/api.js"; import { devToCardsContainer } from './elements.js'; +import endpoint from "../service/config.js"; const populateCards = (item) => { const article = document.createElement('article'); @@ -19,8 +20,11 @@ const populateCards = (item) => { } const devToPostSection = async () => { - return await fetchDevToData() - .then(result => result.data.map(item => populateCards(item))); + return await fetchData(endpoint.DEV_TO_POSTS_SUMMARY, '?collection=progresso') + .then(data => { + const { result } = data; + return result.data.slice(0, 4).map(item => populateCards(item)) + }); } export default devToPostSection; \ No newline at end of file diff --git a/js/components/github-section.js b/js/components/github-section.js index ea1f4c2..632df4b 100644 --- a/js/components/github-section.js +++ b/js/components/github-section.js @@ -1,6 +1,7 @@ import { githubCardRepoTemplate } from "./../templates/index.js"; -import { fetchGithubReposData } from "./../service/api.js"; +import { fetchData } from "./../service/api.js"; import { githubCardsContainer } from './elements.js'; +import endpoint from "../service/config.js"; const populateCards = (item) => { const article = document.createElement('article'); @@ -25,9 +26,12 @@ const sortByLastestRepoUpdates = (a, b) => { } const githubSection = async () => { - return await fetchGithubReposData() - .then(data => data.sort(sortByLastestRepoUpdates) - .slice(0, 4).map(item => populateCards(item))); + return await fetchData(endpoint.GITHUB, '?sort=updated&direction=desc') + .then(data => { + const { result } = data; + result.sort(sortByLastestRepoUpdates) + .slice(0, 4).map(item => populateCards(item)) + }); } export default githubSection; \ No newline at end of file diff --git a/js/components/instagram-section.js b/js/components/instagram-section.js index ff55034..c7512ed 100644 --- a/js/components/instagram-section.js +++ b/js/components/instagram-section.js @@ -1,4 +1,5 @@ -import { fetchInstagramMediaData } from "./../service/api.js"; +import endpoint from "../service/config.js"; +import { fetchData } from "./../service/api.js"; import { instagramItemTemplate } from "./../templates/index.js"; import { instagramListContainer } from "./elements.js"; @@ -20,7 +21,7 @@ const populateCards = (item) => { } const instagramSection = async () => { - return await fetchInstagramMediaData() + return await fetchData(`${endpoint.ALURA}/api/meu-instagram`) .then(insta => { insta.data.slice(0, 15) .map(item => populateCards(item)) diff --git a/js/components/site-iframe-urls.js b/js/components/site-iframe-urls.js new file mode 100644 index 0000000..473172c --- /dev/null +++ b/js/components/site-iframe-urls.js @@ -0,0 +1,20 @@ +const urlDictionary = [ + { + "title": "abrir em outra aba: 30 day of JavaScript - WesBos Challenge", + "url": "https://vanribeiro-30daysofjavascript.netlify.app" + }, + { + "title": "abrir em outra aba: documentação back-end deste site", + "url": "https://vanribeiro-github-io-backend.vercel.app" + }, + { + "title": "abrir em outra aba: Know more about countries app - Frontend Mentor Challenge", + "url": "https://know-more-about-countries-app.vercel.app" + }, + { + "title": "abrir em outra aba: Advice Generator App - Frontend Mentor Challenge", + "url": "https://advice-generator-app-cyan.vercel.app" + } +]; + +export default urlDictionary; \ No newline at end of file diff --git a/js/components/site-iframe.js b/js/components/site-iframe.js index f60e65b..1d09ca3 100644 --- a/js/components/site-iframe.js +++ b/js/components/site-iframe.js @@ -1,26 +1,8 @@ +import urlDictionary from './site-iframe-urls.js'; const iframe = document.querySelector('.live-jobs__source'); const link = document.querySelector('.live-jobs__link'); const span = link.querySelector('.live-jobs__link__url'); -const urlDictionary = [ - { - title: 'abrir em outra aba: 30 day of JavaScript - WesBos Challenge', - url: 'https://vanribeiro-30daysofjavascript.netlify.app' - }, - { - title: 'abrir em outra aba: documentação back-end deste site', - url: 'https://vanribeiro-github-io-backend.vercel.app' - }, - { - title: 'abrir em outra aba: Know more about countries app - Frontend Mentor Challenge', - url: 'https://know-more-about-countries-app.vercel.app' - }, - { - title: 'abrir em outra aba: Advice Generator App - Frontend Mentor Challenge', - url: 'https://advice-generator-app-cyan.vercel.app', - } -]; - function getRandomNumber(min, max) { const MIN = Math.ceil(min); const MAX = Math.floor(max); diff --git a/js/service/api.js b/js/service/api.js index 47f2cf4..39a4c29 100644 --- a/js/service/api.js +++ b/js/service/api.js @@ -1,40 +1,9 @@ -import { - URL_BASE_API_ALURA, - URL_BASE_API_GITHUB, - URL_BASE_API_DEV_TO_SUMMARY -} from "./config.js"; - -/** - * @todo: DRY - refactor this function to use a generic fetch function - */ - -const fetchGithubReposData = async () => { - const response = await fetch(`${URL_BASE_API_GITHUB}?sort=updated&direction=desc`); - const data = await response.json(); - return data; -} - -const fetchDevToData = async () => { - const response = await fetch(`${URL_BASE_API_DEV_TO_SUMMARY}`); - const data = await response.json(); - return data; -} - -const fetchInstagramMediaData = async () => { - const response = await fetch(`${URL_BASE_API}/api/meu-instagram`); - const data = await response.json(); - return data; -} - -const fetchAluraDashboardData = async () => { - const response = await fetch(`${URL_BASE_API_ALURA}?collection=progresso`); +const fetchData = async (url, query) => { + const response = await fetch(`${url}${query ? query : ''}`); const result = await response.json(); - return [ response, result ]; + return { response, result }; } export { - fetchDevToData, - fetchGithubReposData, - fetchInstagramMediaData, - fetchAluraDashboardData + fetchData, }; \ No newline at end of file diff --git a/js/service/config.js b/js/service/config.js index a6c8028..e6004d1 100644 --- a/js/service/config.js +++ b/js/service/config.js @@ -2,12 +2,14 @@ * @todo: refactor endpoints with dynamic paths */ -const URL_BASE_API_ALURA = 'https://vanribeiro-github-io-backend.vercel.app/api/alura/dashboard'; -const URL_BASE_API_DEV_TO_SUMMARY = 'https://vanribeiro-github-io-backend.vercel.app/api/dev-to/posts-summary'; +const URL_BASE_API = 'https://vanribeiro-github-io-backend.vercel.app/api'; const URL_BASE_API_GITHUB = 'https://api.github.com/users/vanribeiro/repos'; -export { - URL_BASE_API_ALURA, - URL_BASE_API_GITHUB, - URL_BASE_API_DEV_TO_SUMMARY -} \ No newline at end of file +const endpoint = { + ALURA: `${URL_BASE_API}/alura/dashboard`, + GITHUB: `${URL_BASE_API_GITHUB}`, + DEV_TO_POSTS: `${URL_BASE_API}/dev-to/posts`, + DEV_TO_POSTS_SUMMARY: `${URL_BASE_API}/dev-to/posts-summary`, +}; + +export default endpoint; \ No newline at end of file diff --git a/paginas/links.html b/paginas/links.html index cbbae85..e89a502 100644 --- a/paginas/links.html +++ b/paginas/links.html @@ -10,6 +10,11 @@ + + + + + Vanessa Ribeiro - Front-End Developer diff --git a/paginas/updates.html b/paginas/updates.html index 89d9110..6feb31b 100644 --- a/paginas/updates.html +++ b/paginas/updates.html @@ -5,6 +5,7 @@ + + + + + + + + Vanessa Ribeiro - Atualizações