5uck1t commited on
Commit
a92e9af
·
verified ·
1 Parent(s): 673d3dc

now there is no output when generate output is clicked can you re-add that?

Browse files
Files changed (2) hide show
  1. script.js +8 -5
  2. style.css +4 -2
script.js CHANGED
@@ -1,5 +1,8 @@
1
 
2
  document.addEventListener('DOMContentLoaded', function() {
 
 
 
3
  // Add input field
4
  const addInputBtn = document.getElementById('add-input');
5
  const inputContainer = document.getElementById('input-container');
@@ -36,10 +39,8 @@ document.addEventListener('DOMContentLoaded', function() {
36
 
37
  // Generate output
38
  const generateBtn = document.getElementById('generate-btn');
39
- const outputTextarea = document.querySelector('#output textarea');
40
- const previewContent = document.querySelector('.preview-content');
41
- const rawContent = document.querySelector('.raw-content');
42
- generateBtn.addEventListener('click', () => {
43
  const className = document.getElementById('class-name').value || 'MyClass';
44
  const inputGroups = Array.from(document.querySelectorAll('.input-group'));
45
  const fields = inputGroups.map(group => {
@@ -109,10 +110,12 @@ document.addEventListener('DOMContentLoaded', function() {
109
 
110
  jpaCode += `}\n`;
111
  // Update output
 
112
  outputTextarea.value = jpaCode;
 
113
 
114
  // Set up download functionality
115
- const downloadBtn = document.getElementById('download-btn');
116
  downloadBtn.onclick = function() {
117
  const blob = new Blob([jpaCode], { type: 'text/plain' });
118
  const url = URL.createObjectURL(blob);
 
1
 
2
  document.addEventListener('DOMContentLoaded', function() {
3
+ // Initialize highlight.js
4
+ hljs.highlightAll();
5
+
6
  // Add input field
7
  const addInputBtn = document.getElementById('add-input');
8
  const inputContainer = document.getElementById('input-container');
 
39
 
40
  // Generate output
41
  const generateBtn = document.getElementById('generate-btn');
42
+ const outputTextarea = document.getElementById('output-text');
43
+ generateBtn.addEventListener('click', () => {
 
 
44
  const className = document.getElementById('class-name').value || 'MyClass';
45
  const inputGroups = Array.from(document.querySelectorAll('.input-group'));
46
  const fields = inputGroups.map(group => {
 
110
 
111
  jpaCode += `}\n`;
112
  // Update output
113
+ // Update output
114
  outputTextarea.value = jpaCode;
115
+ hljs.highlightElement(outputTextarea);
116
 
117
  // Set up download functionality
118
+ const downloadBtn = document.getElementById('download-btn');
119
  downloadBtn.onclick = function() {
120
  const blob = new Blob([jpaCode], { type: 'text/plain' });
121
  const url = URL.createObjectURL(blob);
style.css CHANGED
@@ -27,10 +27,12 @@ body {
27
  flex: 1;
28
  min-height: 0;
29
  }
30
-
31
- textarea, .preview-content {
32
  height: 100% !important;
33
  min-height: 0;
 
 
 
34
  }
35
  /* Custom Scrollbar */
36
  ::-webkit-scrollbar {
 
27
  flex: 1;
28
  min-height: 0;
29
  }
30
+ textarea {
 
31
  height: 100% !important;
32
  min-height: 0;
33
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
34
+ font-size: 0.875rem;
35
+ line-height: 1.5;
36
  }
37
  /* Custom Scrollbar */
38
  ::-webkit-scrollbar {