Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide elements on small screens #22

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,31 @@
gap: 30px;
}

.memory-addr {
margin-top: 30px;
margin-bottom: 0;
}

.memory-value {
margin-top: 5px;
}

.compile-button {
font-weight: bold;
}

.hex {
color: #fffdfd;
}
}

/* Default style: hide the element */
.hidden-on-small {
display: none;
}

/* When screen width is 850 or more, show the element */
@media (min-width: 850px) {
.hidden-on-small {
display: inherit;
}
}
26 changes: 13 additions & 13 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<card-component
class="input-card"
title="S.M.A.R.T Control and Inputs" width="5" height="2" id="input-card"
title="Control and Inputs" width="5" height="2" id="input-card"
href="https://github.com/yaacov/smart-tools"
hreflabel="https://github.com/yaacov/smart-tools">
<div class="flex-container">
Expand All @@ -28,28 +28,28 @@
</div>
</div>

<div class="flex-container">
<div class="flex-container">
<div class="group-margin">
<p class="title-text">Memory Address</p>
<led-switch-array width="8" value="0" class="address-set" id="address-set-array"></led-switch-array>
<p class="title-text hidden-on-small">Memory Address</p>
<led-switch-array width="8" value="0" class="address-set hidden-on-small" id="address-set-array"></led-switch-array>
</div>

<div class="group-margin">
<p class="title-text">Memory Value</p>
<led-switch-array width="8" value="0" class="memory-set" id="memory-set-array"></led-switch-array>
<p class="title-text hidden-on-small">Memory Value</p>
<led-switch-array width="8" value="0" class="memory-set hidden-on-small" id="memory-set-array"></led-switch-array>
</div>

<div class="group-margin">
<p class="title-text">Set</p>
<led-switch layout="horizontal" autoreset="true" value="false" color="red" class="memory-send" id="memory-set-switch" label="Set memory"></led-switch>
<p>Address: <span id="address-value" class="hex">0x00</span></p>
<p>Value: <span id="memory-value" class="hex">0x00</span></p>
<p class="title-text hidden-on-small">Set Memory</p>
<led-switch layout="horizontal" autoreset="true" value="false" color="red" class="memory-send hidden-on-small" id="memory-set-switch"></led-switch>
<p class="memory-addr hidden-on-small">Addr: <span id="address-value" class="hex">0x00</span></p>
<p class="memory-value hidden-on-small">Value: <span id="memory-value" class="hex">0x00</span></p>
</div>
</div>
</card-component>

<card-component
class="vm-card" title="S.M.A.R.T Virtual Machine" width="3" height="28" id="vm-card"
class="vm-card" title="Virtual Machine" width="3" height="28" id="vm-card"
href="https://github.com/yaacov/smart-tools">
<div class="flex-container">
<div class="group-margin">
Expand All @@ -69,7 +69,7 @@

<div class="group-margin">
<p class="title-text">Turbo</p>
<led-switch layout="horizontal" value="true" color="green" class="turbo" id="turbo-switch"></led-switch>
<led-switch layout="horizontal" value="false" color="green" class="turbo" id="turbo-switch"></led-switch>
</div>
</div>

Expand All @@ -80,7 +80,7 @@
<led-memory-table class="ledTable" color="red" id="memory-table"></led-memory-table>
</card-component>

<card-component class="editor-card" title="S.M.A.R.T Assembly Code Editor" width="5" height="15" id="editor-card" href="https://github.com/yaacov/smart-tools">
<card-component class="editor-card" title="Assembly Code Editor" width="5" height="15" id="editor-card" href="https://github.com/yaacov/smart-tools">
<div class="main-container">
<div class="editor-column">
<code-editor theme="new" id="code-editor"></code-editor>
Expand Down
2 changes: 1 addition & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import compile from './src/compiler.mjs';
// Virtual machine
const memorySize = 256;
const vm = new VM(memorySize);
let runningStepTimeMs = 20;
let runningStepTimeMs = 250;

let runningSteps = 0;
let runningInterval;
Expand Down
14 changes: 11 additions & 3 deletions public/js/components/led-memory-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ class LedMemoryTable extends HTMLElement {
.decimal {
color: #D3D3D3;
}
.hidden-on-small {
display: none;
}
@media (min-width: 850px) {
.hidden-on-small {
display: table-cell;
}
}
`;
this.shadowRoot.appendChild(this._style);
}
Expand Down Expand Up @@ -123,9 +131,9 @@ class LedMemoryTable extends HTMLElement {
<td><led-array color="red" width="1" value="${item.indicator ? '1' : '0'}"></led-array>
<td><led-array color="green" width="8" value="${item.value}"></led-array></td>
<td>${valueHex}</td>
<td class="decimal">${valueDecimal}</td>
<td class="label">${item.label || ''}</td>
${item.opCode ? `<td>${item.opCode}</td>` : `<td class="decimal">${item.oprand || ''}</td>`}
<td class="decimal hidden-on-small">${valueDecimal}</td>
<td class="label hidden-on-small">${item.label || ''}</td>
${item.opCode ? `<td class="hidden-on-small">${item.opCode}</td>` : `<td class="decimal hidden-on-small">${item.oprand || ''}</td>`}
`;
}
}
Expand Down