commit 732c0971b11163e022a957a62fa44e3bae213da2
parent f5a116e1b3cb1e0b7a4741d82b08e00f54f7a749
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Fri, 31 May 2024 22:41:39 +0200
fix external link marker
Diffstat:
A | index.php | | | 96 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
M | template.html | | | 2 | +- |
2 files changed, 97 insertions(+), 1 deletion(-)
diff --git a/index.php b/index.php
@@ -0,0 +1,96 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-or-later
+ SPDX-FileCopyrightText: 2024 JayVii <jayvii[AT]posteo[DOT]de>
+-->
+
+<!DOCTYPE html>
+<html>
+
+<?php
+
+if (unset($_POST["streams"])) {
+
+ // Prepare streams array
+ $streams = array(
+ "video_id" => array(),
+ "video_title" => array(),
+ "video_desc" => array(),
+ "video_date" => array(),
+ "channel_id" => array(),
+ "channel_name" => array()
+ );
+ $loading_screen = true;
+
+} else {
+
+ $streams = unserialize($_POST["streams"]);
+ $loading_screen = false;
+
+}
+
+// Streams or Loading Screen
+if (!$loading_screen) {
+ // Load Stream Data
+ include("lib/load_streams.php");
+ // Build HTML from Stream Data
+ include("lib/build_html.php");
+} else {
+ // Load Loading Screen content
+ include("lib/loadingscreen.php");
+}
+
+?>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Twitch Streams</title>
+ <link rel="icon" type="image/png" href="assets/img/twitch.png">
+ <link rel="icon" type="image/png" sizes="16x16" href="assets/img/twitch_16.png">
+ <link rel="icon" type="image/png" sizes="32x32" href="assets/img/twitch_32.png">
+ <link rel="icon" type="image/png" sizes="64x64" href="assets/img/twitch_64.png">
+ <link rel="icon" type="image/png" sizes="128x128" href="assets/img/twitch_128.png">
+ <link rel="apple-touch-icon" href="assets/img/twitch.png">
+ <link rel="stylesheet" type="text/css" href="assets/css/stylesheet.css"/>
+ <link rel="stylesheet" href="assets/css/loading.css" />
+ <link rel="stylesheet" href="assets/css/custom.css" />
+ <script async src="assets/js/twitch.js"></script>
+ <link crossorigin="use-credentials" rel="manifest" href="manifest.json">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ </head>
+
+ <body class="list dark">
+ <main class="main">
+
+ <h1>Streams</h1>
+
+ <!-- Save Button -->
+ <button class="button" onclick="<?php echo "document.cookie='streams=" . implode(",", $streams["stream"]) . ";path=/;max-age=31536000;';" ?>" style="<?php echo "color:" . $save_col; ?>">
+ 🖫 Save
+ </button>
+
+ <!-- Reload Button -->
+ <a href="<?php echo "/?streams=" . implode(",", $streams["stream"]); ?>">
+ <button class="button">
+ ↻ Reload
+ </button>
+ </a>
+
+ <button class="button">
+ Live: <?php echo array_sum($streams["status"]); ?>
+ </button>
+
+ <br>
+
+ <!-- Search Bar -->
+ <form action="https://www.twitch.tv/search" method="GET" style="width:100%;">
+ <input id="searchbar" type="text" id="searchInput" name="term" placeholder="🔍 Search...">
+ </form><br>
+
+<?php
+
+echo $content;
+
+?>
+
+ </main>
+ </body>
+</html>
diff --git a/template.html b/template.html
@@ -23,7 +23,7 @@
img, iframe { height: auto; width: 100%; margin-top: 1em; margin-bottom: 1em; border: 0; }
iframe { aspect-ratio: 16/9; }
a[href^="https"]:where([href*="www.youtube.com"])::after {
- content: "︎ ↗";
+ content: " \2197";
}
#searchbar {
width: 100%;