Moved websearch and speedtest into site

This commit is contained in:
Keith Irwin 2022-01-18 14:08:26 -07:00
parent 1da582aa81
commit b3916c66e8
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
3 changed files with 35 additions and 1 deletions

View File

@ -20,7 +20,7 @@
<header>
<div id="topbar">
<aside>
<a href="https://speedtest.slvit.us/">Speedtest</a> | <a href="https://searx.slvit.us/">Web search</a>
<a href="/speedtest/">Speedtest</a> | <a href="/websearch/">Web search</a>
</aside>
<aside id="rh-aside">
<a href="/login">Login</a>

6
_src/speedtest.njk Normal file
View File

@ -0,0 +1,6 @@
---
layout: layouts/base.njk
title: Speedtest
---
<iframe id="speedtest-frame" src="https://speedtest.slvit.us/" style="border:none;width:100%;min-height:700px;height:calc(70vh + 10vw)"></iframe>

28
_src/websearch.njk Normal file
View File

@ -0,0 +1,28 @@
---
layout: layouts/base.njk
title: Web search
---
<h1>{{title}}</h1>
<p>Use this page to anonymously search the web.</p>
<div class="flex">
<input id="search-box" type="text" placeholder="Enter your query here" style="width:80%">
<button id="search-btn" onClick="search()">Search</button>
</div>
<script>
const SEARX_URL = 'https://searx.slvit.us'
const searchBox = document.getElementById('search-box')
function search(){
window.location.href = `${SEARX_URL}/?q=${encodeURIComponent(searchBox.value)}`
}
function checkLength() {
document.getElementById('search-btn').disabled = (searchBox.value.length===0)
}
searchBox.addEventListener('keyup', (e) => {
if (!e) var e = window.event
if (e.keyCode === 13) search()
else checkLength()
}, false)
</script>