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

Preview mode for the script #1

Closed
wants to merge 4 commits into from
Closed
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
5 changes: 5 additions & 0 deletions preview/codemirror.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions preview/codemirror.min.js

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions preview/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>FinFiddle</title>
<link rel="stylesheet" href="codemirror.min.css">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}

main {
display: flex;
height: 100%;
}

.editing {
flex: 1 1 50%;
height: 100%;
width: 50%;
}

.execution {
flex: 1 1 50%;
height: 100%;
width: 50%;
display: flex;
flex-direction: column;
}

.CodeMirror {
height: 100%;
}

canvas#preview {
width: 100%;
height: 100%;
}

.coords {
display: none;
}
</style>
<main>
<div class="editing">
<textarea id="source"># Loading...</textarea>
</div>
<div class="execution">
<form>
<button type="button" id="play-btn" title="Play">▶</button>
<label>
<input type="checkbox" id="rotate-check" />
Rotate Tree
</label>
</form>
<canvas id="preview"></canvas>
</div>
</main>
<pre id="output"></pre>
<pre id="Python/coords.txt" class="coords"></pre>
<script id="vshader" type="x-shader/x-vertex">
attribute vec3 pos;
attribute vec4 colorIn;
uniform float pointSize;
uniform mat4 vMatrix;
varying vec4 color;

void main()
{
gl_PointSize = pointSize;
color = colorIn;
gl_Position = vMatrix * vec4(pos.xyz, 3.0);
}
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 color;

void main()
{
gl_FragColor = color;
}
</script>
<script src="skulpt.min.js" type="text/javascript"></script>
<script src="skulpt-stdlib.js" type="text/javascript"></script>
<script src="codemirror.min.js" type="text/javascript"></script>
<script src="mode/python/python.js" type="text/javascript"></script>
<script type="module" src="render.js" async></script>
Loading