Style cleanup

This commit is contained in:
Will Scullin 2020-04-23 19:48:52 -07:00
parent bb6e36f964
commit 87e8cde031
No known key found for this signature in database
GPG Key ID: 9092A5C0A673416B
5 changed files with 116 additions and 99 deletions

View File

@ -37,12 +37,12 @@
ondragover="Apple2.handleDragOver(0, event)" ondragover="Apple2.handleDragOver(0, event)"
ondrop="Apple2.handleDrop(0, event)" ondrop="Apple2.handleDrop(0, event)"
ondragend="Apple2.handleDragEnd(0, event)"> ondragend="Apple2.handleDragEnd(0, event)">
<div style="margin: auto; width: 614px"> <div class="outer">
<div id="header"> <div id="header">
<a href="https://github.com/whscullin/apple2js#readme" target="_blank"> <a href="https://github.com/whscullin/apple2js#readme" target="_blank">
<img src="img/badge.png" id="badge" /> <img src="img/badge.png" id="badge" />
</a> </a>
<h1 id="subtitle">An Apple ][ Emulator in JavaScript</h1> <div id="subtitle">An Apple ][ Emulator in JavaScript</div>
</div> </div>
<div id="display"> <div id="display">
<div class="overscan"> <div class="overscan">
@ -50,37 +50,36 @@
</div> </div>
</div> </div>
<div class="inset"> <div class="inset">
<div style="float: left; width: 50%" <div class="disk"
ondragover="Apple2.handleDragOver(1, event)" ondragover="Apple2.handleDragOver(1, event)"
ondrop="Apple2.handleDrop(1, event)" ondrop="Apple2.handleDrop(1, event)"
ondragend="Apple2.handleDragEnd(1, event)"> ondragend="Apple2.handleDragEnd(1, event)">
<button id="diskload1" class="diskload" title="Load Disk" <div class="disk-light" id="disk1"></div>
<button title="Load Disk"
onclick="Apple2.openLoad(1, event);"> onclick="Apple2.openLoad(1, event);">
<i class="fas fa-folder-open"></i> <i class="fas fa-folder-open"></i>
</button> </button>
<button id="disksave1" class="disksave" title="Save Disk" <button title="Save Disk"
onclick="Apple2.openSave(1, event);"> onclick="Apple2.openSave(1, event);">
<i class="fas fa-save"></i> <i class="fas fa-save"></i>
</button> </button>
<div class="disk" id="disk1">&nbsp;</div> <div id="disk-label1" class="disk-label">Disk 1</div>
<span id="disklabel1" class="disklabel">Disk 1</span>
</div> </div>
<div style="float: left; width: 50%" <div class="disk"
ondragover="Apple2.handleDragOver(2, event)" ondragover="Apple2.handleDragOver(2, event)"
ondrop="Apple2.handleDrop(2, event)" ondrop="Apple2.handleDrop(2, event)"
ondragend="Apple2.handleDragEnd(2, event)"> ondragend="Apple2.handleDragEnd(2, event)">
<button id="diskload2" class="diskload" title="Load Disk" <div class="disk-light" id="disk2"></div>
<button title="Load Disk"
onclick="Apple2.openLoad(2, event);"> onclick="Apple2.openLoad(2, event);">
<i class="fas fa-folder-open"></i> <i class="fas fa-folder-open"></i>
</button> </button>
<button id="disksave2" class="disksave" title="Save Disk" <button title="Save Disk"
onclick="Apple2.openSave(2, event);"> onclick="Apple2.openSave(2, event);">
<i class="fas fa-save"></i> <i class="fas fa-save"></i>
</button> </button>
<div class="disk" id="disk2">&nbsp;</div> <div id="disk-label2" class="disk-label">Disk 2</div>
<span id="disklabel2" class="disklabel">Disk 2</span>
</div> </div>
<div style="clear: both"></div>
</div> </div>
<div class="inset"> <div class="inset">
<div id="khz" onclick="Apple2.toggleShowFPS()">0 kHz</div> <div id="khz" onclick="Apple2.toggleShowFPS()">0 kHz</div>
@ -93,14 +92,13 @@
<button id="toggle-printer" onclick="Apple2.openPrinterModal()" title="Toggle Printer"> <button id="toggle-printer" onclick="Apple2.openPrinterModal()" title="Toggle Printer">
<i class="fas fa-print"></i> <i class="fas fa-print"></i>
</button> </button>
<div style="float: right"> <div class="spacer"></div>
<button onclick="window.open('https://github.com/whscullin/apple2js#readme', 'blank')" title="About"> <button onclick="window.open('https://github.com/whscullin/apple2js#readme', 'blank')" title="About">
<i class="fas fa-info"></i> <i class="fas fa-info"></i>
</button> </button>
<button onclick="Apple2.openOptions()" title="Options"> <button onclick="Apple2.openOptions()" title="Options">
<i class="fas fa-cog"></i> <i class="fas fa-cog"></i>
</button> </button>
</div>
</div> </div>
<div class="inset"> <div class="inset">
<div style="margin: 0 10px"> <div style="margin: 0 10px">
@ -267,8 +265,7 @@
<main class="modal__content" id="save-modal-content"> <main class="modal__content" id="save-modal-content">
<form action="#" onsubmit="return false;"> <form action="#" onsubmit="return false;">
<h3>Save to Browser</h3> <h3>Save to Browser</h3>
Save Name: <input type="text" name="name" id="save_name" Save Name: <input type="text" name="name" id="save_name" />
style="width: 200px" />
</form> </form>
<hr /> <hr />
<div> <div>
@ -314,11 +311,11 @@
</header> </header>
<main class="modal__content" id="http-modal-content"> <main class="modal__content" id="http-modal-content">
<form action="#"> <form action="#">
<input type="text" id="http_url" style="width: 500px"/> <input type="text" id="http_url" />
</form> </form>
</main> </main>
<footer class="modal__footer"> <footer class="modal__footer">
<button class="modal__btn" data-micromodal-close aria-label="Close this dialog window">OK</button> <button class="modal__btn" data-micromodal-close aria-label="Load this URL">OK</button>
</footer> </footer>
</div> </div>
</div> </div>
@ -373,9 +370,7 @@
</button> </button>
</header> </header>
<main class="modal__content" id="printer-modal-content"> <main class="modal__content" id="printer-modal-content">
<div class="feed"> <div class="paper"></div>
<div class="paper"></div>
</div>
</main> </main>
<footer class="modal__footer"> <footer class="modal__footer">
<button class="modal__btn" data-micromodal-close aria-label="Close this dialog window">Close</button> <button class="modal__btn" data-micromodal-close aria-label="Close this dialog window">Close</button>
@ -386,16 +381,16 @@
<div class="modal" id="alert-modal" aria-hidden="true"> <div class="modal" id="alert-modal" aria-hidden="true">
<div class="modal__overlay" tabindex="-1" data-micromodal-close> <div class="modal__overlay" tabindex="-1" data-micromodal-close>
<div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="Printer"> <div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="Alert">
<header class="modal__header"> <header class="modal__header">
<span class="modal__title" id="printer-modal-title"> <span class="modal__title" id="alert-modal-title">
Alert Alert
</span> </span>
<button class="modal__close" aria-label="Close modal" data-micromodal-close> <button class="modal__close" aria-label="Close modal" data-micromodal-close>
</button> </button>
</header> </header>
<main class="modal__content" id="alert-modal-content"> <main class="modal__content" id="alert-modal-content">
<div class=".message"> <div class="message">
</div> </div>
</main> </main>
<footer class="modal__footer"> <footer class="modal__footer">

View File

@ -15,7 +15,7 @@
<title>Apple //jse - An Apple //e Emulator in JavaScript</title> <title>Apple //jse - An Apple //e Emulator in JavaScript</title>
<meta name="viewport" content="width=640 user-scalable=0" /> <meta name="viewport" content="width=640, height=device-height, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Apple //jse"> <meta name="apple-mobile-web-app-title" content="Apple //jse">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
@ -42,7 +42,7 @@
<a href="https://github.com/whscullin/apple2js#readme" target="_blank"> <a href="https://github.com/whscullin/apple2js#readme" target="_blank">
<img src="img/badge2e.png" id="badge" /> <img src="img/badge2e.png" id="badge" />
</a> </a>
<h1 id="subtitle">An Apple //e Emulator in JavaScript</h1> <div id="subtitle">An Apple //e Emulator in JavaScript</div>
</div> </div>
<div id="display"> <div id="display">
<div class="overscan" <div class="overscan"
@ -52,58 +52,56 @@
</div> </div>
</div> </div>
<div class="inset"> <div class="inset">
<div style="float: left; width: 50%" <div class="disk"
ondragover="Apple2.handleDragOver(1, event)" ondragover="Apple2.handleDragOver(1, event)"
ondrop="Apple2.handleDrop(1, event)" ondrop="Apple2.handleDrop(1, event)"
ondragend="Apple2.handleDragEnd(1, event)"> ondragend="Apple2.handleDragEnd(1, event)">
<button id="diskload1" class="diskload" title="Load Disk" <div class="disk-light" id="disk1"></div>
<button title="Load Disk"
onclick="Apple2.openLoad(1, event);"> onclick="Apple2.openLoad(1, event);">
<i class="fas fa-folder-open"></i> <i class="fas fa-folder-open"></i>
</button> </button>
<button id="disksave1" class="disksave" title="Save Disk" <button title="Save Disk"
onclick="Apple2.openSave(1, event);"> onclick="Apple2.openSave(1, event);">
<i class="fas fa-save"></i> <i class="fas fa-save"></i>
</button> </button>
<div class="disk" id="disk1">&nbsp;</div> <div id="disk-label1" class="disk-label">Disk 1</div>
<span id="disklabel1" class="disklabel">Disk 1</span>
</div> </div>
<div style="float: left; width: 50%" <div class="disk"
ondragover="Apple2.handleDragOver(2, event)" ondragover="Apple2.handleDragOver(2, event)"
ondrop="Apple2.handleDrop(2, event)" ondrop="Apple2.handleDrop(2, event)"
ondragend="Apple2.handleDragEnd(2, event)"> ondragend="Apple2.handleDragEnd(2, event)">
<button id="diskload2" class="diskload" title="Load Disk" <div class="disk-light" id="disk2"></div>
<button title="Load Disk"
onclick="Apple2.openLoad(2, event);"> onclick="Apple2.openLoad(2, event);">
<i class="fas fa-folder-open"></i> <i class="fas fa-folder-open"></i>
</button> </button>
<button id="disksave2" class="disksave" title="Save Disk" <button title="Save Disk"
onclick="Apple2.openSave(2, event);"> onclick="Apple2.openSave(2, event);">
<i class="fas fa-save"></i> <i class="fas fa-save"></i>
</button> </button>
<div class="disk" id="disk2">&nbsp;</div> <div id="disk-label2" class="disk-label">Disk 2</div>
<span id="disklabel2" class="disklabel">Disk 2</span>
</div> </div>
<div style="clear: both"></div>
</div> </div>
<div style="position: relative"> <div id="reset-row">
<div id="controls" class="inset"> <div id="controls" class="inset">
<div id="khz" onclick="Apple2.toggleShowFPS()">0 kHz</div> <div id="khz" onclick="Apple2.toggleShowFPS()">0 kHz</div>
<button id="pause-run" onclick="Apple2.pauseRun()"> <button id="pause-run" onclick="Apple2.pauseRun()" title="Pause/Run">
<i class="fas fa-pause"></i> <i class="fas fa-pause"></i>
</button> </button>
<button id="toggle-sound" onclick="Apple2.toggleSound()"> <button id="toggle-sound" onclick="Apple2.toggleSound()" title="Toggle Sound">
<i class="fas fa-volume-off"></i> <i class="fas fa-volume-off"></i>
</button> </button>
<button id="toggle-printer" onclick="Apple2.openPrinterModal()" title="Toggle Printer"> <button id="toggle-printer" onclick="Apple2.openPrinterModal()" title="Toggle Printer">
<i class="fas fa-print"></i> <i class="fas fa-print"></i>
</button> </button>
<div style="float: right"> <div class="spacer"></div>
<button onclick="window.open('https://github.com/whscullin/apple2js#readme', 'blank')" title="About"> <button onclick="window.open('https://github.com/whscullin/apple2js#readme', 'blank')" title="About">
<i class="fas fa-info"></i> <i class="fas fa-info"></i>
</button> </button>
<button onclick="Apple2.openOptions()"> <button onclick="Apple2.openOptions()" title="Options">
<i class="fas fa-cog"></i> <i class="fas fa-cog"></i>
</button> </button>
</div>
</div> </div>
<button id="reset" type="button" <button id="reset" type="button"
onclick="Apple2.reset(event)" onclick="Apple2.reset(event)"
@ -236,7 +234,7 @@
<div class="modal__overlay" tabindex="-1" data-micromodal-close> <div class="modal__overlay" tabindex="-1" data-micromodal-close>
<div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="Save Disk"> <div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="Save Disk">
<header class="modal__header"> <header class="modal__header">
<span id="save-modal-title"> <span class="modal__title" id="save-modal-title">
Save Disk Save Disk
</span> </span>
<button class="modal__close" aria-label="Close modal" data-micromodal-close> <button class="modal__close" aria-label="Close modal" data-micromodal-close>
@ -245,8 +243,7 @@
<main class="modal__content" id="save-modal-content"> <main class="modal__content" id="save-modal-content">
<form action="#" onsubmit="return false;"> <form action="#" onsubmit="return false;">
<h3>Save to Browser</h3> <h3>Save to Browser</h3>
Save Name: <input type="text" name="name" id="save_name" Save Name: <input type="text" name="name" id="save_name" />
style="width: 200px" />
</form> </form>
<hr /> <hr />
<div> <div>
@ -292,11 +289,11 @@
</header> </header>
<main class="modal__content" id="http-modal-content"> <main class="modal__content" id="http-modal-content">
<form action="#"> <form action="#">
<input type="text" id="http_url" style="width: 500px"/> <input type="text" id="http_url" />
</form> </form>
</main> </main>
<footer class="modal__footer"> <footer class="modal__footer">
<button class="modal__btn" data-micromodal-close aria-label="Close this dialog window">OK</button> <button class="modal__btn" data-micromodal-close aria-label="Load this URL">OK</button>
</footer> </footer>
</div> </div>
</div> </div>
@ -362,9 +359,9 @@
<div class="modal" id="alert-modal" aria-hidden="true"> <div class="modal" id="alert-modal" aria-hidden="true">
<div class="modal__overlay" tabindex="-1" data-micromodal-close> <div class="modal__overlay" tabindex="-1" data-micromodal-close>
<div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="Printer"> <div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="Alert">
<header class="modal__header"> <header class="modal__header">
<span class="modal__title" id="printer-modal-title"> <span class="modal__title" id="alert-modal-title">
Alert Alert
</span> </span>
<button class="modal__close" aria-label="Close modal" data-micromodal-close> <button class="modal__close" aria-label="Close modal" data-micromodal-close>

View File

@ -5,21 +5,6 @@
margin: auto; margin: auto;
} }
.motter {
font-family: "Motter Tektura";
}
.clear {
clear: both
}
.disklabel {
color: #000;
font-weight: bold;
vertical-align: middle;
margin-right: 0.5em;
}
img { img {
border: none; border: none;
} }
@ -126,19 +111,29 @@ body {
} }
.disk { .disk {
align-items: center;
display: flex;
flex-grow: 1;
max-width: 50%;
}
.disk-light {
margin: 5px; margin: 5px;
float: left;
background-image: url(red-off-16.png); background-image: url(red-off-16.png);
flex-shrink: 0;
width: 16px; width: 16px;
height: 16px; height: 16px;
} }
.disklabel { .disk-label {
color: #000;
font-family: sans-serif; font-family: sans-serif;
} font-weight: bold;
margin-right: 0.5em;
.disksave { text-overflow: ellipsis;
display: none; overflow: hidden;
white-space: nowrap;
flex-grow: 1;
} }
.code { .code {
@ -159,22 +154,25 @@ th {
} }
.inset { .inset {
width: 594px;
border-radius: 6px; border-radius: 6px;
border: 3px inset #f0edd0; border: 3px inset #f0edd0;
padding: 6px; padding: 6px;
margin: 10px 0; margin: 10px 0;
display: flex;
} }
.inset button { .inset button {
min-width: 36px; min-width: 36px;
} }
.inset button {
margin: 0 2px;
}
#khz { #khz {
margin-right: 4px; margin-right: 4px;
overflow: hidden; overflow: hidden;
padding: 4px; padding: 4px;
float: left;
font-family: Courier; font-family: Courier;
font-size: 12px; font-size: 12px;
width: 60px; width: 60px;
@ -352,7 +350,7 @@ button:focus {
outline: none; outline: none;
} }
#keyboard { #keyboard, #reset {
-webkit-touch-callout: none; -webkit-touch-callout: none;
-webkit-user-select: none; -webkit-user-select: none;
-khtml-user-select: none; -khtml-user-select: none;
@ -435,11 +433,11 @@ button:focus {
text-align: center; text-align: center;
} }
#keyboard .vcenter div { #keyboard .v-center div {
bottom: 10px; bottom: 10px;
} }
#keyboard .vcenter2 div { #keyboard .v-center2 div {
bottom: 5px; bottom: 5px;
} }
@ -552,13 +550,25 @@ button:focus {
display: inline; display: inline;
} }
.apple2e #controls { #controls {
width: calc(100% - 70px) flex-grow: 1;
} }
.apple2e #reset { .spacer {
position: absolute; flex-grow: 1;
right: 0; top: 0; }
#reset-row {
align-items: center;
display: flex;
margin: 10px 0;
}
#reset-row .inset {
margin: 0;
}
#reset {
background: #44372C; background: #44372C;
border: 3px outset #66594E; border: 3px outset #66594E;
border-radius: 3px; border-radius: 3px;
@ -566,15 +576,16 @@ button:focus {
font: 9px Helvetica; font: 9px Helvetica;
height: 42px; height: 42px;
padding: 0; padding: 0;
margin-left: 10px;
width: 42px; width: 42px;
} }
.apple2e #reset:hover { #reset:hover {
background: #44372C; background: #44372C;
border: 3px outset #66594E; border: 3px outset #66594E;
} }
.apple2e #reset:active { #reset:active {
background: #22150A; background: #22150A;
border: 5px outset #44372C; border: 5px outset #44372C;
} }
@ -612,6 +623,14 @@ button:focus {
font-family: courier; font-family: courier;
} }
#http_url {
width: 500px;
}
#save_name {
width: 200px;
}
#options-modal { #options-modal {
width: 300px; width: 300px;
line-height: 1.75em; line-height: 1.75em;

