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

Style Changes #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 15 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
</script>
<!-- github ribbon -->
<a id="github" href="https://github.com/engine262/engine262" aria-label="Fork me on GitHub"></a>

<h1>engine262</h1>
<p>A JavaScript engine written in JavaScript for development and exploration.</p>
<nav>
<a href="/">engine262</a>
<p>A JavaScript engine written in JavaScript for development and exploration.</p>
</nav>

<main>
<section id="input-section">
Expand All @@ -34,13 +35,17 @@ <h1>engine262</h1>

<fieldset>
<legend>Editor</legend>
<label><input id="autoevaluate" checked type="checkbox">Auto Evaluate</label>
<select id="mode">
<option value="script" selected="selected" autocomplete="off">Script</option>
<option value="module">Module</option>
</select>
<button type="button" id="save-to-gist">Save to Gist</button>
<span id="save-to-gist-output"></span>
<input id="autoevaluate" checked type="checkbox">
<label for="autoevaluate">Auto Evaluate</label>
<span class="row">
<select id="mode">
<option value="script" selected="selected" autocomplete="off">Script</option>
<option value="module">Module</option>
</select>

<button type="button" id="save-to-gist">Save to Gist</button>
<span id="save-to-gist-output"></span>
</span>
</fieldset>

<textarea id="input" autocomplete="off"></textarea>
Expand Down
14 changes: 12 additions & 2 deletions src/runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,27 @@ function respawn(first = false) {
respawn();
});
});

getState('features')
.then((requestedFeatures) => {
input.checked = requestedFeatures.has(name);
});



const id = name.replace(/\W+/g, '_');
input.id = id;

const label = document.createElement('label');
label.appendChild(input);
label.htmlFor = id;
label.appendChild(document.createTextNode(name));

const pair = document.createElement('div');
pair.appendChild(input);
pair.appendChild(label);

const li = document.createElement('li');
li.appendChild(label);
li.appendChild(pair);

features.appendChild(li);
});
Expand Down
106 changes: 100 additions & 6 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,112 @@ html, body {
padding: 0;
margin: 0;
overflow: auto;
background-color: #f7df1e;
background-color: #fdfafa;
display: flex;
flex-direction: column;
font-size: 16px;
}
h1, h2 {

h2, p {
margin: 0;
}

nav {
background: #303235;
display: flex;
color: white;
align-items: center;
padding: 0.6em 0.6em;
}

nav > * {
line-height: 1;
}

nav > a {
font-size: 1.6em;
display: flex;
color: #f7df1e;

text-decoration: none;
}

nav > p {
margin-left: 0.5em;
padding-left: 0.5em;
}

input[type=checkbox] {
position: absolute;
top: 0;
left: -1000rem;
}

input[type=checkbox] + label {
display: flex;
line-height: 1;
}

input[type=checkbox] + label::before {
content: '';
display: block;
width: 0.8em;
height: 0.8em;
position: relative;
top: 0.1em;
margin-right: 0.4em;
color: #999;
box-shadow: 0 0 1px 1px currentColor;
background-color: white;
}

input[type=checkbox]:checked + label::before {
color: #136308;
background-size: 100%;
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMjAwMTA5MDQvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvVFIvMjAwMS9SRUMtU1ZHLTIwMDEwOTA0L0RURC9zdmcxMC5kdGQiPjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjgwLjAwMDAwMHB0IiBoZWlnaHQ9IjEyMjAuMDAwMDAwcHQiIHZpZXdCb3g9IjAgMCAxMjgwLjAwMDAwMCAxMjIwLjAwMDAwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCI+PG1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DUgMzE4IDY2IDEyOCA3NyAyODQgMjkgMzg5IC00NyAxMDMgLTEzNyAxMzIgLTI1MiA4NHoiLz48L2c+PC9zdmc+');
}

button {
display: flex;
padding: 0.2em 0.4em;
background: #3d3b32;
color: white;
cursor: pointer;
}

button:hover {
background: #292720;
}

.row {
display: flex;
align-items: center;
}

.row > *:not(:first-child) {
margin-left: 0.4em;
}

nav > a:hover {
text-decoration: underline;
}

label {
white-space: nowrap;
}
fieldset {
border: none;
padding: 0;
margin: 0;
margin: 0.6em 1em;
margin-bottom: 5px;
}
legend {
font-weight: bold;
margin-bottom: 5px;
padding-inline-start: 0;
}
body {
font-family: sans-serif;
padding: 10px;
display: flex;
flex-direction: column;
}
Expand All @@ -48,11 +131,22 @@ textarea:disabled {
color: black;
}

#input-section, #output-section {
#input-section, #output-section {
display: flex;
flex-direction: column;
margin: 0.4em 0.7em;
}

#input-section {
flex-shrink: 3;
flex-grow: 1;
flex-shrink: 1;
max-width: 65%;
}

#output-section {
margin-left: auto;
flex-basis: calc(35vw + 10em);
max-width: 98vw;
}

#output {
Expand Down