diff --git a/.vscodeignore b/.vscodeignore index d255964..8306204 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -3,6 +3,7 @@ out/** node_modules/** src/** +!media/** .gitignore .yarnrc webpack.config.js diff --git a/media/styles.css b/media/styles.css new file mode 100644 index 0000000..8981742 --- /dev/null +++ b/media/styles.css @@ -0,0 +1,124 @@ +:root { + --bg: #f7f7fa; + --panel-bg: #fff; + --text: #222; + --label: #555; + --input-bg: #f0f0f3; + --input-border: #d0d0d7; + --input-focus: #1976d2; + --button-bg: #1976d2; + --button-text: #fff; + --button-hover: #1565c0; + --border-radius: 8px; + --shadow: 0 2px 12px rgba(0,0,0,0.07); +} +@media (prefers-color-scheme: dark) { + :root { + --bg: #181a1b; + --panel-bg: #23272e; + --text: #f3f3f3; + --label: #b0b0b0; + --input-bg: #23272e; + --input-border: #33363b; + --input-focus: #90caf9; + --button-bg: #1976d2; + --button-text: #fff; + --button-hover: #1565c0; + --border-radius: 8px; + --shadow: 0 2px 12px rgba(0,0,0,0.25); + } +} +body { + background: var(--bg); + color: var(--text); + font-family: 'Segoe UI', 'Roboto', Arial, sans-serif; + margin: 0; + min-height: 100vh; +} +.create-container, .config-container { + max-width: 420px; + margin: 48px auto; + background: var(--panel-bg); + border-radius: var(--border-radius); + box-shadow: var(--shadow); + padding: 32px 36px 28px 36px; + display: flex; + flex-direction: column; + gap: 18px; +} +.head-wrap { + display: flex; + align-items: center; + justify-content: space-between; +} +.create-container h2, .config-container h2 { + margin: 0; + font-size: 1.5em; + font-weight: 600; + letter-spacing: 0.01em; +} +.form-group { + display: flex; + flex-direction: column; + gap: 6px; +} +label { + color: var(--label); + font-size: 1em; + font-weight: 500; +} +input, select { + background: var(--input-bg); + color: var(--text); + border: 1.5px solid var(--input-border); + border-radius: var(--border-radius); + padding: 8px 10px; + font-size: 1em; + transition: border 0.2s, box-shadow 0.2s; + outline: none; +} +input:focus, select:focus { + border-color: var(--input-focus); + box-shadow: 0 0 0 2px var(--input-focus)33; +} +button, .btn { + margin-top: 10px; + background: var(--button-bg); + color: var(--button-text); + border: none; + border-radius: var(--border-radius); + padding: 10px 15px; + font-size: 1.1em; + font-weight: 600; + cursor: pointer; + transition: background 0.2s, box-shadow 0.2s; + box-shadow: 0 1px 4px rgba(25, 118, 210, 0.08); +} +button:hover, button:focus, .btn:hover, .btn:focus { + background: var(--button-hover); +} +.destination { + margin-bottom: 16px; + color: #888; + font-size: 13px; +} +.lang-select { + display: block; +} +.var-hint { + color: #888; + font-size: 13px; + margin-bottom: 10px; +} + +.template-list { + display: flex; + flex-direction: column; + gap: 8px; +} + +#configForm { + display: flex; + flex-direction: column; + gap: 8px; +} \ No newline at end of file diff --git a/mytemplategenerator-0.0.6.vsix b/mytemplategenerator-0.0.6.vsix new file mode 100644 index 0000000..f0a8e5c Binary files /dev/null and b/mytemplategenerator-0.0.6.vsix differ diff --git a/package.json b/package.json index f7715a8..8d468f7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "mytemplategenerator", "displayName": "myTemplateGenerator", "description": "Generate files and folders from customizable templates with variable substitution in VSCode.", - "version": "0.0.6", + "version": "0.0.7", "publisher": "MyTemplateGenerator", "author": "Sergey Gromov", "icon": "logo.png", diff --git a/src/webview/configWebview.ts b/src/webview/configWebview.ts index 6e6facc..d1a4c44 100644 --- a/src/webview/configWebview.ts +++ b/src/webview/configWebview.ts @@ -48,8 +48,8 @@ export async function showConfigWebview(context: vscode.ExtensionContext) { { enableScripts: true } ); let config = readConfig(); - // Получаем URI для стилей - const stylePath = vscode.Uri.joinPath(context.extensionUri, 'src', 'webview', 'styles.css'); + // Стили теперь лежат в media/styles.css (папка для статики) + const stylePath = vscode.Uri.joinPath(context.extensionUri, 'media', 'styles.css'); const styleUri = panel.webview.asWebviewUri(stylePath); setHtml((config.language === 'en' ? 'en' : 'ru')); diff --git a/src/webview/templateVarsWebview.ts b/src/webview/templateVarsWebview.ts index 1f41152..5ccee28 100644 --- a/src/webview/templateVarsWebview.ts +++ b/src/webview/templateVarsWebview.ts @@ -17,7 +17,8 @@ export async function showTemplateAndVarsWebview( return I18N_DICTIONARIES[language] || I18N_DICTIONARIES['ru']; } const templates = fs.readdirSync(templatesDir).filter(f => fs.statSync(path.join(templatesDir, f)).isDirectory()); - const stylePath = vscode.Uri.joinPath(context.extensionUri, 'src', 'webview', 'styles.css'); + // Стили теперь лежат в media/styles.css (папка для статики) + const stylePath = vscode.Uri.joinPath(context.extensionUri, 'media', 'styles.css'); return new Promise((resolve) => { const panel = vscode.window.createWebviewPanel( 'templateVars',