config file
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
a 2022-12-18 12:53:49 -06:00
parent 6ff2eaa540
commit df8e8b8355
3 changed files with 97 additions and 37 deletions

35
config/config.json Normal file
View File

@ -0,0 +1,35 @@
{
"search_engine": "https://www.google.com/search",
"categories": [
{
"image": "res/4chan.png",
"links": [
{"href":"https://boards.4chan.org/w/", "label":"walls"},
{"href":"https://boards.4chan.org/g/", "label":"tech"},
{"href":"https://boards.4chan.org/a/", "label":"anime"},
{"href":"https://boards.4chan.org/mu/", "label":"music"}
]
},
{
"image": "res/social.png",
"links": [
{"href":"https://facebook.com", "label":"facebook"},
{"href":"https://youtube.com/", "label":"youtube"},
{"href":"https://tumblr.com", "label":"tumblr"}
]
},
{
"image": "res/music.png",
"links": [
{"href":"https://last.fm", "label":"last.fm"},
{"href":"https://bandcamp.com/", "label":"bandcamp"}
]
},
{
"image": "res/mail.png",
"links": [
{"href":"https://mail.google.com", "label":"gmail"}
]
}
]
}

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<!-- homepage by noha javascript by nullbyte -->
<!-- original homepage by noha https://www.deviantart.com/noha-ra/art/Konbanwa-homepage-450787545 -->
<html>
<head>
@ -12,25 +12,6 @@
</head>
<body>
<h1 align="center" id="message" class="expandUp"></h1>
<div class="boxed" class=slideUp>
<span> <img src="res/4chan.png"></span>
<a style="padding-left:10px" href="http://boards.4chan.org/w/">walls</a>
<a href="http://boards.4chan.org/g/">tech</a>
<a href="http://boards.4chan.org/a/">anime</a>
<a href="http://boards.4chan.org/mu/">music</a>
</br>
<span> <img src="res/social.png"></span>
<a style="padding-left:10px" href="https://www.facebook.com">facebook</a>
<a href="http://youtube.com">youtube</a>
<a href="http://tumblr.com">tumblr</a>
</br>
<span> <img src="res/music.png"></span>
<a style="padding-left:10px" href="http://www.last.fm">last.fm</a>
<a href="http://bandcamp.com">bandcamp</a>
</br>
<span> <img src="res/mail.png"></span>
<a style="padding-left:10px" href="http://mail.google.com">gmail</a>
</br>
<form method="get" action="http://www.google.com/search"> <input type="text" placeholder="" value="" name="q">
<div id="categories" class="boxed" class=slideUp>
</div>
</body>

View File

@ -1,28 +1,72 @@
var d = new Date();
var n = d.getHours();
var message = ""
const updateTime = () => {
const n = (new Date()).getHours()
var imgName = "goodnight"
if ( n == 23 || n == 0) {
message = "<img src='res/goodnight.png'></img>";
imgName = "goodnight"
} else if ( n >= 1 && n <= 4 ) {
message = "<img src='res/goodnight.png'></img>";
imgName = "goodnight"
} else if ( n >= 5 && n <= 11 ) {
message = "<img src='res/goodmorning.png'></img>";
imgName = "goodmorning"
} else if ( n >= 12 && n <= 17 ) {
message = "<img src='res/goodafternoon.png'></img>";
imgName = "goodafternoon"
} else if ( n >= 18 && n <= 22 ) {
message = "<img src='res/goodevening.png'></img>";
imgName = "goodevening"
}
//$("#message").html(imgName)
$("#message").html(`<image src="res/${imgName}.png" />`)
}
const renderCategoryLink = (link, first) => {
if(first) {
return `<a style="padding-left:10px" href="${link.href}">${link.label}</a>
`
}
return `<a href="${link.href}">${link.label}</a>
`
}
const renderCategoryLinks = (links) => {
let out = ""
for(let i = 0; i < links.length; i++) {
out = out + renderCategoryLink(links[i], i==0)
}
return out
}
const renderCategory =(obj) => {
return `<span> <img src="${obj.image}"></span>
${renderCategoryLinks(obj.links)}</br>
`
}
const renderCategories =(objs) => {
let out = ""
for(let i = 0; i < objs.length; i++) {
out = out + renderCategory(objs[i])
}
return out
}
const renderCategoriesBox = (data) => {
return `${renderCategories(data.categories)}
<form method="get" action="${data.search_engine}"> <input type="text" placeholder="" value="" name="q">
`
}
const loadUI = () => {
$.getJSON("config/config.json", (data)=>{
let drawn = renderCategoriesBox(data)
console.log(drawn)
$("#categories").html(drawn)
})
}
$(()=>{
document.getElementById("message").innerHTML = message;
loadUI();
updateTime();
setInterval(updateTime, 1000 * 60)
})
$(window).scroll(function() {
$('#animatedElement').each(function(){
var imagePos = $(this).offset().top;
var topOfWindow = $(window).scrollTop();
if (imagePos < topOfWindow+400) {
$(this).addClass("slideUp");