PORTFOLICO Js
PORTFOLICO Js
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Portfólio Pessoal</title>
</head>
<body>
<header>
<nav>
<a href="#projetos">Projetos</a>
<a href="#hobbies">Hobbies</a>
<a href="#certificacoes">Certificações</a>
<a href="#contato">Contato</a>
<button id="modo-escuro"></button>
</nav>
</header>
</section>
<div id="carrossel">
</div>
</section>
<h2>Meus Hobbies</h2>
<ul>
</ul>
</section>
<h2>Certificações</h2>
<ul>
</ul>
</section>
<h2>Entre em Contato</h2>
<form id="form-contato">
<label for="nome">Nome:</label>
<label for="email">E-mail:</label>
<label for="mensagem">Mensagem:</label>
<button type="submit">Enviar</button>
</form>
</section>
<footer>
</footer>
<script src="script.js"></script>
</body>
</html>
Css (styles.css)
*{
margin: 0;
padding: 0;
box-sizing: border-box;
body {
background-color: #f0f0f0;
color: #333;
header {
background-color: #333;
color: white;
display: flex;
justify-content: space-between;
align-items: center;
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-weight: bold;
nav a:hover {
color: #ffcc00;
#modo-escuro {
background: none;
border: none;
color: white;
cursor: pointer;
font-size: 20px;
/* Animações */
.fade-in {
opacity: 0;
transform: translateY(20px);
.fade-in.show {
opacity: 1;
transform: translateY(0);
}
/* Carrossel */
#carrossel {
position: relative;
max-width: 600px;
margin: 0 auto;
#carrossel img {
width: 100%;
display: none;
#carrossel img.ativo {
display: block;
footer {
background-color: #333;
color: white;
text-align: center;
padding: 10px;
position: fixed;
bottom: 0;
width: 100%;
}
@media (max-width: 600px) {
nav {
flex-direction: column;
nav a {
margin: 10px 0;
}
Script.js
// Scroll suave
anchor.addEventListener('click', function(e) {
e.preventDefault();
document.querySelector(targetId).scrollIntoView({
behavior: 'smooth'
});
});
});
// Validação do formulário
document.getElementById('form-contato').addEventListener('submit', function(e) {
e.preventDefault();
this.reset();
} else {
});
// Modo claro/escuro
botaoModoEscuro.addEventListener('click', () => {
document.body.classList.toggle('modo-escuro');
});
// Carrossel de imagens
let indiceAtual = 0;
function mostrarProximaImagem() {
imagens[indiceAtual].classList.remove('ativo');
imagens[indiceAtual].classList.add('ativo');
// Animações de entrada
window.addEventListener('scroll', () => {
secoes.forEach(secao => {
secao.classList.add('show');
});
});