Compare commits
6 Commits
dev/tasks-
...
38c48861a9
| Author | SHA1 | Date | |
|---|---|---|---|
| 38c48861a9 | |||
| 30044e00e9 | |||
| 23027d54d7 | |||
| 5e10d19bbd | |||
| 1953df262c | |||
| ac40c7d949 |
@@ -131,9 +131,9 @@ $news_items = $stmt->fetchAll();
|
|||||||
<div class="leaflet-sidebar-tabs">
|
<div class="leaflet-sidebar-tabs">
|
||||||
<ul role="tablist">
|
<ul role="tablist">
|
||||||
<li><a href="#tab-home" role="tab"><i class="fa-solid fa-house"></i></a></li>
|
<li><a href="#tab-home" role="tab"><i class="fa-solid fa-house"></i></a></li>
|
||||||
<li><a href="#tab-help" role="tab"><i class="fa-solid fa-circle-question"></i></a></li>
|
|
||||||
<li><a href="#tab-list" role="tab"><i class="fa-solid fa-list"></i></a></li>
|
<li><a href="#tab-list" role="tab"><i class="fa-solid fa-list"></i></a></li>
|
||||||
<li><a href="#tab-news" role="tab"><i class="fa-solid fa-newspaper"></i></a></li>
|
<li><a href="#tab-news" role="tab"><i class="fa-solid fa-newspaper"></i></a></li>
|
||||||
|
<li><a href="#tab-help" role="tab"><i class="fa-solid fa-circle-question"></i></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -148,17 +148,12 @@ $news_items = $stmt->fetchAll();
|
|||||||
</h2>
|
</h2>
|
||||||
<div class="sidebar-body">
|
<div class="sidebar-body">
|
||||||
<p>Willkommen beim Bürgerbeteiligungsportal <strong><?= htmlspecialchars($municipality['name']) ?></strong>.</p>
|
<p>Willkommen beim Bürgerbeteiligungsportal <strong><?= htmlspecialchars($municipality['name']) ?></strong>.</p>
|
||||||
<p>Verwenden Sie die Karte, um Hinweise und Aufgaben für die Stadtverwaltung hinzuzufügen oder bestehende Beiträge der Bürgerschaft zu betrachten.</p>
|
<p>Verwenden Sie die Karte, um Hinweise für die Stadtverwaltung hinzuzufügen oder bestehende Beiträge zu betrachten, zu bewerten und zu kommentieren.</p>
|
||||||
|
|
||||||
<h3>Kategorien</h3>
|
<h3>Kategorien</h3>
|
||||||
<div id="category-filter">
|
<div id="category-filter">
|
||||||
<!-- Category Filter Checkboxes — populated by app.js -->
|
<!-- Category Filter Checkboxes — populated by app.js -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Statistik</h3>
|
|
||||||
<div id="stats-container">
|
|
||||||
<!-- Contribution Statistics — populated by app.js -->
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -178,6 +173,41 @@ $news_items = $stmt->fetchAll();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- News Tab -->
|
||||||
|
<div class="leaflet-sidebar-pane" id="tab-news">
|
||||||
|
<h2 class="leaflet-sidebar-header">
|
||||||
|
Neuigkeiten
|
||||||
|
<span class="leaflet-sidebar-close"><i class="fa-solid fa-xmark"></i></span>
|
||||||
|
</h2>
|
||||||
|
<div class="sidebar-body">
|
||||||
|
<!-- News Search -->
|
||||||
|
<div class="list-search">
|
||||||
|
<input type="text" id="news-search-input" placeholder="Neuigkeiten durchsuchen..." class="form-input" oninput="filterNews()">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- News Items Container -->
|
||||||
|
<div id="news-list">
|
||||||
|
<?php if (empty($news_items)): ?>
|
||||||
|
<p class="empty-state">Noch keine Neuigkeiten veröffentlicht.</p>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($news_items as $news): ?>
|
||||||
|
<div class="news-item"
|
||||||
|
data-title="<?= htmlspecialchars(strtolower($news['title'])) ?>"
|
||||||
|
data-content="<?= htmlspecialchars(strtolower($news['content'])) ?>"
|
||||||
|
data-author="<?= htmlspecialchars(strtolower($news['author_name'])) ?>">
|
||||||
|
<h3><?= htmlspecialchars($news['title']) ?></h3>
|
||||||
|
<p><?= nl2br(htmlspecialchars($news['content'])) ?></p>
|
||||||
|
<span class="news-date">
|
||||||
|
<?= htmlspecialchars($news['author_name']) ?>
|
||||||
|
· <?= date('d.m.Y', strtotime($news['published_at'])) ?>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Help Tab -->
|
<!-- Help Tab -->
|
||||||
<div class="leaflet-sidebar-pane" id="tab-help">
|
<div class="leaflet-sidebar-pane" id="tab-help">
|
||||||
<h2 class="leaflet-sidebar-header">
|
<h2 class="leaflet-sidebar-header">
|
||||||
@@ -207,43 +237,6 @@ $news_items = $stmt->fetchAll();
|
|||||||
|
|
||||||
<h3><i class="fa-solid fa-magnifying-glass"></i> Suchen</h3>
|
<h3><i class="fa-solid fa-magnifying-glass"></i> Suchen</h3>
|
||||||
<p>Verwenden Sie die Adresssuche rechts, um schnell den richtigen Ort auf der Mitmachkarte zu finden.</p>
|
<p>Verwenden Sie die Adresssuche rechts, um schnell den richtigen Ort auf der Mitmachkarte zu finden.</p>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- News Tab -->
|
|
||||||
<div class="leaflet-sidebar-pane" id="tab-news">
|
|
||||||
<h2 class="leaflet-sidebar-header">
|
|
||||||
Neuigkeiten
|
|
||||||
<span class="leaflet-sidebar-close"><i class="fa-solid fa-xmark"></i></span>
|
|
||||||
</h2>
|
|
||||||
<div class="sidebar-body">
|
|
||||||
<!-- News Search -->
|
|
||||||
<div class="list-search">
|
|
||||||
<input type="text" id="news-search-input" placeholder="Neuigkeiten durchsuchen..." class="form-input" oninput="filterNews()">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- News Items Container -->
|
|
||||||
<div id="news-list">
|
|
||||||
<?php if (empty($news_items)): ?>
|
|
||||||
<p style="text-align:center;color:#999;padding:20px;">Noch keine Neuigkeiten veröffentlicht.</p>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php foreach ($news_items as $news): ?>
|
|
||||||
<div class="news-item"
|
|
||||||
data-title="<?= htmlspecialchars(strtolower($news['title'])) ?>"
|
|
||||||
data-content="<?= htmlspecialchars(strtolower($news['content'])) ?>"
|
|
||||||
data-author="<?= htmlspecialchars(strtolower($news['author_name'])) ?>">
|
|
||||||
<h3><?= htmlspecialchars($news['title']) ?></h3>
|
|
||||||
<p><?= nl2br(htmlspecialchars($news['content'])) ?></p>
|
|
||||||
<span class="news-date">
|
|
||||||
<?= htmlspecialchars($news['author_name']) ?>
|
|
||||||
· <?= date('d.m.Y', strtotime($news['published_at'])) ?>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -316,7 +309,7 @@ $news_items = $stmt->fetchAll();
|
|||||||
<!-- ============================================================= -->
|
<!-- ============================================================= -->
|
||||||
<div id="create-modal" class="modal-overlay" style="display:none;">
|
<div id="create-modal" class="modal-overlay" style="display:none;">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<h2><i class="fa-solid fa-plus-circle"></i> Beitrag</h2>
|
<h2><i class="fa-solid fa-pencil"></i> Beitrag hinzufügen</h2>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="create-category">Kategorie</label>
|
<label for="create-category">Kategorie</label>
|
||||||
|
|||||||
@@ -220,6 +220,21 @@ sidebar = L.control.sidebar({
|
|||||||
position: 'left'
|
position: 'left'
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
|
// Hides Map Controls on Mobile while Sidebar is open
|
||||||
|
sidebar.on('content', function () {
|
||||||
|
if (window.innerWidth < 769) {
|
||||||
|
document.querySelectorAll('.leaflet-top.leaflet-right').forEach(function (el) {
|
||||||
|
el.style.display = 'none';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
sidebar.on('closing', function () {
|
||||||
|
document.querySelectorAll('.leaflet-top.leaflet-right').forEach(function (el) {
|
||||||
|
el.style.display = '';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
// Block 6: Geoman Drawing Tools and CRUD Trigger
|
// Block 6: Geoman Drawing Tools and CRUD Trigger
|
||||||
@@ -346,7 +361,7 @@ function loadContributions() {
|
|||||||
layerControl.addOverlay(contributionsLayer, '<i class="fa-solid fa-map-pin" style="color:#C00000;"></i> Beiträge');
|
layerControl.addOverlay(contributionsLayer, '<i class="fa-solid fa-map-pin" style="color:#C00000;"></i> Beiträge');
|
||||||
// Update Sidebar List and Statistics
|
// Update Sidebar List and Statistics
|
||||||
updateContributionsList();
|
updateContributionsList();
|
||||||
updateStatistics();
|
buildCategoryFilter();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,7 +781,7 @@ function updateContributionsList() {
|
|||||||
|
|
||||||
// Builds HTML
|
// Builds HTML
|
||||||
if (filtered.length === 0) {
|
if (filtered.length === 0) {
|
||||||
container.innerHTML = '<p style="text-align:center;color:#999;padding:20px;">Keine Beiträge gefunden.</p>';
|
container.innerHTML = '<p class="empty-state">Keine Beiträge gefunden.</p>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -830,22 +845,33 @@ document.getElementById('list-search-input').addEventListener('input', function
|
|||||||
// Block 12: Sidebar Category Filter and Statistics
|
// Block 12: Sidebar Category Filter and Statistics
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
|
|
||||||
// Builds Category Filter Checkboxes
|
// Builds Category Filter Checkboxes with Counts
|
||||||
function buildCategoryFilter() {
|
function buildCategoryFilter() {
|
||||||
const container = document.getElementById('category-filter');
|
const container = document.getElementById('category-filter');
|
||||||
|
|
||||||
|
const counts = {};
|
||||||
|
contributionsData.forEach(function (f) {
|
||||||
|
const cat = f.properties.category;
|
||||||
|
counts[cat] = (counts[cat] || 0) + 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
const total = contributionsData.length;
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|
||||||
for (const key in CATEGORIES) {
|
for (const key in CATEGORIES) {
|
||||||
const cat = CATEGORIES[key];
|
const cat = CATEGORIES[key];
|
||||||
const checked = activeFilters.indexOf(key) !== -1 ? 'checked' : '';
|
const checked = activeFilters.indexOf(key) !== -1 ? 'checked' : '';
|
||||||
|
const count = counts[key] || 0;
|
||||||
|
|
||||||
html += '' +
|
html += '<label style="display:flex;align-items:center;gap:8px;margin-bottom:6px;cursor:pointer;font-size:0.85rem;color:var(--color-text-secondary)">' +
|
||||||
'<label style="display:flex;align-items:center;gap:8px;margin-bottom:6px;cursor:pointer;">' +
|
|
||||||
'<input type="checkbox" value="' + key + '" ' + checked + ' onchange="toggleCategoryFilter(this)">' +
|
'<input type="checkbox" value="' + key + '" ' + checked + ' onchange="toggleCategoryFilter(this)">' +
|
||||||
'<span>' + categoryIcon(cat) + ' ' + cat.label + '</span>' +
|
categoryIcon(cat) +
|
||||||
|
'<span>' + cat.label + ' (' + count + ')</span>' +
|
||||||
'</label>';
|
'</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html += '<p style="margin-top:10px;font-size:0.85rem;color:var(--color-text-secondary)"><strong>' + total + '</strong> Beiträge insgesamt</p>';
|
||||||
|
|
||||||
container.innerHTML = html;
|
container.innerHTML = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -892,34 +918,6 @@ function toggleCategoryFilter(checkbox) {
|
|||||||
updateContributionsList();
|
updateContributionsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates Statistics in Home Tab
|
|
||||||
function updateStatistics() {
|
|
||||||
const container = document.getElementById('stats-container');
|
|
||||||
const total = contributionsData.length;
|
|
||||||
|
|
||||||
// Counts per Category
|
|
||||||
const counts = {};
|
|
||||||
contributionsData.forEach(function (f) {
|
|
||||||
const cat = f.properties.category;
|
|
||||||
counts[cat] = (counts[cat] || 0) + 1;
|
|
||||||
});
|
|
||||||
|
|
||||||
let html = '<p style="font-size:0.9rem;"><strong>' + total + '</strong> Beiträge insgesamt</p>';
|
|
||||||
|
|
||||||
for (const key in CATEGORIES) {
|
|
||||||
const cat = CATEGORIES[key];
|
|
||||||
const count = counts[key] || 0;
|
|
||||||
if (count > 0) {
|
|
||||||
html += '<div style="display:flex;align-items:center;gap:8px;margin:4px 0;font-size:0.85rem;">' +
|
|
||||||
categoryIcon(cat) + ' ' +
|
|
||||||
cat.label + ': ' + count +
|
|
||||||
'</div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
container.innerHTML = html;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
// Block 13: Modals — Welcome, Login, Info, Privacy, Imprint
|
// Block 13: Modals — Welcome, Login, Info, Privacy, Imprint
|
||||||
@@ -957,6 +955,11 @@ function submitLogin() {
|
|||||||
document.cookie = 'webgis_user=' + encodeURIComponent(name) + ';path=/;max-age=31536000;SameSite=Lax';
|
document.cookie = 'webgis_user=' + encodeURIComponent(name) + ';path=/;max-age=31536000;SameSite=Lax';
|
||||||
document.getElementById('login-modal').style.display = 'none';
|
document.getElementById('login-modal').style.display = 'none';
|
||||||
|
|
||||||
|
// Starts Onboarding Tour on first Login
|
||||||
|
if (!localStorage.getItem('webgis_onboarding_done')) {
|
||||||
|
setTimeout(function () { startTour(); }, 500);
|
||||||
|
}
|
||||||
|
|
||||||
// Open Create Modal if Geometry is pending
|
// Open Create Modal if Geometry is pending
|
||||||
if (drawnGeometry) {
|
if (drawnGeometry) {
|
||||||
document.getElementById('create-geom').value = JSON.stringify(drawnGeometry);
|
document.getElementById('create-geom').value = JSON.stringify(drawnGeometry);
|
||||||
@@ -967,6 +970,11 @@ function submitLogin() {
|
|||||||
|
|
||||||
function skipLogin() {
|
function skipLogin() {
|
||||||
document.getElementById('login-modal').style.display = 'none';
|
document.getElementById('login-modal').style.display = 'none';
|
||||||
|
|
||||||
|
// Starts Onboarding Tour on first Login
|
||||||
|
if (!localStorage.getItem('webgis_onboarding_done')) {
|
||||||
|
setTimeout(function () { startTour(); }, 500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Info Modal
|
// Info Modal
|
||||||
@@ -1034,7 +1042,7 @@ function escapeHtml(text) {
|
|||||||
|
|
||||||
// Returns a colored Font Awesome Icon HTML String for a Category
|
// Returns a colored Font Awesome Icon HTML String for a Category
|
||||||
function categoryIcon(cat) {
|
function categoryIcon(cat) {
|
||||||
return '<i class="fa-solid ' + cat.faIcon + '" style="color:' + cat.color + ';"></i>';
|
return '<i class="fa-solid ' + cat.faIcon + ' fa-fw" style="color:' + cat.color + ';"></i>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse Geocodes Coordinates and saves Address to Contribution via API
|
// Reverse Geocodes Coordinates and saves Address to Contribution via API
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// =====================================================================
|
// =====================================================================
|
||||||
// WebGIS Citizen Participation Portal — Onboarding Tour
|
// WebGIS Citizen Participation Portal — Onboarding Tour
|
||||||
// Guides Users through the Participation Portal
|
// Guides Users through the Participation Portal.
|
||||||
|
// On Mobile centered Overlays. On Desktop attached to User Interface.
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
|
|
||||||
|
|
||||||
@@ -8,74 +9,28 @@
|
|||||||
// Block 1: Onboarding Configuration
|
// Block 1: Onboarding Configuration
|
||||||
// =================================================================
|
// =================================================================
|
||||||
|
|
||||||
// ONBOARDING_MODE — Controls when the Tutorial is shown:
|
|
||||||
const ONBOARDING_MODE = 'once';
|
|
||||||
// 'once' — Shown on first Visit, stored in localStorage
|
|
||||||
// 'session' — Shown per Browser Session, stored in sessionStorage
|
|
||||||
// 'always' — Shows always, nothing stored
|
|
||||||
|
|
||||||
// Prevents double Initialization
|
// Prevents double Initialization
|
||||||
let onboardingStarted = false;
|
let onboardingStarted = false;
|
||||||
|
|
||||||
|
// Detects Mobile Viewport
|
||||||
// =================================================================
|
function isMobile() {
|
||||||
// Block 2: Tour Initialization
|
return window.innerWidth < 769;
|
||||||
// =================================================================
|
|
||||||
|
|
||||||
function initOnboardingTour() {
|
|
||||||
|
|
||||||
// Checks if Tutorial should be shown based on Onboarding Mode
|
|
||||||
if (ONBOARDING_MODE === 'once' && localStorage.getItem('webgis_onboarding_done')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (ONBOARDING_MODE === 'session' && sessionStorage.getItem('webgis_onboarding_done')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Waits for Welcome and Login Modals to be closed
|
|
||||||
waitForModalsToClose(function () {
|
|
||||||
setTimeout(startTour, 600);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// =================================================================
|
// =================================================================
|
||||||
// Block 3: Modal Watcher — Starts Tour other Welcome and Login Modals closed
|
// Block 2: Tour Definition
|
||||||
// =================================================================
|
// =================================================================
|
||||||
|
|
||||||
function waitForModalsToClose(callback) {
|
function startTour(manual) {
|
||||||
const welcomeModal = document.getElementById('welcome-modal');
|
|
||||||
const loginModal = document.getElementById('login-modal');
|
|
||||||
|
|
||||||
const checkInterval = setInterval(function () {
|
|
||||||
const welcomeHidden = !welcomeModal || welcomeModal.style.display === 'none' || welcomeModal.style.display === '';
|
|
||||||
const loginHidden = !loginModal || loginModal.style.display === 'none' || loginModal.style.display === '';
|
|
||||||
|
|
||||||
if (welcomeHidden && loginHidden) {
|
|
||||||
clearInterval(checkInterval);
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}, 300);
|
|
||||||
|
|
||||||
// Safety Timeout
|
|
||||||
setTimeout(function () {
|
|
||||||
clearInterval(checkInterval);
|
|
||||||
callback();
|
|
||||||
}, 30000);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// =================================================================
|
|
||||||
// Block 4: Tour Definition
|
|
||||||
// =================================================================
|
|
||||||
|
|
||||||
function startTour() {
|
|
||||||
// Prevents double Start
|
// Prevents double Start
|
||||||
if (onboardingStarted) return;
|
if (onboardingStarted) return;
|
||||||
onboardingStarted = true;
|
onboardingStarted = true;
|
||||||
|
|
||||||
|
const mobile = isMobile();
|
||||||
|
|
||||||
const tour = new Shepherd.Tour({
|
const tour = new Shepherd.Tour({
|
||||||
useModalOverlay: true,
|
useModalOverlay: !mobile,
|
||||||
defaultStepOptions: {
|
defaultStepOptions: {
|
||||||
cancelIcon: { enabled: true },
|
cancelIcon: { enabled: true },
|
||||||
scrollTo: false,
|
scrollTo: false,
|
||||||
@@ -90,45 +45,53 @@ function startTour() {
|
|||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Step 1: Welcome
|
// Step 1: Welcome — Skip Timer at automatic Start
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
tour.addStep({
|
var welcomeButtons = [
|
||||||
id: 'welcome',
|
|
||||||
title: '<i class="fa-solid fa-hand-wave"></i> Wilkommen bei der Mitmachkarte!',
|
|
||||||
text: 'Dieses interaktive Tutorial zeigt Ihnen die Kernfunktionen der Mitmachkarte.' +
|
|
||||||
'<br><br><span style="font-size:0.8rem;color:var(--color-text-secondary);">Sie können das Tutorial jederzeit durch den Hilfe-Tab der Seitenleiste wiederholen.</span>',
|
|
||||||
buttons: [
|
|
||||||
{
|
{
|
||||||
text: 'Überspringen',
|
text: 'Überspringen',
|
||||||
action: tour.cancel,
|
action: tour.cancel,
|
||||||
classes: 'shepherd-button-secondary'
|
classes: 'shepherd-button-secondary' + (manual ? '' : ' skip-btn-locked')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Los geht\'s <i class="fa-solid fa-arrow-right"></i>',
|
text: 'Los geht\'s <i class="fa-solid fa-arrow-right"></i>',
|
||||||
action: tour.next,
|
action: tour.next,
|
||||||
classes: 'shepherd-button-primary'
|
classes: 'shepherd-button-primary'
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
|
|
||||||
|
tour.addStep({
|
||||||
|
id: 'welcome',
|
||||||
|
title: '<i class="fa-solid fa-hand-wave"></i> Willkommen bei der Mitmachkarte!',
|
||||||
|
text: 'Dieses <strong>interaktive Tutorial</strong> zeigt Ihnen die Kernfunktionen der Mitmachkarte.' +
|
||||||
|
'<br><br><span style="color:var(--color-text-secondary);">Sie können das Tutorial jederzeit über den Hilfe-Tab der Seitenleiste wiederholen.</span>',
|
||||||
|
buttons: welcomeButtons,
|
||||||
|
when: {
|
||||||
|
show: function () {
|
||||||
|
if (manual) return;
|
||||||
|
|
||||||
|
// Locks Skip Button with Progress Bar for 5 Seconds
|
||||||
|
var skipBtn = document.querySelector('.skip-btn-locked');
|
||||||
|
if (!skipBtn) return;
|
||||||
|
skipBtn.disabled = true;
|
||||||
|
skipBtn.style.pointerEvents = 'none';
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
skipBtn.disabled = false;
|
||||||
|
skipBtn.style.pointerEvents = '';
|
||||||
|
skipBtn.classList.remove('skip-btn-locked');
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Step 2: Drawing Tools
|
// Step 2: Drawing Tools
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
tour.addStep({
|
var drawingStep = {
|
||||||
id: 'drawing-tools',
|
id: 'drawing-tools',
|
||||||
title: '<i class="fa-solid fa-pencil"></i> Beitrag hinzufügen',
|
title: '<i class="fa-solid fa-pencil"></i> Beitrag hinzufügen',
|
||||||
text: 'Verwenden Sie die <strong>Zeichenwerkzeuge</strong>, um Hinweise, Anregungen und Vorschläge auf der Mitmachkarte als Punkte, Linien oder Flächen hinzuzufügen.',
|
|
||||||
attachTo: {
|
|
||||||
element: '.leaflet-pm-toolbar',
|
|
||||||
on: 'left'
|
|
||||||
},
|
|
||||||
beforeShowPromise: function () {
|
|
||||||
return new Promise(function (resolve) {
|
|
||||||
sidebar.close();
|
|
||||||
setTimeout(resolve, 300);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: '<i class="fa-solid fa-arrow-left"></i> Zurück',
|
text: '<i class="fa-solid fa-arrow-left"></i> Zurück',
|
||||||
@@ -141,20 +104,32 @@ function startTour() {
|
|||||||
classes: 'shepherd-button-primary'
|
classes: 'shepherd-button-primary'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
if (mobile) {
|
||||||
|
drawingStep.text = 'Verwenden Sie die <strong>Zeichenwerkzeuge</strong> ' +
|
||||||
|
'<i class="fa-solid fa-location-dot"></i> ' +
|
||||||
|
'rechts, um Hinweise als Punkte, Linien oder Flächen hinzuzufügen.';
|
||||||
|
} else {
|
||||||
|
drawingStep.text = 'Verwenden Sie die <strong>Zeichenwerkzeuge</strong>, um Hinweise, Anregungen und Vorschläge auf der Mitmachkarte als Punkte, Linien oder Flächen hinzuzufügen.';
|
||||||
|
drawingStep.attachTo = { element: '.leaflet-pm-toolbar', on: 'left' };
|
||||||
|
drawingStep.beforeShowPromise = function () {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
sidebar.close();
|
||||||
|
setTimeout(resolve, 300);
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
tour.addStep(drawingStep);
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Step 3: Address Search
|
// Step 3: Address Search
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
tour.addStep({
|
var searchStep = {
|
||||||
id: 'address-search',
|
id: 'address-search',
|
||||||
title: '<i class="fa-solid fa-magnifying-glass"></i> Adresssuche',
|
title: '<i class="fa-solid fa-magnifying-glass"></i> Adresssuche',
|
||||||
text: 'Verwenden Sie die <strong>Adresssuche</strong>, um schnell den richtigen Ort auf der Mitmachkarte zu finden.',
|
|
||||||
attachTo: {
|
|
||||||
element: '.leaflet-control-geocoder',
|
|
||||||
on: 'left'
|
|
||||||
},
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: '<i class="fa-solid fa-arrow-left"></i> Zurück',
|
text: '<i class="fa-solid fa-arrow-left"></i> Zurück',
|
||||||
@@ -167,20 +142,25 @@ function startTour() {
|
|||||||
classes: 'shepherd-button-primary'
|
classes: 'shepherd-button-primary'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (mobile) {
|
||||||
|
searchStep.text = 'Verwenden Sie die <strong>Adresssuche</strong> ' +
|
||||||
|
'<i class="fa-solid fa-magnifying-glass"></i> rechts, um schnell den richtigen Ort auf der Mitmachkarte zu finden.';
|
||||||
|
} else {
|
||||||
|
searchStep.text = 'Verwenden Sie die <strong>Adresssuche</strong>, um schnell den richtigen Ort auf der Mitmachkarte zu finden.';
|
||||||
|
searchStep.attachTo = { element: '.leaflet-control-geocoder', on: 'left' };
|
||||||
|
}
|
||||||
|
|
||||||
|
tour.addStep(searchStep);
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Step 4: Layer Control
|
// Step 4: Layer Control
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
tour.addStep({
|
var layerStep = {
|
||||||
id: 'layer-control',
|
id: 'layer-control',
|
||||||
title: '<i class="fa-solid fa-layer-group"></i> Kartenansicht',
|
title: '<i class="fa-solid fa-layer-group"></i> Kartenansicht',
|
||||||
text: 'Wechseln Sie zwischen verschiedenen <strong>Hintergrundkarten</strong> und <strong>Satellitenbildern</strong>.',
|
|
||||||
attachTo: {
|
|
||||||
element: '.leaflet-control-layers',
|
|
||||||
on: 'left'
|
|
||||||
},
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: '<i class="fa-solid fa-arrow-left"></i> Zurück',
|
text: '<i class="fa-solid fa-arrow-left"></i> Zurück',
|
||||||
@@ -193,26 +173,25 @@ function startTour() {
|
|||||||
classes: 'shepherd-button-primary'
|
classes: 'shepherd-button-primary'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (mobile) {
|
||||||
|
layerStep.text = 'Wechseln Sie über das <strong>Layer-Symbol</strong> ' +
|
||||||
|
'<i class="fa-solid fa-layer-group"></i> oben rechts zwischen verschiedenen Hintergrundkarten und Satellitenbildern.';
|
||||||
|
} else {
|
||||||
|
layerStep.text = 'Wechseln Sie zwischen verschiedenen <strong>Hintergrundkarten</strong> und <strong>Satellitenbildern</strong>.';
|
||||||
|
layerStep.attachTo = { element: '.leaflet-control-layers', on: 'left' };
|
||||||
|
}
|
||||||
|
|
||||||
|
tour.addStep(layerStep);
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Step 5: Sidebar
|
// Step 5: Sidebar
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
tour.addStep({
|
var sidebarStep = {
|
||||||
id: 'sidebar',
|
id: 'sidebar',
|
||||||
title: '<i class="fa-solid fa-bars"></i> Seitenleiste',
|
title: '<i class="fa-solid fa-bars"></i> Seitenleiste',
|
||||||
text: 'In der Seitenleiste finden Sie <strong>Hilfestellungen</strong>, <strong>Listenansichten</strong> und <strong>Neuigkeiten</strong>.',
|
|
||||||
attachTo: {
|
|
||||||
element: '#sidebar',
|
|
||||||
on: 'right'
|
|
||||||
},
|
|
||||||
beforeShowPromise: function () {
|
|
||||||
return new Promise(function (resolve) {
|
|
||||||
sidebar.open('tab-help');
|
|
||||||
setTimeout(resolve, 400);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: '<i class="fa-solid fa-arrow-left"></i> Zurück',
|
text: '<i class="fa-solid fa-arrow-left"></i> Zurück',
|
||||||
@@ -220,58 +199,106 @@ function startTour() {
|
|||||||
classes: 'shepherd-button-secondary'
|
classes: 'shepherd-button-secondary'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Tutorial abschließen <i class="fa-solid fa-check"></i>',
|
text: 'Abschließen <i class="fa-solid fa-check"></i>',
|
||||||
action: tour.next,
|
action: tour.next,
|
||||||
classes: 'shepherd-button-primary'
|
classes: 'shepherd-button-primary'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
if (mobile) {
|
||||||
|
sidebarStep.text = 'In der <strong>Seitenleiste</strong> ' +
|
||||||
|
'<i class="fa-solid fa-house"></i> ' +
|
||||||
|
'links finden Sie Hilfestellungen, Listenansichten und Neuigkeiten.';
|
||||||
|
} else {
|
||||||
|
sidebarStep.text = 'In der <strong>Seitenleiste</strong> finden Sie Hilfestellungen, Listenansichten und Neuigkeiten.';
|
||||||
|
sidebarStep.attachTo = { element: '#sidebar', on: 'right' };
|
||||||
|
sidebarStep.beforeShowPromise = function () {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
sidebar.open('tab-help');
|
||||||
|
setTimeout(resolve, 400);
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
tour.addStep(sidebarStep);
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Completion and Cancellation
|
// Completion and Cancellation — shows Drawing Arrow
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
tour.on('complete', function () {
|
function onTourEnd() {
|
||||||
markOnboardingDone();
|
|
||||||
onboardingStarted = false;
|
onboardingStarted = false;
|
||||||
});
|
if (mobile) sidebar.close();
|
||||||
|
|
||||||
tour.on('cancel', function () {
|
// Shows Arrow Hint
|
||||||
markOnboardingDone();
|
if (!localStorage.getItem('webgis_onboarding_done')) {
|
||||||
onboardingStarted = false;
|
localStorage.setItem('webgis_onboarding_done', 'true');
|
||||||
});
|
showDrawingArrow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tour.on('complete', onTourEnd);
|
||||||
|
tour.on('cancel', onTourEnd);
|
||||||
|
|
||||||
tour.start();
|
tour.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// =================================================================
|
// =================================================================
|
||||||
// Marks Onboarding as completed
|
// Drawing Arrow — Points to Geoman Toolbar after Tour
|
||||||
// =================================================================
|
// =================================================================
|
||||||
|
|
||||||
function markOnboardingDone() {
|
function showDrawingArrow() {
|
||||||
if (ONBOARDING_MODE === 'once') {
|
var hint = document.createElement('div');
|
||||||
localStorage.setItem('webgis_onboarding_done', 'true');
|
hint.id = 'drawing-hint-arrow';
|
||||||
} else if (ONBOARDING_MODE === 'session') {
|
hint.innerHTML = '<span class="drawing-hint-label">' +
|
||||||
sessionStorage.setItem('webgis_onboarding_done', 'true');
|
'<i class="fa-solid fa-pencil"></i> Beitrag hinzufügen' +
|
||||||
|
'</span>' +
|
||||||
|
'<span class="drawing-hint-chevrons">' +
|
||||||
|
'<i class="fa-solid fa-chevron-right"></i>' +
|
||||||
|
'<i class="fa-solid fa-chevron-right"></i>' +
|
||||||
|
'</span>';
|
||||||
|
document.body.appendChild(hint);
|
||||||
|
|
||||||
|
// Positions Hint centered on Geoman Toolbar
|
||||||
|
function positionHint() {
|
||||||
|
var toolbar = document.querySelector('.leaflet-pm-toolbar');
|
||||||
|
if (!toolbar) { removeDrawingArrow(); return; }
|
||||||
|
|
||||||
|
var rect = toolbar.getBoundingClientRect();
|
||||||
|
var hintHeight = hint.offsetHeight || 32;
|
||||||
|
hint.style.top = (rect.top + (rect.height / 2) - (hintHeight / 2)) + 'px';
|
||||||
|
hint.style.right = (window.innerWidth - rect.left + 10) + 'px';
|
||||||
|
}
|
||||||
|
|
||||||
|
positionHint();
|
||||||
|
window.addEventListener('resize', positionHint);
|
||||||
|
|
||||||
|
var timeout = setTimeout(removeDrawingArrow, 60000);
|
||||||
|
|
||||||
|
map.on('pm:globaldrawmodetoggled', function onDraw() {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
removeDrawingArrow();
|
||||||
|
map.off('pm:globaldrawmodetoggled', onDraw);
|
||||||
|
window.removeEventListener('resize', positionHint);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeDrawingArrow() {
|
||||||
|
var arrow = document.getElementById('drawing-hint-arrow');
|
||||||
|
if (arrow) {
|
||||||
|
arrow.classList.add('fade-out');
|
||||||
|
setTimeout(function () { arrow.remove(); }, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// =================================================================
|
// =================================================================
|
||||||
// Manual Tour Restart
|
// Manual Tour Restart (from Info Modal or Help Tab)
|
||||||
// =================================================================
|
// =================================================================
|
||||||
|
|
||||||
function restartOnboarding() {
|
function restartOnboarding() {
|
||||||
localStorage.removeItem('webgis_onboarding_done');
|
|
||||||
sessionStorage.removeItem('webgis_onboarding_done');
|
|
||||||
onboardingStarted = false;
|
onboardingStarted = false;
|
||||||
startTour();
|
startTour(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// =================================================================
|
|
||||||
// Auto-Start on Page Load
|
|
||||||
// =================================================================
|
|
||||||
|
|
||||||
initOnboardingTour();
|
|
||||||
@@ -464,6 +464,7 @@ select.form-input { cursor: pointer; }
|
|||||||
margin-bottom: var(--space-sm);
|
margin-bottom: var(--space-sm);
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
|
font-size: 0.85rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -874,6 +875,97 @@ select.form-input { cursor: pointer; }
|
|||||||
transform: translate(-50%, -50%) !important;
|
transform: translate(-50%, -50%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------------
|
||||||
|
4.10 Skip Button Progress Bar (Onboarding)
|
||||||
|
----------------------------------------------------------------- */
|
||||||
|
.skip-btn-locked {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skip-btn-locked::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
width: 0%;
|
||||||
|
background: rgba(0, 0, 0, 0.12);
|
||||||
|
border-radius: 6px;
|
||||||
|
animation: skip-fill 5s linear forwards;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes skip-fill {
|
||||||
|
from { width: 0%; }
|
||||||
|
to { width: 100%; opacity: 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------------
|
||||||
|
4.11 Drawing Hint Arrow after Onboarding
|
||||||
|
----------------------------------------------------------------- */
|
||||||
|
#drawing-hint-arrow {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1500;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
pointer-events: none;
|
||||||
|
animation: hint-fade-in 400ms ease;
|
||||||
|
transition: opacity 300ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
#drawing-hint-arrow.fade-out {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawing-hint-label {
|
||||||
|
background: var(--color-primary);
|
||||||
|
color: white;
|
||||||
|
font-family: var(--font-body);
|
||||||
|
font-size: 0.78rem;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 6px 14px;
|
||||||
|
border-radius: 20px;
|
||||||
|
white-space: nowrap;
|
||||||
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawing-hint-chevrons {
|
||||||
|
display: flex;
|
||||||
|
gap: 0;
|
||||||
|
color: var(--color-primary);
|
||||||
|
font-size: 1.2rem;
|
||||||
|
font-weight: 900;
|
||||||
|
filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawing-hint-chevrons i:nth-child(1) {
|
||||||
|
animation: chevron-pulse 1.2s ease-in-out infinite;
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawing-hint-chevrons i:nth-child(2) {
|
||||||
|
animation: chevron-pulse 1.2s ease-in-out 0.3s infinite;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes chevron-pulse {
|
||||||
|
0%, 100% { transform: translateX(0); opacity: 0.3; }
|
||||||
|
50% { transform: translateX(3px); opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes hint-fade-in {
|
||||||
|
from { opacity: 0; transform: translateX(-10px); }
|
||||||
|
to { opacity: 1; transform: translateX(0); }
|
||||||
|
}
|
||||||
|
|
||||||
/* Mobile */
|
/* Mobile */
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.shepherd-element { max-width: 300px !important; }
|
.shepherd-element { max-width: 300px !important; }
|
||||||
@@ -1248,6 +1340,15 @@ select.form-input { cursor: pointer; }
|
|||||||
/* Legal */
|
/* Legal */
|
||||||
.page-content-box { padding: 20px; }
|
.page-content-box { padding: 20px; }
|
||||||
.page-container { padding: 0 8px; }
|
.page-container { padding: 0 8px; }
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------
|
||||||
|
6.1 Prevents iOS Auto-Zoom on Inputs
|
||||||
|
--------------------------------------------------------- */
|
||||||
|
input, textarea, select {
|
||||||
|
font-size: 16px !important;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 769px) {
|
@media (min-width: 769px) {
|
||||||
|
|||||||
Reference in New Issue
Block a user