Skip to content

improving visibility, and responsiveness #195

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

Open
wants to merge 2 commits 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
JS-Interpreter
==============

<img src="./fullWidth.jpg" alt="Full width"/>

A sandboxed JavaScript interpreter in JavaScript. Execute arbitrary JavaScript
code line by line in isolation and safety.

Expand Down
Binary file added fullWidth.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
max-width: 1200px;
width: 100%;
padding-right: 15px;
padding-left: 15px;
margin: 2rem auto;
}

.container h1 {
margin: 1rem 0;
font-weight: 600;
font-size: x-large;
color: #324146;
}

.container .description {
margin-bottom: .8rem;
font-weight: 100;
color: #355056;
}

textarea {
background-color: #355056;
border: 1px solid #324146;
border-radius: .3rem;
color: #ffffff;
padding: .5rem 0;
margin-bottom: .5rem;
}

button {
display: inline-block;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.25rem;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
cursor: pointer;
margin-bottom: .5rem;
}

button:hover {
color: #fff;
background-color: #324146;
border-color: #324146;
}
79 changes: 42 additions & 37 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
<head>
<meta charset="utf-8">
<title>JS-Interpreter Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="demos/style.css" rel="stylesheet" type="text/css">

<!-- custom css -->
<link rel="stylesheet" href="index.css">

<script>
// Depending on the URL argument, test the compressed or uncompressed version.
var compressed = (document.location.search == '?compressed');
Expand Down Expand Up @@ -82,43 +86,44 @@
</script>
</head>
<body>
<h1>JS-Interpreter Demo</h1>

<p>Enter JavaScript code below, then click <em>Parse</em>. To execute, either
click <em>Step</em> repeatedly, or click <em>Run</em> once.
Open your browser's console for errors.</p>
<p><textarea id="code">
var result = [];
function fibonacci(n, output) {
var a = 1, b = 1, sum;
for (var i = 0; i &lt; n; i++) {
output.push(a);
sum = a + b;
a = b;
b = sum;
}
}
fibonacci(16, result);
alert(result.join(', '));
</textarea><br>
<button onclick="parseButton()">Parse</button>
<button onclick="stepButton()" id="stepButton" disabled="disabled">Step</button>
<button onclick="runButton()" id="runButton" disabled="disabled">Run</button>
</p>

<p><small>
<script>
if (compressed) {
document.write('[ Running compressed bundle. Switch to <A HREF="?uncompressed">raw sources</A>. ]');
} else {
document.write('[ Running raw sources. Switch to <A HREF="?compressed">compressed bundle</A>. ]');
<div class="container">
<h1>JS-Interpreter Demo</h1>
<p class="description">Enter JavaScript code below, then click <em>Parse</em>. To execute, either
click <em>Step</em> repeatedly, or click <em>Run</em> once.
<br> Open your browser's console for errors.</p>
<p><textarea id="code">
var result = [];
function fibonacci(n, output) {
var a = 1, b = 1, sum;
for (var i = 0; i &lt; n; i++) {
output.push(a);
sum = a + b;
a = b;
b = sum;
}
disable('disabled');
</script>
</small></p>

<p>Read the <a href="docs.html">JS-Interpreter documentation</a>.</p>
<p>Get the <a href="https://github.com/NeilFraser/JS-Interpreter">source code</a>.</p>

}
fibonacci(16, result);
alert(result.join(', '));
</textarea><br>
<button class="btn" onclick="parseButton()">Parse</button>
<button onclick="stepButton()" id="stepButton" disabled="disabled">Step</button>
<button onclick="runButton()" id="runButton" disabled="disabled">Run</button>
</p>

<p><small>
<script>
if (compressed) {
document.write('[ Running compressed bundle. Switch to <A HREF="?uncompressed">raw sources</A>. ]');
} else {
document.write('[ Running raw sources. Switch to <A HREF="?compressed">compressed bundle</A>. ]');
}
disable('disabled');
</script>
</small></p>

<p>Read the <a href="docs.html">JS-Interpreter documentation</a>.</p>
<p>Get the <a href="https://github.com/NeilFraser/JS-Interpreter">source code</a>.</p>

</div>
</body>
</html>
Binary file added mobWidth.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.