Widget:520Jeopardy: Difference between revisions

From Doc-Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:


==Usage==
==Usage==
  <nowiki>{{#widget:520Jeopardy}}</nowiki>
  <nowiki>{{#widget:520Jeapordy}}</nowiki>
</noinclude><includeonly><div id="jeopardy-widget-container">
</noinclude><includeonly><div id="jeopardy-widget-container">
<style>
<style>
.jep * { margin: 0; padding: 0; box-sizing: border-box; }
.jep * { margin: 0; padding: 0; box-sizing: border-box; }
.jep { font-family: Arial, sans-serif; background: linear-gradient(135deg, rgb(30,58,95) 0%, rgb(12,25,41) 100%); min-height: 100vh; padding: 20px; }
.jep { font-family: Arial, sans-serif; background: linear-gradient(135deg, rgb(30,58,95) 0%, rgb(12,25,41) 100%); min-height: 100vh; padding: 20px; position: relative; }
.jep .ctr { max-width: 1200px; margin: 0 auto; }
.jep .ctr { max-width: 1200px; margin: 0 auto; }
.jep .ctr.blur { filter: blur(5px); pointer-events: none; }
.jep .ttl { text-align: center; color: rgb(251,191,36); font-size: 2.2rem; font-weight: bold; margin-bottom: 8px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.jep .ttl { text-align: center; color: rgb(251,191,36); font-size: 2.2rem; font-weight: bold; margin-bottom: 8px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.jep .sub { text-align: center; color: rgb(147,197,253); margin-bottom: 5px; font-size: 0.95rem; }
.jep .sub { text-align: center; color: rgb(147,197,253); margin-bottom: 5px; font-size: 0.95rem; }
Line 27: Line 28:
.jep .rst { background: rgb(220,38,38); color: white; padding: 10px 20px; border-radius: 6px; font-weight: bold; font-size: 0.95rem; cursor: pointer; border: none; transition: all 0.2s; }
.jep .rst { background: rgb(220,38,38); color: white; padding: 10px 20px; border-radius: 6px; font-weight: bold; font-size: 0.95rem; cursor: pointer; border: none; transition: all 0.2s; }
.jep .rst:hover { background: rgb(185,28,28); }
.jep .rst:hover { background: rgb(185,28,28); }
.jep .mute { position: fixed; top: 15px; right: 15px; background: rgb(30,64,175); color: white; width: 45px; height: 45px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.3rem; z-index: 1000; transition: all 0.2s; }
.jep .mute { position: absolute; top: 15px; right: 15px; background: rgb(30,64,175); color: white; width: 45px; height: 45px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.3rem; z-index: 10; transition: all 0.2s; }
.jep .mute:hover { background: rgb(37,99,235); }
.jep .mute:hover { background: rgb(37,99,235); }
.jep .tip { text-align: center; color: rgb(147,197,253); font-size: 0.8rem; margin-top: 12px; }
.jep .tip { text-align: center; color: rgb(147,197,253); font-size: 0.8rem; margin-top: 12px; }
.jep .tip p { margin: 3px 0; }
.jep .tip p { margin: 3px 0; }
.jep .mov { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 999; justify-content: center; align-items: center; padding: 20px; }
.jep .mov { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100; justify-content: center; align-items: center; padding: 20px; border-radius: 8px; }
.jep .mov.act { display: flex; }
.jep .mov.act { display: flex; }
.jep .moc { background: rgb(30,64,175); border-radius: 12px; padding: 25px; max-width: 650px; width: 100%; max-height: 90vh; overflow-y: auto; color: white; }
.jep .moc { background: rgb(30,64,175); border-radius: 12px; padding: 25px; max-width: 650px; width: 100%; max-height: 85vh; overflow-y: auto; color: white; }
.jep .moh { text-align: center; margin-bottom: 15px; }
.jep .moh { text-align: center; margin-bottom: 15px; }
.jep .mct { display: inline-block; background: rgb(251,191,36); color: rgb(30,58,95); padding: 6px 18px; border-radius: 20px; font-weight: bold; font-size: 0.95rem; }
.jep .mct { display: inline-block; background: rgb(251,191,36); color: rgb(30,58,95); padding: 6px 18px; border-radius: 20px; font-weight: bold; font-size: 0.95rem; }
Line 70: Line 71:
<div class="jep">
<div class="jep">
     <button class="mute" id="jepMute" onclick="Jep.mute()">🔊</button>
     <button class="mute" id="jepMute" onclick="Jep.mute()">🔊</button>
     <div class="ctr">
     <div class="ctr" id="jepCtr">
         <h1 class="ttl">🏥 Nursing Pharmacology Jeopardy</h1>
         <h1 class="ttl">🏥 Nursing Pharmacology Jeopardy</h1>
         <p class="sub">NSG 520 - Pathophysiology and Pharmacology</p>
         <p class="sub">NSG 520 - Pathophysiology and Pharmacology</p>
Line 162: Line 163:
function xTmr(){if(st.ti){clearInterval(st.ti);st.ti=null;}}
function xTmr(){if(st.ti){clearInterval(st.ti);st.ti=null;}}
function uTmr(){var b=document.getElementById('jepTmr');if(b){b.textContent='⏱️ '+st.tmr+'s';b.className='tmb '+(st.tmr<=10?'tmw':'tmn');}}
function uTmr(){var b=document.getElementById('jepTmr');if(b){b.textContent='⏱️ '+st.tmr+'s';b.className='tmb '+(st.tmr<=10?'tmw':'tmn');}}
function sel(ci,qi){var k=ci+'-'+qi;if(st.done[k])return;pSel();st.sel={c:ci,q:qi};var cat=cats[ci],qn=cat.q[qi];var mc=document.getElementById('jepMCat'),mt=document.getElementById('jepMTm'),sc=document.getElementById('jepScn'),qs=document.getElementById('jepQst'),an=document.getElementById('jepAns'),ab=document.getElementById('jepAsw'),bg=document.getElementById('jepBtg'),mo=document.getElementById('jepQM');if(mc)mc.textContent=cat.name+' - $'+qn.p;if(mt)mt.textContent="Team "+st.tm+"'s Turn";if(sc)sc.textContent=qn.s;if(qs)qs.textContent=qn.q;if(an)an.textContent=qn.a;if(ab)ab.style.display='none';if(bg)bg.innerHTML='<button class="btn brv" onclick="Jep.reveal()">Reveal Answer</button>';if(mo)mo.className='mov act';sTmr();setTimeout(sMus,300);}
function blurOn(){var c=document.getElementById('jepCtr');if(c)c.className='ctr blur';}
function blurOff(){var c=document.getElementById('jepCtr');if(c)c.className='ctr';}
function sel(ci,qi){var k=ci+'-'+qi;if(st.done[k])return;pSel();st.sel={c:ci,q:qi};var cat=cats[ci],qn=cat.q[qi];var mc=document.getElementById('jepMCat'),mt=document.getElementById('jepMTm'),sc=document.getElementById('jepScn'),qs=document.getElementById('jepQst'),an=document.getElementById('jepAns'),ab=document.getElementById('jepAsw'),bg=document.getElementById('jepBtg'),mo=document.getElementById('jepQM');if(mc)mc.textContent=cat.name+' - $'+qn.p;if(mt)mt.textContent="Team "+st.tm+"'s Turn";if(sc)sc.textContent=qn.s;if(qs)qs.textContent=qn.q;if(an)an.textContent=qn.a;if(ab)ab.style.display='none';if(bg)bg.innerHTML='<button class="btn brv" onclick="Jep.reveal()">Reveal Answer</button>';if(mo)mo.className='mov act';blurOn();sTmr();setTimeout(sMus,300);}
function reveal(){xMus();xTmr();pRev();var ab=document.getElementById('jepAsw'),bg=document.getElementById('jepBtg');if(ab)ab.style.display='block';if(st.sel&&bg){var qn=cats[st.sel.c].q[st.sel.q];bg.innerHTML='<button class="btn bcr" onclick="Jep.ans(true)">✓ Correct (+$'+qn.p+')</button><button class="btn bic" onclick="Jep.ans(false)">✗ Incorrect (-$'+qn.p+')</button>';}}
function reveal(){xMus();xTmr();pRev();var ab=document.getElementById('jepAsw'),bg=document.getElementById('jepBtg');if(ab)ab.style.display='block';if(st.sel&&bg){var qn=cats[st.sel.c].q[st.sel.q];bg.innerHTML='<button class="btn bcr" onclick="Jep.ans(true)">✓ Correct (+$'+qn.p+')</button><button class="btn bic" onclick="Jep.ans(false)">✗ Incorrect (-$'+qn.p+')</button>';}}
function ans(cor){xMus();xTmr();cor?pCor():pInc();var qn=cats[st.sel.c].q[st.sel.q],k=st.sel.c+'-'+st.sel.q;st.tm===1?st.sc.t1+=(cor?qn.p:-qn.p):st.sc.t2+=(cor?qn.p:-qn.p);st.done[k]=true;st.tm=st.tm===1?2:1;var mo=document.getElementById('jepQM');if(mo)mo.className='mov';bld();upd();if(Object.keys(st.done).length===cats.length*5)setTimeout(go,500);}
function ans(cor){xMus();xTmr();cor?pCor():pInc();var qn=cats[st.sel.c].q[st.sel.q],k=st.sel.c+'-'+st.sel.q;st.tm===1?st.sc.t1+=(cor?qn.p:-qn.p):st.sc.t2+=(cor?qn.p:-qn.p);st.done[k]=true;st.tm=st.tm===1?2:1;var mo=document.getElementById('jepQM');if(mo)mo.className='mov';blurOff();bld();upd();if(Object.keys(st.done).length===cats.length*5)setTimeout(go,500);}
function go(){pVic();var w;if(st.sc.t1>st.sc.t2)w="Team 1 Wins!";else if(st.sc.t2>st.sc.t1)w="Team 2 Wins!";else w="It's a Tie!";var fs=document.getElementById('jepFsc'),wn=document.getElementById('jepWin'),mo=document.getElementById('jepGO');if(fs)fs.innerHTML='<p>Team 1: $'+st.sc.t1+'</p><p>Team 2: $'+st.sc.t2+'</p>';if(wn)wn.textContent=w;if(mo)mo.className='mov act';}
function go(){pVic();var w;if(st.sc.t1>st.sc.t2)w="Team 1 Wins!";else if(st.sc.t2>st.sc.t1)w="Team 2 Wins!";else w="It's a Tie!";var fs=document.getElementById('jepFsc'),wn=document.getElementById('jepWin'),mo=document.getElementById('jepGO');if(fs)fs.innerHTML='<p>Team 1: $'+st.sc.t1+'</p><p>Team 2: $'+st.sc.t2+'</p>';if(wn)wn.textContent=w;if(mo)mo.className='mov act';blurOn();}
function reset(){xMus();xTmr();st.sc={t1:0,t2:0};st.tm=1;st.done={};st.sel=null;st.tmr=30;var qm=document.getElementById('jepQM'),gm=document.getElementById('jepGO'),sn=document.getElementById('jepSnd');if(qm)qm.className='mov';if(gm)gm.className='mov';if(sn)sn.style.display='block';bld();upd();}
function reset(){xMus();xTmr();st.sc={t1:0,t2:0};st.tm=1;st.done={};st.sel=null;st.tmr=30;var qm=document.getElementById('jepQM'),gm=document.getElementById('jepGO'),sn=document.getElementById('jepSnd');if(qm)qm.className='mov';if(gm)gm.className='mov';if(sn)sn.style.display='block';blurOff();bld();upd();}
function init(){bld();upd();}
function init(){bld();upd();}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();

Revision as of 00:55, 11 January 2026

Nursing Pharmacology Jeopardy Game for NSG 520 - Pathophysiology and Pharmacology

Usage

{{#widget:520Jeapordy}}