Deploying to gh-pages from @ ce6ea17c57 🚀

This commit is contained in:
Lemmih 2020-08-21 01:53:12 +00:00
commit dfdfc87c23
13 changed files with 7239 additions and 0 deletions

1
playground/bulma.min.css vendored Normal file

File diff suppressed because one or more lines are too long

6877
playground/elm.js Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" viewBox="0 0 24 24" fill="white" width="48px" height="48px"><g><rect fill="none" height="24" width="24"/></g><g><g><path d="M18,13c0,3.31-2.69,6-6,6s-6-2.69-6-6s2.69-6,6-6v4l5-5l-5-5v4c-4.42,0-8,3.58-8,8c0,4.42,3.58,8,8,8s8-3.58,8-8H18z"/><polygon points="10.86,15.94 10.86,11.67 10.77,11.67 9,12.3 9,12.99 10.01,12.68 10.01,15.94"/><path d="M12.25,13.44v0.74c0,1.9,1.31,1.82,1.44,1.82c0.14,0,1.44,0.09,1.44-1.82v-0.74c0-1.9-1.31-1.82-1.44-1.82 C13.55,11.62,12.25,11.53,12.25,13.44z M14.29,13.32v0.97c0,0.77-0.21,1.03-0.59,1.03c-0.38,0-0.6-0.26-0.6-1.03v-0.97 c0-0.75,0.22-1.01,0.59-1.01C14.07,12.3,14.29,12.57,14.29,13.32z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 714 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="48px" height="48px"><path d="M0 0h24v24H0z" fill="none"/><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"/></svg>

After

Width:  |  Height:  |  Size: 398 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="48px" height="48px"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>

After

Width:  |  Height:  |  Size: 190 B

155
playground/index.html Normal file
View file

