mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 14:58:14 +01:00
use js
This commit is contained in:
parent
52451a70b1
commit
b793d1377d
1 changed files with 20 additions and 1 deletions
|
@ -16,8 +16,15 @@
|
||||||
if (window.NodeList && !NodeList.prototype.forEach)
|
if (window.NodeList && !NodeList.prototype.forEach)
|
||||||
NodeList.prototype.forEach = Array.prototype.forEach;
|
NodeList.prototype.forEach = Array.prototype.forEach;
|
||||||
</script>
|
</script>
|
||||||
|
<noscript>
|
||||||
|
<style>
|
||||||
|
.feeling-lucky {
|
||||||
|
display:none;
|
||||||
|
}</style>
|
||||||
|
</noscript>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
|
||||||
@keyframes gradient {
|
@keyframes gradient {
|
||||||
0% {
|
0% {
|
||||||
background-position: 0 50%;
|
background-position: 0 50%;
|
||||||
|
@ -223,7 +230,7 @@
|
||||||
<p style="margin-top: auto;margin-bottom: auto;font-weight: 1000;margin-left: 6px;font-stretch: ultra-expanded;font-family:"poketube flex";Poketube flex;">Search Poke</p>
|
<p style="margin-top: auto;margin-bottom: auto;font-weight: 1000;margin-left: 6px;font-stretch: ultra-expanded;font-family:"poketube flex";Poketube flex;">Search Poke</p>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="btn btn-success" name="lk" 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;">
|
<button class="btn btn-success feeling-lucky" onclick="feelingLucky()" 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;">
|
||||||
<p style="margin-top: auto;margin-bottom: auto;font-weight: 1000;margin-left: 6px;font-stretch: ultra-expanded;font-family:"poketube flex";Poketube flex;">Im feeling lucky</p>
|
<p style="margin-top: auto;margin-bottom: auto;font-weight: 1000;margin-left: 6px;font-stretch: ultra-expanded;font-family:"poketube flex";Poketube flex;">Im feeling lucky</p>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -258,6 +265,18 @@ if (userAgent.includes("windows")) {
|
||||||
const osInfoElement = document.getElementById("osInfo");
|
const osInfoElement = document.getElementById("osInfo");
|
||||||
osInfoElement.textContent = `${osName} - `;
|
osInfoElement.textContent = `${osName} - `;
|
||||||
</script> <script>
|
</script> <script>
|
||||||
|
|
||||||
|
function feelingLucky() {
|
||||||
|
const query = document.getElementById('search_input').value;
|
||||||
|
|
||||||
|
// Add a cache buster (timestamp)
|
||||||
|
const cacheBuster = new Date().getTime();
|
||||||
|
|
||||||
|
// Redirect to the "/im-feeling-lucky" route with cache buster
|
||||||
|
window.location.href = '/im-feeling-lucky?query=' + encodeURIComponent(query) + '&cb=' + cacheBuster;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const css = localStorage.getItem("poke-custom-css");
|
const css = localStorage.getItem("poke-custom-css");
|
||||||
|
|
||||||
var head = document.head
|
var head = document.head
|
||||||
|
|
Loading…
Reference in a new issue