/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; // main.ts var main_exports = {}; __export(main_exports, { default: () => DynamicBackgroundPlugin }); module.exports = __toCommonJS(main_exports); var import_obsidian = require("obsidian"); // effects/dark-dynamic-star-sky.ts function Add_StarSky(dynamicBackgroundContainer) { if (dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.createEl("div", { cls: "odb-dt-star-sky-dynamic-effect" }); effect.createEl("div", { cls: "star-sky" }); } } function Remove_StarSky(dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.find("div.odb-dt-star-sky-dynamic-effect"); if (effect) { effect.remove(); } } // effects/dark-dynamic-snow.ts var DarkTheme_Snow_Background_Property = "radial-gradient(ellipse at bottom, #1b2735 20%, #090a0f 100%)"; function Add_Snow(dynamicBackgroundContainer) { if (dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.createEl("div", { cls: "odb-dt-snow-dynamic-effect" }); effect.createEl("div", { cls: "snow" }); } } function Remove_Snow(dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.find("div.odb-dt-snow-dynamic-effect"); if (effect) { effect.remove(); } } // effects/dark-dynamic-rain.ts var DarkTheme_Rain_Background_Property = "radial-gradient(ellipse at bottom, #1b2735 20%, #090a0f 100%)"; function Add_Rain(dynamicBackgroundContainer) { if (dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.createEl("div", { cls: "odb-dt-rain-dynamic-effect" }); let drop1 = ''; let drop2 = ''; let drop3 = ''; let drop4 = ''; let drop5 = ''; let drop6 = ''; let drop7 = ''; let drop8 = ''; let drop9 = ''; let drop10 = ''; let drop11 = ''; let drop12 = ''; let drop13 = ''; let drop14 = ''; let drop15 = ''; let drop16 = ''; let drops = drop1 + drop2 + drop3 + drop4 + drop5 + drop6 + drop7 + drop8 + drop9 + drop10; drops += drop11 + drop12 + drop13 + drop14 + drop15 + drop16; effect.innerHTML += drops; } } function Remove_Rain(dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.find("div.odb-dt-rain-dynamic-effect"); if (effect) { effect.remove(); } } // effects/dark-dynamic-random-circle.ts var DarkTheme_Random_Circle_Background_Property = "radial-gradient(ellipse at bottom, #1b2735 20%, #090a0f 100%)"; function Add_RandomCircle(dynamicBackgroundContainer) { let effectScript; if (dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.createEl("div", { cls: "odb-dt-random-circle-dynamic-effect" }); effect.createEl("canvas"); let code = ` var odb_random_circle_ctx; var odb_random_circle_grd; function Obsidian_Dynamic_Background_Start() { var canvas = document.querySelector("div.odb-dt-random-circle-dynamic-effect canvas"); canvas.width = window.innerWidth; canvas.height = window.innerHeight; odb_random_circle_ctx = canvas.getContext("2d"); odb_random_circle_grd = odb_random_circle_ctx.createLinearGradient(0, window.innerHeight, 0, 0); odb_random_circle_ctx.fillStyle = odb_random_circle_grd; odb_random_circle_ctx.fillRect(0, 0, window.innerWidth, window.innerHeight); Obsidian_Dynamic_Background_Animate(); } function Obsidian_Dynamic_Background_Firework(x, y) { this.x = x; this.y = y; this.radius = 5; this.time = 0; this.lifespan = Math.random()*180 + 150; this.draw = function() { odb_random_circle_ctx.beginPath(); odb_random_circle_ctx.arc(this.x, window.innerHeight - this.y, this.radius, 0, 2*Math.PI, false); var alpha = (this.lifespan - this.time)/this.lifespan; odb_random_circle_ctx.strokeStyle = "rgba(255, 255, 255, " + alpha + ")"; odb_random_circle_ctx.stroke(); } this.update = function() { if (this.time < this.lifespan) { this.radius += .25; this.time += 1; this.draw(); } } } var fireworks = []; var time = 0; function Obsidian_Dynamic_Background_Animate() { odb_random_circle_ctx.clearRect(0, 0, window.innerWidth, window.innerHeight); odb_random_circle_ctx.fillStyle = odb_random_circle_grd; odb_random_circle_ctx.fillRect(0, 0, window.innerWidth, window.innerHeight); if (time % Math.floor(Math.random()*100 + 40) == 0) { var x = Math.floor(Math.random()*window.innerWidth); var y = Math.floor(Math.random()*window.innerHeight); fireworks.push(new Obsidian_Dynamic_Background_Firework(x, y)); } fireworks.forEach(firework => { firework.update(); if ((firework.time - firework.explosionTime) > 20) { for (var i = 0; i < fireworks.length; i++) { if (firework === fireworks[i]) { delete fireworks[i]; } } } }) time += 1; if (Obsidian_Dynamic_Background_Animate) requestAnimationFrame(Obsidian_Dynamic_Background_Animate); } Obsidian_Dynamic_Background_Start(); `; effectScript = effect.createEl("script"); effectScript.textContent = code; } } function Remove_RandomCircle(dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.find("div.odb-dt-random-circle-dynamic-effect"); if (effect) { effect.remove(); } Unload_Effect_Script(); } function Unload_Effect_Script() { window["Obsidian_Dynamic_Background_Start"] = null; window["Obsidian_Dynamic_Background_Firework"] = null; window["Obsidian_Dynamic_Background_Animate"] = null; } // effects/light-dynamic-random-circle.ts var LightTheme_Random_Circle_Background_Property = "linear-gradient(0deg, rgba(255,255,255,1) 62%, rgba(230,244,255,1) 100%)"; function Add_RandomCircle_Light(dynamicBackgroundContainer) { let effectScript; if (dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.createEl("div", { cls: "odb-lt-random-circle-dynamic-effect" }); effect.createEl("canvas"); let code = ` var odb_random_circle_ctx; var odb_random_circle_grd; function Obsidian_Dynamic_Background_Start() { var canvas = document.querySelector("div.odb-lt-random-circle-dynamic-effect canvas"); canvas.width = window.innerWidth; canvas.height = window.innerHeight; odb_random_circle_ctx = canvas.getContext("2d"); odb_random_circle_grd = odb_random_circle_ctx.createLinearGradient(0, window.innerHeight, 0, 0); odb_random_circle_ctx.fillStyle = odb_random_circle_grd; odb_random_circle_ctx.fillRect(0, 0, window.innerWidth, window.innerHeight); Obsidian_Dynamic_Background_Animate(); } function Obsidian_Dynamic_Background_Firework(x, y) { this.x = x; this.y = y; this.radius = 5; this.time = 0; this.lifespan = Math.random()*180 + 150; this.draw = function() { odb_random_circle_ctx.beginPath(); odb_random_circle_ctx.arc(this.x, window.innerHeight - this.y, this.radius, 0, 2*Math.PI, false); var alpha = (this.lifespan - this.time)/this.lifespan; odb_random_circle_ctx.strokeStyle = "rgba(0, 128, 255, " + alpha + ")"; odb_random_circle_ctx.stroke(); } this.update = function() { if (this.time < this.lifespan) { this.radius += .25; this.time += 1; this.draw(); } } } var fireworks = []; var time = 0; function Obsidian_Dynamic_Background_Animate() { odb_random_circle_ctx.clearRect(0, 0, window.innerWidth, window.innerHeight); odb_random_circle_ctx.fillStyle = odb_random_circle_grd; odb_random_circle_ctx.fillRect(0, 0, window.innerWidth, window.innerHeight); if (time % Math.floor(Math.random()*100 + 40) == 0) { var x = Math.floor(Math.random()*window.innerWidth); var y = Math.floor(Math.random()*window.innerHeight); fireworks.push(new Obsidian_Dynamic_Background_Firework(x, y)); } fireworks.forEach(firework => { firework.update(); if ((firework.time - firework.explosionTime) > 20) { for (var i = 0; i < fireworks.length; i++) { if (firework === fireworks[i]) { delete fireworks[i]; } } } }) time += 1; if (Obsidian_Dynamic_Background_Animate) requestAnimationFrame(Obsidian_Dynamic_Background_Animate); } Obsidian_Dynamic_Background_Start(); `; effectScript = effect.createEl("script"); effectScript.textContent = code; } } function Remove_RandomCircle_Light(dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.find("div.odb-lt-random-circle-dynamic-effect"); if (effect) { effect.remove(); } Unload_Effect_Script2(); } function Unload_Effect_Script2() { window["Obsidian_Dynamic_Background_Start"] = null; window["Obsidian_Dynamic_Background_Firework"] = null; window["Obsidian_Dynamic_Background_Animate"] = null; } // effects/light-dynamic-wave.ts var LightTheme_Wave_Background_Property = "linear-gradient(0deg, rgba(255,255,255,1) 60%, rgba(201,233,255,1) 100%)"; function Add_Wave_Light(dynamicBackgroundContainer) { let effectScript; if (dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.createEl("div", { cls: "odb-lt-wave-effect" }); effect.createEl("div", { cls: "ocean" }); let code = ` function Obsidian_Dynamic_Background_ShowWave() { var ocean = document.querySelector("div.odb-lt-wave-effect div.ocean"), waveWidth = 10, waveCount = Math.floor(window.innerWidth/waveWidth), docFrag = document.createDocumentFragment(); for(var i = 0; i < waveCount; i++){ var wave = document.createElement("div"); wave.className += " wave-0723"; docFrag.appendChild(wave); wave.style.left = i * waveWidth + "px"; wave.style.webkitAnimationDelay = (i/100) + "s"; } ocean.appendChild(docFrag); } Obsidian_Dynamic_Background_ShowWave(); `; effectScript = effect.createEl("script"); effectScript.textContent = code; } } function Remove_Wave_Light(dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.find("div.odb-lt-wave-effect"); if (effect) { effect.remove(); } Unload_Effect_Script3(); } function Unload_Effect_Script3() { window["Obsidian_Dynamic_Background_ShowWave"] = null; } // effects/dark-dynamic-digital-rain.ts var DarkTheme_Digital_Rain_Background_Property = "radial-gradient(ellipse at bottom, #1b2735 20%, #090a0f 100%)"; function Add_DigitalRain(dynamicBackgroundContainer) { let effectScript; if (dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.createEl("div", { cls: "odb-dt-digital-rain-dynamic-effect" }); effect.createEl("canvas"); let code = ` var odb_digital_rain_canvas var odb_digital_rain_ctx; var odb_digital_rain_grd; var odb_digital_rain_digitals = "1001101010110101010101010010101010101011101111010101010110101010101010101110010101"; var odb_digital_rain_font_size = 15; var odb_digital_rain_columns; //number of columns for the rain var odb_digital_rain_drops = []; //an array of drops - one per column var odb_digital_rain_interval; function Obsidian_Dynamic_Background_Draw(){ odb_digital_rain_ctx.fillStyle = "rgba(0, 0, 0, 0.1)"; odb_digital_rain_ctx.fillRect(0, 0, odb_digital_rain_canvas.width, odb_digital_rain_canvas.height); odb_digital_rain_ctx.fillStyle = "#0F0"; odb_digital_rain_ctx.font = odb_digital_rain_font_size + "px arial"; for(var i = 0; i < odb_digital_rain_drops.length; i++) { var digital = odb_digital_rain_digitals[Math.floor(Math.random()*odb_digital_rain_digitals.length)]; odb_digital_rain_ctx.fillText(digital, i*odb_digital_rain_font_size, odb_digital_rain_drops[i]*odb_digital_rain_font_size); if(odb_digital_rain_drops[i]*odb_digital_rain_font_size > odb_digital_rain_canvas.height && Math.random() > 0.975) odb_digital_rain_drops[i] = 0; odb_digital_rain_drops[i]++; } } function Obsidian_Dynamic_Background_Start() { odb_digital_rain_canvas = document.querySelector("div.odb-dt-digital-rain-dynamic-effect canvas"); odb_digital_rain_canvas.width = window.innerWidth; odb_digital_rain_canvas.height = window.innerHeight; odb_digital_rain_ctx = odb_digital_rain_canvas.getContext("2d"); odb_digital_rain_ctx.globalAlpha = 1; odb_digital_rain_ctx.globalCompositeOperation = "xor"; odb_digital_rain_columns = odb_digital_rain_canvas.width/odb_digital_rain_font_size; for(var x = 0; x < odb_digital_rain_columns; x++) odb_digital_rain_drops[x] = 1; } function Obsidian_Dynamic_Background_SetBrightness(brightness) { odb_digital_rain_canvas.width = window.innerWidth; // clear canvas odb_digital_rain_ctx.globalCompositeOperation = "xor"; odb_digital_rain_ctx.globalAlpha = brightness; } function Obsidian_Dynamic_Background_Clear() { clearInterval(odb_digital_rain_interval); } Obsidian_Dynamic_Background_Start(); odb_digital_rain_interval = setInterval(Obsidian_Dynamic_Background_Draw, 80); `; effectScript = effect.createEl("script"); effectScript.textContent = code; } } function Remove_DigitalRain(dynamicBackgroundContainer) { let effect = dynamicBackgroundContainer.find("div.odb-dt-digital-rain-dynamic-effect"); if (effect) { CallClear(dynamicBackgroundContainer); effect.remove(); } Unload_Effect_Script4(); } function Unload_Effect_Script4() { window["Obsidian_Dynamic_Background_Start"] = null; window["Obsidian_Dynamic_Background_Draw"] = null; window["Obsidian_Dynamic_Background_Clear"] = null; window["Obsidian_Dynamic_Background_SetBrightness"] = null; } function CallClear(dynamicBackgroundContainer) { let effectScript; let effect = dynamicBackgroundContainer.find("div.odb-dt-digital-rain-dynamic-effect"); let code = ` Obsidian_Dynamic_Background_Clear(); `; effectScript = effect.createEl("script"); effectScript.textContent = code; } function SetBrightness(dynamicBackgroundContainer, brightness) { let setBrightnessScript; let setBrightnessScriptContainer; let effect = dynamicBackgroundContainer.find("div.odb-dt-digital-rain-dynamic-effect"); if (effect) { let setBrightnessScriptContainer2 = dynamicBackgroundContainer.find("div.odb-dt-digital-rain-dynamic-effect div.set-brightness-script-container"); if (setBrightnessScriptContainer2) { setBrightnessScriptContainer2.remove(); } setBrightnessScriptContainer2 = effect.createEl("div", { cls: "div.set-brightness-script-container" }); let code = "Obsidian_Dynamic_Background_SetBrightness(" + brightness + ")"; setBrightnessScript = setBrightnessScriptContainer2.createEl("script"); setBrightnessScript.textContent = code; } } // main.ts var DEFAULT_SETTINGS = { dynamicEffect: 1 /* Dark_StarSky */, digitalRainBrightness: 0.7, enableDynamicEffect: true, backgroundImageFile: "", blur: 0 }; var DynamicBackgroundPlugin = class extends import_obsidian.Plugin { onload() { return __async(this, null, function* () { console.log("loading dynamic background plugin..."); this.preDynamicEffect = -1 /* Unknown */; yield this.loadSettings(); this.addSettingTab(new DynamicBackgroundSettingTab(this.app, this)); this.app.workspace.onLayoutReady(() => { this.AddDynamicBackgroundContainer(); this.SetDynamicBackgroundContainerBgProperty(); if (this.settings.enableDynamicEffect == true) { this.AddDynamicBackgroundEffect(this.settings.dynamicEffect); } }); }); } onunload() { console.log("unloading dynamic background plugin..."); this.RemoveDynamicBackgroundContainer(); } loadSettings() { return __async(this, null, function* () { this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); }); } saveSettings() { return __async(this, null, function* () { yield this.saveData(this.settings); }); } AddDynamicBackgroundContainer() { let div_root = app.workspace.containerEl.find("div.workspace > div.mod-root"); this.dynamicBackgroundContainer = null; if (div_root) { this.dynamicBackgroundContainer = div_root.createEl("div", { cls: "rh-obsidian-dynamic-background-container" }); this.wallpaperCover = this.dynamicBackgroundContainer.createEl("div", { cls: "rh-wallpaper-cover" }); this.SetWallpaperBlur(); } } SetWallpaperBlur() { let value = "blur(" + this.settings.blur.toString() + "px)"; this.wallpaperCover.style.setProperty("filter", value); } RemoveDynamicBackgroundContainer() { if (this.dynamicBackgroundContainer) { this.dynamicBackgroundContainer.remove(); this.dynamicBackgroundContainer = null; } } SetDynamicBackgroundContainerBgProperty() { return __async(this, null, function* () { if (this.dynamicBackgroundContainer == null) return; let backgroundImageAlreadySet = false; let imageFullFilename = ""; try { imageFullFilename = this.app.vault.adapter.getResourcePath(this.settings.backgroundImageFile); } catch (e) { } if (imageFullFilename != "") { this.dynamicBackgroundContainer.style.setProperty("background", 'url("' + imageFullFilename + '"'); this.dynamicBackgroundContainer.style.setProperty("background-size", "cover"); this.dynamicBackgroundContainer.style.setProperty("background-position", "center"); backgroundImageAlreadySet = true; } else { this.dynamicBackgroundContainer.style.removeProperty("background"); this.dynamicBackgroundContainer.style.removeProperty("background-size"); this.dynamicBackgroundContainer.style.removeProperty("background-position"); } if (backgroundImageAlreadySet == false) { this.dynamicBackgroundContainer.style.removeProperty("background"); this.dynamicBackgroundContainer.style.removeProperty("background-size"); this.dynamicBackgroundContainer.style.removeProperty("background-position"); if (this.settings.enableDynamicEffect == false) return; switch (this.settings.dynamicEffect) { case 1 /* Dark_StarSky */: break; case 2 /* Dark_Snow */: this.dynamicBackgroundContainer.style.setProperty("background", DarkTheme_Snow_Background_Property); break; case 3 /* Dark_Rain */: this.dynamicBackgroundContainer.style.setProperty("background", DarkTheme_Rain_Background_Property); break; case 4 /* Dark_RandomCircle */: this.dynamicBackgroundContainer.style.setProperty("background", DarkTheme_Random_Circle_Background_Property); break; case 40 /* Light_RandomCircle */: this.dynamicBackgroundContainer.style.setProperty("background", LightTheme_Random_Circle_Background_Property); break; case 41 /* Light_Wave */: this.dynamicBackgroundContainer.style.setProperty("background", LightTheme_Wave_Background_Property); break; case 5 /* Dark_DigitalRain */: this.dynamicBackgroundContainer.style.setProperty("background", DarkTheme_Digital_Rain_Background_Property); } } }); } SetDigitalRainBrightnessHelper() { if (this.dynamicBackgroundContainer) { SetBrightness(this.dynamicBackgroundContainer, this.settings.digitalRainBrightness); } } AddDynamicBackgroundEffect(effect) { switch (effect) { case 1 /* Dark_StarSky */: if (this.dynamicBackgroundContainer) Add_StarSky(this.dynamicBackgroundContainer); break; case 2 /* Dark_Snow */: if (this.dynamicBackgroundContainer) Add_Snow(this.dynamicBackgroundContainer); break; case 3 /* Dark_Rain */: if (this.dynamicBackgroundContainer) Add_Rain(this.dynamicBackgroundContainer); break; case 5 /* Dark_DigitalRain */: if (this.dynamicBackgroundContainer) { Add_DigitalRain(this.dynamicBackgroundContainer); this.SetDigitalRainBrightnessHelper(); } break; case 4 /* Dark_RandomCircle */: if (this.dynamicBackgroundContainer) Add_RandomCircle(this.dynamicBackgroundContainer); break; case 40 /* Light_RandomCircle */: if (this.dynamicBackgroundContainer) Add_RandomCircle_Light(this.dynamicBackgroundContainer); break; case 41 /* Light_Wave */: if (this.dynamicBackgroundContainer) Add_Wave_Light(this.dynamicBackgroundContainer); break; } } RemoveDynamicBackgroundEffect(effect) { if (effect == -1 /* Unknown */) return; switch (effect) { case 1 /* Dark_StarSky */: if (this.dynamicBackgroundContainer) Remove_StarSky(this.dynamicBackgroundContainer); break; case 2 /* Dark_Snow */: if (this.dynamicBackgroundContainer) Remove_Snow(this.dynamicBackgroundContainer); break; case 3 /* Dark_Rain */: if (this.dynamicBackgroundContainer) Remove_Rain(this.dynamicBackgroundContainer); break; case 5 /* Dark_DigitalRain */: if (this.dynamicBackgroundContainer) Remove_DigitalRain(this.dynamicBackgroundContainer); break; case 4 /* Dark_RandomCircle */: if (this.dynamicBackgroundContainer) Remove_RandomCircle(this.dynamicBackgroundContainer); break; case 40 /* Light_RandomCircle */: if (this.dynamicBackgroundContainer) Remove_RandomCircle_Light(this.dynamicBackgroundContainer); break; case 41 /* Light_Wave */: if (this.dynamicBackgroundContainer) Remove_Wave_Light(this.dynamicBackgroundContainer); break; } } }; var DynamicBackgroundSettingTab = class extends import_obsidian.PluginSettingTab { constructor(app2, plugin) { super(app2, plugin); this.plugin = plugin; } display() { const { containerEl } = this; containerEl.empty(); containerEl.createEl("h2", { text: "Dynamic Background Plugin - Settings" }); new import_obsidian.Setting(containerEl).setName("Dynamic Effect").setDesc("Select a dynamic effect").addDropdown((dropdown) => dropdown.addOption(5 /* Dark_DigitalRain */.toString(), "Dark - Matrix / Digital Rain").addOption(3 /* Dark_Rain */.toString(), "Dark - Rain").addOption(4 /* Dark_RandomCircle */.toString(), "Dark - Random Circle").addOption(2 /* Dark_Snow */.toString(), "Dark - Snow").addOption(1 /* Dark_StarSky */.toString(), "Dark - Star Sky").addOption(40 /* Light_RandomCircle */.toString(), "Light - Random Circle").addOption(41 /* Light_Wave */.toString(), "Light - Wave").setValue(this.plugin.settings.dynamicEffect.toString()).onChange((value) => __async(this, null, function* () { this.plugin.preDynamicEffect = this.plugin.settings.dynamicEffect; this.plugin.settings.dynamicEffect = Number(value); yield this.plugin.saveSettings(); this.plugin.RemoveDynamicBackgroundEffect(this.plugin.preDynamicEffect); if (this.plugin.settings.enableDynamicEffect == true) this.plugin.AddDynamicBackgroundEffect(this.plugin.settings.dynamicEffect); this.plugin.SetDynamicBackgroundContainerBgProperty(); this.display(); }))); if (this.plugin.settings.dynamicEffect == 5 /* Dark_DigitalRain */) { new import_obsidian.Setting(containerEl).setName("Brightness").setDesc("Set Digital Rain Brightness.").addSlider((tc) => { tc.setDynamicTooltip().setLimits(0.5, 1, 0.01).setValue(this.plugin.settings.digitalRainBrightness).onChange((value) => __async(this, null, function* () { this.plugin.settings.digitalRainBrightness = value; this.plugin.SetDigitalRainBrightnessHelper(); yield this.plugin.saveSettings(); })); }); } new import_obsidian.Setting(containerEl).setName("Enable Dynamic Effect").setDesc("Enable or disable dynamic effect").addToggle((tc) => tc.setValue(this.plugin.settings.enableDynamicEffect).onChange((value) => __async(this, null, function* () { this.plugin.settings.enableDynamicEffect = value; yield this.plugin.saveSettings(); if (this.plugin.settings.enableDynamicEffect == false) { this.plugin.RemoveDynamicBackgroundEffect(this.plugin.settings.dynamicEffect); } else { this.plugin.AddDynamicBackgroundEffect(this.plugin.settings.dynamicEffect); } }))); new import_obsidian.Setting(containerEl).setName("Static Wallpaper Image").setDesc("Image file in Vault. Please use the relative path of the image file inside Vault.").addTextArea((text) => text.setValue(this.plugin.settings.backgroundImageFile).setPlaceholder("Example: attachments/moon.jpg or wallpapers/green.png").then((cb) => { cb.inputEl.style.width = "100%"; cb.inputEl.rows = 5; }).onChange((value) => __async(this, null, function* () { this.plugin.settings.backgroundImageFile = value; yield this.plugin.saveSettings(); this.plugin.SetDynamicBackgroundContainerBgProperty(); }))); new import_obsidian.Setting(containerEl).setName("Blur").setDesc("The blurriness of the wallpaper, 0 means no blur.").addSlider((tc) => { tc.setDynamicTooltip().setLimits(0, 100, 1).setValue(this.plugin.settings.blur).onChange((value) => __async(this, null, function* () { this.plugin.settings.blur = value; yield this.plugin.saveSettings(); this.plugin.SetWallpaperBlur(); })); }); } }; /* nosourcemap */