Files
PPve/index.html
T
Tomas Dvorak 46949d74b0 img fetch
2025-05-29 10:16:21 +02:00

481 lines
23 KiB
HTML

<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aplikační Rozcestník</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
<style>
.card {
transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
</style>
<script>
// Load and display banner
async function loadBanner() {
try {
const response = await fetch('/api/banner');
if (!response.ok) {
console.error('Failed to load banner:', response.status);
return;
}
const banner = await response.json();
// Log the banner data for debugging
console.log('Banner data:', JSON.stringify(banner, null, 2));
// Check if banner should be visible
const isVisible = banner.Style?.IsVisible ?? banner.IsVisible ?? true;
if (!isVisible) {
console.log('Banner is not visible');
return;
}
const bannerContainer = document.getElementById('bannerContainer');
const bannerContent = document.getElementById('bannerContent');
if (!bannerContainer || !bannerContent) {
console.error('Banner container elements not found');
return;
}
// Get style values with fallbacks
const style = banner.style || {};
const borderRadius = style.borderRadius || '8';
const backgroundColor = style.backgroundColor || '#f8f9fa';
const textColor = style.textColor || '#212529';
const textAlign = style.textAlign || 'left';
const fontSize = style.fontSize || '16px';
const padding = style.padding || '20px';
const margin = style.margin || '20px';
const imagePosition = style.imagePosition || 'right';
// Create banner container with proper styling
bannerContainer.style.cssText = `
background-color: ${backgroundColor};
color: ${textColor};
text-align: ${textAlign};
font-size: ${fontSize};
padding: ${padding};
margin: ${margin} 0;
border-radius: ${borderRadius}px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
overflow: hidden;
display: block;
width: 100%;
box-sizing: border-box;
`;
// Start building banner content
let content = '';
// Handle image if it exists
const bannerText = banner.text || banner.Text || '';
const bannerLink = banner.link || banner.Link || '';
const bannerImage = banner.image || banner.Image || '';
if (bannerImage) {
// Ensure the image URL is correct (add leading slash if missing)
let imageUrl = bannerImage.startsWith('http') ? bannerImage :
bannerImage.startsWith('/') ? bannerImage : `/${bannerImage}`;
// Use default dimensions if not specified or 0
const imageWidth = (style.imageWidth && style.imageWidth > 0) ? style.imageWidth : 'auto';
const imageHeight = (style.imageHeight && style.imageHeight > 0) ? style.imageHeight : 'auto';
// Create image element with styles
const imgStyle = `
max-width: 100%;
height: ${imageHeight === 'auto' ? 'auto' : imageHeight + 'px'};
${imageWidth !== 'auto' ? `width: ${imageWidth}px;` : 'width: auto;'}
object-fit: contain;
border-radius: ${borderRadius}px;
${imagePosition === 'left' ? 'float: left; margin: 0 20px 10px 0;' : ''}
${imagePosition === 'right' ? 'float: right; margin: 0 0 10px 20px;' : ''}
${imagePosition === 'center' ? 'display: block; margin: 0 auto 20px;' : ''}
${imagePosition === 'top' ? 'display: block; margin: 0 auto 20px;' : ''}
${imagePosition === 'bottom' ? 'display: block; margin: 20px auto 0;' : ''}
`;
// Create image container
const imgContainer = `
<div class="banner-image-container" style="
display: block;
max-width: 100%;
text-align: center;
${imagePosition === 'top' || imagePosition === 'bottom' ? 'margin-bottom: 20px;' : ''}
">
<img
src="${imageUrl}"
style="${imgStyle}"
alt="Banner obrázek"
class="banner-image"
onerror="console.error('Failed to load banner image:', this.src)"
>
</div>`;
// Add image to content
content += imgContainer;
// Wrap image with link if URL is provided
if (bannerLink) {
imgContainer = `
<a href="${bannerLink}" target="_blank" style="text-decoration: none; display: inline-block;">
${imgContainer}
</a>`;
}
// Add image to content based on position
if (['left', 'top'].includes(imagePosition)) {
content += imgContainer;
}
// Add text content with proper spacing
if (bannerText) {
const textStyle = `
margin: 0;
padding: 10px;
line-height: 1.6;
color: ${textColor};
text-align: ${textAlign};
font-size: ${fontSize};
${['left', 'right'].includes(imagePosition) ? 'overflow: hidden;' : 'display: block;'}
${imagePosition === 'left' ? 'padding-left: 20px;' : ''}
${imagePosition === 'right' ? 'padding-right: 20px;' : ''}
`;
// Wrap text in link if URL is provided
const textContent = bannerText.replace(/\n/g, '<br>');
const textElement = bannerLink
? `<a href="${bannerLink}" target="_blank" style="color: inherit; text-decoration: none;">${textContent}</a>`
: textContent;
content += `
<div class="banner-text" style="${textStyle}">
${textElement}
</div>`;
}
// Add image if position is right or bottom
if (['right', 'bottom'].includes(imagePosition)) {
content += imgContainer;
}
// Add clearfix if needed
if (['left', 'right'].includes(imagePosition)) {
content += '<div style="clear: both;"></div>';
}
} else {
// No image, just show text
if (bannerText) {
const textStyle = `
margin: 0;
padding: 20px;
line-height: 1.6;
color: ${textColor};
text-align: ${textAlign};
font-size: ${fontSize};
`;
// Wrap text in link if URL is provided
const textElement = bannerLink
? `<a href="${bannerLink}" target="_blank" style="color: inherit; text-decoration: none;">${bannerText}</a>`
: bannerText;
content += `
<div class="banner-text" style="${textStyle}">
${textElement}
</div>`;
}
}
// Add text if it exists
if (bannerText) {
const textStyle = `
margin: 0;
padding: 10px;
line-height: 1.6;
color: ${textColor};
text-align: ${textAlign};
font-size: ${fontSize};
`;
// Wrap text in link if URL is provided
const textElement = bannerLink
? `<a href="${bannerLink}" target="_blank" style="color: inherit; text-decoration: none;">${bannerText}</a>`
: bannerText;
content += `
<div class="banner-text" style="${textStyle}">
${textElement}
</div>`;
}
// Set the content and make banner visible
bannerContent.innerHTML = content;
// Log the content for debugging
console.log('Banner content:', content);
// Ensure the banner is visible
bannerContainer.style.display = 'block';
bannerContainer.style.visibility = 'visible';
bannerContainer.style.opacity = '1';
} catch (error) {
console.error('Error loading banner:', error);
}
}
// Load banner when page loads
document.addEventListener('DOMContentLoaded', () => {
loadBanner();
// Move banner to the correct position after load
const bannerContainer = document.getElementById('bannerContainer');
const main = document.querySelector('main');
if (bannerContainer && main) {
main.insertBefore(bannerContainer, main.firstChild);
}
});
tailwind.config = {
theme: {
extend: {
colors: {
'brand-blue': '#004990',
'brand-light-blue': '#0072b0',
'brand-gray': '#f0f2f5'
}
}
}
}
</script>
</head>
<body class="bg-gray-100 min-h-screen">
<!-- Banner Container -->
<div id="bannerContainer" style="display: none; width: 100%; transition: all 0.3s ease; margin: 0 auto; max-width: 1200px; padding: 0 1rem;">
<div id="bannerContent" style="padding: 20px; text-align: center; border-radius: 8px; margin: 20px 0;"></div>
</div>
<nav class="bg-brand-blue text-white shadow-lg">
<div class="max-w-6xl mx-auto px-4 py-3 flex justify-between items-center">
<div class="flex items-center space-x-2">
<a href="http://webportal/index.html"><img src="http://pp-kunovice.cz/wp-content/uploads/2022/04/logo-retina-white.png" alt="Poppe Potthoff Logo" class="h-10"></a>
<div class="hidden md:block text-xl font-semibold">Poppe + Potthoff</div>
</div>
<!-- Mobile menu button -->
<div class="md:hidden">
<button id="mobile-menu-button" class="text-white focus:outline-none">
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
</div>
<!-- Desktop menu -->
<div class="hidden md:flex space-x-6">
<a href="http://webportal/index.html" class="hover:text-brand-light-blue">Rozcestník</a>
<a href="http://webportal/evidence-aut" class="hover:text-brand-light-blue">Evidence aut</a>
<a href="http://ppc-app/pwkweb2/" class="hover:text-brand-light-blue">Obědy</a>
<a href="http://osticket/" class="hover:text-brand-light-blue">OSticket</a>
<a href="http://kanboard/" class="hover:text-brand-light-blue">Kanboard</a>
<a href="http://webportal/kontakt" class="hover:text-brand-light-blue">Kontakt</a>
</div>
</div>
<!-- Mobile menu -->
<div id="mobile-menu" class="hidden md:hidden px-2 pt-2 pb-3 space-y-1">
<a href="webportal/index.html" class="block px-3 py-2 rounded-md text-base font-medium hover:text-brand-light-blue">Rozcestník</a>
<a href="webportal/evidence-aut" class="block px-3 py-2 rounded-md text-base font-medium hover:text-brand-light-blue">Evidence aut</a>
<a href="http://ppc-app/pwkweb2/" class="block px-3 py-2 rounded-md text-base font-medium hover:text-brand-light-blue">Obědy</a>
<a href="http://osticket/" class="block px-3 py-2 rounded-md text-base font-medium hover:text-brand-light-blue">OSticket</a>
<a href="http://kanboard/" class="block px-3 py-2 rounded-md text-base font-medium hover:text-brand-light-blue">Kanboard</a>
<a href="webportal/kontakt" class="block px-3 py-2 rounded-md text-base font-medium hover:text-brand-light-blue">Kontakt</a>
</div>
</nav>
<script>
// Mobile menu toggle
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
mobileMenuButton.addEventListener('click', () => {
mobileMenu.classList.toggle('hidden');
});
</script>
<!-- Page Header -->
<div class="bg-gradient-to-r from-brand-blue to-brand-light-blue text-white py-6 mb-8">
<div class="max-w-6xl mx-auto px-4">
<h1 class="text-3xl font-bold">Poppe + Potthoff - Firemní Aplikace</h1>
<p class="text-gray-100 mt-2">Rychlý přístup ke všem důležitým systémům</p>
</div>
</div>
<main class="container mx-auto px-4 py-4">
<!-- Banner will be inserted here by JavaScript -->
<!-- Search -->
<div class="mb-8 max-w-xl mx-auto">
<div class="relative">
<input type="text" id="search" placeholder="Hledat aplikaci..." style="margin-bottom: 20px;"
class="w-full px-4 py-3 rounded-lg shadow-sm border-gray-200 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none">
<div class="absolute right-3 top-3 text-gray-400">
<i class="fas fa-search"></i>
</div>
</div>
</div>
<!-- Apps Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<!-- 1. Car trips app -->
<div class="card bg-white rounded-xl shadow p-6 border-t-4 border-blue-600" data-name="zápis cest aut project">
<div class="rounded-full w-14 h-14 flex items-center justify-center bg-blue-100 text-blue-600 mb-4">
<i class="fas fa-car-side text-2xl"></i>
</div>
<h2 class="text-xl font-bold text-gray-800 mb-2">Záznam služebních jízd</h2>
<p class="text-gray-600 mb-4">Jednoduchý systém pro evidenci a správu jízd služebními vozidly.</p>
<a href="/evidence-aut" class="block text-center bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition-colors">
Otevřít aplikaci
</a>
</div>
<!-- 2. Lunches -->
<div class="card bg-white rounded-xl shadow p-6 border-t-4 border-green-600" data-name="obědy obedy jídlo lunch">
<div class="rounded-full w-14 h-14 flex items-center justify-center bg-green-100 text-green-600 mb-4">
<i class="fas fa-utensils text-2xl"></i>
</div>
<h2 class="text-xl font-bold text-gray-800 mb-2">Objednávka obědů</h2>
<p class="text-gray-600 mb-4">Portál pro objednávku a přehled firemních obědů</p>
<a href="http://ppc-app/pwkweb2/" class="block text-center bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded-lg transition-colors">
Otevřít aplikaci
</a>
</div>
<!-- 3. OSTicket -->
<div class="card bg-white rounded-xl shadow p-6 border-t-4 border-orange-600" data-name="osticket pomoc podpora support ticket">
<div class="rounded-full w-14 h-14 flex items-center justify-center bg-orange-100 text-orange-600 mb-4">
<i class="fas fa-headset text-2xl"></i>
</div>
<h2 class="text-xl font-bold text-gray-800 mb-2">OSTicket</h2>
<p class="text-gray-600 mb-4">Systém technické podpory a hlášení problémů</p>
<a href="http://osticket/" class="block text-center bg-orange-600 hover:bg-orange-700 text-white font-medium py-2 px-4 rounded-lg transition-colors">
Otevřít aplikaci
</a>
</div>
<!-- 4. Canboard tasks -->
<div class="card bg-white rounded-xl shadow p-6 border-t-4 border-purple-600" data-name="canboard úkoly úkolníček tasks">
<div class="rounded-full w-14 h-14 flex items-center justify-center bg-purple-100 text-purple-600 mb-4">
<i class="fas fa-tasks text-2xl"></i>
</div>
<h2 class="text-xl font-bold text-gray-800 mb-2">Kanboard</h2>
<p class="text-gray-600 mb-4">Správa úkolů a projektů v přehledném kanban stylu</p>
<a href="http://kanboard/" class="block text-center bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-4 rounded-lg transition-colors">
Otevřít aplikaci
</a>
</div>
</div>
<style>
/* Rounded border */
hr.rounded {
border-top: 2px solid #bbb;
border-radius: 5px;
margin-top: 20px;
margin-bottom: 20px;
}
</style>
<hr class="rounded">
<!-- Contact card - Subtle and full width -->
<div>
<div class="bg-gray-50 rounded-lg p-4 border border-gray-200">
<div class="flex items-center justify-between">
<div class="flex items-center">
<div class="rounded-full w-10 h-10 flex items-center justify-center bg-gray-100 text-gray-500 mr-3">
<i class="fas fa-phone-alt"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-700">Telefonní seznam</h3>
<p class="text-xs text-gray-500">Firemní kontakty a důležitá čísla</p>
</div>
</div>
<a href="http://webportal/kontakt" class="text-sm text-blue-600 hover:text-blue-800 hover:underline">
Otevřít
</a>
</div>
</div>
</div>
</main>
<footer class="bg-gray-800 text-gray-400 py-8 mt-12">
<div class="max-w-6xl mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<!-- Company Info -->
<div>
<h3 class="text-white text-lg font-semibold mb-4">Poppe + Potthoff CZ</h3>
<p class="mb-2">IČO: 26902214</p>
<p class="mb-2">DIČ: CZ26902214</p>
<p class="mb-2">Schránka: gfrk5qy</p>
<p>Na Záhonech 1086, 686 04 Kunovice</p>
</div>
<!-- Quick Links -->
<div>
<h3 class="text-white text-lg font-semibold mb-4">Rychlé odkazy</h3>
<ul class="space-y-2">
<li><a href="http://webportal/" class="hover:text-white">Rozcestník</a></li>
<li><a href="http://webportal/evidence-aut" class="hover:text-white">Evidence aut</a></li>
<li><a href="http://ppc-app/pwkweb2/" class="hover:text-white">Objednávka obědů</a></li>
<li><a href="http://osticket/" class="hover:text-white">Technická podpora</a></li>
<li><a href="http://webportal/kontakt" class="hover:text-white">Kontakty</a></li>
</ul>
</div>
<!-- Copyright -->
<div class="md:text-right">
<img src="http://pp-kunovice.cz/wp-content/uploads/2022/04/logo-retina-white.png" alt="Poppe Potthoff Logo" class="h-10 mb-4 inline-block">
<p class="text-sm"> 2025 Poppe + Potthoff CZ</p>
<p class="text-xs mt-2">Všechna práva vyhrazena</p>
</div>
</div>
<div class="border-t border-gray-700 mt-8 pt-6 text-center text-sm">
<p>Created by <a href="https://tdvorak.dev" class="text-blue-400 hover:text-blue-300">TDvorak</a></p>
</div>
</div>
</footer>
<script>
// Search functionality
const searchInput = document.getElementById('search');
const appCards = document.querySelectorAll('.card');
searchInput.addEventListener('input', function() {
const searchTerm = this.value.toLowerCase();
appCards.forEach(card => {
const cardName = card.getAttribute('data-name').toLowerCase();
const cardTitle = card.querySelector('h2').textContent.toLowerCase();
const cardDesc = card.querySelector('p').textContent.toLowerCase();
if (cardName.includes(searchTerm) || cardTitle.includes(searchTerm) || cardDesc.includes(searchTerm)) {
card.style.display = 'block';
} else {
card.style.display = 'none';
}
});
});
</script>
</body>
</html>