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

View File

@ -15,7 +15,7 @@
<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-title" content="Apple //jse">
<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">
<img src="img/badge2e.png" id="badge" />
</a>
<h1 id="subtitle">An Apple //e Emulator in JavaScript</h1>
<div id="subtitle">An Apple //e Emulator in JavaScript</div>
</div>
<div id="display">
<div class="overscan"
@ -52,58 +52,56 @@
</div>
</div>
<div class="inset">
<div style="float: left; width: 50%"
<div class="disk"
ondragover="Apple2.handleDragOver(1, event)"
ondrop="Apple2.handleDrop(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);">
<i class="fas fa-folder-open"></i>
</button>
<button id="disksave1" class="disksave" title="Save Disk"
<button title="Save Disk"
onclick="Apple2.openSave(1, event);">
<i class="fas fa-save"></i>
</button>
<div class="disk" id="disk1">&nbsp;</div>
<span id="disklabel1" class="disklabel">Disk 1</span>
<div id="disk-label1" class="disk-label">Disk 1</div>
</div>
<div style="float: left; width: 50%"
<div class="disk"
ondragover="Apple2.handleDragOver(2, event)"
ondrop="Apple2.handleDrop(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);">
<i class="fas fa-folder-open"></i>
</button>
<button id="disksave2" class="disksave" title="Save Disk"
<button title="Save Disk"
onclick="Apple2.openSave(2, event);">
<i class="fas fa-save"></i>
</button>
<div class="disk" id="disk2">&nbsp;</div>
<span id="disklabel2" class="disklabel">Disk 2</span>
<div id="disk-label2" class="disk-label">Disk 2</div>
</div>
<div style="clear: both"></div>
</div>
<div style="position: relative">
<div id="reset-row">
<div id="controls" class="inset">
<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>
</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>
</button>
<button id="toggle-printer" onclick="Apple2.openPrinterModal()" title="Toggle Printer">
<i class="fas fa-print"></i>
</button>
<div style="float: right">
<button onclick="window.open('https://github.com/whscullin/apple2js#readme', 'blank')" title="About">
<i class="fas fa-info"></i>
</button>
<button onclick="Apple2.openOptions()">
<i class="fas fa-cog"></i>
</button>
</div>
<div class="spacer"></div>
<button onclick="window.open('https://github.com/whscullin/apple2js#readme', 'blank')" title="About">
<i class="fas fa-info"></i>
</button>
<button onclick="Apple2.openOptions()" title="Options">
<i class="fas fa-cog"></i>
</button>
</div>
<button id="reset" type="button"
onclick="Apple2.reset(event)"
@ -236,7 +234,7 @@
<div class="modal__overlay" tabindex="-1" data-micromodal-close>
<div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="Save Disk">
<header class="modal__header">
<span id="save-modal-title">
<span class="modal__title" id="save-modal-title">
Save Disk
</span>
<button class="modal__close" aria-label="Close modal" data-micromodal-close>
@ -245,8 +243,7 @@
<main class="modal__content" id="save-modal-content">
<form action="#" onsubmit="return false;">
<h3>Save to Browser</h3>
Save Name: <input type="text" name="name" id="save_name"
style="width: 200px" />
Save Name: <input type="text" name="name" id="save_name" />
</form>
<hr />
<div>
@ -292,11 +289,11 @@
</header>
<main class="modal__content" id="http-modal-content">
<form action="#">
<input type="text" id="http_url" style="width: 500px"/>
<input type="text" id="http_url" />
</form>
</main>
<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>
</div>
</div>
@ -362,9 +359,9 @@
<div class="modal" id="alert-modal" aria-hidden="true">
<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">
<span class="modal__title" id="printer-modal-title">
<span class="modal__title" id="alert-modal-title">
Alert
</span>
<button class="modal__close" aria-label="Close modal" data-micromodal-close>

View File

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

View File

@ -12,9 +12,9 @@ export default function DriveLights()
},
label: function(drive, 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() {
return {

View File

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