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

added 'h' to toggle info panel and added text description. #7

Open
wants to merge 1 commit 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
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ <h1>Screen Tunes</h1>
<p>
<strong>Edit:</strong> I kinda managed to get this to play music but it doesn't work very well. If you're ambitious you can download and try out the "music" branch on Github.
</p>
<p>
Press 'h' to toggle this info,<br>
press 'F11' to toggle fullscreen.
</p>
</div>
<canvas id="main" width="200" height="200"></canvas>
<script>
Expand Down
12 changes: 12 additions & 0 deletions screentunes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
var start = null;
var t = null;

$(document).keydown(function(keyEvent) {
if(keyEvent.keyCode == 72){
var x = document.getElementById("info");
if (x.style.display === "none") {
x.style.display = "block";
}
else {
x.style.display = "none";
}
}
});

var AnimationFrame = (function() {
var FPS = 16.6666666667; // 1000 / 60 = Frames Per Second
var RAF = window.requestAnimationFrame
Expand Down