-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from vanribeiro/dev
refact: organize components
- Loading branch information
Showing
20 changed files
with
222 additions
and
212 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 |
---|---|---|
@@ -1 +1,19 @@ | ||
{"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"} | ||
{ | ||
"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": "#eca769", | ||
"background_color": "#eca769", | ||
"display": "standalone" | ||
} |
21 changes: 21 additions & 0 deletions
21
js/components/alura-section/alura-progress-course-template.js
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,21 @@ | ||
const aluraProgressCourseTemplate = (courseName, courseProgress, courseSlug) =>{ | ||
|
||
return ` | ||
<header class="course-in-progress__item-header"> | ||
<a href="https://cursos.alura.com.br/course/${courseSlug}" title="Informações sobre o curso" rel="noreferrer noopener" target="_blank"> | ||
<h4 class="courses-in-progress__item-title subtitle-cards"> | ||
${courseName} | ||
</h4> | ||
</a> | ||
</header> | ||
<div class="progress-bar__container"> | ||
<div class="progress-bar__background"> | ||
<div class="progress-bar" data-bar-value="${courseProgress}" style="width:0%"></div> | ||
</div> | ||
<span class="progress-bar__percentual">${courseProgress}%</span> | ||
</div> | ||
`; | ||
|
||
} | ||
|
||
export default aluraProgressCourseTemplate; |
11 changes: 6 additions & 5 deletions
11
js/components/alura-section.js → js/components/alura-section/index.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const devToPostCardTemplate = (title, description, publishAt, url, image) =>{ | ||
return ` | ||
<div class="posts__dev-to__card__container"> | ||
<header class="posts__dev-to__header"> | ||
<a class="posts__dev-to__link" href=${url} rel="noreferrer noopener" target="_blank"> | ||
<figure> | ||
<img | ||
class="posts__dev-to__image" | ||
src="${image}" | ||
alt="Capa do post" | ||
> | ||
</figure> | ||
<h4 class="posts__dev-to__title card__container--dev-to"> | ||
${title} | ||
</h4> | ||
</a> | ||
<h5 class="posts__dev-to__subtitle card__container--dev-to"> | ||
<span class="posts__dev-to__data"> | ||
${publishAt} - Van Ribeiro | ||
</span> | ||
</h5> | ||
</header> | ||
<div class="posts__dev-to__content card__container--dev-to"> | ||
<div class="posts__dev-to__description"> | ||
<p>${description === null ? 'nenhuma descrição encontrada': description}</p> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
} | ||
|
||
export default devToPostCardTemplate; |
9 changes: 5 additions & 4 deletions
9
js/components/dev-to-section.js → js/components/dev-to-section/index.js
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 was deleted.
Oops, something went wrong.
File renamed without changes.
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,44 @@ | ||
const githubCardRepoTemplate = ( | ||
repoName, | ||
repoDescription, | ||
repoLastUpdate, | ||
repoProgrammingLanguage, | ||
repoURL | ||
) => { | ||
|
||
const date = new Date(repoLastUpdate); | ||
const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate(); | ||
const mounth = date.getMonth() < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1; | ||
const year = date.getFullYear(); | ||
const repoLastDayUpdate = `${day}/${mounth}/${year}`; | ||
|
||
return ` | ||
<div class="github-repo__card__container card__container"> | ||
<header class="github-repo__header"> | ||
<a class="github-repo__link" href=${repoURL} rel="noreferrer noopener" target="_blank"> | ||
<h4 class="github-repo__title subtitle-cards"> | ||
<i class="github-repos__book-icon icons"></i> | ||
${repoName} | ||
</h4> | ||
</a> | ||
</header> | ||
<div class="github-repo__content"> | ||
<div class="github-repo__description"> | ||
<p>${repoDescription === null ? 'not specified': repoDescription}</p> | ||
</div> | ||
<div class="github-repo__info"> | ||
<span class="github-repo__data"> | ||
${repoLastDayUpdate} | ||
</span> | ||
<span class="github-repo__language-name"> | ||
<i class="github-repo__color bg-color-${repoProgrammingLanguage === null ? 'default': repoProgrammingLanguage.toLowerCase()}"></i> | ||
${repoProgrammingLanguage === null ? 'not specified': repoProgrammingLanguage} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
} | ||
|
||
export default githubCardRepoTemplate; |
9 changes: 5 additions & 4 deletions
9
js/components/github-section.js → js/components/github-section/index.js
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
8 changes: 4 additions & 4 deletions
8
js/components/instagram-section.js → js/components/instagram-section/index.js
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
18 changes: 18 additions & 0 deletions
18
js/components/instagram-section/instagram-item-template.js
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,18 @@ | ||
const instagramItemTemplate = (caption, media_type, permalink, thumbnail_url, media_url) =>{ | ||
return ` | ||
<a href="${permalink}" rel="noreferrer noopener" target="_blank"> | ||
<figure class="instagram-posts__image-container"> | ||
<img | ||
style="height:1080; width:1080px;" | ||
loading="lazy" | ||
class="img-responsive instagram-posts__image lazyload" | ||
src="./../assets/img/placeholders/placeholder-image.svg" | ||
data-src="${media_type === 'VIDEO' ? thumbnail_url : media_url}" | ||
alt="${caption}" | ||
> | ||
</figure> | ||
</a> | ||
`; | ||
} | ||
|
||
export default instagramItemTemplate; |
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const menuMobile = () => { | ||
return ` | ||
<div class="menu-mobile__close-button-container this-container"> | ||
<span class="menu-mobile__close-button"> | ||
× | ||
</span> | ||
</div> | ||
<div class="menu-mobile__container this-container"> | ||
<div class="header-page__logo--mobile"> | ||
<a href="/"> | ||
<h3 class="header-page__logo__title">vanessa ribeiro</h3> | ||
<h4 class="header-page__logo__subtitle">front-end developer</h4> | ||
</a> | ||
</div> | ||
<ul class="menu-mobile__list"> | ||
<li class="menu-mobile__list-item"> | ||
<a class="menu-mobile__link" href="/">Home</a> | ||
</li> | ||
<li class="menu-mobile__list-item"> | ||
<a class="menu-mobile__link" href="/paginas/updates.html">Atualizações</a> | ||
</li> | ||
</ul> | ||
<ul class="menu-mobile__icons-list"> | ||
<a class="menu-mobile__icon-link" href="https://www.linkedin.com/in/vanribeiro" rel="noreferrer noopener" target="_blank" > | ||
<i class="icons linkedin"></i> | ||
</a> | ||
<a class="menu-mobile__icon-link" href="https://www.instagram.com/vanribeiro.dev" rel="noreferrer noopener" target="_blank" > | ||
<i class="icons instagram"></i> | ||
</a> | ||
<a class="menu-mobile__icon-link" href="https://github.com/vanribeiro" rel="noreferrer noopener" target="_blank" > | ||
<i class="icons github"></i> | ||
</a> | ||
</ul> | ||
</div> | ||
`; | ||
} | ||
|
||
export default menuMobile; |
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 @@ | ||
const menuTopList = () => { | ||
return ` | ||
<ul class="header-page__list"> | ||
<li class="header-page__list-item"> | ||
<a class="header-page__link" href="/">Home</a> | ||
</li> | ||
<li class="header-page__list-item"> | ||
<a class="header-page__link" href="/paginas/updates.html">Atualizações</a> | ||
</li> | ||
</ul> | ||
`; | ||
} | ||
|
||
|
||
export default menuTopList; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { playOnProgressBarAnimation } from "../components/progress-bar.js"; | ||
import githubSection from "../components/github-section.js"; | ||
import aluraSection from "../components/alura-section.js"; | ||
import { getRandomUrlSource } from "../components/site-iframe.js"; | ||
import devToPostSection from "../components/dev-to-section.js"; | ||
import playOnProgressBarAnimation from "../components/progress-bar/index.js"; | ||
import githubSection from "../components/github-section/index.js"; | ||
import aluraSection from "../components/alura-section/index.js"; | ||
import devToPostSection from "../components/dev-to-section/index.js"; | ||
import liveAppsRandomly from "../components/live-apps/index.js"; | ||
|
||
const handleLoad = async () => { | ||
await githubSection(); | ||
await devToPostSection(); | ||
await aluraSection(); | ||
|
||
setTimeout(playOnProgressBarAnimation, 5 * 100); | ||
getRandomUrlSource(); | ||
liveAppsRandomly(); | ||
} | ||
|
||
window.addEventListener('load', handleLoad); |
Oops, something went wrong.