base.js
This commit is contained in:
@@ -455,6 +455,7 @@ window.windowMixin = {
|
|||||||
toggleSubs: true,
|
toggleSubs: true,
|
||||||
reactionChoice: 'confettiBothSides',
|
reactionChoice: 'confettiBothSides',
|
||||||
borderChoice: '',
|
borderChoice: '',
|
||||||
|
backgroundImage: '',
|
||||||
gradientChoice:
|
gradientChoice:
|
||||||
this.$q.localStorage.getItem('lnbits.gradientBg') || false,
|
this.$q.localStorage.getItem('lnbits.gradientBg') || false,
|
||||||
isUserAuthorized: false,
|
isUserAuthorized: false,
|
||||||
@@ -487,12 +488,54 @@ window.windowMixin = {
|
|||||||
gradientStyle,
|
gradientStyle,
|
||||||
'important'
|
'important'
|
||||||
)
|
)
|
||||||
const gradientStyleCards = `background-color: ${LNbits.utils.hexAlpha(String(darkBgColor), 0.4)} !important`
|
const gradientStyleCards = `background-color: ${LNbits.utils.hexAlpha(String(darkBgColor), 0.55)} !important`
|
||||||
const style = document.createElement('style')
|
const style = document.createElement('style')
|
||||||
style.innerHTML =
|
style.innerHTML = `
|
||||||
`body[data-theme="${this.$q.localStorage.getItem('lnbits.theme')}"] .q-card:not(.q-dialog .q-card, .lnbits__dialog-card, .q-dialog-plugin--dark), body.body${this.$q.dark.isActive ? '--dark' : ''} .q-header, body.body${this.$q.dark.isActive ? '--dark' : ''} .q-drawer { ${gradientStyleCards} }` +
|
body[data-theme="${this.$q.localStorage.getItem('lnbits.theme')}"] .q-card:not(.q-dialog .q-card, .lnbits__dialog-card, .q-dialog-plugin--dark),
|
||||||
`body[data-theme="${this.$q.localStorage.getItem('lnbits.theme')}"].body--dark{background: ${LNbits.utils.hexDarken(String(primaryColor), -88)} !important; }` +
|
body.body${this.$q.dark.isActive ? '--dark' : ''} .q-header,
|
||||||
`[data-theme="${this.$q.localStorage.getItem('lnbits.theme')}"] .q-card--dark{background: ${String(darkBgColor)} !important;} }`
|
body.body${this.$q.dark.isActive ? '--dark' : ''} .q-drawer,
|
||||||
|
body.body${this.$q.dark.isActive ? '--dark' : ''} .q-tab-panels {
|
||||||
|
${gradientStyleCards}
|
||||||
|
}
|
||||||
|
|
||||||
|
body[data-theme="${this.$q.localStorage.getItem('lnbits.theme')}"].body--dark {
|
||||||
|
background: ${LNbits.utils.hexDarken(String(primaryColor), -88)} !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="${this.$q.localStorage.getItem('lnbits.theme')}"] .q-card--dark {
|
||||||
|
background: ${String(darkBgColor)} !important;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
document.head.appendChild(style)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
applyBackgroundImage() {
|
||||||
|
if (this.backgroundImage) {
|
||||||
|
this.$q.localStorage.set('lnbits.backgroundImage', this.backgroundImage)
|
||||||
|
}
|
||||||
|
let bgImage = this.$q.localStorage.getItem('lnbits.backgroundImage')
|
||||||
|
if (bgImage) {
|
||||||
|
const style = document.createElement('style')
|
||||||
|
style.innerHTML = `
|
||||||
|
body[data-theme="${this.$q.localStorage.getItem('lnbits.theme')}"]::before {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: url(${bgImage});
|
||||||
|
background-size: cover;
|
||||||
|
filter: blur(8px);
|
||||||
|
z-index: -1;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
body[data-theme="${this.$q.localStorage.getItem('lnbits.theme')}"] .q-page-container {
|
||||||
|
backdrop-filter: none; /* Ensure the page content is not affected */
|
||||||
|
}`
|
||||||
document.head.appendChild(style)
|
document.head.appendChild(style)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -510,6 +553,9 @@ window.windowMixin = {
|
|||||||
if (borderStyle == 'hard-border') {
|
if (borderStyle == 'hard-border') {
|
||||||
borderStyleCSS = `box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 0 0 1px #ffffff47; border: none;`
|
borderStyleCSS = `box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 0 0 1px #ffffff47; border: none;`
|
||||||
}
|
}
|
||||||
|
if (borderStyle == 'neon-border') {
|
||||||
|
borderStyleCSS = `border: 2px solid ${this.$q.localStorage.getItem('lnbits.primaryColor')}; box-shadow: none;`
|
||||||
|
}
|
||||||
if (borderStyle == 'no-border') {
|
if (borderStyle == 'no-border') {
|
||||||
borderStyleCSS = `box-shadow: none; border: none;`
|
borderStyleCSS = `box-shadow: none; border: none;`
|
||||||
}
|
}
|
||||||
@@ -686,6 +732,7 @@ window.windowMixin = {
|
|||||||
|
|
||||||
this.applyGradient()
|
this.applyGradient()
|
||||||
this.applyBorder()
|
this.applyBorder()
|
||||||
|
this.applyBackgroundImage()
|
||||||
|
|
||||||
if (window.user) {
|
if (window.user) {
|
||||||
this.g.user = Object.freeze(window.LNbits.map.user(window.user))
|
this.g.user = Object.freeze(window.LNbits.map.user(window.user))
|
||||||
@@ -725,4 +772,4 @@ window.decryptLnurlPayAES = (success_action, preimage) => {
|
|||||||
let decoder = new TextDecoder('utf-8')
|
let decoder = new TextDecoder('utf-8')
|
||||||
return decoder.decode(valueb)
|
return decoder.decode(valueb)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user