poke/html/search-web-main.ejs

328 lines
12 KiB
Text
Raw Normal View History

2023-11-02 16:58:23 +01:00
<!DOCTYPE html>
2023-10-31 16:45:11 +01:00
<!--[if IE 6]><html class="ie6" xmlns="http://www.w3.org/1999/xhtml"><![endif]-->
<!--[if IE 7]><html class="lt-ie8 lt-ie9" xmlns="http://www.w3.org/1999/xhtml"><![endif]-->
<!--[if IE 8]><html class="lt-ie9" xmlns="http://www.w3.org/1999/xhtml"><![endif]-->
<!--[if gt IE 8]><!--><html xmlns="http://www.w3.org/1999/xhtml"><!--<![endif]-->
<head>
<title>PokeSearch</title>
2023-11-02 18:29:59 +01:00
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=1" />
2023-10-31 16:45:11 +01:00
<link rel="manifest" href="/manifest.json">
<link href=/css/yt-ukraine.svg?v=6 rel=icon>
<link href=https://p.poketube.fun/https://site-assets.fontawesome.com/releases/v6.1.1/css/all.css rel=stylesheet>
2023-11-01 16:18:31 +01:00
<link rel="stylesheet" href="/css/search-web.main.css?v=4">
2023-11-02 16:58:23 +01:00
<script type="text/javascript">
/* Patch IE to support forEach on NodeLists, used in show/hide */
if (window.NodeList && !NodeList.prototype.forEach)
NodeList.prototype.forEach = Array.prototype.forEach;
</script>
<style>
2023-11-02 04:55:41 +01:00
@keyframes gradient {
0% {
background-position: 0 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0 50%;
}
}
.body--home, .site-wrapper--home {
background-image: radial-gradient(circle, #231638, #2b160e, #09250e, #0f132b);
animation: gradient 64s ease infinite;
background-size: 400% 400%;
}
.downnav {
2023-11-01 16:18:31 +01:00
position: fixed;
padding:10px;
bottom: 0;
left: 0;
width: 100%;
margin: auto;
overflow: hidden;
z-index: 1;
color:#fff;
background-color: #0f0f0f;
}</style>
<script>
<!--//--><![CDATA[//><!--
/**
* @licstart The following is the entire license notice for the JavaScript
* code in this page.
*
* Copyright (C) 2021-2023 PokeTube Project (https://codeberg.org/Ashley/poketube)
*
* The JavaScript code in this page is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License
* (GNU GPL) as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version. The code is
* distributed WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GPL
* for more details.
*
* As additional permission under GNU GPL version 3 section 7, you may
* distribute non-source (e.g., minimized or compacted) forms of that code
* without the copy of the GNU GPL normally required by section 4, provided
* you include this license notice and a URL through which recipients can
* access the Corresponding Source.
*
* @licend The above is the entire license notice for the JavaScript code
* in this page.
*/
//--><!]]>
</script>
2023-10-31 16:45:11 +01:00
</head>
<body class="body--home body--html">
2023-11-02 15:15:24 +01:00
<script> /**
* Generates a random number between a specified range.
*
* @param {number} min - The minimum value (inclusive).
* @param {number} max - The maximum value (inclusive).
* @returns {number} A random number within the specified range.
*/
function getRandomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
2023-11-01 16:18:31 +01:00
2023-11-02 15:15:24 +01:00
/**
* Capitalizes the first letter of a string.
*
* @param {string} string - The input string.
* @returns {string} The input string with the first letter capitalized.
*/
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
2023-11-01 16:18:31 +01:00
2023-11-02 15:15:24 +01:00
/**
* Checks if a string contains a specific substring.
*
* @param {string} mainString - The main string to search in.
* @param {string} subString - The substring to look for.
* @returns {boolean} True if the substring is found, otherwise false.
*/
function stringContains(mainString, subString) {
return mainString.includes(subString);
}
/**
* Calculates the square of a number.
*
* @param {number} number - The input number.
* @returns {number} The square of the input number.
*/
function calculateSquare(number) {
return number * number;
}
/**
* Returns the current date as a string in the format 'YYYY-MM-DD'.
*
* @returns {string} The current date in 'YYYY-MM-DD' format.
*/
function getCurrentDate() {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
/**
* Redirects the current browser window to a new URL.
*
* @param {string} url - The URL to redirect to.
*/
function redirectToURL(url) {
window.location.href = url;
}
/**
* Scrolls to the top of the current page.
*/
function scrollToTop() {
window.scrollTo(0, 0);
}
/**
* Opens a new browser window with the specified URL.
*
* @param {string} url - The URL to open in the new window.
*/
function openNewWindow(url) {
window.open(url, '_blank');
}
/**
* Reloads the current browser window.
*/
function reloadWindow() {
window.location.reload();
}</script>
<script>
/**
* Makes a GET request to the specified URL using the Fetch API.
*
* @param {string} url - The URL to send the GET request to.
* @returns {Promise} A Promise that resolves to the response data.
*/
function fetchData(url) {
return fetch(url)
.then((response) => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
});
}
/**
* Makes a POST request to the specified URL using the Fetch API.
*
* @param {string} url - The URL to send the POST request to.
* @param {Object} data - The data to send in the request body.
* @returns {Promise} A Promise that resolves to the response data.
*/
function postData(url, data) {
return fetch(url, {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json',
},
})
.then((response) => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
});
}
</script>
2023-10-31 16:45:11 +01:00
<div class="header-wrap--home"></div>
<div id="content_wrapper_homepage" class="content-wrap--home">
<div id="content_homepage" class="content--home">
<div class="logo-wrap--home">
2023-11-02 04:55:41 +01:00
<img src="/css/logo-search.svg?v=393939">
2023-10-31 16:45:11 +01:00
</div>
<div class="search-wrap--home">
2023-12-26 15:47:45 +01:00
<form name="x" id="search_form_homepage" class="search" action="/web" method="get">
<input placeholder="Search the web" name="query" autocomplete="off" id="search_form_input_homepage" class="search__input" type="text" autofocus />
<div>
<button class="btn btn-success" type="submit" style="margin-top: 1em;margin-left: auto;text-align: center;display: flex;flex-direction: column;background: #fff;background-color: #303134;border: 1px solid #303134;border-radius: 4px;color: #e8eaed;font-family: arial,sans-serif;font-size: 14px;padding: 0 16px;line-height: 27px;height: 36px;min-width: 54px;margin-right: 13em;text-align: center;cursor: pointer;user-select: none;">
<p style="margin-top: auto;margin-bottom: auto;font-weight: 1000;margin-left: 6px;font-stretch: ultra-expanded;font-family:&quot;poketube flex&quot;;Poketube flex;">Search Poke</p>
</button>
2023-12-29 07:39:31 +01:00
<button class="btn btn-success" name="lucky" value="true" type="submit" style="margin-top: 1em;margin-left: auto;text-align: center;display: flex;flex-direction: column;background: #fff;background-color: #303134;border: 1px solid #303134;border-radius: 4px;color: #e8eaed;font-family: arial,sans-serif;font-size: 14px;padding: 0 16px;line-height: 27px;height: 36px;min-width: 54px;margin-right: 9em;text-align: center;cursor: pointer;user-select: none;margin-top: -38px;margin-left: 21em;">
2023-12-26 15:47:45 +01:00
<p style="margin-top: auto;margin-bottom: auto;font-weight: 1000;margin-left: 6px;font-stretch: ultra-expanded;font-family:&quot;poketube flex&quot;;Poketube flex;">Im feeling lucky</p>
</button>
</div>
</form>
2023-10-31 16:45:11 +01:00
2023-11-01 16:18:31 +01:00
<div class="downnav">
2023-11-28 09:23:28 +01:00
<span style="color:#fff;" id="weatherInfo"></span> - <a style="color:#fff" href="/map"> PokeMaps </a> - <a style="color:#fff" href="/account-create">My Account</a> - <a style="color:#fff" href="/privacy">Privacy</a> - <a style="color:#fff" href="https://codeberg.org/ashley/poketube">Git</a>
2023-11-01 16:18:31 +01:00
<div style="float: right;">
<a style="color:#fff" id="osInfo"></a> <a style="color:#fff;margin-right: 1em;" href="/license">License</a>
</div>
</div>
2023-10-31 16:45:11 +01:00
2023-11-01 16:18:31 +01:00
<script>
const userAgent = navigator.userAgent.toLowerCase();
let osName = "";
if (userAgent.includes("windows")) {
osName = "Windows";
} else if (userAgent.includes("mac") || userAgent.includes("macintosh")) {
osName = "MacOS";
} else if (userAgent.includes("linux")) {
osName = "GNU/Linux";
} else if (userAgent.includes("android")) {
osName = "Android";
} else if (userAgent.includes("ios") || userAgent.includes("iphone") || userAgent.includes("ipad")) {
osName = "iOS";
}
const osInfoElement = document.getElementById("osInfo");
osInfoElement.textContent = `${osName} - `;
</script> <script>
const css = localStorage.getItem("poke-custom-css");
var head = document.head
var style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet){
// This is required for IE8 and below.
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
var script_tag = document.createElement('script');
script_tag.type = 'text/javascript';
script_tag.text = localStorage.getItem("poke-custom-script");
document.head.appendChild(script_tag);
var config = {}
config.plausible_enabled = false
if (window.location.hostname === "poketube.fun" && config.plausible_enabled == true) {
const plausble_main = "https://telemetry.poketube.fun/js/p.js";
const script = document.createElement("script");
const isTrackingEnabled = localStorage.getItem("plausible-enabled") !== "false";
if (isTrackingEnabled) {
script.defer = true;
script.src = plausble_main;
script.dataset.domain = "poketube.fun";
document.head.appendChild(script);
}
}
2023-11-02 16:58:23 +01:00
// Function to fetch weather data and update the element
function fetchAndDisplayWeather() {
const url = 'https://wttr.in/?format=%c%t+%l';
fetch(url)
.then((response) => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text(); // Get the response as plain text
})
.then((weatherData) => {
const weatherElement = document.getElementById('weatherInfo');
weatherElement.textContent = weatherData; // Display the weather data in the element
})
.catch((error) => {
console.error('Error:', error);
});
}
// Call the fetchAndDisplayWeather function when the page loads
fetchAndDisplayWeather();
</script><script src="/static/emojis.js"></script><style> img.emoji {height: 1em;width: 1em;margin: 0 .05em 0 .1em;vertical-align: -0.1em;}</style>
<script>twemoji.parse(document.body,{ base: 'https://p.poketube.fun/https://cdn.zptr.cc/twemoji/' })</script></div>
</div> <!-- id="content_homepage" -->
2023-10-31 16:45:11 +01:00
</div> <!-- id="content_wrapper_homepage" -->
</body>
2023-12-26 08:53:38 +01:00
</html>