Fix opengraph icons

This commit is contained in:
2021-11-10 19:30:49 +01:00
parent 04fb4e5b27
commit e99a00e369
6 changed files with 17 additions and 24 deletions

View File

@@ -28,8 +28,8 @@
window.user_authenticated = {{.Authenticated}}; window.user_authenticated = {{.Authenticated}};
</script> </script>
<link rel='stylesheet' href='/res/svelte/file_viewer.css?v1'> <link rel='stylesheet' href='/res/svelte/file_viewer.css?v3'>
<script defer src='/res/svelte/file_viewer.js?v1'></script> <script defer src='/res/svelte/file_viewer.js?v3'></script>
{{template "analytics"}} {{template "analytics"}}
</head> </head>

View File

@@ -224,10 +224,10 @@
</div> </div>
<div> <div>
<div class="feat_label"> <div class="feat_label">
Bandwidth Download speed
</div> </div>
<div class="feat_normal"> <div class="feat_normal">
Up to 8 MiB/s, may be slower during busy periods Up to 4 MiB/s, may be slower during busy periods
</div> </div>
<div class="feat_pro"> <div class="feat_pro">
<span class="text_highlight">High priority</span> <span class="text_highlight">High priority</span>

View File

@@ -13,6 +13,8 @@ let set_ad_type = (t) => {
} else if (ad_type === "adaround") { } else if (ad_type === "adaround") {
adaround_load.set(true) adaround_load.set(true)
} }
console.log("leaderboard ad is " + t)
} }
onMount(() => { onMount(() => {
@@ -24,27 +26,23 @@ onMount(() => {
} }
} }
switch (Math.floor(Math.random() * 10)) { switch (Math.floor(Math.random() * 6)) {
case 0: case 0:
set_ad_type("publisherrest_1") set_ad_type("publisherrest_1")
break break
case 1: case 1:
set_ad_type("publisherrest_3")
break
case 2:
case 3:
set_ad_type("brave") set_ad_type("brave")
break break
case 4: case 2:
case 5: set_ad_type("aads1")
break
case 3:
set_ad_type("ads.plus") set_ad_type("ads.plus")
break break
case 6: case 4:
case 7:
set_ad_type("pixfuture") set_ad_type("pixfuture")
break break
case 8: case 5:
case 9:
set_ad_type("adaround") set_ad_type("adaround")
break break
} }

View File

@@ -14,6 +14,8 @@ let set_ad_type = (t) => {
} else if (ad_type === "adaround") { } else if (ad_type === "adaround") {
adaround_load.set(true) adaround_load.set(true)
} }
console.log("skyscraper ad is " + t)
} }

View File

@@ -59,12 +59,14 @@ func (wc *WebController) metadataFromFile(f pixelapi.FileInfo) (og ogData) {
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail") og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
} else if strings.HasPrefix(f.MimeType, "audio") { } else if strings.HasPrefix(f.MimeType, "audio") {
og.addProp("og:type", "music.song") og.addProp("og:type", "music.song")
og.addProp("og:image", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
og.addProp("og:audio", wc.websiteAddress+"/api/file/"+f.ID) og.addProp("og:audio", wc.websiteAddress+"/api/file/"+f.ID)
og.addProp("og:audio:secure_url", wc.websiteAddress+"/api/file/"+f.ID) og.addProp("og:audio:secure_url", wc.websiteAddress+"/api/file/"+f.ID)
og.addProp("og:audio:type", f.MimeType) og.addProp("og:audio:type", f.MimeType)
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail") og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
} else { } else {
og.addProp("og:type", "website") og.addProp("og:type", "website")
og.addProp("og:image", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail") og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
} }
return og return og

View File

@@ -114,15 +114,6 @@ type hsl struct {
Lightness float64 Lightness float64
} }
func (h hsl) cssString() string {
return fmt.Sprintf(
"hsl(%d, %.3f%%, %.3f%%)",
h.Hue,
h.Saturation*100,
h.Lightness*100,
)
}
func (orig hsl) RGB() string { func (orig hsl) RGB() string {
var r, g, b, q, p float64 var r, g, b, q, p float64
var h, s, l = float64(orig.Hue) / 360, orig.Saturation, orig.Lightness var h, s, l = float64(orig.Hue) / 360, orig.Saturation, orig.Lightness