mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added colors in chrome android
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<meta name="description" content="The Shared (free) YouTube radio. Being built around the YouTube search and video API it enables the creation of collaborative and shared live playlists, with billions of videos and songs to choose from, all for free and without registration. Enjoy!"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="theme-color" content="#2D2D2D" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta property="og:image" content="/static/images/highlogo.png" />
|
||||
<meta property="og:title" content="Zöff"/>
|
||||
|
||||
2
static/dist/main.min.js
vendored
2
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -157,6 +157,15 @@ var Helper = {
|
||||
if(l>0.5)l=0.5; //make sure it isnt too light
|
||||
|
||||
return "hsl("+Math.floor(h*360)+", "+Math.floor(s*100)+"%, "+Math.floor(l*100)+"%)";
|
||||
},
|
||||
|
||||
componentToHex: function(c) {
|
||||
var hex = c.toString(16);
|
||||
return hex.length == 1 ? "0" + hex : hex;
|
||||
},
|
||||
|
||||
rgbToHex: function(r, g, b) {
|
||||
return "#" + Helper.componentToHex(r) + Helper.componentToHex(g) + Helper.componentToHex(b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -141,11 +141,14 @@ var Youtube = {
|
||||
setBGimage: function(id){
|
||||
if(id !== undefined)
|
||||
{
|
||||
console.log($("meta[name=theme-color]").attr("content", ""));
|
||||
var img = new Image();
|
||||
img.onload = function ()
|
||||
{
|
||||
|
||||
var colorThief = new ColorThief();
|
||||
document.getElementsByTagName("body")[0].style.backgroundColor = Helper.rgbToHsl(colorThief.getColor(img));
|
||||
$("meta[name=theme-color]").attr("content", Helper.rgbToHex(colorThief.getColor(img)));
|
||||
};
|
||||
|
||||
img.crossOrigin = 'Anonymous';
|
||||
|
||||
Reference in New Issue
Block a user