forked from rc/aircox
radiocampus/assets: remove cruft
This commit is contained in:
parent
ccc6ed26fd
commit
9a58fba0fd
|
@ -1,27 +0,0 @@
|
||||||
// Enable styling body background while using vue hotreload
|
|
||||||
// Tags with side effect (<script> and <style>) are ignored in client component templates.
|
|
||||||
|
|
||||||
const backgrounds = new Map();
|
|
||||||
backgrounds.set('default', "linear-gradient(#738ef2, white)");
|
|
||||||
backgrounds.set('/', "url(/static/radiocampus/backgrounds/photo-04-20.jpg) no-repeat center center fixed");
|
|
||||||
|
|
||||||
|
|
||||||
export default class BackgroundLoad {
|
|
||||||
constructor () {
|
|
||||||
let url = new URL(document.location)
|
|
||||||
this.path = url.pathname
|
|
||||||
this.update()
|
|
||||||
document.addEventListener("pageLoaded", this.handlePageLoad.bind(this), false)
|
|
||||||
}
|
|
||||||
|
|
||||||
handlePageLoad (e) {
|
|
||||||
this.path = e.detail
|
|
||||||
this.update()
|
|
||||||
}
|
|
||||||
|
|
||||||
update () {
|
|
||||||
let background = backgrounds.get(this.path) || backgrounds.get("default")
|
|
||||||
document.body.style.background = background;
|
|
||||||
document.body.style.backgroundSize = "cover";
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
import {createApp} from 'vue'
|
import {createApp} from 'vue'
|
||||||
|
|
||||||
import PageLoad from './pageLoad'
|
import PageLoad from './pageLoad'
|
||||||
import BackgroundLoad from './backgroundLoad'
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user