{"id":171,"date":"2025-06-24T15:05:45","date_gmt":"2025-06-24T15:05:45","guid":{"rendered":"https:\/\/wendoragames.de\/index.php\/front_page\/"},"modified":"2025-08-29T05:24:15","modified_gmt":"2025-08-29T05:24:15","slug":"front_page","status":"publish","type":"page","link":"https:\/\/wendoragames.de\/","title":{"rendered":""},"content":{"rendered":"\n<style>\n\/* Einfaches Styling (kannst du anpassen) *\/\n#streaming-calendar { background:#41445E; color:#fff; padding:18px; border-radius:10px; box-shadow:0 6px 20px rgba(0,0,0,0.5); }\n#streaming-calendar h2 { color:#ffcc00; margin:0 0 12px 0; text-align:center; }\n.event { display:flex; gap:12px; align-items:center; padding:12px; background:#E1E1E1; border-radius:8px; margin-bottom:10px; transition:transform .15s; }\n.event:hover { transform: translateY(-3px); background:#2c2c42; }\n.event img.icon { width:30px; height:30px; object-fit:contain; }\n.event .info { flex:1; }\n.event .title { font-weight:700; font-size:16px; color:#000000; margin-bottom:6px; }\n.event .meta { color:#494949; font-size:13px; }\n.btn { background:#ff4d4d; color:white; padding:6px 10px; border-radius:6px; text-decoration:none; font-weight:600; }\n.err { color:#ff9999; background:#3b1b1b; padding:10px; border-radius:6px; margin-top:10px; }\n.debugpre { white-space:pre-wrap; background:#0f0f12; padding:10px; border-radius:6px; color:#9ad; font-size:12px; margin-top:8px; }\n<\/style>\n<\/head>\n<body>\n\n<div id=\"streaming-calendar\">Kalender wird geladen&#8230;<\/div>\n\n<script>\n  const API_KEY = \"AIzaSyAGwklWMDyi09jqJwtUeVwCHRd6_uTqe8A\";\n  const CALENDAR_ID = \"8edbff23e682773a99fd7e5954c16f6bc41500f7aa878d6fa35a3c01a17b0851@group.calendar.google.com\";\n  const MAX_RESULTS = 5;\n\n  async function loadCalendar() {\n    const now = new Date().toISOString();\n    const url = `https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/${encodeURIComponent(CALENDAR_ID)}\/events?key=${API_KEY}&timeMin=${now}&singleEvents=true&orderBy=startTime&maxResults=${MAX_RESULTS}`;\n    \n    console.log(\"[StreamingCalendar] Fetch URL:\", url);\n\n    const response = await fetch(url);\n    const data = await response.json();\n\n    const container = document.getElementById(\"streaming-calendar\");\n    container.innerHTML = `<h2>\ud83c\udfae Livestream-Kalender<\/h2>`;\n\n    if (!data.items || data.items.length === 0) {\n      container.innerHTML += \"<p>Keine kommenden Streams gefunden.<\/p>\";\n      return;\n    }\n\n    data.items.forEach(event => {\n      const title = event.summary || \"Ohne Titel\";\n      const start = new Date(event.start.dateTime || event.start.date);\n      const when = `${start.toLocaleDateString(\"de-DE\", {weekday:\"short\", day:\"2-digit\", month:\"short\"})} \u2022 ${start.toLocaleTimeString(\"de-DE\", {hour:\"2-digit\", minute:\"2-digit\"})} Uhr`;\n\nlet platform = \"other\";\nlet linkFromDesc = \"\";\n\nif (event.description) {\n  const desc = event.description.toLowerCase();\n  \n  if (desc.includes(\"youtube.com\") || desc.includes(\"youtube.de\")) {\n    platform = \"youtube\";\n    linkFromDesc = \"https:\/\/www.youtube.com\/@WendoraGames\";\n  } else if (desc.includes(\"twitch.tv\")) {\n    platform = \"twitch\";\n    linkFromDesc = \"https:\/\/twitch.tv\/wendoragames\";\n  }\n\n  \/\/ Falls keine der obigen Bedingungen zutrifft, erste URL aus der Beschreibung ziehen:\n  \/\/ linkFromDesc = event.description.match(\/https?:\\\/\\\/\\S+\/)?.[0] || \"\";\n}\n\n      const platformIcons = {\n        youtube: \"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/b\/b8\/YouTube_Logo_2017.svg\",\n        twitch: \"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/2\/26\/Twitch_logo.svg\",\n        other: \"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/8\/88\/Video_camera_icon.svg\"\n      };\n\n      const platformIcon = platformIcons[platform] || platformIcons.other;\n\n      const html = `\n        <div class=\"event\">\n          <img decoding=\"async\" class=\"icon\" src=\"${platformIcon}\" alt=\"${platform}\">\n          <div class=\"info\">\n            <div class=\"title\">${title}<\/div>\n            <div class=\"meta\">${when}<\/div>\n          <\/div>\n          ${linkFromDesc ? `<a class=\"btn\" href=\"${linkFromDesc}\" target=\"_blank\" rel=\"noopener\">Zum Stream<\/a>` : \"\"}\n        <\/div>\n      `;\n      container.innerHTML += html;\n    });\n  }\n\n  loadCalendar();\n<\/script>\n\n<\/body>\n<\/html>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kalender wird geladen&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-171","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/pages\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":64,"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/pages\/171\/revisions"}],"predecessor-version":[{"id":497,"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/pages\/171\/revisions\/497"}],"wp:attachment":[{"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/media?parent=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}