|
8 | 8 | margin: 0; |
9 | 9 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; |
10 | 10 | padding: 12px; |
11 | | - width: 520px; |
12 | | - min-height: 450px; |
| 11 | + width: 880px; |
| 12 | + height: 700px; |
| 13 | + max-height: 700px; |
13 | 14 | font-size: 14px; |
| 15 | + overflow: hidden; |
| 16 | + box-sizing: border-box; |
14 | 17 | } |
| 18 | + |
| 19 | + .container { |
| 20 | + display: flex; |
| 21 | + flex-direction: column; |
| 22 | + height: 100%; |
| 23 | + gap: 8px; |
| 24 | + } |
| 25 | + |
15 | 26 | textarea, pre { |
16 | 27 | width: 100%; |
17 | 28 | box-sizing: border-box; |
18 | 29 | font-family: 'Consolas', 'Monaco', 'Courier New', monospace; |
19 | 30 | font-size: 12px; |
20 | 31 | } |
| 32 | + |
21 | 33 | textarea { |
22 | | - height: 120px; |
| 34 | + height: 100px; |
23 | 35 | border: 1px solid #ccc; |
24 | 36 | border-radius: 4px; |
25 | 37 | padding: 8px; |
26 | | - resize: vertical; |
27 | | - margin-bottom: 12px; |
| 38 | + resize: none; |
| 39 | + flex-shrink: 0; |
28 | 40 | } |
| 41 | + |
29 | 42 | pre { |
30 | 43 | white-space: pre-wrap; |
31 | | - margin: 8px 0; |
| 44 | + margin: 0; |
32 | 45 | padding: 12px; |
33 | 46 | background: #f8f9fa; |
34 | 47 | border: 1px solid #e9ecef; |
35 | 48 | border-radius: 4px; |
36 | | - max-height: 300px; |
37 | 49 | overflow-y: auto; |
38 | 50 | font-size: 11px; |
39 | 51 | line-height: 1.4; |
| 52 | + flex: 1; |
| 53 | + min-height: 0; |
40 | 54 | } |
| 55 | + |
41 | 56 | button { |
42 | 57 | margin-right: 8px; |
43 | 58 | padding: 8px 16px; |
|
48 | 63 | cursor: pointer; |
49 | 64 | font-size: 14px; |
50 | 65 | } |
| 66 | + |
51 | 67 | button:hover { |
52 | 68 | background: #106ebe; |
53 | 69 | } |
| 70 | + |
| 71 | + .header { |
| 72 | + flex-shrink: 0; |
| 73 | + } |
| 74 | + |
| 75 | + .input-section { |
| 76 | + flex-shrink: 0; |
| 77 | + } |
| 78 | + |
54 | 79 | .button-row { |
55 | | - margin: 12px 0; |
| 80 | + margin: 8px 0; |
56 | 81 | display: flex; |
57 | 82 | align-items: center; |
58 | 83 | gap: 12px; |
| 84 | + flex-shrink: 0; |
59 | 85 | } |
| 86 | + |
60 | 87 | .options-row { |
61 | 88 | margin: 8px 0; |
62 | 89 | display: flex; |
63 | 90 | align-items: center; |
64 | 91 | gap: 16px; |
65 | 92 | font-size: 13px; |
| 93 | + flex-shrink: 0; |
66 | 94 | } |
| 95 | + |
67 | 96 | .option-group { |
68 | 97 | display: flex; |
69 | 98 | align-items: center; |
70 | 99 | gap: 6px; |
71 | 100 | } |
| 101 | + |
| 102 | + .result-section { |
| 103 | + flex: 1; |
| 104 | + min-height: 0; |
| 105 | + display: flex; |
| 106 | + flex-direction: column; |
| 107 | + } |
| 108 | + |
72 | 109 | input[type="radio"] { |
73 | 110 | margin: 0; |
74 | 111 | } |
| 112 | + |
75 | 113 | h3 { |
76 | 114 | margin: 0 0 8px 0; |
77 | 115 | color: #323130; |
|
80 | 118 | align-items: center; |
81 | 119 | gap: 8px; |
82 | 120 | } |
| 121 | + |
83 | 122 | .status { |
84 | 123 | font-size: 12px; |
85 | 124 | color: #666; |
86 | 125 | font-weight: normal; |
87 | 126 | } |
| 127 | + |
88 | 128 | .exact-copy { |
89 | 129 | color: #107c10; |
90 | 130 | font-weight: 600; |
91 | 131 | } |
| 132 | + |
92 | 133 | .clean-copy { |
93 | 134 | color: #0078d4; |
94 | 135 | font-weight: 600; |
95 | 136 | } |
| 137 | + |
| 138 | + /* Enhanced scrolling for better code visibility */ |
| 139 | + pre::-webkit-scrollbar { |
| 140 | + width: 12px; |
| 141 | + } |
| 142 | + pre::-webkit-scrollbar-track { |
| 143 | + background: #f1f1f1; |
| 144 | + border-radius: 6px; |
| 145 | + } |
| 146 | + pre::-webkit-scrollbar-thumb { |
| 147 | + background: #c1c1c1; |
| 148 | + border-radius: 6px; |
| 149 | + } |
| 150 | + pre::-webkit-scrollbar-thumb:hover { |
| 151 | + background: #a8a8a8; |
| 152 | + } |
| 153 | + |
| 154 | + /* Better labels and spacing */ |
| 155 | + label { |
| 156 | + font-weight: 600; |
| 157 | + color: #323130; |
| 158 | + margin-bottom: 4px; |
| 159 | + display: block; |
| 160 | + } |
| 161 | + |
| 162 | + /* Better spacing for the result area */ |
| 163 | + #result { |
| 164 | + margin-top: 4px; |
| 165 | + } |
96 | 166 | </style> |
97 | 167 | </head> |
98 | 168 | <body> |
99 | | - <h3> |
100 | | - BlazorSnap - HTML to Blazor |
101 | | - <span class="status" id="mode-status">Exact Visual Copy</span> |
102 | | - </h3> |
103 | | - |
104 | | - <label for="source">Selected HTML:</label> |
105 | | - <textarea id="source" placeholder="Right-click an element and select 'Convert Element to Blazor Component'"></textarea> |
106 | | - |
107 | | - <div class="options-row"> |
108 | | - <div class="option-group"> |
109 | | - <input type="radio" id="exact-mode" name="conversion-mode" value="exact" checked> |
110 | | - <label for="exact-mode" class="exact-copy">Exact Visual Copy</label> |
| 169 | + <div class="container"> |
| 170 | + <div class="header"> |
| 171 | + <h3> |
| 172 | + BlazorSnap - HTML to Blazor |
| 173 | + <span class="status" id="mode-status">Exact Visual Copy</span> |
| 174 | + </h3> |
111 | 175 | </div> |
112 | | - <div class="option-group"> |
113 | | - <input type="radio" id="clean-mode" name="conversion-mode" value="clean"> |
114 | | - <label for="clean-mode" class="clean-copy">Clean/Simplified</label> |
| 176 | + |
| 177 | + <div class="input-section"> |
| 178 | + <label for="source">Selected HTML:</label> |
| 179 | + <textarea id="source" placeholder="Right-click an element and select 'Convert Element to Blazor Component'"></textarea> |
| 180 | + |
| 181 | + <div class="options-row"> |
| 182 | + <div class="option-group"> |
| 183 | + <input type="radio" id="exact-mode" name="conversion-mode" value="exact" checked> |
| 184 | + <label for="exact-mode" class="exact-copy">Exact Visual Copy</label> |
| 185 | + </div> |
| 186 | + <div class="option-group"> |
| 187 | + <input type="radio" id="clean-mode" name="conversion-mode" value="clean"> |
| 188 | + <label for="clean-mode" class="clean-copy">Clean/Simplified</label> |
| 189 | + </div> |
| 190 | + </div> |
| 191 | + |
| 192 | + <div class="button-row"> |
| 193 | + <button id="convert">Generate .razor</button> |
| 194 | + <button id="copy">Copy to Clipboard</button> |
| 195 | + </div> |
115 | 196 | </div> |
116 | | - </div> |
117 | | - |
118 | | - <div class="button-row"> |
119 | | - <button id="convert">Generate .razor</button> |
120 | | - <button id="copy">Copy to Clipboard</button> |
121 | | - </div> |
122 | | - |
123 | | - <label for="result">Generated Blazor Component:</label> |
124 | | - <pre id="result">// Generated component will appear here... |
| 197 | + |
| 198 | + <div class="result-section"> |
| 199 | + <label for="result">Generated Blazor Component:</label> |
| 200 | + <pre id="result">// Generated component will appear here... |
125 | 201 | // |
126 | 202 | // EXACT VISUAL COPY MODE: |
127 | 203 | // - Preserves all computed styles for identical appearance |
|
132 | 208 | // - Converts utility classes to semantic CSS |
133 | 209 | // - Removes unnecessary attributes |
134 | 210 | // - Best for maintainable components</pre> |
| 211 | + </div> |
| 212 | + </div> |
135 | 213 |
|
136 | 214 | <script src="popup.js"></script> |
137 | 215 | </body> |
|
0 commit comments