SUPER PC
by BoldPenguin14190 lines7.5 KB
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>SUPER PC</title>
<style>
*{box-sizing:border-box}
body{margin:0;font-family:Arial;color:white;background:linear-gradient(135deg,#087bc0,#06152f)}
#desktop{height:100vh;padding:20px}
.apps{display:grid;grid-template-columns:repeat(2,85px);gap:15px}
.app{background:#ffffff25;padding:12px 5px;text-align:center;border-radius:10px;cursor:pointer}
.app span{display:block;font-size:30px}
#bar{position:fixed;bottom:0;background:#e5eff8;color:#123;width:100%;padding:10px;display:flex;justify-content:space-around}
button{background:#087bc0;color:white;border:0;border-radius:7px;padding:10px;margin:3px;cursor:pointer}
#win{display:none;position:fixed;top:7%;left:4%;width:92%;height:82%;background:#edf4fa;color:#123;padding:15px;border-radius:12px;overflow:auto}
.card{background:#d5e8f8;padding:12px;margin:8px 0;border-radius:9px}
input,textarea{padding:10px;border-radius:7px;border:1px solid #aaa;max-width:100%}
</style>
</head>
<body>
<div id="desktop">
<h1>💻 SUPER PC</h1>
<p>🛜 Wi-Fi | 🔋 100%</p>
<div class="apps">
<div class="app" onclick="openApp('store')"><span>🛍️</span>Store</div>
<div class="app" onclick="openApp('games')"><span>🎮</span>Games</div>
<div class="app" onclick="openApp('notes')"><span>📝</span>Notepad</div>
<div class="app" onclick="openApp('ai')"><span>🤖</span>SUPER AI</div>
<div class="app" onclick="openApp('messages')"><span>💬</span>Messages</div>
<div class="app" onclick="openApp('settings')"><span>⚙️</span>Settings</div>
</div>
</div>
<div id="bar">
<button onclick="openApp('start')">⊞ Start</button>
<span id="clock"></span>
</div>
<div id="win">
<button onclick="closeApp()">✖ Close</button>
<div id="content"></div>
</div>
<script>
let owned=JSON.parse(localStorage.getItem('owned')||'[]');
let savedNotes=localStorage.getItem('notes')||'';
let appNames=['Block World','Space Impostor','Racing','Snake','Tic Tac Toe','Memory'];
let games=document.createElement('div');
function openApp(a){
let h='';
if(a==='start')h=`<h1>Start Menu</h1>${['store','games','notes','ai','messages','settings'].map(x=>`<button onclick="openApp('${x}')">${x}</button>`).join('')}`;
if(a==='store')h=`<h1>🛍️ App Store</h1>${appNames.map(x=>`<div class="card">${x}<button onclick="install('${x}')">Install</button></div>`).join('')}<h3>Owned: ${owned.join(', ')}</h3>`;
if(a==='games')h=`<h1>🎮 Games</h1>${appNames.map(x=>`<div class="card">${x}<button onclick="play('${x}')">PLAY</button></div>`).join('')}<div id="game"></div>`;
if(a==='notes')h=`<h1>📝 Notepad</h1><textarea id="note" style="width:100%;height:60%">${escapeHTML(savedNotes)}</textarea><button onclick="saveNote()">Save Notes</button>`;
if(a==='messages')h=`<h1>💬 Messages</h1><div id="messages"></div><input id="msg" placeholder="Message"><button onclick="sendMsg()">Send</button>`;
if(a==='ai')h=`<h1>🤖 SUPER AI</h1><div id="aiChat"></div><input id="question" placeholder="Ask something"><button onclick="ask()">Send</button><p>AI connection not configured.</p>`;
if(a==='settings')h=`<h1>⚙️ Settings</h1><p>Brightness</p><input type="range" min="20" max="100" oninput="desktop.style.filter='brightness('+this.value+'%)'"><p>Volume</p><input type="range" min="0" max="100">`;
content.innerHTML=h;
win.style.display='block';
}
function closeApp(){win.style.display='none'}
function install(x){
if(!owned.includes(x)){owned.push(x);localStorage.setItem('owned',JSON.stringify(owned))}
alert(x+' installed!');
}
function saveNote(){
savedNotes=document.getElementById('note').value;
localStorage.setItem('notes',savedNotes);
alert('Saved!');
}
function sendMsg(){
let m=document.getElementById('msg');
if(!m.value.trim())return;
let old=localStorage.getItem('messages')||'';
old+= '<p>You: '+escapeHTML(m.value)+'</p>';
localStorage.setItem('messages',old);
document.getElementById('messages').innerHTML=old;
m.value='';
}
function play(x){
let g=document.getElementById('game');
if(!g)return;
if(x==='Snake'){
g.innerHTML='<h2>🐍 Snake</h2><canvas id="snake" width="300" height="300" style="background:#102b30;max-width:100%"></canvas><p>Arrow keys to move</p>';
snake();
}
else if(x==='Tic Tac Toe')tic();
else if(x==='Memory')memory();
else if(x==='Block World')blocks();
else if(x==='Space Impostor')g.innerHTML='<h2>🚀 Space Impostor</h2><p>Find the impostor!</p><button onclick="alert(\'You caught the impostor!\')">Investigate</button>';
else g.innerHTML='<h2>🏎️ Racing</h2><button onclick="alert(\'Race started!\')">Start Race</button>';
}
function snake(){
let c=document.getElementById('snake'),ctx=c.getContext('2d');
let s=[{x:5,y:5}],d={x:1,y:0},food={x:10,y:10};
document.onkeydown=e=>{
if(e.key==='ArrowUp'&&d.y!==1)d={x:0,y:-1};
if(e.key==='ArrowDown'&&d.y!==-1)d={x:0,y:1};
if(e.key==='ArrowLeft'&&d.x!==1)d={x:-1,y:0};
if(e.key==='ArrowRight'&&d.x!==-1)d={x:1,y:0};
};
let t=setInterval(()=>{
if(!c.isConnected){clearInterval(t);return}
let h={x:(s[0].x+d.x+15)%15,y:(s[0].y+d.y+15)%15};
s.unshift(h);
if(h.x===food.x&&h.y===food.y)food={x:Math.floor(Math.random()*15),y:Math.floor(Math.random()*15)};
else s.pop();
ctx.clearRect(0,0,300,300);
ctx.fillStyle='red';ctx.fillRect(food.x*20,food.y*20,18,18);
ctx.fillStyle='lime';s.forEach(p=>ctx.fillRect(p.x*20,p.y*20,18,18));
},150);
}
function tic(){
let a=Array(9).fill(''),turn='X';
let g=document.getElementById('game');
g.innerHTML='<h2>Tic Tac Toe</h2><div id="board" style="display:grid;grid-template-columns:repeat(3,65px)"></div><p id="result"></p>';
a.forEach((_,i)=>{
let b=document.createElement('button');
b.style.height='65px';
b.onclick=()=>{
if(a[i]||document.getElementById('result').textContent)return;
a[i]=turn;b.textContent=turn;
if([[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]].some(q=>q.every(k=>a[k]===turn)))document.getElementById('result').textContent=turn+' wins!';
else if(a.every(Boolean))document.getElementById('result').textContent='Draw!';
else turn=turn==='X'?'O':'X';
};
document.getElementById('board').appendChild(b);
});
}
function memory(){
let a=['🐶','🐱','🍎','🚀','🐶','🐱','🍎','🚀'].sort(()=>Math.random()-.5),first=null,lock=false;
let g=document.getElementById('game');
g.innerHTML='<h2>Memory Match</h2><div id="mem" style="display:grid;grid-template-columns:repeat(4,65px)"></div>';
a.forEach(v=>{
let b=document.createElement('button');b.style.height='65px';b.textContent='❔';
b.onclick=()=>{
if(lock||b.textContent!=='❔')return;
b.textContent=v;
if(!first)first=b;
else{
let old=first;first=null;
if(old.textContent!==v){lock=true;setTimeout(()=>{old.textContent='❔';b.textContent='❔';lock=false},700)}
}
};
document.getElementById('mem').appendChild(b);
});
}
function blocks(){
let g=document.getElementById('game');
g.innerHTML='<h2>⛏️ Block World</h2><p>Tap blocks to build your world!</p><div id="world" style="display:grid;grid-template-columns:repeat(6,45px)"></div>';
for(let i=0;i<36;i++){
let b=document.createElement('button');b.textContent='🟩';b.style.height='45px';
b.onclick=()=>b.textContent=b.textContent==='🟩'?'🟫':'🟩';
document.getElementById('world').appendChild(b);
}
}
function ask(){
let q=document.getElementById('question');
if(!q.value.trim())return;
document.getElementById('aiChat').innerHTML+='<p>You: '+escapeHTML(q.value)+'</p><p>SUPER AI: AI is not connected yet.</p>';
q.value='';
}
function escapeHTML(s){
return String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
}
setInterval(()=>clock.textContent=new Date().toLocaleTimeString(),1000);
</script>
</body>
</html>
Game Source: SUPER PC
Creator: BoldPenguin14
Libraries: none
Complexity: moderate (190 lines, 7.5 KB)
The full source code is displayed above on this page.
Remix Instructions
To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: super-pc-boldpenguin14" to link back to the original. Then publish at arcadelab.ai/publish.