{"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":"2026-05-16T13:45:58","modified_gmt":"2026-05-16T13:45:58","slug":"front_page","status":"publish","type":"page","link":"https:\/\/wendoragames.de\/","title":{"rendered":""},"content":{"rendered":"\n<style>\n#streaming-calendar {\n  background:#41445E;\n  color:#fff;\n  padding:18px;\n  border-radius:10px;\n  box-shadow:0 6px 20px rgba(0,0,0,0.5);\n}\n\n#streaming-calendar h2 {\n  color:#ffcc00;\n  margin:0 0 12px 0;\n  text-align:center;\n  font-size:22px;\n}\n\n.event {\n  display:grid;\n  grid-template-columns:30px 120px 1fr auto;\n  gap:12px;\n  align-items:center;\n  padding:12px;\n  background:#E1E1E1;\n  border-radius:8px;\n  margin-bottom:10px;\n  transition:transform .15s;\n}\n\n.event:hover {\n  transform:translateY(-3px);\n  background:#2c2c42;\n}\n\n.event:hover .title,\n.event:hover .meta {\n  color:#fff;\n}\n\n.event img.icon {\n  width:30px;\n  height:30px;\n  object-fit:contain;\n}\n\n.game-cover {\n  width:120px;\n  height:56px;\n  object-fit:cover;\n  border-radius:8px;\n  border:2px solid #9147ff;\n}\n\n.event .info {\n  min-width:0;\n}\n\n.event .title {\n  font-weight:700;\n  font-size:16px;\n  color:#000;\n  margin-bottom:6px;\n  line-height:1.25;\n}\n\n.event .meta {\n  color:#494949;\n  font-size:13px;\n  line-height:1.4;\n}\n\n.btn {\n  background:#9147ff;\n  color:white;\n  padding:6px 10px;\n  border-radius:6px;\n  text-decoration:none;\n  font-weight:600;\n  white-space:nowrap;\n}\n\n\/* Handy *\/\n@media (max-width: 600px) {\n\n  #streaming-calendar {\n    padding:12px;\n    border-radius:8px;\n  }\n\n  #streaming-calendar h2 {\n    font-size:19px;\n  }\n\n  .event {\n    grid-template-columns:32px 1fr;\n    gap:10px;\n    align-items:start;\n  }\n\n  .event img.icon {\n    grid-column:1;\n    grid-row:1;\n    width:28px;\n    height:28px;\n    margin-top:4px;\n  }\n\n  .game-cover {\n    grid-column:1 \/ -1;\n    grid-row:2;\n    width:100%;\n    height:120px;\n  }\n\n  .event .info {\n    grid-column:2;\n    grid-row:1;\n  }\n\n  .btn {\n    grid-column:1 \/ -1;\n    grid-row:3;\n    display:block;\n    text-align:center;\n    padding:10px;\n    margin-top:4px;\n  }\n}\n<\/style>\n\n<div id=\"streaming-calendar\">\n  Kalender wird geladen&#8230;\n<\/div>\n\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/ical.js@1.5.0\/build\/ical.min.js\"><\/script>\n\n<script>\n\nconst TWITCH_CALENDAR = \"\/twitch-calendar.php\";\n\nconst RAWG_API_KEY =\n  \"4d88e6e282134204be22e3d3eebbd7a9\";\n\nconst TWITCH_LINK =\n  \"https:\/\/twitch.tv\/wendoragames\";\n\nconst TWITCH_ICON =\n  \"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/2\/26\/Twitch_logo.svg\";\n\nconst FALLBACK_IMAGE =\n  \"https:\/\/placehold.co\/120x56\/1e1e2e\/ffffff?text=Game\";\n\nasync function getGameImage(gameName) {\n\n  try {\n\n    const response = await fetch(\n      `https:\/\/api.rawg.io\/api\/games?key=${RAWG_API_KEY}&search=${encodeURIComponent(gameName)}`\n    );\n\n    const data = await response.json();\n\n    return data.results?.[0]?.background_image || FALLBACK_IMAGE;\n\n  } catch (error) {\n\n    console.error(\"RAWG Fehler:\", error);\n\n    return FALLBACK_IMAGE;\n  }\n}\n\nasync function loadCalendar() {\n\n  const response = await fetch(TWITCH_CALENDAR);\n\n  const text = await response.text();\n\n  const jcalData = ICAL.parse(text);\n\n  const comp = new ICAL.Component(jcalData);\n\n  const events = comp.getAllSubcomponents(\"vevent\");\n\n  const container =\n    document.getElementById(\"streaming-calendar\");\n\n  container.innerHTML =\n    `<h2>\ud83c\udfae Livestream-Kalender<\/h2>`;\n\n  if (!events.length) {\n\n    container.innerHTML +=\n      \"<p>Keine Streams gefunden.<\/p>\";\n\n    return;\n  }\n\n  const sortedEvents = events\n  .map(vevent => new ICAL.Event(vevent))\n  .filter(event => event.startDate.toJSDate() >= new Date())\n  .sort((a, b) => a.startDate.toJSDate() - b.startDate.toJSDate())\n  .slice(0, 5);\n\n for (const event of sortedEvents) {\n    const title =\n      event.summary || \"Ohne Titel\";\n    const start =\n      event.startDate.toJSDate();\n    const when =\n      `${start.toLocaleDateString(\"de-DE\", {\n        weekday:\"short\",\n        day:\"2-digit\",\n        month:\"short\"\n      })} \u2022 ${start.toLocaleTimeString(\"de-DE\", {\n        hour:\"2-digit\",\n        minute:\"2-digit\"\n      })} Uhr`;\n\n    let gameName =\n      event.description || \"Unknown Game\";\n\n    gameName =\n      gameName.trim().replace(\/\\.$\/, \"\");\n\n    const gameImage =\n      await getGameImage(gameName);\n\n    const html = `\n      <div class=\"event\">\n\n        <img decoding=\"async\" class=\"icon\"\n             src=\"${TWITCH_ICON}\"\n             alt=\"Twitch\">\n\n        <img decoding=\"async\" class=\"game-cover\"\n             src=\"${gameImage}\"\n             alt=\"${gameName}\"\n             onerror=\"this.src='${FALLBACK_IMAGE}'\">\n\n        <div class=\"info\">\n\n          <div class=\"title\">\n            ${title}\n          <\/div>\n\n          <div class=\"meta\">\n            \ud83c\udfae ${gameName}<br>\n            \ud83d\udcc5 ${when}\n          <\/div>\n\n        <\/div>\n        <a class=\"btn\"\n           href=\"${TWITCH_LINK}\"\n           target=\"_blank\"\n           rel=\"noopener\">\n           Zum Stream\n        <\/a>\n      <\/div>\n    `;\n    container.innerHTML += html;\n  }\n}\nloadCalendar();\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><\/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":77,"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/pages\/171\/revisions"}],"predecessor-version":[{"id":623,"href":"https:\/\/wendoragames.de\/index.php\/wp-json\/wp\/v2\/pages\/171\/revisions\/623"}],"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}]}}