all repos — plain-startpage @ ea0d10d3245996ef8a47ec68a587c1703152b86b

initial commit
Marco Andronaco andronacomarco@gmail.com
Sun, 16 May 2021 01:06:38 +0200
commit

ea0d10d3245996ef8a47ec68a587c1703152b86b

5 files changed, 208 insertions(+), 0 deletions(-)

jump to
A .gitignore

@@ -0,0 +1,1 @@

+config.js
A config_example.js

@@ -0,0 +1,29 @@

+let theme = "based"; + +let categories = [ + { + name: "Useful links", + links: [ + "https://discord.com/app Discord", + "https://youtube.com YouTube", + "https://twitch.tv Twitch", + "https://facebook.com Facebook", + "https://instagram.com Instagram", + "https://web.whatsapp.com WhatsApp", + "https://amazon.it Amazon", + "https://outlook.com Outlook", + "https://twitter.com Twitter" + ] + }, + { + name: "Your own links", + links: [ + "# Link 1", + "# Link 2", + "# Link 3", + "# Link 4", + "# Link 5", + "# Link 6" + ] + } +];
A index.htm

@@ -0,0 +1,40 @@

+<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Startpage</title> + <meta name="description" content="BiRabittoh's plain startpage"> + <meta name="author" content="BiRabittoh"> + <base target="_blank"> + </head> + <body style="background-color: black; color: white;"> + <h1>Welcome back.</h1> + <div id="links"></div> + <script src="config.js"></script> + <script> +if (theme) { + let head = document.getElementsByTagName("head")[0]; + let css = document.createElement("link"); + css.type = "text/css"; + css.rel = "stylesheet"; + css.href = `themes/${theme}.css`; + head.appendChild(css); +} +if (categories) { + let main = document.getElementById("links"); + let str = ""; + let info; + categories.forEach(cat => { + str += `<h2>${cat.name}</h2>`; + cat.links.forEach(link => { + info = link.split(/(?<=^\S+)\s/); + if(info[0]){ + str += `<div><a href="${info[0]}">${info[1] ? info[1] : info[0]}</a></div>` + } + }); + }); + main.innerHTML = str; +} + </script> + </body> +</html>
A themes/based.css

@@ -0,0 +1,78 @@

+body { + background: #151515 ; + color: #ccc ; + max-width: 800px ; + margin: auto ; + padding: 0 16px ; + margin-bottom: 500px ; + font-family: sans-serif ; +} + +a, a:visited { + color: lightblue ; +} + +h1 { + text-align: center ; +} + +h2 { + color: tomato ; +} + +footer { + text-align: center ; +} + +img { + max-width: 600px ; + width: 100% ; + margin: auto ; + display: block ; +} + +code { + overflow-wrap: break-word ; + color: lime ; +} + +img[alt="BTC logo"], +img[alt="XMR Logo"] { + max-width: 1em ; + max-height: 1em ; + display: inline ; +} + +@media (prefers-color-scheme: light) { + body { + background: white ; + color: black ; + } + a { + color: blue ; + } + a:visited { + color: purple ; + } + h2 { + color: inherit ; + } + code { + color: forestgreen ; + } +} + +@media print { + a[href] { + text-decoration: none ; + color: black ; + } +} + +@media (min-width: 55em) { + #artlist { column-count: 2 ;} +} + +@media (min-width: 100em) { + #artlist { column-count: 3 ;} +}
A themes/nicksphere.css

@@ -0,0 +1,60 @@

+/* + nicksphere.com-gmi Generates a Gemini capsule from existing files + Copyright (C) 2021 Nicholas Johnson + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +body { + background-color: #000; + color: white; + padding: 30px; + font-family: monospace; + font-size: 16px; + line-height: 22px; + max-width: 960px; /* mobile-first */ + margin: 0 auto; /* remove default styling */ +} + +h1 { color: red; } +h2 { color: #66ff00; } +h3 { color: #FF007F; } + +h1:before { content: "# " } +h2:before { content: "## " } +h3:before { content: "### " } + +h1, h2, h3 { + font-size: 20px; +} + +a:before { content: "=> "; } + +a { + color: #004EFF; + text-decoration: none; /* remove default styling */ +} + +a:hover { + color: black; + background-color: #004EFF; +} + +pre { + overflow: auto; +} + +p { + overflow-wrap: break-word; +}