fix(test): rename module to Test in overview and restore original web audio synth look
This commit is contained in:
parent
71fed56884
commit
46d9b0f4a0
2 changed files with 140 additions and 177 deletions
|
|
@ -27,8 +27,8 @@ class ModuleService {
|
||||||
],
|
],
|
||||||
'test' => [
|
'test' => [
|
||||||
'slug' => 'test',
|
'slug' => 'test',
|
||||||
'name' => 'Web Audio Synth',
|
'name' => 'Test',
|
||||||
'badge' => 'Audio / Test',
|
'badge' => 'Test',
|
||||||
'description' => 'Interaktive Web Audio API Synthese & Soundtest',
|
'description' => 'Interaktive Web Audio API Synthese & Soundtest',
|
||||||
'path' => '/test',
|
'path' => '/test',
|
||||||
'adminOnly' => false
|
'adminOnly' => false
|
||||||
|
|
|
||||||
305
test/index.php
305
test/index.php
|
|
@ -1,15 +1,22 @@
|
||||||
<?php
|
<?php
|
||||||
// DATEI: ./test/index.php
|
// Session starten, falls noch nicht geschehen
|
||||||
if (session_status() === PHP_SESSION_NONE) {
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Einfache Logout-Logik direkt in dieser Datei
|
||||||
|
if (isset($_GET['logout'])) {
|
||||||
|
session_destroy();
|
||||||
|
header("Location: /");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// 1. Projekt identifizieren und schützen
|
// 1. Projekt identifizieren und schützen
|
||||||
$current_project = 'test';
|
$current_project = 'test';
|
||||||
require_once __DIR__ . '/../auth.php';
|
require_once __DIR__ . '/../auth.php';
|
||||||
|
|
||||||
// 2. Nutzerdaten abrufen
|
// 2. Nutzerdaten abrufen
|
||||||
$loggedInUser = isset($_SESSION['user_email']) ? $_SESSION['user_email'] : 'Gast';
|
$loggedInUser = isset($_SESSION['user_email']) ? $_SESSION['user_email'] : 'neuankoemmling@beispiel.de';
|
||||||
$isAdmin = !empty($_SESSION['is_admin']);
|
$isAdmin = !empty($_SESSION['is_admin']);
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
@ -17,251 +24,216 @@ $isAdmin = !empty($_SESSION['is_admin']);
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Web Audio Synth | Test-Modul</title>
|
<title>Erster Login-Check: Erfolgreich!</title>
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--primary: #06b6d4;
|
--primary: #ff00ff;
|
||||||
--secondary: #10b981;
|
--secondary: #00ff00;
|
||||||
--bg: #020617;
|
--bg: #222;
|
||||||
--surface: #0b1120;
|
--text: #fff;
|
||||||
--card-border: #1e293b;
|
--accent: #ffff00;
|
||||||
--text: #f8fafc;
|
|
||||||
--muted: #94a3b8;
|
|
||||||
--accent: #d946ef;
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: var(--bg);
|
background-color: var(--bg);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
font-family: 'Comic Sans MS', 'Comic Sans', cursive, sans-serif;
|
||||||
min-height: 100vh;
|
margin: 0;
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Top Bar */
|
.top-bar {
|
||||||
.top-nav {
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 16px;
|
top: 15px;
|
||||||
left: 20px;
|
left: 15px;
|
||||||
right: 20px;
|
z-index: 100;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
gap: 10px;
|
||||||
align-items: center;
|
font-family: sans-serif;
|
||||||
z-index: 50;
|
font-size: 13px;
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-links {
|
.top-bar a {
|
||||||
display: flex;
|
color: #fff;
|
||||||
gap: 12px;
|
background: #000;
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-nav a {
|
|
||||||
color: var(--muted);
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 8px 14px;
|
padding: 8px 14px;
|
||||||
background: rgba(11, 17, 32, 0.85);
|
border: 2px solid var(--accent);
|
||||||
border: 1px solid var(--card-border);
|
border-radius: 8px;
|
||||||
border-radius: 10px;
|
text-decoration: none;
|
||||||
backdrop-filter: blur(8px);
|
font-weight: bold;
|
||||||
transition: all 0.2s ease;
|
transition: transform 0.1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-nav a:hover {
|
.top-bar a:hover {
|
||||||
color: var(--primary);
|
transform: scale(1.05);
|
||||||
border-color: rgba(6, 182, 212, 0.4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-nav a.admin-link {
|
.top-bar a.admin-btn {
|
||||||
color: var(--primary);
|
color: #000;
|
||||||
border-color: rgba(6, 182, 212, 0.3);
|
background: var(--secondary);
|
||||||
background: rgba(6, 182, 212, 0.08);
|
border-color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-nav a.admin-link:hover {
|
|
||||||
background: rgba(6, 182, 212, 0.18);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Container */
|
|
||||||
.container {
|
.container {
|
||||||
background: var(--surface);
|
background: #333;
|
||||||
border: 1px solid var(--card-border);
|
border: 8px solid var(--primary);
|
||||||
padding: 40px;
|
padding: 40px;
|
||||||
max-width: 540px;
|
max-width: 600px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 28px;
|
border-radius: 30px;
|
||||||
box-shadow: 0 0 50px rgba(6, 182, 212, 0.08);
|
transform: rotate(-1.5deg);
|
||||||
|
box-shadow: 20px 20px 0px var(--secondary);
|
||||||
position: relative;
|
position: relative;
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
height: 2px;
|
|
||||||
background: linear-gradient(90deg, transparent, var(--primary), transparent);
|
|
||||||
border-radius: 28px 28px 0 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
margin-bottom: 24px;
|
text-align: center;
|
||||||
}
|
border-bottom: 4px dashed var(--accent);
|
||||||
|
margin-bottom: 20px;
|
||||||
.badge {
|
transform: rotate(2deg);
|
||||||
display: inline-block;
|
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
||||||
font-size: 10px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.15em;
|
|
||||||
color: var(--primary);
|
|
||||||
background: rgba(6, 182, 212, 0.1);
|
|
||||||
border: 1px solid rgba(6, 182, 212, 0.25);
|
|
||||||
padding: 4px 10px;
|
|
||||||
border-radius: 9999px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
color: var(--text);
|
color: var(--secondary);
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
text-shadow: 3px 3px 0px var(--primary);
|
||||||
font-size: 1.6rem;
|
font-size: 2.2rem;
|
||||||
font-weight: 800;
|
margin-bottom: 5px;
|
||||||
letter-spacing: -0.02em;
|
line-height: 1.2;
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-info {
|
.user-info {
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
background: #444;
|
||||||
font-size: 11px;
|
padding: 5px 15px;
|
||||||
color: var(--muted);
|
display: inline-block;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border: 2px solid var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content {
|
.main-content {
|
||||||
margin: 28px 0;
|
text-align: center;
|
||||||
|
margin: 30px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.description {
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--muted);
|
|
||||||
line-height: 1.6;
|
|
||||||
margin-bottom: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Sound Button */
|
|
||||||
#whoopee-cushion {
|
#whoopee-cushion {
|
||||||
width: 140px;
|
width: 160px;
|
||||||
height: 140px;
|
height: 160px;
|
||||||
background: radial-gradient(circle, #f43f5e 0%, #be123c 100%);
|
background: #ff4d4d;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 4px solid #e11d48;
|
border: 6px solid #b30000;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
font-size: 14px;
|
||||||
font-size: 11px;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
transition: transform 0.08s, box-shadow 0.08s;
|
transition: transform 0.05s;
|
||||||
box-shadow: 0 10px 0 #881337, 0 15px 25px rgba(244, 63, 94, 0.3);
|
box-shadow: 0 12px 0 #b30000;
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#whoopee-cushion:active {
|
#whoopee-cushion:active {
|
||||||
transform: translateY(8px) scale(0.95);
|
transform: translateY(10px) scale(0.92);
|
||||||
box-shadow: 0 2px 0 #881337, 0 5px 15px rgba(244, 63, 94, 0.2);
|
box-shadow: 0 2px 0 #b30000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#whoopee-cushion::after {
|
||||||
|
content: "HIER DRÜCKEN!";
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.fart-cloud {
|
.fart-cloud {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: rgba(16, 185, 129, 0.4);
|
background: rgba(180, 255, 100, 0.7);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
animation: float-up 1.2s ease-out forwards;
|
animation: float-up 1.5s ease-out forwards;
|
||||||
filter: blur(8px);
|
filter: blur(5px);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes float-up {
|
@keyframes float-up {
|
||||||
0% { transform: translateY(0) scale(0.6); opacity: 0.7; }
|
0% { transform: translateY(0) scale(0.5); opacity: 0.8; }
|
||||||
100% { transform: translateY(-130px) scale(3.5); opacity: 0; }
|
100% { transform: translateY(-150px) scale(4); opacity: 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-msg {
|
.logout-btn {
|
||||||
margin-top: 20px;
|
display: block;
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
width: fit-content;
|
||||||
font-size: 11px;
|
margin: 30px auto 0;
|
||||||
color: var(--muted);
|
background: var(--accent);
|
||||||
|
color: #000;
|
||||||
|
padding: 12px 25px;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
border-radius: 10px;
|
||||||
|
transform: rotate(-2deg);
|
||||||
|
border: 4px solid #000;
|
||||||
|
transition: 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout-btn:hover {
|
||||||
|
transform: rotate(0deg) scale(1.1);
|
||||||
|
background: #ff3300;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shake {
|
.shake {
|
||||||
animation: shake 0.35s cubic-bezier(.36,.07,.19,.97) both;
|
animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes shake {
|
@keyframes shake {
|
||||||
10%, 90% { transform: translate3d(-2px, 0, 0); }
|
10%, 90% { transform: translate3d(-2px, 0, 0) rotate(-1.5deg); }
|
||||||
20%, 80% { transform: translate3d(3px, 0, 0); }
|
20%, 80% { transform: translate3d(4px, 0, 0) rotate(-2deg); }
|
||||||
30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
|
30%, 50%, 70% { transform: translate3d(-6px, 0, 0) rotate(-1deg); }
|
||||||
40%, 60% { transform: translate3d(4px, 0, 0); }
|
40%, 60% { transform: translate3d(6px, 0, 0) rotate(-1.8deg); }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- Top Navigation -->
|
<div class="top-bar">
|
||||||
<nav class="top-nav">
|
|
||||||
<div class="nav-links">
|
|
||||||
<a href="/">← Website</a>
|
<a href="/">← Website</a>
|
||||||
<?php if ($isAdmin): ?>
|
<?php if ($isAdmin): ?>
|
||||||
<a href="/admin" class="admin-link">Admin Dashboard</a>
|
<a href="/admin" class="admin-btn">Admin-Bereich</a>
|
||||||
<a href="/admin/users" class="admin-link">Benutzerverwaltung</a>
|
<a href="/admin/users" class="admin-btn">Benutzerverwaltung</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-links">
|
|
||||||
<a href="/login/logout" style="color: #f43f5e;">Logout</a>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="container" id="app-container">
|
<div class="container" id="app-container">
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<span class="badge">Web Audio API / Test-Modul</span>
|
<h1>Willkommen beim ersten Check! 🎉</h1>
|
||||||
<h1>Web Audio Synth</h1>
|
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
Angemeldet: <span><?php echo htmlspecialchars($loggedInUser); ?></span>
|
Eingeloggt als: <strong><?php echo htmlspecialchars($loggedInUser); ?></strong>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="main-content">
|
<main class="main-content">
|
||||||
<p class="description">
|
<p><strong>Glückwunsch!</strong> Deine Zugangsdaten sind korrekt und du bist erfolgreich im System gelandet.</p>
|
||||||
Interaktiver Audiotest zur dynamischen Klangsynthese mit Oszillatoren, Rauschgeneratoren und Filtern über die HTML5 Web Audio API.
|
<p style="font-size: 0.9rem;">Um sicherzugehen, dass auch interaktive Elemente bei dir funktionieren, teste bitte unser hochmodernes Belohnungsmodul:</p>
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="synth-section">
|
<div class="fart-section" style="margin-top: 30px;">
|
||||||
<div id="whoopee-cushion" role="button" tabindex="0">TRIGGER</div>
|
<div id="whoopee-cushion" title="Funktionstest für Sound und Animation"></div>
|
||||||
<p id="status-msg" class="status-msg">Klicke auf den Button, um den Soundtest zu starten.</p>
|
<p id="status-msg" style="margin-top: 20px; font-style: italic; color: #888;">Hinweis: Sound bitte einschalten!</p>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<!-- Link angepasst auf Parameter-Logout -->
|
||||||
|
<a href="?logout=1" class="logout-btn">Test beendet? Hier abmelden!</a>
|
||||||
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -270,11 +242,10 @@ $isAdmin = !empty($_SESSION['is_admin']);
|
||||||
const statusMsg = document.getElementById('status-msg');
|
const statusMsg = document.getElementById('status-msg');
|
||||||
|
|
||||||
function playOrganicFart() {
|
function playOrganicFart() {
|
||||||
const AudioCtx = window.AudioContext || window.webkitAudioContext;
|
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
||||||
const audioCtx = new AudioCtx();
|
|
||||||
if (audioCtx.state === 'suspended') audioCtx.resume();
|
if (audioCtx.state === 'suspended') audioCtx.resume();
|
||||||
|
|
||||||
const duration = 0.4 + Math.random() * 0.4;
|
const duration = 0.4 + Math.random() * 0.5;
|
||||||
const mainGain = audioCtx.createGain();
|
const mainGain = audioCtx.createGain();
|
||||||
|
|
||||||
const osc = audioCtx.createOscillator();
|
const osc = audioCtx.createOscillator();
|
||||||
|
|
@ -327,38 +298,30 @@ $isAdmin = !empty($_SESSION['is_admin']);
|
||||||
lfo.stop(audioCtx.currentTime + duration);
|
lfo.stop(audioCtx.currentTime + duration);
|
||||||
noise.stop(audioCtx.currentTime + duration);
|
noise.stop(audioCtx.currentTime + duration);
|
||||||
|
|
||||||
statusMsg.textContent = "Audio-Synthese aktiv. Interaktionstest bestanden.";
|
statusMsg.textContent = "Interaktionstest: Bestanden! 👍";
|
||||||
statusMsg.style.color = "#10b981";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCloud() {
|
function createCloud() {
|
||||||
const cloud = document.createElement('div');
|
const cloud = document.createElement('div');
|
||||||
cloud.classList.add('fart-cloud');
|
cloud.classList.add('fart-cloud');
|
||||||
const size = Math.random() * 50 + 20;
|
const size = Math.random() * 60 + 20;
|
||||||
cloud.style.width = size + 'px';
|
cloud.style.width = size + 'px';
|
||||||
cloud.style.height = size + 'px';
|
cloud.style.height = size + 'px';
|
||||||
const rect = cushion.getBoundingClientRect();
|
const rect = cushion.getBoundingClientRect();
|
||||||
cloud.style.left = (rect.left + rect.width / 2 - size / 2 + (Math.random() * 80 - 40)) + 'px';
|
cloud.style.left = (rect.left + rect.width / 2 - size / 2 + (Math.random() * 100 - 50)) + 'px';
|
||||||
cloud.style.top = (rect.top + rect.height / 2 - size / 2) + 'px';
|
cloud.style.top = (rect.top + rect.height / 2 - size / 2) + 'px';
|
||||||
document.body.appendChild(cloud);
|
document.body.appendChild(cloud);
|
||||||
setTimeout(() => cloud.remove(), 1200);
|
setTimeout(() => cloud.remove(), 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
cushion.addEventListener('click', () => {
|
cushion.addEventListener('click', () => {
|
||||||
playOrganicFart();
|
playOrganicFart();
|
||||||
container.classList.add('shake');
|
container.classList.add('shake');
|
||||||
setTimeout(() => container.classList.remove('shake'), 350);
|
setTimeout(() => container.classList.remove('shake'), 400);
|
||||||
for(let i = 0; i < 8; i++) {
|
for(let i = 0; i < 12; i++) {
|
||||||
setTimeout(createCloud, i * 80);
|
setTimeout(createCloud, i * 80);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
cushion.addEventListener('keydown', (e) => {
|
|
||||||
if (e.key === 'Enter' || e.key === ' ') {
|
|
||||||
e.preventDefault();
|
|
||||||
cushion.click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in a new issue