diff --git a/LICENSE b/LICENSE index 287f37a..e43424e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2020-2025 by Dynalist Inc. +Copyright (C) 2026 by Jatin Shihora Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. diff --git a/esbuild.config.mjs b/esbuild.config.mjs index aaa4475..e873573 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -14,7 +14,7 @@ const context = await esbuild.context({ banner: { js: banner, }, - entryPoints: ["main.ts"], + entryPoints: ["src/main.ts"], bundle: true, external: [ "obsidian", diff --git a/manifest.json b/manifest.json index 29d70e3..51c289c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,6 +6,5 @@ "description": "Focus better with lofi vibes and Pomodoro sessions. Stream radio or play your music library, all within your vault.", "author": "Jatin Shihora", "authorUrl": "https://github.com/Jatin-Shihora", - "fundingUrl": "https://github.com/Jatin-Shihora/Obsidian-lofi-plugin", "isDesktopOnly": false -} +} \ No newline at end of file diff --git a/defaults.ts b/src/defaults.ts similarity index 100% rename from defaults.ts rename to src/defaults.ts diff --git a/main.ts b/src/main.ts similarity index 98% rename from main.ts rename to src/main.ts index 4d5db72..b70b946 100644 --- a/main.ts +++ b/src/main.ts @@ -110,7 +110,7 @@ export default class LofiPlugin extends Plugin { "Toggle lofi playback", () => this.togglePlayback() ); - ribbonIconEl.addClass("lofi-plugin-ribbon-icon"); + ribbonIconEl.addClass("ribbon-icon"); this.statusBarItemEl = this.addStatusBarItem(); @@ -166,32 +166,32 @@ export default class LofiPlugin extends Plugin { ); this.addCommand({ - id: "lofi-plugin-toggle-playback", + id: "toggle-playback", name: "Toggle lofi playback", callback: () => this.togglePlayback(), }); this.addCommand({ - id: "lofi-plugin-play-next-track", + id: "play-next-track", name: "Play next lofi track", callback: () => this.playNextTrack(), }); this.addCommand({ - id: "lofi-plugin-play-previous-track", + id: "play-previous-track", name: "Play previous lofi track", callback: () => this.playPreviousTrack(), }); this.addCommand({ - id: "lofi-plugin-start-timer", + id: "start-timer", name: "Start focus timer", callback: () => this.startTimer(), }); this.addCommand({ - id: "lofi-plugin-pause-timer", + id: "pause-timer", name: "Pause focus timer", callback: () => this.pauseTimer(), }); this.addCommand({ - id: "lofi-plugin-reset-timer", + id: "reset-timer", name: "Reset focus timer", callback: () => this.resetTimer(), }); @@ -705,15 +705,6 @@ export default class LofiPlugin extends Plugin { private setupAnimationCanvas(): void { this.animationCanvas = document.createElement("canvas"); - this.animationCanvas.setCssProps({ - position: "fixed", - top: "0", - left: "0", - width: "100%", - height: "100%", - zIndex: "0", - pointerEvents: "none" - }); this.animationCanvas.classList.add("lofi-animation-canvas"); document.body.appendChild(this.animationCanvas); this.animationContext = this.animationCanvas.getContext("2d"); diff --git a/modal.ts b/src/modal.ts similarity index 100% rename from modal.ts rename to src/modal.ts diff --git a/settings-tab.ts b/src/settings-tab.ts similarity index 97% rename from settings-tab.ts rename to src/settings-tab.ts index 0807805..22cb6d5 100644 --- a/settings-tab.ts +++ b/src/settings-tab.ts @@ -31,10 +31,7 @@ export class LofiSettingTab extends PluginSettingTab { const { containerEl } = this; containerEl.empty(); - new Setting(containerEl).setName("Lofi plugin").setHeading(); - new Setting(containerEl).setName("Audio").setHeading(); - new Setting(containerEl).setName("Audio source").setHeading(); const streamOptions: Record = {}; PREDEFINED_LOFI_STREAMS.forEach((stream) => { @@ -269,7 +266,6 @@ export class LofiSettingTab extends PluginSettingTab { text: "⬆️ ..", cls: "lofi-browser-item-name", }); - upButtonEl.setCssProps({ cursor: "pointer" }); upButtonEl.addEventListener("click", () => { this.navigateUp(); }); @@ -295,14 +291,12 @@ export class LofiSettingTab extends PluginSettingTab { if (child instanceof TFolder) { iconEl.setText("📁"); itemEl.addClass("lofi-browser-item-folder"); - itemEl.setCssProps({ cursor: "pointer" }); itemEl.addEventListener("click", () => { this.navigateToFolder(child.path); }); } else if (child instanceof TFile) { iconEl.setText("📄"); itemEl.addClass("lofi-browser-item-file"); - itemEl.setCssProps({ cursor: "default" }); } } } catch (error) { @@ -387,7 +381,6 @@ export class LofiSettingTab extends PluginSettingTab { cls: "lofi-track-name", }); trackItemEl.addClass("lofi-track-item-clickable"); - trackItemEl.setCssProps({ cursor: "pointer" }); trackItemEl.addEventListener("click", () => { this.plugin.playTrackByPath(trackVaultPath); this.updateTrackListPlayingState( diff --git a/streams.ts b/src/streams.ts similarity index 100% rename from streams.ts rename to src/streams.ts diff --git a/types.ts b/src/types.ts similarity index 100% rename from types.ts rename to src/types.ts diff --git a/styles.css b/styles.css index 788fe78..bf36f58 100644 --- a/styles.css +++ b/styles.css @@ -148,19 +148,6 @@ If your plugin does not need CSS, delete this file. /* --- End Styles for the Custom Folder Browser UI --- */ -/* You can keep your existing styles for the ribbon icon etc. below this */ - -.lofi-plugin-ribbon-icon { - /* Add your styles for the ribbon icon here */ - /* For example: */ - /* fill: purple; */ -} - -/* Styles for the status bar item if you want to customize it */ -/* .status-bar-item { ... } */ - -/* styles.css (add these below the folder browser styles) */ - /* --- Styles for the Track List --- */ .lofi-track-list { @@ -195,6 +182,11 @@ If your plugin does not need CSS, delete this file. background-color: var(--background-modifier-hover); /* Hover effect */ } +/* Style for clickable track items */ +.lofi-track-item-clickable { + cursor: pointer; +} + /* Style for the track name text */ .lofi-track-name { flex-grow: 1; /* Allow name to take space */ @@ -371,10 +363,9 @@ If your plugin does not need CSS, delete this file. align-items: center; } -/* --- NEW: Styles for Animation Canvas --- */ +/* Styles for Animation Canvas */ .lofi-animation-canvas { - /* Styles are primarily set in main.ts, but defining the class is good practice */ - /* These styles ensure it acts as a fixed overlay */ + /* Fixed overlay for background animation */ position: fixed; top: 0; left: 0; @@ -383,4 +374,3 @@ If your plugin does not need CSS, delete this file. z-index: 0; /* Or 1, below most Obsidian UI elements */ pointer-events: none; /* Crucial: allows clicks/interaction with UI elements behind the canvas */ } -/* --- END NEW --- */ diff --git a/versions.json b/versions.json index f66b649..03d60fe 100644 --- a/versions.json +++ b/versions.json @@ -2,4 +2,4 @@ "1.0.0": "0.15.0", "1.0.1": "0.15.0", "1.0.2": "0.15.0" -} +} \ No newline at end of file