@ -0,0 +1,155 @@
<html>
<head>
<title>Reanimate - viewer</title>
<script src="https://unpkg.com/split-grid/dist/split-grid.js"></script>
<script type="text/javascript" src="elm.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.56.0/codemirror.min.js"
integrity="sha512-H5RyE1jRbGn8d0dsSstZi0SSs23X6Hkkf5hLneEIFyCfP/cBwJ/jFJESBuFBiUyzbGZGa06tnrvw1SboRKdwcA=="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.56.0/mode/haskell/haskell.min.js"
integrity="sha512-oOdg3fdacCLYkvreThQx4i+lslUn27SGRFyjQOyE5M+KaM3vPJNyLDjU82LEkMup6PTWPrpFt7zkiBBGSZLEbg=="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"
integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg=="
crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.56.0/codemirror.min.css"
integrity="sha512-/BlxZbYLtYGExexketXsTi47eHp+r2kTeq2OHecQPZlfbc7WFXVrwbVW9HOYjI6c9Ti+P60ASmVLxittZ0EBGw=="
crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css">
<link rel="stylesheet" href="style.css">
<script src="playground.js"></script>
</head>
<body>
<!-- <a href="https://github.com/reanimate/reanimate" class="github-corner" aria-label="View source on GitHub"><svg
width="80" height="80" viewBox="0 0 250 250"
style="fill:#64CEAA; color:#fff; position: fixed; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill="currentColor" class="octo-body"></path>
</svg>
</a> -->
<div class="grid">
<div class="edit-box">
<select class="column-header">
<option>Example 1</option>
<option>Example 2</option>
</select>
<div id="editor"></div>
</div>
<div class="gutter-column-1"></div>
<div class="edit-box">
<div class="media-buttons column-header">
<div style="display: flex;flex-flow:row;justify-content: space-between;">
<a href="https://reanimate.github.io/"><img src="home-white-48dp.svg"></a>
<div>
<img id="seek-10" src="replay_10-white-48dp.svg">
<img id="seek-1" src="skip_previous-white-48dp.svg">
<img id="play" src="play_circle_outline-white-48dp.svg">
<img id="pause" src="pause_circle_outline-white-48dp.svg">
<img id="seek1" src="skip_next-white-48dp.svg">
<img id="seek10" src="forward_10-white-48dp.svg">
</div>
<img id="help" src="help_outline-white-48dp.svg">
</div>
</div>
<div id="elm"></div>
</div>
</div>
<div id="help-modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Reanimate Playground</p>
<button class="delete" aria-label="close"></button>
</header>
<section class="modal-card-body">
<ul>
<li>List</li>
</ul>
</section>
<!-- <footer class="modal-card-foot">
</footer> -->
</div>
<button class="modal-close is-large" area-label="close"></button>
</div>
<script type="text/javascript">
var app = playgroundInit('elm');
var myCodeMirror = CodeMirror(document.querySelector('#editor'), {
lineNumbers: true,
value: "animation :: Animation\nanimation = docEnv $\n drawBox\n",
mode: "haskell",
lineWrapping: true
});
myCodeMirror.on('change', function () {
document.querySelector('.media-buttons').classList.remove('paused');
app.ports.receiveControlMsg.send('play');
app.ports.receiveEditorMsg.send(myCodeMirror.getValue());
});
document.getElementById('play').onclick = function() {
document.querySelector('.media-buttons').classList.toggle('paused');
app.ports.receiveControlMsg.send('play');
};
document.getElementById('pause').onclick = function() {
document.querySelector('.media-buttons').classList.toggle('paused');
app.ports.receiveControlMsg.send('pause');
};
document.getElementById('seek1').onclick = function() {
document.querySelector('.media-buttons').classList.add('paused');
app.ports.receiveControlMsg.send('pause');
app.ports.receiveControlMsg.send('seek1');
};
document.getElementById('seek10').onclick = function() {
document.querySelector('.media-buttons').classList.add('paused');
app.ports.receiveControlMsg.send('pause');
app.ports.receiveControlMsg.send('seek10');
};
document.getElementById('seek-1').onclick = function() {
document.querySelector('.media-buttons').classList.add('paused');
app.ports.receiveControlMsg.send('pause');
app.ports.receiveControlMsg.send('seek-1');
};
document.getElementById('seek-10').onclick = function() {
document.querySelector('.media-buttons').classList.add('paused');
app.ports.receiveControlMsg.send('pause');
app.ports.receiveControlMsg.send('seek-10');
};
document.getElementById('help').onclick = function() {
document.querySelector('#help-modal').classList.add('is-active');
};
document.querySelector('#help-modal .modal-background').onclick = function() {
document.querySelector('#help-modal').classList.remove('is-active');
};
document.querySelector('#help-modal .modal-close').onclick = function() {
document.querySelector('#help-modal').classList.remove('is-active');
};
document.querySelector('#help-modal .delete').onclick = function() {
document.querySelector('#help-modal').classList.remove('is-active');
};
</script>
<script>
Split({ // gutters specified in options
columnGutters: [{
track: 1,
element: document.querySelector('.gutter-column-1'),
}]
});
</script>
</body>
</html>

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="48px" height="48px"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16h2V8H9v8zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm1-4h2V8h-2v8z"/></svg>

After

Width:  |  Height:  |  Size: 307 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="48px" height="48px"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>

After

Width:  |  Height:  |  Size: 302 B

44
playground/playground.js Normal file
View file

