Vou criar uma versão mais moderna e funcional, com uma caixa de pesquisa que filtra os softwares em tempo real. Esta versão usa HTML5, CSS3 e JavaScript para a pesquisa, mantendo o PHP para a lista de softwares.
php Copy code
<?php
// softwares.php
$softwares = [
[
'nome' => 'Software 1',
'descricao' => 'Descrição do Software 1',
'link' => 'https://drive.google.com/file/d/ID_DO_ARQUIVO1/view?usp=sharing'
],
[
'nome' => 'Software 2',
'descricao' => 'Descrição do Software 2',
'link' => 'https://drive.google.com/file/d/ID_DO_ARQUIVO2/view?usp=sharing'
],
// Adicione mais softwares aqui
];
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lista de Softwares</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: #f0f2f5;
color: #333;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
margin-bottom: 40px;
}
.header h1 {
font-size: 2.5em;
color: #1a73e8;
margin-bottom: 20px;
}
.search-container {
position: relative;
max-width: 500px;
margin: 0 auto 30px;
}
.search-input {
width: 100%;
padding: 12px 20px;
padding-right: 40px;
font-size: 16px;
border: 2px solid #ddd;
border-radius: 25px;
outline: none;
transition: border-color 0.3s ease;
}
.search-input:focus {
border-color: #1a73e8;
}
.search-icon {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
color: #666;
}
.software-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
}
.software-card {
background: white;
border-radius: 10px;
padding: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.software-card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.software-card h2 {
font-size: 1.3em;
color: #1a73e8;
margin-bottom: 10px;
}
.software-card p {
color: #666;
margin-bottom: 15px;
}
.download-btn {
display: inline-block;
background: #1a73e8;
color: white;
padding: 10px 20px;
text-decoration: none;
border-radius: 5px;
font-weight: 500;
transition: background 0.3s ease;
}
.download-btn:hover {
background: #1557b0;
}
.no-results {
text-align: center;
color: #666;
grid-column: 1 / -1;
}
@media (max-width: 768px) {
.software-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Lista de Softwares</h1>
</div>
<div class="search-container">
<input type="text" id="searchInput" class="search-input" placeholder="Pesquisar softwares...">
<span class="search-icon">🔍</span>
</div>
<div class="software-grid" id="softwareGrid">
<?php foreach ($softwares as $software): ?>
<div class="software-card" data-name="<?php echo htmlspecialchars(strtolower($software['nome'])); ?>" data-description="<?php echo htmlspecialchars(strtolower($software['descricao'])); ?>">
<h2><?php echo htmlspecialchars($software['nome']); ?></h2>
<p><?php echo htmlspecialchars($software['descricao']); ?></p>
<a href="<?php echo htmlspecialchars($software['link']); ?>" class="download-btn" target="_blank" rel="noopener noreferrer">Baixar</a>
</div>
<?php endforeach; ?>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const searchInput = document.getElementById('searchInput');
const softwareGrid = document.getElementById('softwareGrid');
const softwareCards = document.querySelectorAll('.software-card');
let noResultsDiv = null;
searchInput.addEventListener('input', function() {
const searchTerm = this.value.toLowerCase().trim();
let hasResults = false;
// Remove mensagem de "nenhum resultado" se existir
if (noResultsDiv) {
noResultsDiv.remove();
noResultsDiv = null;
}
softwareCards.forEach(card => {
const name = card.dataset.name;
const description = card.dataset.description;
if (name.includes(searchTerm) || description.includes(searchTerm)) {
card.style.display = 'block';
hasResults = true;
} else {
card.style.display = 'none';
}
});
// Mostra mensagem se não houver resultados
if (!hasResults && searchTerm !== '') {
noResultsDiv = document.createElement('div');
noResultsDiv.className = 'no-results';
noResultsDiv.textContent = 'Nenhum software encontrado.';
softwareGrid.appendChild(noResultsDiv);
}
});
});
</script>
</body>
</html>