From 07b93660c6ecf95954ce14c8ef6a372c031b8406 Mon Sep 17 00:00:00 2001 From: mousebomb Date: Sat, 17 May 2025 11:49:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3styles=E6=94=BE=E5=85=A5css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.ts | 15 +++------------ styles.css | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/main.ts b/main.ts index 120f024..bb36058 100644 --- a/main.ts +++ b/main.ts @@ -522,28 +522,19 @@ class DiaryIcsSettingTab extends PluginSettingTab { await this.plugin.saveSettings(false); })); - const templateExample = containerEl.createEl('div', {text: locale.templateExampleTitle}); - templateExample.style.padding = '5px'; - templateExample.style.fontSize = '0.8em'; - templateExample.style.color = '#888'; + const templateExample = containerEl.createEl('div', {text: locale.templateExampleTitle, cls: 'diary-ics-template-example'}); templateExample.createEl('div', {text: locale.templateExample1}); templateExample.createEl('div', {text: locale.templateExample2}); templateExample.createEl('div', {text: locale.templateExample3}); templateExample.createEl('div', {text: locale.templateExample4}); - templateExample.style.marginBottom = '20px'; // 显示当前ICS订阅链接 const localIP = this.plugin.getLocalIP(); containerEl.createEl('h3', {text: locale.icsLinkTitle}); - const linkEl = containerEl.createEl('div', {text: `http://${localIP}:${this.plugin.settings.port}/feed.ics`}); - linkEl.style.padding = '10px'; - linkEl.style.backgroundColor = '#f5f5f5'; - linkEl.style.borderRadius = '5px'; - linkEl.style.marginBottom = '20px'; + const linkEl = containerEl.createEl('div', {text: `http://${localIP}:${this.plugin.settings.port}/feed.ics`, cls: 'diary-ics-link-div'}); // 添加复制按钮 - const copyButton = containerEl.createEl('button', {text: locale.copyLinkButton}); - copyButton.style.marginBottom = '20px'; + const copyButton = containerEl.createEl('button', {text: locale.copyLinkButton, cls: 'diary-ics-copy-button'}); copyButton.addEventListener('click', () => { const url = `http://${localIP}:${this.plugin.settings.port}/feed.ics`; navigator.clipboard.writeText(url); diff --git a/styles.css b/styles.css index 71cc60f..cc3b516 100644 --- a/styles.css +++ b/styles.css @@ -6,3 +6,21 @@ available in the app when your plugin is enabled. If your plugin does not need CSS, delete this file. */ + +.diary-ics-template-example { + padding: 5px; + font-size: 0.8em; + color: #888; + margin-bottom: 20px; +} + +.diary-ics-link-div { + padding: 10px; + background-color: #f5f5f5; + border-radius: 5px; + margin-bottom: 20px; +} + +.diary-ics-copy-button { + margin-bottom: 20px; +}