diff --git a/packages/backend/src/server/web/bios.css b/packages/backend/src/server/web/bios.css index b0da3ee39b..318fc3e28b 100644 --- a/packages/backend/src/server/web/bios.css +++ b/packages/backend/src/server/web/bios.css @@ -1,23 +1,11 @@ -* { - font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; -} - -html { - background: #ffb4e1; -} - -main { - background: #dedede; -} main > .tabs { padding: 16px; - border-bottom: solid 4px #c3c3c3; + border-bottom: 4px solid #c3c3c3; } - #lsEditor > .adder { margin: 16px; padding: 16px; - border: solid 2px #c3c3c3; + border: 2px solid #c3c3c3; } #lsEditor > .adder > textarea { display: block; @@ -27,10 +15,10 @@ main > .tabs { } #lsEditor > .record { padding: 16px; - border-bottom: solid 1px #c3c3c3; + border-bottom: 1px solid #c3c3c3; } #lsEditor > .record > header { - font-weight: bold; + font-weight: 700; } #lsEditor > .record > textarea { display: block; @@ -38,3 +26,123 @@ main > .tabs { min-height: 5em; box-sizing: border-box; } + +html { + background: #222; +} +main { + background: #333; + border-radius: 10px; +} +#tl > div { + padding: 16px; + border-bottom: 1px solid #c3c3c3; +} +#tl > div > header { + font-weight: 700; +} + +* { + font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif; +} +#misskey_app { + display: none !important; +} +body, +html { + background-color: #222; + color: #dfddcc; + justify-content: center; + margin: auto; + padding: 10px; + text-align: center; +} +button { + border-radius: 999px; + padding: 0px 12px 0px 12px; + border: none; + cursor: pointer; + margin-bottom: 12px; + background: linear-gradient(90deg, rgb(134, 179, 0), rgb(74, 179, 0)); + line-height: 50px; + color: #222; + font-weight: bold; + font-size: 20px; + padding: 12px; +} +button { + border-radius: 999px; + padding: 0px 12px 0px 12px; + border: none; + cursor: pointer; + margin-bottom: 12px; +} +button { + background: #444; + line-height: 40px; + color: rgb(153, 204, 0); + font-size: 16px; + padding: 0 20px; + margin-right: 5px; + margin-left: 5px; + +} +button:hover { + background: #555; +} +#ls { + background: linear-gradient(90deg, rgb(134, 179, 0), rgb(74, 179, 0)); + line-height: 30px; + color: #222; + font-weight: bold; + font-size: 18px; + padding: 12px; +} +#ls:hover { + background: rgb(153, 204, 0); +} +a { + color: rgb(134, 179, 0); + text-decoration: none; +} +p, +li { + font-size: 16px; +} + +h1 { + font-size: 32px; +} +code { + font-family: Fira, FiraCode, monospace; +} +textarea { + background-color: #444; + border: solid #aaa; + border-radius: 10px; + color: #dfddcc; + margin-top: 1rem; + margin-bottom: 1rem; + width: 20rem; + height: 7.5rem; + padding: 0.5rem; +} + +textarea:focus { + border: solid #eee; +} +input { + background-color: #666; + border: solid #aaa; + border-radius: 10px; + color: #dfddcc; + margin-top: 1rem; + margin-bottom: 1rem; + width: 10rem; + height: 1rem; + padding: 0.5rem; +} + +input:focus { + border: solid #eee; +} diff --git a/packages/backend/src/server/web/bios.js b/packages/backend/src/server/web/bios.js index d06dee801a..1acdafd1d5 100644 --- a/packages/backend/src/server/web/bios.js +++ b/packages/backend/src/server/web/bios.js @@ -8,7 +8,7 @@ window.onload = async () => { const promise = new Promise((resolve, reject) => { // Append a credential if (i) data.i = i; - + // Send request fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, { method: 'POST', @@ -17,7 +17,7 @@ window.onload = async () => { cache: 'no-cache' }).then(async (res) => { const body = res.status === 204 ? null : await res.json(); - + if (res.status === 200) { resolve(body); } else if (res.status === 204) { @@ -27,7 +27,7 @@ window.onload = async () => { } }).catch(reject); }); - + return promise; }; @@ -44,7 +44,7 @@ window.onload = async () => { const addKeyInput = document.createElement('input'); const addValueTextarea = document.createElement('textarea'); const addButton = document.createElement('button'); - addButton.textContent = 'add'; + addButton.textContent = 'Add'; addButton.addEventListener('click', () => { localStorage.setItem(addKeyInput.value, addValueTextarea.value); location.reload(); @@ -64,13 +64,13 @@ window.onload = async () => { const textarea = document.createElement('textarea'); textarea.textContent = localStorage.getItem(k); const saveButton = document.createElement('button'); - saveButton.textContent = 'save'; + saveButton.textContent = 'Save'; saveButton.addEventListener('click', () => { localStorage.setItem(k, textarea.value); location.reload(); }); const removeButton = document.createElement('button'); - removeButton.textContent = 'remove'; + removeButton.textContent = 'Remove'; removeButton.addEventListener('click', () => { localStorage.removeItem(k); location.reload(); diff --git a/packages/backend/src/server/web/cli.css b/packages/backend/src/server/web/cli.css index 07cd27830b..63e8ca6f2f 100644 --- a/packages/backend/src/server/web/cli.css +++ b/packages/backend/src/server/web/cli.css @@ -1,19 +1,81 @@ -* { - font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; -} - html { - background: #ffb4e1; + background: #222; } - main { - background: #dedede; + background: #333; + border-radius: 10px; } - #tl > div { padding: 16px; - border-bottom: solid 1px #c3c3c3; + border-bottom: 1px solid #c3c3c3; } #tl > div > header { - font-weight: bold; + font-weight: 700; +} + +* { + font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif; +} +#misskey_app { + display: none !important; +} +body, +html { + background-color: #222; + color: #dfddcc; + justify-content: center; + margin: auto; + padding: 10px; + text-align: center; +} +button { + border-radius:999px; + padding:0 40px; + margin-top: 1rem; + border:none; + cursor:pointer; + margin-bottom:12px; + background:linear-gradient(90deg,#86b300,#4ab300); + line-height:50px; + color:#222; + font-weight:700; + font-size:20px; + } +button:hover { + background: rgb(153, 204, 0); +} +a { + color: rgb(134, 179, 0); + text-decoration: none; +} +p, +li { + font-size: 16px; +} + +h1 { + font-size: 32px; +} +code { + font-family: Fira, FiraCode, monospace; +} +#text { + background-color: #444; + border: solid #aaa; + border-radius: 10px; + color: #dfddcc; + margin-top: 3rem; + width: 20rem; + height: 5rem; + padding: 0.5rem; +} + +#text:focus { + border: solid #eee; +} + +@media screen and (max-width: 500px) { + #text { + width: 80% + } } diff --git a/packages/backend/src/server/web/views/bios.pug b/packages/backend/src/server/web/views/bios.pug index 791863f204..b32a2e3d9a 100644 --- a/packages/backend/src/server/web/views/bios.pug +++ b/packages/backend/src/server/web/views/bios.pug @@ -5,7 +5,8 @@ html head meta(charset='utf-8') meta(name='application-name' content='Calckey') - title Calckey Repair Tool + meta(name='viewport' content='width=device-width, initial-scale=1.0') + title Misskey Repair Tool style include ../bios.css script @@ -13,8 +14,8 @@ html body header - h1 Calckey Repair Tool #{version} + h1 Calckey Repair Tool v#{version} main div.tabs - button#ls edit local storage + button#ls Edit local storage div#content diff --git a/packages/backend/src/server/web/views/cli.pug b/packages/backend/src/server/web/views/cli.pug index 92872819c5..9e0229bc54 100644 --- a/packages/backend/src/server/web/views/cli.pug +++ b/packages/backend/src/server/web/views/cli.pug @@ -5,7 +5,8 @@ html head meta(charset='utf-8') meta(name='application-name' content='Calckey') - title Calckey Cli + meta(name='viewport' content='width=device-width, initial-scale=1.0') + title Misskey Cli style include ../cli.css script @@ -13,9 +14,10 @@ html body header - h1 Calckey Cli #{version} + h1 Calckey Simple Client v#{version} main div#form textarea#text - button#submit submit + br + button#submit Post div#tl diff --git a/packages/backend/src/server/web/views/flush.pug b/packages/backend/src/server/web/views/flush.pug index 331a91e252..784d179462 100644 --- a/packages/backend/src/server/web/views/flush.pug +++ b/packages/backend/src/server/web/views/flush.pug @@ -1,47 +1,71 @@ doctype html html - #msg - script. - const msg = document.getElementById('msg'); - const successText = `\nSuccess Flush! Back to Calckey\n成功しました。Misskeyを開き直してください。`; - - message('Start flushing.'); - - (async function() { - try { - localStorage.clear(); - message('localStorage cleared.'); - - const idbPromises = ['MisskeyClient', 'keyval-store'].map((name, i, arr) => new Promise((res, rej) => { - const delidb = indexedDB.deleteDatabase(name); - delidb.onsuccess = () => res(message(`indexedDB "${name}" cleared. (${i + 1}/${arr.length})`)); - delidb.onerror = e => rej(e) - })); - - await Promise.all(idbPromises); - - if (navigator.serviceWorker.controller) { - navigator.serviceWorker.controller.postMessage('clear'); - await navigator.serviceWorker.getRegistrations() - .then(registrations => { - return Promise.all(registrations.map(registration => registration.unregister())); - }) - .catch(e => { throw Error(e) }); - } - - message(successText); - } catch (e) { - message(`\n${e}\n\nFlush Failed. Please retry.\n失敗しました。もう一度試してみてください。`); - message(`\nIf you retry more than 3 times, clear the browser cache or contact to instance admin.\n3回以上試しても失敗する場合、ブラウザのキャッシュを消去し、それでもだめならインスタンス管理者に連絡してみてください。\n`) - - console.error(e); - setTimeout(() => { - location = '/'; - }, 10000) + head + meta(charset='utf-8') + meta(name='application-name' content='Calckey') + meta(name='viewport' content='width=device-width, initial-scale=1.0') + title Flush Misskey + style. + * { + font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif; + } + body, + html { + background-color: #222; + color: #dfddcc; + justify-content: center; + margin: auto; + padding: 10px; + text-align: center; + } + a { + color: rgb(134, 179, 0); + text-decoration: none; } - })(); - function message(text) { - msg.insertAdjacentHTML('beforeend', `

[${(new Date()).toString()}] ${text.replace(/\n/g,'
')}

`) - } + body + #msg + script. + const msg = document.getElementById('msg'); + const successText = `\nSuccess Flush! Back to Calckey\n成功しました。Calckeyを開き直してください。`; + + message('Start flushing.'); + + (async function() { + try { + localStorage.clear(); + message('localStorage cleared.'); + + const idbPromises = ['MisskeyClient', 'keyval-store'].map((name, i, arr) => new Promise((res, rej) => { + const delidb = indexedDB.deleteDatabase(name); + delidb.onsuccess = () => res(message(`indexedDB "${name}" cleared. (${i + 1}/${arr.length})`)); + delidb.onerror = e => rej(e) + })); + + await Promise.all(idbPromises); + + if (navigator.serviceWorker.controller) { + navigator.serviceWorker.controller.postMessage('clear'); + await navigator.serviceWorker.getRegistrations() + .then(registrations => { + return Promise.all(registrations.map(registration => registration.unregister())); + }) + .catch(e => { throw Error(e) }); + } + + message(successText); + } catch (e) { + message(`\n${e}\n\nFlush Failed. Please retry.\n失敗しました。もう一度試してみてください。`); + message(`\nIf you retry more than 3 times, clear the browser cache or contact to instance admin.\n3回以上試しても失敗する場合、ブラウザのキャッシュを消去し、それでもだめならインスタンス管理者に連絡してみてください。\n`) + + console.error(e); + setTimeout(() => { + location = '/'; + }, 10000) + } + })(); + + function message(text) { + msg.insertAdjacentHTML('beforeend', `

[${(new Date()).toString()}] ${text.replace(/\n/g,'
')}

`) + }