Skip to content

Commit

Permalink
second test
Browse files Browse the repository at this point in the history
  • Loading branch information
Villhellm committed Jul 7, 2020
1 parent 7a40147 commit e1954aa
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions dist/animated-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ function getEntityState(entity) {

//main render function
function renderBackgroundHTML() {
if(!View_Layout){
return;
}
var current_config = currentConfig();
var state_url = "";
var temp_enabled = true;
Expand Down Expand Up @@ -483,7 +480,8 @@ function renderBackgroundHTML() {
if (!current_config.entity) {
STATUS_MESSAGE("Applying default background", true);
}
html_to_render = `<style>
var style = document.createElement("style");
style.innerHTML = `
.bg-video{
min-width: 100vw;
min-height: 100vh;
Expand All @@ -496,12 +494,15 @@ function renderBackgroundHTML() {
min-width: 100vw;
min-height: 100vh;
z-index: -10;
}
</style>
<div id="background-video" class="bg-wrap">
}`;
var div = document.createElement("div");
div.id = "background-video";
div.className = "bg-wrap"
div.innerHTML = `
<iframe id="background-iframe" class="bg-video" frameborder="0" srcdoc="${source_doc}"/>
</div>`;
View_Layout.insertAdjacentHTML("beforebegin", html_to_render);
`;
Root.shadowRoot.appendChild(style);
Root.shadowRoot.appendChild(div)
Previous_Url = state_url;
}
else {
Expand Down Expand Up @@ -530,9 +531,6 @@ function urlIsVideo(url) {

//removes lovelace theme background
function removeDefaultBackground(node, current_config) {
if(!View_Layout){
return;
}
var background = 'transparent';
if (current_config.background) {
background = current_config.background;
Expand All @@ -545,9 +543,6 @@ function removeDefaultBackground(node, current_config) {

//restores lovelace theme background
function restoreDefaultBackground(node) {
if(!View_Layout){
return;
}
View_Layout.style.background = null;
node.style.background = null;
}
Expand Down

0 comments on commit e1954aa

Please sign in to comment.