feat: add more style

This commit is contained in:
Minhyeok Park 2024-10-15 16:55:07 +09:00
parent b40e6313b3
commit 1358b22a54
Signed by: pmh_only
SSH Key Fingerprint: SHA256:g/OyGvi2pcd8ub9mqge/ohmDP0fZX/xOPWPIcM+9XpI

View File

@ -21,6 +21,10 @@
</div> </div>
<style> <style>
:root {
background-color: #212121;
}
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -28,7 +32,8 @@
html, body, #container { html, body, #container {
width: 100%; width: 100%;
height: 100% height: 100%;
user-select: none;
} }
#container { #container {
@ -42,6 +47,10 @@
flex: 1; flex: 1;
} }
#main {
background-color: #1e1e1e;
}
#q { #q {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
@ -88,13 +97,26 @@
padding: 6px 10px; padding: 6px 10px;
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
background-color: #1683ff; background-color: #ff1696;
color: white; color: white;
margin-right: 6px; margin-right: 6px;
} }
#r button:hover { #r button:hover {
background-color: #1c74da; background-color: #da1c9b;
}
#r input {
background-color: transparent;
color: #fafafa;
border: none;
border-bottom: 1px solid #fafafa;
text-align: center;
accent-color: #ff1696;
}
#r input:focus {
outline: none;
} }
</style> </style>
@ -104,7 +126,7 @@
require(['vs/editor/editor.main'], function () { require(['vs/editor/editor.main'], function () {
var editor = monaco.editor.create(document.getElementById('main'), { var editor = monaco.editor.create(document.getElementById('main'), {
value: '', value: 'Type Something Here',
language: 'json', language: 'json',
automaticLayout: true, automaticLayout: true,
minimap: { enabled: false }, minimap: { enabled: false },
@ -116,6 +138,7 @@
wordWrap: true wordWrap: true
}); });
render()
function render () { function render () {
const value = editor.getValue() const value = editor.getValue()
try { document.getElementById('base64d').value = atob(value) } catch { document.getElementById('base64d').value ='(err)' } try { document.getElementById('base64d').value = atob(value) } catch { document.getElementById('base64d').value ='(err)' }