-
Notifications
You must be signed in to change notification settings - Fork 3
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 #6 from Jovens-do-futuro/dev-pedro
feat: componentes header & footer
- Loading branch information
Showing
15 changed files
with
205 additions
and
42 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,3 @@ | ||
<footer> | ||
<p>Copyright © 2022. Todos os direitos reservados.</p> | ||
</footer> |
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,23 @@ | ||
<header> | ||
<nav> | ||
<ul> | ||
<li> | ||
<a href=""> | ||
<img | ||
src="../assets/logo.jpeg" | ||
alt="Logo da Associação Jovens do Futuro" | ||
/> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#home">Home</a> | ||
</li> | ||
<li> | ||
<a href="#about">About</a> | ||
</li> | ||
<li> | ||
<a href="#contact">Contact</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</header> |
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,13 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Associação Jovens do Futuro</title> | ||
<link rel="stylesheet" href="./pages/home/style.css"> | ||
<link rel="stylesheet" href="./global.css"> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> | ||
<html lang="pt-BR"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Associação Jovens do Futuro</title> | ||
|
||
<link rel="stylesheet" href="./pages/home/style.css" /> | ||
<link rel="stylesheet" href="./global.css" /> | ||
|
||
<script src="scripts/loaders/header.js" type="module" defer></script> | ||
<script src="scripts/loaders/footer.js" type="module" defer></script> | ||
</head> | ||
<body> | ||
<header></header> | ||
|
||
<footer></footer> | ||
</body> | ||
</html> |
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,13 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-BR"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Contatos</title> | ||
<link rel="stylesheet" href="./style.css"> | ||
<link rel="stylesheet" href="../../global.css"> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Contatos</title> | ||
<link rel="stylesheet" href="./style.css" /> | ||
<link rel="stylesheet" href="../../global.css" /> | ||
|
||
<script src="../../scripts/loaders/header.js" type="module" defer></script> | ||
<script src="../../scripts/loaders/footer.js" type="module" defer></script> | ||
</head> | ||
<body> | ||
<header></header> | ||
|
||
<footer></footer> | ||
</body> | ||
</html> |
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,13 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-BR"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Doações</title> | ||
<link rel="stylesheet" href="./style.css"> | ||
<link rel="stylesheet" href="../../global.css"> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Doações</title> | ||
<link rel="stylesheet" href="./style.css" /> | ||
<link rel="stylesheet" href="../../global.css" /> | ||
|
||
<script src="../../scripts/loaders/header.js" type="module" defer></script> | ||
<script src="../../scripts/loaders/footer.js" type="module" defer></script> | ||
</head> | ||
<body> | ||
<header></header> | ||
|
||
<footer></footer> | ||
</body> | ||
</html> |
Empty file.
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
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,13 @@ | ||
import loader from './index.js' | ||
|
||
function loadFooter() { | ||
const url = '../../components/footer.html' | ||
|
||
loader(url, function (response) { | ||
const footer = document.querySelector('footer') | ||
|
||
footer.innerHTML = response | ||
}) | ||
} | ||
|
||
loadFooter() |
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,13 @@ | ||
import loader from './index.js' | ||
|
||
function loadHeader() { | ||
const url = '../../components/header.html' | ||
|
||
loader(url, function (response) { | ||
const header = document.querySelector('header') | ||
|
||
header.innerHTML = response | ||
}) | ||
} | ||
|
||
loadHeader() |
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,20 @@ | ||
export default async (url, callback) => { | ||
try { | ||
const response = await fetch(url); | ||
|
||
const data = await response.text(); | ||
|
||
if (!response.ok) { | ||
throw new Error('Erro ao carregar o arquivo'); | ||
} | ||
|
||
if (!data) { | ||
throw new Error('Arquivo vazio'); | ||
} | ||
|
||
callback(data); | ||
} catch (error) { | ||
console.error('Erro:', error); | ||
callback(''); | ||
} | ||
} |