1
0
mirror of https://github.com/osmarks/website synced 2025-01-10 17:30:28 +00:00

Adjust colors in search

This commit is contained in:
osmarks 2024-09-01 13:23:57 +01:00
parent ed9b8cd382
commit 4cb1cba03e
2 changed files with 9 additions and 2 deletions

View File

@ -597,6 +597,12 @@ const nameMappings = {
"experiment": "Experiments",
"mycorrhiza": "Documentation"
}
const hues = {
"blog": "210",
"microblog": "290",
"mycorrhiza": "30",
"experiment": "120"
}
const closeOverlay = () => {
if (document.querySelector(".search-overlay")) {
@ -637,8 +643,8 @@ loginButton.onclick = async ev => {
if (result.description) {
e("description", item, result.description)
}
item.style.border = `${colHash(result.sourceType)} solid 4px`
item.style.background = `${colHash(result.sourceType, 50, 10)}`
item.style.border = `hsl(${hues[result.sourceType]}deg, 100%, 70%) solid 4px`
item.style.background = `hsl(${hues[result.sourceType]}deg, 50%, 10%)`
}
overlay.appendChild(resultsEl)
}

View File

@ -383,6 +383,7 @@ table
color: white
.search-results
width: 100%
max-width: $content-width
.search-result
padding: 0.5em
margin: 0.5em