@ -0,0 +1,44 @@
function playgroundInit(elt) {
var mySockets = {};
function sendSocketCommand(wat) {
if (wat.cmd == "connect") {
socket = new WebSocket(wat.address);
socket.onopen = function (event) {
app.ports.receiveSocketMsg.send({
name: wat.name,
msg: "data",
data: "connection established"
});
}
socket.onmessage = function (event) {
app.ports.receiveSocketMsg.send({
name: wat.name,
msg: "data",
data: event.data
});
}
connectionFailedHandler = function (event) {
app.ports.receiveSocketMsg.send({
name: wat.name,
msg: "data",
data: "connection failed"
});
}
socket.onerror = connectionFailedHandler;
socket.onclose = connectionFailedHandler;
mySockets[wat.name] = socket;
} else if (wat.cmd == "send") {
mySockets[wat.name].send(wat.content);
} else if (wat.cmd == "close") {
mySockets[wat.name].close();
delete mySockets[wat.name];
}
}
var app = Elm.Main.init({
node: document.getElementById(elt)
});
app.ports.sendSocketCommand.subscribe(sendSocketCommand);
return app;
}

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" viewBox="0 0 24 24" fill="white" width="48px" height="48px"><g><rect fill="none" height="24" width="24"/></g><g><g><path d="M11.99,5V1l-5,5l5,5V7c3.31,0,6,2.69,6,6s-2.69,6-6,6s-6-2.69-6-6h-2c0,4.42,3.58,8,8,8s8-3.58,8-8S16.41,5,11.99,5z"/><g><path d="M10.89,16h-0.85v-3.26l-1.01,0.31v-0.69l1.77-0.63h0.09V16z"/><path d="M15.17,14.24c0,0.32-0.03,0.6-0.1,0.82s-0.17,0.42-0.29,0.57s-0.28,0.26-0.45,0.33s-0.37,0.1-0.59,0.1 s-0.41-0.03-0.59-0.1s-0.33-0.18-0.46-0.33s-0.23-0.34-0.3-0.57s-0.11-0.5-0.11-0.82V13.5c0-0.32,0.03-0.6,0.1-0.82 s0.17-0.42,0.29-0.57s0.28-0.26,0.45-0.33s0.37-0.1,0.59-0.1s0.41,0.03,0.59,0.1c0.18,0.07,0.33,0.18,0.46,0.33 s0.23,0.34,0.3,0.57s0.11,0.5,0.11,0.82V14.24z M14.32,13.38c0-0.19-0.01-0.35-0.04-0.48s-0.07-0.23-0.12-0.31 s-0.11-0.14-0.19-0.17s-0.16-0.05-0.25-0.05s-0.18,0.02-0.25,0.05s-0.14,0.09-0.19,0.17s-0.09,0.18-0.12,0.31 s-0.04,0.29-0.04,0.48v0.97c0,0.19,0.01,0.35,0.04,0.48s0.07,0.24,0.12,0.32s0.11,0.14,0.19,0.17s0.16,0.05,0.25,0.05 s0.18-0.02,0.25-0.05s0.14-0.09,0.19-0.17s0.09-0.19,0.11-0.32s0.04-0.29,0.04-0.48V13.38z"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="48px" height="48px"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"/></svg>

After

Width:  |  Height:  |  Size: 190 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="48px" height="48px"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/></svg>

After

Width:  |  Height:  |  Size: 182 B

154
playground/style.css Normal file
View file

@ -0,0 +1,154 @@
body {
padding: 0;
margin: 0;
}
.app {
height: 100vh;
background-color: #282c34;
color: white;
font-family: monospace;
overflow: hidden;
}
.media-buttons {
background-color: #282c34;
}
.viewer {
position: static;
}
.viewer img {
max-width: 100vw;
max-height: 100vh;
margin-top: auto;
margin-bottom: auto;
}
pre {
white-space: pre-wrap;
}
.bar {
display: none;
/* position: absolute; */
/* top: 0; */
margin-top: 0;
width: 100%;
/* background: rgba(0,0,0,0.5); */
}
.bar progress {
background-color: #eee;
border: 1px solid white;
}
.media-controls {
display: none;
}
.help-button {
position: absolute;
right: 0;
top: 0;
}
.help-dialog {
position: absolute;
top: 0;
right: 0;
color: white;
background-color: #555;
padding: 30px;
}
.help-dialog table {
color: white;
}
#play-or-pause {
text-align: center;
width: 60px;
}
.gutter-column-1 {
cursor: ew-resize;
background: lightgrey;
}
.gutter.gutter-horizontal {
cursor: ew-resize;
}
.grid {
grid-template-columns: 1fr 10px 2fr;
display: grid;
}
.grid textarea {
width: 100%;
height: 100%;
resize: none;
}
.CodeMirror {
border: 0px solid #eee;
height: auto;
}
.select2 {
}
.select2-selection--single {
border: 0 !important;
border-bottom: 1px solid #aaa !important;
border-radius: 0 !important;
}
.edit-box {
display: flex;
flex-flow: column;
height: 100vh;
}
.edit-box .column-header {
flex: 0 1 auto;
}
.edit-box #editor {
flex: 1 1 auto;
}
.edit-box .app {
flex: 1 1 auto;
}
.media-buttons.paused #pause {
display: none;
}
.media-buttons:not(.paused) #play {
display: none;
}
.media-buttons img:hover {
cursor: pointer;
}
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
@keyframes octocat-wave {
0%,
100% {
transform: rotate(0)
}
20%,
60% {
transform: rotate(-25deg)
}
40%,
80% {
transform: rotate(10deg)
}
}
@media (max-width:500px) {
.github-corner:hover .octo-arm {
animation: none
}
.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
}