Skip to content

Commit

Permalink
made archive for 0.5.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dktr0 committed Jan 30, 2025
1 parent b1cc1a2 commit 422f0e6
Show file tree
Hide file tree
Showing 3 changed files with 498 additions and 0 deletions.
94 changes: 94 additions & 0 deletions archive/0.5.1.1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"></meta>
<title>Punctual</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>

<body onLoad="window.doLaunch()">

<script type="module">
import * as P from "./punctual.js";
window.footer = true;
window.info = false;
window.doLaunch = function () {
var cvs = document.getElementById('canvas');
window.punctual = new P.Punctual();
window.timeOfLastFPSUpdate = Date.now()/1000.0;
window.framesSinceFPSUpdate = 0;
window.requestAnimationFrame(animate);
setTimeout(updateFPS,1020);
}
function animate() {
window.requestAnimationFrame(animate);
var now = Date.now()/1000.0;
window.punctual.preRender({canDraw: true, nowTime: now});
window.punctual.render({canDraw: true, zone:0, nowTime: now});
window.punctual.postRender({canDraw: true, nowTime: now});
window.framesSinceFPSUpdate += 1;
}
function updateFPS() {
var now = Date.now()/1000.0;
var elapsed = now - window.timeOfLastFPSUpdate;
var fps = Math.round(window.framesSinceFPSUpdate/elapsed);
document.getElementById('fps').textContent = fps.toString() + " FPS";
setTimeout(updateFPS,1020);
}
window.doEval = function () {
var t = document.getElementById("editorArea").value;
window.punctual.define({zone:0,text:t,time: Date.now()/1000.0})
.then( r => {
document.getElementById('info').textContent = r.info;
document.getElementById('errors').textContent = "";
})
.catch( e => {
var eString = e.toString();
document.getElementById('errors').textContent = eString;
});
}
window.addEventListener('keydown', function (e) {
e = e || window.event;
if(e.shiftKey && e.key=="Enter") {
e.preventDefault();
window.doEval();
}
if(e.ctrlKey && e.shiftKey && e.key=="F") {
window.footer = !window.footer;
document.getElementById('status').hidden = !window.footer;
}
if(e.ctrlKey && e.shiftKey && (e.key=="Q" || e.key=="S")) {
window.info = !window.info;
document.getElementById('info').hidden = !window.info;
}

});
</script>

<div id="canvasDiv"><canvas id="canvas"></canvas></div>
<div class="editorAndStatus">
<div class="editor">
<textarea class="editorArea" id="editorArea">
-- Punctual, an audiovisual live coding language, version 0.5.1.1
-- Press Shift-Enter to (re)evaluate/activate code
-- documentation @ /~https://github.com/dktr0/Punctual.git
-- help/discussion @ Estuary discord server

x1 << osc $ 0.11*[1,2]; y1 << osc $ 0.08/[3,4];
x2 << osc $ 0.06/[5,6]; y2 << osc $ 0.04*[7,8];
ls << mono $ iline [x1,y1] [x2,y2] 0.002;
col << hsvrgb [osc 0.11,0.5 ~~ 1 $ osc 0.12, 1];
mask << prox 0 ** 8;
a << fit 1 $ ls * col * mask;
gate 0.1 (maxp a (fb * 0.98)) >> add <> 5
</textarea>
</div>
<pre class="info" id="info" hidden="true"></pre>
<div class="status" id="status">
<div class="errors" id="errors"></div>
<div class="fps" id="fps">-- FPS</div>
</div>
</div>
</body>

</html>
324 changes: 324 additions & 0 deletions archive/0.5.1.1/punctual.js

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions archive/0.5.1.1/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
body {
background-color: black;
}

.standalone {
}

.canvas {
position: absolute;
width: 100%;
height: 100%;
left: 0px;
top: 0px;
pointer-events: none;
z-index: 1;
}

.editorAndStatus {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
position: absolute;
left: 0px;
top: 0px;
overflow: hidden;
}

.editor {
flex-grow: 1;
flex-direction: column;
background-color: transparent;
width: 100%;
resize: none;
}

.info {
flex-grow: 1;
flex-direction: column;
background-colour: transparent;
width: 100%;
color: white;
font-family: Inconsolata,Consolas,monospace;
background-color: transparent;
border: none;
resize: none;
box-shadow: none;
outline: none;
font-size: 1em;
overflow: scroll;
}

.editorArea {
font-family: Inconsolata,Consolas,monospace;
background-color: transparent;
border: none;
width: 100%;
height: 100%;
color: white;
resize: none;
overflow: hidden;
box-shadow: none;
outline: none;
font-size: 1em;
}

.status {
font-family: Inconsolata,Consolas,monospace;
width: 100%;
color: white;
font-size: 1em;
}

.errors {
float: left;
}

.fps {
float: right;
}

0 comments on commit 422f0e6

Please sign in to comment.