startpage/bookmark.go
2022-05-08 16:00:03 +02:00

142 lines
3.8 KiB
Go

package main
import "sort"
var (
Bookmarks = []Bookmark{
{
Title: "DuckDuckGo",
Image: "https://duckduckgo.com/assets/logo_homepage.alt.v108.svg",
Link: "https://duckduckgo.com/",
Color: "#e37151",
},
{
Title: "Postbank",
Image: "https://meine.postbank.de/bundles/@pbs/patternlib_pb/lib/runtime/assets/images/logo-claim.svg",
Link: "https://meine.postbank.de/#/login",
Color: "#ffcc00",
},
{
Title: "DKB",
Image: "https://vdiv-sa.de/wp-content/uploads/2016/08/DKB_AG_web_RGB.jpg",
Link: "https://www.dkb.de/",
Color: "#ffffff",
},
{
Title: "YouTube",
Image: "https://upload.wikimedia.org/wikipedia/commons/1/1f/YouTube_light_logo_%282017%29.svg",
Color: "#ff0000",
Link: "https://www.youtube.com/",
},
{
Title: "Jisho",
Image: "https://assets.jisho.org/assets/jisho-logo-v4@2x-7330091c079b9dd59601401b052b52e103978221c8fb6f5e22406d871fcc746a.png",
Link: "https://jisho.com/",
Color: "#ffffff",
},
{
Title: "Wadoku",
Image: "https://www.wadoku.de/img/wadoku_logo.svg",
Link: "https://www.wadoku.de/",
Color: "#ffffff",
},
{
Title: "Übersetzer",
Image: "https://tools.avans.nl/tools/image/wZkdyaMblN.jpg",
Link: "https://www.deepl.com/translator",
Color: "#042b48",
ImageSize: "cover",
IconPadding: "0em",
},
{
Title: "WaniKani",
Image: "https://assets.wanikani.com/assets/logo--retro-colors-b79775af8773b5a416e4ec3fae02e62d391b7e88e57f9fe0c2e4997a3383b002.png",
Link: "https://www.wanikani.com/",
Color: "#ffffff",
},
{
Title: "Passwörter",
Image: "https://raw.githubusercontent.com/dani-garcia/vaultwarden/main/resources/vaultwarden-logo-white.svg",
Link: "https://pw.tordarus.net",
Color: "#175ddc",
},
{
Title: "Projekte",
Image: "https://cdn.icon-icons.com/icons2/2407/PNG/512/gitea_icon_146173.png", //"https://git.tordarus.net/assets/img/logo.svg",
Link: "https://git.tordarus.net",
Color: "#609926",
ImageSize: "cover",
IconPadding: "0em",
},
{
Title: "Wikipedia",
Image: "https://upload.wikimedia.org/wikipedia/commons/8/80/Wikipedia-logo-v2.svg",
Link: "https://www.wikipedia.org/",
Color: "#ffffff",
},
{
Title: "Reddit",
Image: "https://www.redditinc.com/assets/images/site/reddit-logo.png",
Link: "https://www.reddit.com/",
Color: "#ff4300",
ImageSize: "cover",
IconPadding: "0em",
},
{
Title: "Tagesschau",
Image: "https://m47ch.com/wp-content/uploads/2010/12/Tagesschau.png",
Link: "https://www.golem.de/",
Color: "#003f8c",
},
{
Title: "Golem",
Image: "https://www.golem.de/staticrl/images/golem-logo-opt2.svg",
Link: "https://www.golem.de/",
Color: "#000000",
},
{
Title: "Comico",
Image: "https://play-lh.googleusercontent.com/xZ5bfg-XfyEmM1641bXduE27w44OmyWeVspg626wRYF0ejAgZAvsRKP4sECblfmnpg=w512",
Link: "https://comico.jp/",
Color: "#f40000",
ImageSize: "cover",
IconPadding: "0em",
},
{
Title: "Manganelo",
Image: "https://manganato.com/themes/hm/images/logo.png",
Link: "https://manganato.com/",
Color: "#ffffff",
ImageSize: "contain",
IconPadding: "0em",
},
}
)
type Bookmark struct {
Title string
Image string
ImageSize string
IconPadding string
Color string
Link string
HideBorder bool
Order int
}
func ParseBookmarks() {
// set default values
for i := range Bookmarks {
if Bookmarks[i].Color == "" {
Bookmarks[i].Color = DefaultSettings.Background
}
if Bookmarks[i].ImageSize == "" {
Bookmarks[i].ImageSize = "contain"
}
}
sort.SliceStable(Bookmarks, func(i, j int) bool {
return Bookmarks[i].Order < Bookmarks[j].Order
})
}