Skip to content

Commit

Permalink
Merge pull request #15 from vanribeiro/dev
Browse files Browse the repository at this point in the history
feat: add favicon
  • Loading branch information
vanribeiro authored Jul 23, 2024
2 parents 58ebd2b + 23558da commit ca29c3d
Show file tree
Hide file tree
Showing 20 changed files with 172 additions and 74 deletions.
8 changes: 8 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400&family=Style+Script&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://vanribeiro.github.io/assets/style/commons/reset.css">
<link rel="stylesheet" href="https://vanribeiro.github.io/assets/style/app.css">
<link rel="stylesheet" href="https://vanribeiro.github.io/assets/style/pages/not-found.css">

<link rel="shortcut icon" href="https://vanribeiro.github.io/assets/img/favicon/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="180x180" href="https://vanribeiro.github.io/assets/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://vanribeiro.github.io/assets/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://vanribeiro.github.io/assets/img/favicon/favicon-16x16.png">
<link rel="manifest" href="https://vanribeiro.github.io/assets/img/favicon/site.webmanifest">

<title>404 - Página não encontrada</title>
</head>
<body>
Expand Down
Binary file added assets/img/favicon/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/favicon/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/favicon/favicon.ico
Binary file not shown.
88 changes: 88 additions & 0 deletions assets/img/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/img/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -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"}
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<link rel="stylesheet" href="./assets/style/commons/reset.css">
<link rel="stylesheet" href="./assets/style/app.css">
<link rel="stylesheet" href="./assets/style/pages/home.css">
<link rel="shortcut icon" href="./assets/img/favicon/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="180x180" href="./assets/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./assets/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./assets/img/favicon/favicon-16x16.png">
<link rel="manifest" href="./assets/img/favicon/site.webmanifest">
<title>Vanessa Ribeiro - Front-End Developer</title>
</head>
<body>
Expand Down
9 changes: 5 additions & 4 deletions js/components/alura-section.js
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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()
Expand Down
10 changes: 7 additions & 3 deletions js/components/dev-to-section.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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;
12 changes: 8 additions & 4 deletions js/components/github-section.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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;
5 changes: 3 additions & 2 deletions js/components/instagram-section.js
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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))
Expand Down
20 changes: 20 additions & 0 deletions js/components/site-iframe-urls.js
Original file line number Diff line number Diff line change
@@ -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;
20 changes: 1 addition & 19 deletions js/components/site-iframe.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
39 changes: 4 additions & 35 deletions js/service/api.js
Original file line number Diff line number Diff line change
@@ -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,
};
16 changes: 9 additions & 7 deletions js/service/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
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;
5 changes: 5 additions & 0 deletions paginas/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<link rel="stylesheet" href="./../assets/style/commons/reset.css">
<link rel="stylesheet" href="./../assets/style/app.css">
<link rel="stylesheet" href="./../assets/style/pages/links.css">
<link rel="shortcut icon" href="./../assets/img/favicon/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="180x180" href="./../assets/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./../assets/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./../assets/img/favicon/favicon-16x16.png">
<link rel="manifest" href="./../assets/img/favicon/site.webmanifest">
<title>Vanessa Ribeiro - Front-End Developer</title>
</head>
<body>
Expand Down
8 changes: 8 additions & 0 deletions paginas/updates.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet"
Expand All @@ -14,6 +15,13 @@
<link rel="stylesheet" href="./../assets/style/libs/language-colors.css">
<link rel="stylesheet" href="./../assets/style/app.css">
<link rel="stylesheet" href="./../assets/style/pages/updates.css">

<link rel="shortcut icon" href="./../assets/img/favicon/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="180x180" href="./../assets/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./../assets/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./../assets/img/favicon/favicon-16x16.png">
<link rel="manifest" href="./../assets/img/favicon/site.webmanifest">

<title>Vanessa Ribeiro - Atualizações</title>
</head>

Expand Down

0 comments on commit ca29c3d

Please sign in to comment.