feat: unify tool styles and add dynamic height for textareas

This commit is contained in:
2026-02-27 01:32:08 +00:00
parent 782786ec7e
commit 8bf44cde6a
8 changed files with 443 additions and 70 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref } from 'vue';
import { useFillHeight } from '../../composables/useFillHeight';
// Options
const useLower = ref(true);
@@ -12,6 +13,8 @@ const count = ref(20);
// Result
const result = ref('');
const textareaRef = ref(null);
const { height: textareaHeight } = useFillHeight(textareaRef, 40);
// Character Sets
const CHARS_LOWER = 'abcdefghijklmnopqrstuvwxyz';
@@ -68,8 +71,8 @@ const generatePasswords = () => {
</script>
<template>
<div class="passwords-tool">
<div class="glass-panel tool-panel">
<div class="tool-container">
<div class="tool-panel">
<h2 class="tool-title">Bulk Passwords Generator</h2>
<div class="options-grid">
@@ -129,66 +132,19 @@ const generatePasswords = () => {
<div class="result-area">
<label>Passwords</label>
<textarea
class="result-textarea glass-panel selectable"
v-model="result"
placeholder="Generated passwords will appear here..."
></textarea>
<div ref="textareaRef" :style="{ height: textareaHeight, width: '100%' }">
<textarea
class="tool-textarea"
v-model="result"
placeholder="Generated passwords will appear here..."
></textarea>
</div>
</div>
</div>
</div>
</template>
<style scoped>
.passwords-tool {
display: flex;
justify-content: center;
width: 100%;
max-width: 800px;
margin: 0 auto;
height: 100%;
}
.tool-panel {
width: 100%;
padding: 2rem;
border-radius: 16px;
display: flex;
flex-direction: column;
gap: 1.5rem;
max-height: 100%;
overflow-y: auto;
}
/* Custom scrollbar for tool panel */
.tool-panel::-webkit-scrollbar {
width: 8px;
}
.tool-panel::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 4px;
}
.tool-panel::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.2);
border-radius: 4px;
}
.tool-panel::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.3);
}
.tool-title {
margin: 0;
font-size: 1.5rem;
font-weight: 600;
background: var(--title-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
filter: drop-shadow(0 0 10px var(--title-glow));
}
.options-grid {
display: flex;
flex-direction: column;
@@ -399,23 +355,12 @@ const generatePasswords = () => {
.result-area label {
color: var(--text-secondary);
font-weight: 500;
font-size: 0.9rem;
font-size: 0.9rem;margin-top: auto;
}
.result-textarea {
width: 100%;
box-sizing: border-box;
height: 100%;
.tool-textarea {
min-height: 200px;
padding: 1rem;
background-color: rgba(0, 0, 0, 0.2);
border: 1px solid var(--toggle-border);
border-radius: 12px;
color: var(--text-strong);
font-family: monospace;
font-size: 1rem;
resize: vertical;
line-height: 1.6;
}
.result-textarea:focus {