Update index.html
Browse files- index.html +17 -6
index.html
CHANGED
|
@@ -82,7 +82,7 @@
|
|
| 82 |
<body>
|
| 83 |
<div class="container">
|
| 84 |
<h1>Edu Assess Pro - smart Exam Paper Designer</h1>
|
| 85 |
-
<p class="subtitle">Fill the fields to generate a <strong>
|
| 86 |
<div class="row">
|
| 87 |
<div>
|
| 88 |
<label for="grade">Grade</label>
|
|
@@ -135,6 +135,9 @@
|
|
| 135 |
<button id="gen" class="btn" type="button">Generate Prompt</button>
|
| 136 |
<button id="copy" class="btn" type="button">Copy Prompt and Paste Now</button>
|
| 137 |
</div>
|
|
|
|
|
|
|
|
|
|
| 138 |
<pre id="output"></pre>
|
| 139 |
</div>
|
| 140 |
<div id="toast" class="toast">Copied & Opening GPT...</div>
|
|
@@ -163,11 +166,19 @@
|
|
| 163 |
const prompt=buildPrompt();
|
| 164 |
$('#output').textContent=prompt;
|
| 165 |
});
|
| 166 |
-
$('#copy').addEventListener('click',async()=>{
|
| 167 |
-
const prompt
|
| 168 |
-
|
| 169 |
-
const
|
| 170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
});
|
| 172 |
</script>
|
| 173 |
</body>
|
|
|
|
| 82 |
<body>
|
| 83 |
<div class="container">
|
| 84 |
<h1>Edu Assess Pro - smart Exam Paper Designer</h1>
|
| 85 |
+
<p class="subtitle">Fill the fields to generate a <strong>Complete Exam Paper</strong>. chose Opetion .</p>
|
| 86 |
<div class="row">
|
| 87 |
<div>
|
| 88 |
<label for="grade">Grade</label>
|
|
|
|
| 135 |
<button id="gen" class="btn" type="button">Generate Prompt</button>
|
| 136 |
<button id="copy" class="btn" type="button">Copy Prompt and Paste Now</button>
|
| 137 |
</div>
|
| 138 |
+
<div class="toolbar" aria-label="Open GPT fallback" style="justify-content:flex-end;">
|
| 139 |
+
<a id="open-gpt-fallback" href="https://chatgpt.com/g/g-68697e4c49508191b175d86830b34d85-eduassess-pro-smart-exam-paper-designer" target="_blank" rel="noopener noreferrer" class="btn secondary" style="display:none; width:auto; min-width:14ch; padding:.7rem 1rem;">Open GPT</a>
|
| 140 |
+
</div>
|
| 141 |
<pre id="output"></pre>
|
| 142 |
</div>
|
| 143 |
<div id="toast" class="toast">Copied & Opening GPT...</div>
|
|
|
|
| 166 |
const prompt=buildPrompt();
|
| 167 |
$('#output').textContent=prompt;
|
| 168 |
});
|
| 169 |
+
$('#copy').addEventListener('click', async ()=>{
|
| 170 |
+
const prompt = $('#output').textContent || buildPrompt();
|
| 171 |
+
// Try to open immediately (before any await) so popup blockers allow it
|
| 172 |
+
const popup = window.open(CUSTOM_GPT_URL, '_blank', 'noopener,noreferrer');
|
| 173 |
+
try { await navigator.clipboard.writeText(prompt); } catch(e) {}
|
| 174 |
+
const t = $('#toast');
|
| 175 |
+
t.textContent = popup ? 'Copied & Opening GPT...' : 'Copied! Click "Open GPT" below';
|
| 176 |
+
t.classList.add('show');
|
| 177 |
+
setTimeout(()=>t.classList.remove('show'), 1800);
|
| 178 |
+
if(!popup){
|
| 179 |
+
const link = document.querySelector('#open-gpt-fallback');
|
| 180 |
+
if(link){ link.style.display = 'inline-flex'; link.focus(); }
|
| 181 |
+
}
|
| 182 |
});
|
| 183 |
</script>
|
| 184 |
</body>
|