mirror of
https://github.com/mue/mue.git
synced 2026-07-10 05:55:17 +02:00
Add WIP custom background video feature
This commit is contained in:
@@ -23,8 +23,8 @@ const Update = React.lazy(() => import('./components/modals/Update'));
|
||||
const renderLoader = () => <div></div>;
|
||||
|
||||
export default class App extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
this.state = {
|
||||
mainModal: false,
|
||||
updateModal: false
|
||||
|
||||
@@ -67,6 +67,7 @@ export default class Background extends React.PureComponent {
|
||||
const customBackgroundColour = localStorage.getItem('customBackgroundColour');
|
||||
const customBackground = localStorage.getItem('customBackground');
|
||||
const favourited = JSON.parse(localStorage.getItem('favourite'));
|
||||
const customBackgroundVideo = localStorage.getItem('customBackgroundVideo');
|
||||
|
||||
if (favourited) {
|
||||
if (offlineMode === 'true') return this.doOffline();
|
||||
@@ -83,6 +84,12 @@ export default class Background extends React.PureComponent {
|
||||
this.setBackground(null, customBackgroundColour, 'false');
|
||||
} else if (customBackground !== '') { // Local
|
||||
this.setBackground(customBackground, null, 'false');
|
||||
} else if (customBackgroundVideo) {
|
||||
document.getElementById('backgroundImage').innerHTML = `
|
||||
<video autoplay muted loop id="backgroundVideo">
|
||||
<source src="${customBackgroundVideo}"/>
|
||||
</video>`;
|
||||
document.querySelector('.photoInformation').style.display = 'none'; // Hide the credit
|
||||
} else { // Online
|
||||
if (offlineMode === 'true') return this.doOffline();
|
||||
try { // First we try and get an image from the API...
|
||||
|
||||
@@ -8,7 +8,7 @@ export default class Notes extends React.PureComponent {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
this.state = {
|
||||
notes: localStorage.getItem('notes') || ""
|
||||
notes: localStorage.getItem('notes') || ''
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ body {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -100,4 +101,12 @@ body {
|
||||
|
||||
::selection {
|
||||
background-color: #c2c2c2;
|
||||
}
|
||||
|
||||
#backgroundVideo {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
min-width: 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
Reference in New Issue
Block a user