philippurbschat.de/cooles-feature/index.php

286 lines
No EOL
9.7 KiB
PHP

<?php
// Session starten, falls noch nicht geschehen
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Einfache Logout-Logik direkt in dieser Datei
if (isset($_GET['logout'])) {
session_destroy();
// Seite neu laden ohne Parameter
header("Location: index.php");
exit;
}
// 1. Projekt identifizieren und schützen
$current_project = 'cooles-feature';
require_once '../auth.php';
// 2. Nutzerdaten abrufen
$loggedInUser = isset($_SESSION['user_email']) ? $_SESSION['user_email'] : 'neuankoemmling@beispiel.de';
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Erster Login-Check: Erfolgreich!</title>
<style>
:root {
--primary: #ff00ff;
--secondary: #00ff00;
--bg: #222;
--text: #fff;
--accent: #ffff00;
}
body {
background-color: var(--bg);
color: var(--text);
font-family: 'Comic Sans MS', 'Comic Sans', cursive, sans-serif;
margin: 0;
padding: 20px;
overflow-x: hidden;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
background: #333;
border: 8px solid var(--primary);
padding: 40px;
max-width: 600px;
width: 100%;
border-radius: 30px;
transform: rotate(-1.5deg);
box-shadow: 20px 20px 0px var(--secondary);
position: relative;
}
.header {
text-align: center;
border-bottom: 4px dashed var(--accent);
margin-bottom: 20px;
transform: rotate(2deg);
}
h1 {
color: var(--secondary);
text-shadow: 3px 3px 0px var(--primary);
font-size: 2.2rem;
margin-bottom: 5px;
line-height: 1.2;
}
.user-info {
background: #444;
padding: 5px 15px;
display: inline-block;
border-radius: 10px;
margin-bottom: 10px;
border: 2px solid var(--accent);
}
.main-content {
text-align: center;
margin: 30px 0;
}
#whoopee-cushion {
width: 160px;
height: 160px;
background: #ff4d4d;
border-radius: 50%;
border: 6px solid #b30000;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
font-weight: bold;
color: white;
text-align: center;
margin: 0 auto;
position: relative;
user-select: none;
transition: transform 0.05s;
box-shadow: 0 12px 0 #b30000;
}
#whoopee-cushion:active {
transform: translateY(10px) scale(0.92);
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 {
position: absolute;
background: rgba(180, 255, 100, 0.7);
border-radius: 50%;
pointer-events: none;
z-index: 10;
animation: float-up 1.5s ease-out forwards;
filter: blur(5px);
}
@keyframes float-up {
0% { transform: translateY(0) scale(0.5); opacity: 0.8; }
100% { transform: translateY(-150px) scale(4); opacity: 0; }
}
.logout-btn {
display: block;
width: fit-content;
margin: 30px auto 0;
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 {
animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
10%, 90% { transform: translate3d(-2px, 0, 0) rotate(-1.5deg); }
20%, 80% { transform: translate3d(4px, 0, 0) rotate(-2deg); }
30%, 50%, 70% { transform: translate3d(-6px, 0, 0) rotate(-1deg); }
40%, 60% { transform: translate3d(6px, 0, 0) rotate(-1.8deg); }
}
</style>
</head>
<body>
<div class="container" id="app-container">
<header class="header">
<h1>Willkommen beim ersten Check! 🎉</h1>
<div class="user-info">
Eingeloggt als: <strong><?php echo htmlspecialchars($loggedInUser); ?></strong>
</div>
</header>
<main class="main-content">
<p><strong>Glückwunsch!</strong> Deine Zugangsdaten sind korrekt und du bist erfolgreich im System gelandet.</p>
<p style="font-size: 0.9rem;">Um sicherzugehen, dass auch interaktive Elemente bei dir funktionieren, teste bitte unser hochmodernes Belohnungsmodul:</p>
<div class="fart-section" style="margin-top: 30px;">
<div id="whoopee-cushion" title="Funktionstest für Sound und Animation"></div>
<p id="status-msg" style="margin-top: 20px; font-style: italic; color: #888;">Hinweis: Sound bitte einschalten!</p>
</div>
</main>
<footer>
<!-- Link angepasst auf Parameter-Logout -->
<a href="?logout=1" class="logout-btn">Test beendet? Hier abmelden!</a>
</footer>
</div>
<script>
const cushion = document.getElementById('whoopee-cushion');
const container = document.getElementById('app-container');
const statusMsg = document.getElementById('status-msg');
function playOrganicFart() {
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
if (audioCtx.state === 'suspended') audioCtx.resume();
const duration = 0.4 + Math.random() * 0.5;
const mainGain = audioCtx.createGain();
const osc = audioCtx.createOscillator();
const oscGain = audioCtx.createGain();
osc.type = 'sawtooth';
osc.frequency.setValueAtTime(45 + Math.random() * 20, audioCtx.currentTime);
osc.frequency.exponentialRampToValueAtTime(20, audioCtx.currentTime + duration);
const lfo = audioCtx.createOscillator();
const lfoGain = audioCtx.createGain();
lfo.type = 'square';
lfo.frequency.setValueAtTime(14 + Math.random() * 8, audioCtx.currentTime);
lfoGain.gain.setValueAtTime(0.8, audioCtx.currentTime);
lfo.connect(lfoGain);
lfoGain.connect(oscGain.gain);
const bufferSize = audioCtx.sampleRate * duration;
const noiseBuffer = audioCtx.createBuffer(1, bufferSize, audioCtx.sampleRate);
const noiseData = noiseBuffer.getChannelData(0);
for (let i = 0; i < bufferSize; i++) {
noiseData[i] = Math.random() * 2 - 1;
}
const noise = audioCtx.createBufferSource();
noise.buffer = noiseBuffer;
const noiseFilter = audioCtx.createBiquadFilter();
noiseFilter.type = 'bandpass';
noiseFilter.frequency.setValueAtTime(400, audioCtx.currentTime);
const lowPass = audioCtx.createBiquadFilter();
lowPass.type = 'lowpass';
lowPass.frequency.setValueAtTime(450, audioCtx.currentTime);
lowPass.frequency.exponentialRampToValueAtTime(80, audioCtx.currentTime + duration);
mainGain.gain.setValueAtTime(0, audioCtx.currentTime);
mainGain.gain.linearRampToValueAtTime(0.5, audioCtx.currentTime + 0.05);
mainGain.gain.exponentialRampToValueAtTime(0.01, audioCtx.currentTime + duration);
osc.connect(oscGain);
oscGain.connect(lowPass);
noise.connect(noiseFilter);
noiseFilter.connect(lowPass);
lowPass.connect(mainGain);
mainGain.connect(audioCtx.destination);
osc.start();
lfo.start();
noise.start();
osc.stop(audioCtx.currentTime + duration);
lfo.stop(audioCtx.currentTime + duration);
noise.stop(audioCtx.currentTime + duration);
statusMsg.textContent = "Interaktionstest: Bestanden! 👍";
}
function createCloud() {
const cloud = document.createElement('div');
cloud.classList.add('fart-cloud');
const size = Math.random() * 60 + 20;
cloud.style.width = size + 'px';
cloud.style.height = size + 'px';
const rect = cushion.getBoundingClientRect();
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';
document.body.appendChild(cloud);
setTimeout(() => cloud.remove(), 1500);
}
cushion.addEventListener('click', () => {
playOrganicFart();
container.classList.add('shake');
setTimeout(() => container.classList.remove('shake'), 400);
for(let i = 0; i < 12; i++) {
setTimeout(createCloud, i * 80);
}
});
</script>
</body>
</html>