const OS = { privateMode: false, z: 1, tabs: [{ url: "https://example.com", history: [], index: 0 }], activeTab: 0, bookmarks: [], downloads: [], trash: [], fs: { "デスクトップ": { "メモ.txt": "Hello World", "フォルダ": {} } }, cwd: ["デスクトップ"] }; function createWindow(title, content){ const win = document.createElement("div"); win.className = "window"; win.style.zIndex = ++OS.z; win.innerHTML = `
${title}
_ ×
${content}
`; document.body.appendChild(win); drag(win); return win; } function openBrowser(){ const html = `
`; createWindow("Browser", html); renderTabs(); } function formatURL(v){ if(v.includes(".") && !v.includes(" ")){ return v.startsWith("http") ? v : "https://" + v; } return "https://www.google.com/search?q=" + encodeURIComponent(v); } function go(){ const tab = OS.tabs[OS.activeTab]; const u = formatURL(url.value); tab.url = u; tab.history.push(u); loadTab(); } function renderTabs(){ const el = document.getElementById("tabs"); el.innerHTML = OS.tabs.map((t,i)=> `
Tab ${i+1}
` ).join(""); } function switchTab(i){ OS.activeTab = i; loadTab(); renderTabs(); } function loadTab(){ const tab = OS.tabs[OS.activeTab]; document.getElementById("view").src = tab.url; document.getElementById("url").value = tab.url; } function openExplorer(){ renderExplorer(); } function renderExplorer(){ let dir = OS.fs; OS.cwd.forEach(p => dir = dir[p]); let html = `
${OS.cwd.join(" / ")}
"; createWindow("Explorer", html); } function openNotepad(){ const html = ` `; createWindow("Notepad", html); } function saveFile(){ let dir = OS.fs; OS.cwd.forEach(p => dir = dir[p]); dir[fname.value] = txt.value; notify("保存完了"); } function addBookmark(){ if(OS.privateMode) return; OS.bookmarks.push(OS.tabs[OS.activeTab].url); } function togglePrivate(){ OS.privateMode = !OS.privateMode; document.body.classList.toggle("private", OS.privateMode); notify(OS.privateMode ? "Private ON" : "OFF"); } function notify(msg){ const n = document.createElement("div"); n.className = "notify"; n.innerText = msg; document.body.appendChild(n); setTimeout(()=>n.remove(),3000); } document.oncontextmenu = e=>{ e.preventDefault(); context.style.display="block"; context.style.left=e.pageX+"px"; context.style.top=e.pageY+"px"; context.innerHTML=`
Explorer
Browser
Notepad
`; }; body { margin:0; font-family:Segoe UI; background: linear-gradient(#1e5799,#207cca); } .window { position:absolute; width:500px; height:350px; background:white; border:1px solid #777; } .titlebar { background: linear-gradient(#3a6ea5,#1f3f73); color:white; padding:5px; display:flex; justify-content:space-between; } .private { background:#111 !important; color:white; } .notify { position:fixed; right:10px; bottom:50px; background:#333; color:white; padding:10px; }
windows7sumi
[メールボックス]

不用品買い取り・遺品整理のことは
十勝リユースにおまかせ下さい

- MOBI-PAGE -