IVESTNiKI's picture
Add 3 files
0b25007 verified
Raw History Blame Contribute Delete
10.4 kB
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Анкеты - Поиск</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
body {
font-family: 'Roboto', sans-serif;
background-color: #f5f5f5;
}
.card-shadow {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.search-container {
position: relative;
}
.search-container input {
padding-left: 40px;
}
.search-icon {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: #9ca3af;
}
.profile-image {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: 50%;
}
.status-online {
width: 12px;
height: 12px;
background-color: #10b981;
border-radius: 50%;
position: absolute;
bottom: 0;
right: 0;
border: 2px solid white;
}
.tab-active {
color: #3b82f6;
border-bottom: 2px solid #3b82f6;
}
.transition-all {
transition: all 0.3s ease;
}
</style>
</head>
<body class="bg-gray-100">
<!-- Header -->
<header class="bg-white shadow-sm py-4 px-4 sticky top-0 z-10">
<div class="flex justify-between items-center">
<h1 class="text-xl font-bold text-gray-800">Анкеты</h1>
<div class="flex space-x-4">
<button class="text-gray-600">
<i class="fas fa-filter"></i>
</button>
<button class="text-gray-600">
<i class="fas fa-ellipsis-vertical"></i>
</button>
</div>
</div>
</header>
<!-- Search Bar -->
<div class="px-4 py-3 bg-white">
<div class="search-container relative">
<i class="search-icon fas fa-search"></i>
<input type="text" placeholder="Поиск анкет..."
class="w-full py-2 pl-10 pr-4 bg-gray-100 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</div>
<!-- Tabs -->
<div class="flex border-b bg-white px-4">
<button class="tab-active py-3 px-4 font-medium text-sm">Все</button>
<button class="py-3 px-4 font-medium text-sm text-gray-500">Популярные</button>
<button class="py-3 px-4 font-medium text-sm text-gray-500">Новые</button>
<button class="py-3 px-4 font-medium text-sm text-gray-500">Проверенные</button>
</div>
<!-- Questionnaire List -->
<div class="px-4 py-3" id="questionnaire-list">
<!-- Sample questionnaires will be loaded here -->
</div>
<!-- Bottom Navigation -->
<nav class="fixed bottom-0 w-full bg-white shadow-lg flex justify-around py-3">
<a href="#" class="text-blue-500 flex flex-col items-center">
<i class="fas fa-home text-xl"></i>
<span class="text-xs mt-1">Главная</span>
</a>
<a href="#" class="text-gray-500 flex flex-col items-center">
<i class="fas fa-search text-xl"></i>
<span class="text-xs mt-1">Поиск</span>
</a>
<a href="#" class="text-gray-500 flex flex-col items-center">
<i class="fas fa-plus-circle text-xl"></i>
<span class="text-xs mt-1">Создать</span>
</a>
<a href="#" class="text-gray-500 flex flex-col items-center">
<i class="fas fa-heart text-xl"></i>
<span class="text-xs mt-1">Избранное</span>
</a>
<a href="#" class="text-gray-500 flex flex-col items-center">
<i class="fas fa-user text-xl"></i>
<span class="text-xs mt-1">Профиль</span>
</a>
</nav>
<script>
// Sample questionnaire data
const questionnaires = [
{
id: 1,
name: "Анна Петрова",
age: 25,
city: "Москва",
interests: ["Путешествия", "Фотография", "Кино"],
image: "https://randomuser.me/api/portraits/women/44.jpg",
verified: true,
online: true
},
{
id: 2,
name: "Иван Смирнов",
age: 30,
city: "Санкт-Петербург",
interests: ["Спорт", "Музыка", "Книги"],
image: "https://randomuser.me/api/portraits/men/32.jpg",
verified: false,
online: false
},
{
id: 3,
name: "Елена Козлова",
age: 28,
city: "Казань",
interests: ["Искусство", "Театр", "Кулинария"],
image: "https://randomuser.me/api/portraits/women/63.jpg",
verified: true,
online: true
},
{
id: 4,
name: "Дмитрий Иванов",
age: 35,
city: "Новосибирск",
interests: ["Технологии", "Бизнес", "Автомобили"],
image: "https://randomuser.me/api/portraits/men/75.jpg",
verified: false,
online: false
},
{
id: 5,
name: "Ольга Соколова",
age: 22,
city: "Екатеринбург",
interests: ["Мода", "Танцы", "Фитнес"],
image: "https://randomuser.me/api/portraits/women/85.jpg",
verified: true,
online: true
}
];
// Function to render questionnaires
function renderQuestionnaires(data) {
const container = document.getElementById('questionnaire-list');
container.innerHTML = '';
data.forEach(person => {
const card = document.createElement('div');
card.className = 'bg-white rounded-lg card-shadow mb-3 p-4 transition-all hover:shadow-md';
card.innerHTML = `
<div class="flex items-start">
<div class="relative mr-3">
<img src="${person.image}" alt="${person.name}" class="profile-image">
${person.online ? '<div class="status-online"></div>' : ''}
</div>
<div class="flex-1">
<div class="flex justify-between items-start">
<h3 class="font-medium text-gray-800">${person.name}, ${person.age}</h3>
${person.verified ? '<span class="text-blue-500 text-sm"><i class="fas fa-check-circle"></i> Проверено</span>' : ''}
</div>
<p class="text-gray-600 text-sm mt-1">${person.city}</p>
<div class="mt-2">
${person.interests.map(interest =>
`<span class="inline-block bg-gray-100 text-gray-700 text-xs px-2 py-1 rounded-full mr-1 mb-1">${interest}</span>`
).join('')}
</div>
</div>
</div>
`;
container.appendChild(card);
});
}
// Initial render
renderQuestionnaires(questionnaires);
// Search functionality
const searchInput = document.querySelector('input[type="text"]');
searchInput.addEventListener('input', (e) => {
const searchTerm = e.target.value.toLowerCase();
if (searchTerm === '') {
renderQuestionnaires(questionnaires);
return;
}
const filtered = questionnaires.filter(person =>
person.name.toLowerCase().includes(searchTerm) ||
person.city.toLowerCase().includes(searchTerm) ||
person.interests.some(interest => interest.toLowerCase().includes(searchTerm))
);
renderQuestionnaires(filtered);
});
// Tab switching
const tabs = document.querySelectorAll('.flex.border-b button');
tabs.forEach(tab => {
tab.addEventListener('click', () => {
tabs.forEach(t => t.classList.remove('tab-active', 'text-blue-500'));
tabs.forEach(t => t.classList.add('text-gray-500'));
tab.classList.add('tab-active', 'text-blue-500');
tab.classList.remove('text-gray-500');
// In a real app, we would filter by tab here
renderQuestionnaires(questionnaires);
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=IVESTNiKI/questionnaire-database" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>