Skip to content

Commit

Permalink
comentários
Browse files Browse the repository at this point in the history
  • Loading branch information
D3Z33 committed Aug 30, 2024
1 parent eecc74b commit 9c868f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
4 changes: 1 addition & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta charset="UTF-3">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Projeto Curso - Princípios Cibersegurança</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<!-- Botão principal -->
<button id="mainButton" class="creative-button" onclick="showButtons()">Clique aqui para o Download do Arquivo</button>

<!-- Container com os botões de URL -->
<div id="buttonContainer" class="hidden">
<a href="Apresentasao-Ciber.pptm" download="Apresentasao-Ciber.pptm">
<button class="creative-button download-button">Download Aqui</button>
Expand Down
11 changes: 1 addition & 10 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
document.addEventListener('DOMContentLoaded', function() {
// Posiciona o botão principal em uma posição aleatória ao carregar a página
positionButtonRandomly(document.getElementById('mainButton'));
});

document.getElementById('mainButton').addEventListener('click', function() {
// Esconde o botão principal com efeito de fumaça
this.classList.add('smoke-effect');
setTimeout(() => {
this.classList.add('hidden');
}, 2000); // Tempo da animação (2 segundos)
}, 2000);

// Exibe os outros botões
setTimeout(() => {
document.getElementById('buttonContainer').classList.remove('hidden');
// Posiciona o botão real de download aleatoriamente
positionButtonRandomly(document.querySelector('.download-button'));
}, 2000);
});
Expand All @@ -25,13 +21,11 @@ function openUrl(buttonNumber) {
}
}

// Função para mover o botão aleatoriamente dentro do container
function moveButton(button) {
const container = document.querySelector('.container');
const containerRect = container.getBoundingClientRect();
const buttonRect = button.getBoundingClientRect();

// Calcula novas posições aleatórias dentro do container
const maxLeft = containerRect.width - buttonRect.width;
const maxTop = containerRect.height - buttonRect.height;
const randomLeft = Math.random() * maxLeft;
Expand All @@ -41,13 +35,11 @@ function moveButton(button) {
button.style.top = `${randomTop}px`;
}

// Função para posicionar o botão de download aleatoriamente ao abrir
function positionButtonRandomly(button) {
const container = document.querySelector('.container');
const containerRect = container.getBoundingClientRect();
const buttonRect = button.getBoundingClientRect();

// Calcula novas posições aleatórias dentro do container
const maxLeft = containerRect.width - buttonRect.width;
const maxTop = containerRect.height - buttonRect.height;
const randomLeft = Math.random() * maxLeft;
Expand All @@ -57,7 +49,6 @@ function positionButtonRandomly(button) {
button.style.top = `${randomTop}px`;
}

// Mostrar a URL ao passar o mouse sobre os botões
document.querySelectorAll('.fake-button').forEach((button) => {
button.addEventListener('mouseover', function() {
moveButton(button);
Expand Down
18 changes: 9 additions & 9 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ body {
align-items: center;
height: 100vh;
background: radial-gradient(circle, #2c3e50, #000000);
overflow: hidden; /* Evita que os botões saiam da tela */
overflow: hidden;
}

.container {
position: relative; /* Permite o posicionamento absoluto dos botões */
position: relative;
text-align: center;
width: 80%; /* Ajusta o tamanho do container para limitar o movimento */
width: 80%;
height: 80vh;
}

Expand All @@ -26,8 +26,8 @@ body {
background: linear-gradient(135deg, #f39c12, #e74c3c);
cursor: pointer;
border-radius: 50px;
position: absolute; /* Permite o movimento e posicionamento aleatório */
transition: transform 0.1s, background 0.3s, left 0.3s, top 0.3s; /* Suaviza o movimento */
position: absolute;
transition: transform 0.1s, background 0.3s, left 0.3s, top 0.3s;
}

.creative-button:hover {
Expand Down Expand Up @@ -56,11 +56,11 @@ body {
}

.download-button {
font-size: 1px; /* Diminui ainda mais o tamanho do texto */
padding: 1px 1px; /* Reduz o padding para diminuir a altura */
font-size: 1px;
padding: 1px 1px;
width: 1px;
height: 1px;
bottom: 1px; /* Ajusta para mais próximo do canto inferior */
left: 1px; /* Ajusta para mais próximo do canto esquerdo */
bottom: 1px;
left: 1px;
position: absolute;
}

0 comments on commit 9c868f9

Please sign in to comment.