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

Update keymaps.js ( Added shortcuts to clear graphics and to toggle log ) #79

Open
wants to merge 3 commits into
base: main
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
13 changes: 13 additions & 0 deletions hydra-server/app/keymaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ module.exports = {
e.preventDefault()
screencap()
}

// shift - ctrl - k: clear graphics
if (e.keyCode === 75) {
e.preventDefault()
hush()
}

// shift - ctrl - l: toggle log
if (e.keyCode === 76) {
e.preventDefault()
log.toggle()
}

} else {
// ctrl-enter: evalLine
if ( e.keyCode === 13) {
Expand Down
34,282 changes: 620 additions & 33,662 deletions hydra-server/public/bundle.js
100644 → 100755

Large diffs are not rendered by default.

Empty file modified hydra-server/public/css/fontawesome.css
100644 → 100755
Empty file.
Empty file modified hydra-server/public/css/modal.css
100644 → 100755
Empty file.
114 changes: 114 additions & 0 deletions hydra-server/public/css/rangel-code.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*

Name: Tomorrow Night - Eighties
Author: Chris Kempson

CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)

*/

/*.cm-s-tomorrow-night-eighties.CodeMirror { background: #000000; color: #CCCCCC; }*/

/*OJ*/
.cm-s-tomorrow-night-eighties.CodeMirror {
background: rgba(0, 0, 0, 0);
transition: background-color 0.3s ease;
color: #cccccc;
font-size: 18px;
height: 100%;
}
.cm-s-tomorrow-night-eighties span span.CodeMirror-selectedtext {
background: #666666;
}
.cm-s-tomorrow-night-eighties .CodeMirror-line::selection,
.cm-s-tomorrow-night-eighties .CodeMirror-line > span::selection,
.cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::selection {
background: rgba(45, 45, 45, 0.99);
}
.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection,
.cm-s-tomorrow-night-eighties .CodeMirror-line > span::-moz-selection,
.cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::-moz-selection {
background: rgba(45, 45, 45, 0.99);
}
.cm-s-tomorrow-night-eighties .CodeMirror-gutters {
background: #000000;
border-right: 0px;
}
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker {
color: #f2777a;
}
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle {
color: #777;
}
.cm-s-tomorrow-night-eighties .CodeMirror-linenumber {
color: #515151;
}
.cm-s-tomorrow-night-eighties .CodeMirror-cursor {
border-left: 3px solid #ffffff;
}

/* OJ*/
.cm-s-tomorrow-night-eighties .CodeMirror-line span {
background-color: rgba(0, 0, 0, 0.7);
transition: background-color 0.3s ease;
color: #cccccc;
}
/* fix weird alternating background colors */
.cm-s-tomorrow-night-eighties .CodeMirror-line span span {
background-color: rgba(0, 0, 0, 0);
transition: background-color 0.3s ease;
}

.cm-s-tomorrow-night-eighties span.cm-comment {
color: #ee8d25;
}
.cm-s-tomorrow-night-eighties span.cm-atom {
color: #ed37c2;
}
.cm-s-tomorrow-night-eighties span.cm-number {
color: #e42cb9;
}

.cm-s-tomorrow-night-eighties span.cm-property,
.cm-s-tomorrow-night-eighties span.cm-attribute {
color: #2deb2d;
}
.cm-s-tomorrow-night-eighties span.cm-keyword {
color: #f2777a;
}
.cm-s-tomorrow-night-eighties span.cm-string {
color: #e9fa29;
}

.cm-s-tomorrow-night-eighties span.cm-variable {
color: #2deb2d;
}
.cm-s-tomorrow-night-eighties span.cm-variable-2 {
color: #6699cc;
}
.cm-s-tomorrow-night-eighties span.cm-def {
color: #31ffe0;
}
.cm-s-tomorrow-night-eighties span.cm-bracket {
color: #cccccc;
}
.cm-s-tomorrow-night-eighties span.cm-tag {
color: #31ffe0;
}
.cm-s-tomorrow-night-eighties span.cm-link {
color: #a16a94;
}
.cm-s-tomorrow-night-eighties span.cm-error {
background: #f2777a;
color: #6a6a6a;
}

.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {
background: #343600;
}
/*.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background { background: #0f0; }*/
.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
41 changes: 39 additions & 2 deletions hydra-server/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,45 @@
<html>
<head>
<meta charset="UTF-8">
<title>&lt; hydra &gt;</title>
<title>&lt; hydra editor mod&gt;</title>
<script src="./bundle.js"></script>

<!-- lissajous import -->

<script src="./lissajous/src/vendor/bufferLoader.js"></script>

<script src="./lissajous/src/context.js"></script>
<script src="./lissajous/src/track.core.js"></script>
<script src="./lissajous/src/track.events.js"></script>
<script src="./lissajous/src/track.api.js"></script>
<script src="./lissajous/src/track.oscillator.js"></script>
<script src="./lissajous/src/track.sampler.js"></script>
<script src="./lissajous/src/track.envelope.js"></script>
<script src="./lissajous/src/track.scheduler.js"></script>
<script src="./lissajous/src/track.sequencer.js"></script>
<script src="./lissajous/src/track.filter.js"></script>
<script src="./lissajous/src/track.record.js"></script>

<script src="./lissajous/src/track.effects.delay.js"></script>
<script src="./lissajous/src/track.effects.chorus.js"></script>
<script src="./lissajous/src/track.effects.tremolo.js"></script>
<script src="./lissajous/src/track.effects.filter.js"></script>
<script src="./lissajous/src/track.effects.reverb.js"></script>
<script src="./lissajous/src/track.effects.distortion.js"></script>

<script src="./lissajous/src/group.js"></script>
<script src="./lissajous/src/generators.js"></script>

<script src="./lissajous/src/vendor/tuna.js"></script>

<script src="./lissajous/src/vendor/recorder.js"></script>

<script src="./lissajous/extras.js"></script>
<script src="./lissajous/drag-and-drop.js"></script>

<!-- end lissajous import -->


<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:title" content="HYDRA">
Expand All @@ -17,7 +54,7 @@
<link href="https://fonts.googleapis.com/css?family=Chivo:300,400,700" rel="stylesheet">
<link rel="stylesheet" href="./css/fontawesome.css">
<link rel="stylesheet" href="./css/codemirror.css">
<link rel="stylesheet" href="./css/tomorrow-night-eighties.css">
<link rel="stylesheet" href="./css/rangel-code.css">
<link rel="stylesheet" href="./css/show-hint.css">
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/modal.css">
Expand Down
Binary file not shown.
98 changes: 98 additions & 0 deletions hydra-server/public/lissajous/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
@font-face {
font-family: 'FiraMono';
src: url('firamono-regular-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

*
{
box-sizing: border-box;
}

body
{
font-family: 'FiraMono', Menlo, 'Courier New', monospace;
font-size: 18px;
line-height: 1.5em;
background-color: #ebebe5;
margin: 0;
padding: 0;
}

a
{
color: #4e8996;
text-decoration: none;
}

a:hover
{
color: #335a62;
text-decoration: underline;
}

p
{
text-align: center;
color: #616161;
}

.bar
{
width: 100%;
height: 3px;
background-color: #336777;
}

.logo
{
width: 730px;
height: 130px;
margin: 0 auto;
background-image: url('../images/lissajous-logo.png');
background-size: 730px 130px;
}

.give-me-some-space
{
margin-top: 150px;
}

/**/

.drag-and-drop
{
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;

opacity: 0;
transform: translateY(-100%);
-webkit-transform: translateY(-100%);

transition: transform 0s 0.2s, opacity 0.2s;
-webkit-transition: -webkit-transform 0s 0.2s, opacity 0.2s;

background-color: #D9D8D4;
text-align: center;
}

.drag-and-drop .drag-and-drop-inner
{
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;

display: inline-block;
margin: auto;
height: 40px;
}

.drag-and-drop.show
{
opacity: 1;
transform: translateY(0);
-webkit-transform: translateY(0);

transition: transform 0s, opacity 0.2s;
-webkit-transition: -webkit-transform 0s, opacity 0.2s;
}
73 changes: 73 additions & 0 deletions hydra-server/public/lissajous/drag-and-drop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
(function(){
// inspired by/borrowed from http://jsfiddle.net/gaJyT/18/ -- thanks!

var dragAndDrop = document.querySelector('.drag-and-drop');
var dragging = false;

function dragOver(e) {
e.stopPropagation();
e.preventDefault();
if(!dragging) {
//dragAndDrop.className += ' show'; //Rangel
dragging = true;
}
return false;
}

function dragEnd(e) {
e.stopPropagation();
e.preventDefault();
//dragAndDrop.className = dragAndDrop.className.replace(' show', ''); //Rangel
dragging = false;
return false;
}

function dropEvent(e) {
e.stopPropagation();
e.preventDefault();
//dragAndDrop.className = dragAndDrop.className.replace(' show', ''); //Rangel
dragging = false;

var droppedFiles = e.dataTransfer.files;
var readers = [];
var filenames = [];

droppedFiles = Array.prototype.slice.call(droppedFiles);
droppedFiles.forEach(function(item, i){

readers.push( new FileReader() );
filenames.push( droppedFiles[i].name.replace('.wav', '') );

readers[i].onload = function(fileEvent) {
var data = fileEvent.target.result;
context.decodeAudioData(data, function(buffer) {

if(
window[filenames[i]] !== undefined ||
filenames[i] === 'undefined' ||
filenames[i].match(/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|null|this|true|void|with|break|catch|class|const|false|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/)
) {
filenames[i] = 'sampleupload_' + (filenames[i] || (new Date()).getTime());
}

window[filenames[i]] = buffer;

if(filenames[i].match(/\/|\-|\~|\%|\,|\.|\;|\:|\!|\@|\#|\^|\&|\*|\(|\)|\\|\ /)) {
console.log('The AudioBuffer `window["' + filenames[i] + '"]` is ready for you to use.');
} else {
console.log('The AudioBuffer `' + filenames[i] + '` is ready for you to use.');
}

}, function(e) {
console.log('There was an error decoding your file (make sure it\'s a .wav file!)');
console.log(e);
});
}
readers[i].readAsArrayBuffer(droppedFiles[i]);
});
}

window.addEventListener('dragover', dragOver, false);
window.addEventListener('dragend', dragEnd, false);
window.addEventListener('drop', dropEvent, false);
})();
Loading