Aqui está um exemplo de uma página HTML com CSS e JavaScript que simula visualmente uma interface parecida com o Instagram. Este exemplo inclui um cabeçalho, uma seção de feed de fotos e interações básicas como curtir e comentar.
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Instagram Clone</title>
<style>
/* Estilos Gerais */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #fafafa;
}
/* Cabeçalho */
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
background-color: white;
border-bottom: 1px solid #dbdbdb;
}
header img.logo {
width: 100px;
}
header .actions {
display: flex;
gap: 20px;
}
header .actions svg {
width: 24px;
height: 24px;
cursor: pointer;
fill: black;
}
/* Feed */
.feed {
display: flex;
flex-direction: column;
gap: 20px;
padding: 20px;
}
.post {
background-color: white;
border: 1px solid #dbdbdb;
border-radius: 10px;
overflow: hidden;
}
.post-header {
display: flex;
align-items: center;
padding: 10px;
gap: 10px;
}
.post-header img.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
}
.post-header .username {
font-weight: bold;
}
.post-image img {
width: 100%;
display: block;
}
.post-actions {
display: flex;
align-items: center;
padding: 10px;
gap: 10px;
}
.post-actions svg {
width: 24px;
height: 24px;
cursor: pointer;
fill: black;
}
.liked svg {
fill: red;
}
.post-caption {
padding: 0 10px 10px 10px;
font-size: 14px;
}
.post-caption .username {
font-weight: bold;
}
</style>
</head>
<body>
<!-- Cabeçalho -->
<header>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Instagram_logo.svg/1200px-Instagram_logo.svg.png" alt="Logo do Instagram" class="logo">
<div class="actions">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.41 18.59l-3.41-3.41a7 7 0 10-9.9 0l-3.41 3.41 1.41 1.41 3.41-3.41a5 5 0 117.07 0l3.41 3.41 1.41-1.41z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm0-18c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8z"/></svg>
</div>
</header>
<!-- Feed -->
<div class="feed">
<div class="post">
<div class="post-header">
<img src="https://via.placeholder.com/32" alt="Avatar" class="avatar">
<span class="username">usuario_exemplo</span>
</div>
<div class="post-image">
<img src="https://via.placeholder.com/600x400" alt="Post Image">
</div>
<div class="post-actions">
<svg class="like-btn" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm8 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
</div>
<div class="post-caption">
<span class="username">usuario_exemplo</span> Essa é uma legenda de exemplo para o post.
</div>
</div>
</div>
<!-- JavaScript -->
<script>
// Função para curtir/descurtir posts
document.querySelectorAll('.like-btn').forEach(button => {
button.addEventListener('click', () => {
button.classList.toggle('liked');
});
});
</script>
</body>
</html>
Explicação:
- HTML: Estrutura básica da página, incluindo um cabeçalho, feed e posts.
- CSS: Estilização para criar uma aparência limpa e moderna, semelhante ao Instagram.
- JavaScript: Adiciona funcionalidade de curtir/descurtir ao clicar no ícone de coração.
Você pode copiar e colar este código em um arquivo .html e abrir no navegador para ver o resultado. Para melhorar ainda mais, você pode adicionar mais posts dinamicamente ou usar APIs para carregar imagens reais.