Nuzwa commited on
Commit
1031309
·
verified ·
1 Parent(s): d698e19

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +62 -25
index.html CHANGED
@@ -24,12 +24,12 @@
24
  padding:24px;
25
  display:flex;
26
  justify-content:center;
27
- font-size:1.05rem; /* bigger base font */
28
  line-height:1.5;
29
  }
30
  .app{
31
  width:100%;
32
- max-width:600px; /* wider */
33
  background:var(--container-bg);
34
  padding:36px;
35
  border-radius:18px;
@@ -61,6 +61,7 @@
61
  .input, select, textarea{
62
  width:100%;padding:14px;border:1px solid var(--border-color);border-radius:12px;
63
  background:#fff;color:var(--text-color);font-size:1rem;
 
64
  }
65
  .input:focus,select:focus,textarea:focus{
66
  outline:none;border-color:var(--primary-color-start);
@@ -69,13 +70,36 @@
69
  .group{margin-bottom:22px}
70
  .toggles{display:flex;flex-wrap:wrap;gap:10px}
71
  .toggle{
72
- border:1px solid var(--border-color);background:#f9fafb;color:var(--text-color);
73
- padding:10px 14px;border-radius:12px;cursor:pointer;font-weight:600;font-size:1rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
 
75
  .toggle[aria-pressed="true"]{
76
- color:#fff;border-color:transparent;
 
77
  background:linear-gradient(90deg,var(--primary-color-start),var(--primary-color-end));
 
78
  }
 
 
 
 
 
 
79
  .out{
80
  background:#f9fafb;border:1px dashed var(--border-color);padding:16px;
81
  border-radius:14px;min-height:130px;white-space:pre-wrap;font-size:1rem;
@@ -86,14 +110,17 @@
86
  font-weight:700;font-size:1.1rem;border:none;color:#fff;padding:14px 18px;
87
  border-radius:14px;cursor:pointer;
88
  background:linear-gradient(90deg,var(--primary-color-start),var(--primary-color-end));
 
89
  }
 
 
90
  .btn.hidden{display:none}
91
  .hint{margin-top:10px;color:#6b7280;font-size:1rem;min-height:1.4em}
92
  .footer{text-align:center;color:#9ca3af;font-size:.9rem;margin-top:22px}
93
  @media (max-width:480px){
94
  body{padding:16px;font-size:1rem}
95
- .app{padding:24px;border-radius:14px}
96
- h1{font-size:1.8em}
97
  .btn{width:100%}
98
  .cta-row{flex-direction:column}
99
  }
@@ -209,17 +236,24 @@
209
  <script>
210
  const GPT_URL='https://chat.openai.com/g/g-6864ab7c8c188191b8641483747e63c2-coursemaster-pro';
211
  const $=s=>document.querySelector(s);
212
- const $$=s=>Array.from(document.querySelectorAll(s));
213
- $$(".toggles").forEach(g=>{
214
- g.addEventListener("click",e=>{
 
 
215
  if(!e.target.classList.contains("toggle"))return;
216
- if(!g.classList.contains("multi")){
217
- $$(".toggle",g).forEach(b=>b.setAttribute("aria-pressed","false"));
218
- }
219
- e.target.setAttribute("aria-pressed", e.target.getAttribute("aria-pressed")==="true"?"false":"true");
220
  buildPrompt();
221
  });
 
 
 
 
222
  });
 
223
  function buildPrompt(){
224
  const topic=$("#topic").value.trim();
225
  const duration=$("#duration").value.trim();
@@ -228,29 +262,32 @@
228
  $$(".toggles").forEach(g=>{
229
  const name=g.dataset.name;
230
  const sel=$$(".toggle[aria-pressed='true']",g).map(b=>b.textContent.trim());
231
- if(sel.length>0)p+=`\n- ${name}: ${sel.join(", ")}`;
232
  });
233
- if(duration)p+=`\n- Duration: ${duration}`;
234
- const loc=$("#localization").value;if(loc!=="Auto")p+=`\n- Localization: ${loc}`;
235
- const exp=$("#export").value;if(exp)p+=`\n- Export Format: ${exp}`;
236
- if(notes)p+=`\n- Notes: ${notes}`;
237
  $("#out").textContent=p;
238
  $("#copy").classList.remove("hidden");
239
  $("#copyOpen").classList.remove("hidden");
240
  $("#hint").textContent="Prompt ready!";
241
  }
242
- ["#topic","#duration","#notes"].forEach(s=>{
243
- $(s).addEventListener("input",buildPrompt);
244
- });
245
  $("#copy").addEventListener("click",async()=>{
246
- const t=$("#out").textContent;
 
247
  await navigator.clipboard.writeText(t);
248
  $("#hint").textContent="Copied!";
249
  });
250
  $("#copyOpen").addEventListener("click",async()=>{
251
- const t=$("#out").textContent;
 
252
  await navigator.clipboard.writeText(t);
253
- window.open(`${GPT_URL}?q=${encodeURIComponent(t)}`,"_blank");
 
254
  });
255
  </script>
256
  </body>
 
24
  padding:24px;
25
  display:flex;
26
  justify-content:center;
27
+ font-size:1.05rem;
28
  line-height:1.5;
29
  }
30
  .app{
31
  width:100%;
32
+ max-width:600px;
33
  background:var(--container-bg);
34
  padding:36px;
35
  border-radius:18px;
 
61
  .input, select, textarea{
62
  width:100%;padding:14px;border:1px solid var(--border-color);border-radius:12px;
63
  background:#fff;color:var(--text-color);font-size:1rem;
64
+ transition:box-shadow .15s ease, border-color .15s ease;
65
  }
66
  .input:focus,select:focus,textarea:focus{
67
  outline:none;border-color:var(--primary-color-start);
 
70
  .group{margin-bottom:22px}
71
  .toggles{display:flex;flex-wrap:wrap;gap:10px}
72
  .toggle{
73
+ border:1px solid var(--border-color);
74
+ background:#f9fafb;
75
+ color:var(--text-color);
76
+ padding:10px 14px;
77
+ border-radius:12px;
78
+ cursor:pointer;
79
+ font-weight:600;
80
+ .font-size:1rem;
81
+ transition:transform .05s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
82
+ }
83
+ /* Hover effect for ALL options */
84
+ .toggle:hover{
85
+ transform:translateY(-1px);
86
+ border-color:var(--primary-color-start);
87
+ box-shadow:0 0 0 4px rgba(79,70,229,.12);
88
+ background:#ffffff;
89
  }
90
+ /* Selected option looks "hovered" permanently */
91
  .toggle[aria-pressed="true"]{
92
+ color:#fff;
93
+ border-color:transparent;
94
  background:linear-gradient(90deg,var(--primary-color-start),var(--primary-color-end));
95
+ box-shadow:0 0 0 5px rgba(79,70,229,.18);
96
  }
97
+ /* Extra feedback when hovering a selected option */
98
+ .toggle[aria-pressed="true"]:hover{
99
+ box-shadow:0 0 0 7px rgba(79,70,229,.22);
100
+ transform:translateY(-1px) scale(1.01);
101
+ }
102
+
103
  .out{
104
  background:#f9fafb;border:1px dashed var(--border-color);padding:16px;
105
  border-radius:14px;min-height:130px;white-space:pre-wrap;font-size:1rem;
 
110
  font-weight:700;font-size:1.1rem;border:none;color:#fff;padding:14px 18px;
111
  border-radius:14px;cursor:pointer;
112
  background:linear-gradient(90deg,var(--primary-color-start),var(--primary-color-end));
113
+ transition:filter .15s ease, box-shadow .15s ease, transform .05s ease;
114
  }
115
+ .btn:hover{filter:brightness(0.98)}
116
+ .btn:focus{outline:none;box-shadow:0 0 0 4px rgba(79,70,229,.15)}
117
  .btn.hidden{display:none}
118
  .hint{margin-top:10px;color:#6b7280;font-size:1rem;min-height:1.4em}
119
  .footer{text-align:center;color:#9ca3af;font-size:.9rem;margin-top:22px}
120
  @media (max-width:480px){
121
  body{padding:16px;font-size:1rem}
122
+ .app{padding:24px;border-radius:14px;max-width:100%}
123
+ h1{font-size:1.9em}
124
  .btn{width:100%}
125
  .cta-row{flex-direction:column}
126
  }
 
236
  <script>
237
  const GPT_URL='https://chat.openai.com/g/g-6864ab7c8c188191b8641483747e63c2-coursemaster-pro';
238
  const $=s=>document.querySelector(s);
239
+ const $$=(s,root=document)=>Array.from(root.querySelectorAll(s));
240
+
241
+ // Toggle handling with instant preview update
242
+ $$(".toggles").forEach(group=>{
243
+ group.addEventListener("click",e=>{
244
  if(!e.target.classList.contains("toggle"))return;
245
+ const btn=e.target;
246
+ const isMulti=group.classList.contains("multi");
247
+ if(!isMulti){ $$(".toggle",group).forEach(b=>b.setAttribute("aria-pressed","false")); }
248
+ btn.setAttribute("aria-pressed", btn.getAttribute("aria-pressed")==="true" ? "false" : "true");
249
  buildPrompt();
250
  });
251
+ group.addEventListener("keydown",e=>{
252
+ if(!e.target.classList.contains("toggle"))return;
253
+ if(e.key===" "||e.key==="Enter"){ e.preventDefault(); e.target.click(); }
254
+ });
255
  });
256
+
257
  function buildPrompt(){
258
  const topic=$("#topic").value.trim();
259
  const duration=$("#duration").value.trim();
 
262
  $$(".toggles").forEach(g=>{
263
  const name=g.dataset.name;
264
  const sel=$$(".toggle[aria-pressed='true']",g).map(b=>b.textContent.trim());
265
+ if(sel.length>0) p+=`\n- ${name}: ${sel.join(", ")}`;
266
  });
267
+ if(duration) p+=`\n- Duration: ${duration}`;
268
+ const loc=$("#localization").value; if(loc!=="Auto") p+=`\n- Localization: ${loc}`;
269
+ const exp=$("#export").value; if(exp) p+=`\n- Export Format: ${exp}`;
270
+ if(notes) p+=`\n- Notes: ${notes}`;
271
  $("#out").textContent=p;
272
  $("#copy").classList.remove("hidden");
273
  $("#copyOpen").classList.remove("hidden");
274
  $("#hint").textContent="Prompt ready!";
275
  }
276
+
277
+ ["#topic","#duration","#notes"].forEach(s=>$(s).addEventListener("input",buildPrompt));
278
+
279
  $("#copy").addEventListener("click",async()=>{
280
+ const t=$("#out").textContent.trim();
281
+ if(!t) return;
282
  await navigator.clipboard.writeText(t);
283
  $("#hint").textContent="Copied!";
284
  });
285
  $("#copyOpen").addEventListener("click",async()=>{
286
+ const t=$("#out").textContent.trim();
287
+ if(!t) return;
288
  await navigator.clipboard.writeText(t);
289
+ const win=window.open(`${GPT_URL}?q=${encodeURIComponent(t)}`,"_blank");
290
+ if(!win){ $("#hint").textContent="Copied! • Please allow pop-ups."; }
291
  });
292
  </script>
293
  </body>