View File

@ -12,9 +12,9 @@ export default function DriveLights()
}, },
label: function(drive, label) { label: function(drive, label) {
if (label) { if (label) {
document.querySelector('#disklabel' + drive).innerText = label; document.querySelector('#disk-label' + drive).innerText = label;
} }
return document.querySelector('#disklabel' + drive).innerText; return document.querySelector('#disk-label' + drive).innerText;
}, },
getState: function() { getState: function() {
return { return {

View File

@ -260,6 +260,9 @@ export default function KeyBoard(cpu, io, e) {
commandKey: function keyboard_commandKey(down) { commandKey: function keyboard_commandKey(down) {
var commandKey = kb.querySelector('.key-OPEN_APPLE'); var commandKey = kb.querySelector('.key-OPEN_APPLE');
if (!commandKey) {
return;
}
commanded = down; commanded = down;
if (down) { if (down) {
io.buttonDown(0); io.buttonDown(0);
@ -272,6 +275,9 @@ export default function KeyBoard(cpu, io, e) {
optionKey: function keyboard_optionKey(down) { optionKey: function keyboard_optionKey(down) {
var optionKey = kb.querySelector('.key-CLOSED_APPLE'); var optionKey = kb.querySelector('.key-CLOSED_APPLE');
if (!optionKey) {
return;
}
optioned = down; optioned = down;
if (down) { if (down) {
io.buttonDown(1); io.buttonDown(1);
@ -426,9 +432,9 @@ export default function KeyBoard(cpu, io, e) {
if (key1.length > 1) { if (key1.length > 1) {
if (key1 == 'LOCK') if (key1 == 'LOCK')
key.classList.add('vcenter2'); key.classList.add('v-center2');
else else
key.classList.add('vcenter'); key.classList.add('v-center');
} }
if (key1 != key2) { if (key1 != key2) {
key.classList.add('key-' + key2.replace(/[&;]/g,'')); key.classList.add('key-' + key2.replace(/[&;]/g,''));