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

add link to github somewhere? #1

Open
breck7 opened this issue Sep 23, 2022 · 5 comments
Open

add link to github somewhere? #1

breck7 opened this issue Sep 23, 2022 · 5 comments

Comments

@breck7
Copy link

breck7 commented Sep 23, 2022

No description provided.

@tteskac
Copy link

tteskac commented Sep 23, 2022

were you looking for this?

image

@breck7
Copy link
Author

breck7 commented Sep 23, 2022

No sorry I wasn't clear. I was on nightdrive but wanted to look at the source, and didn't see a "View Source" link, so had to go searching through GitHub for the repo.

@jes
Copy link
Owner

jes commented Sep 23, 2022

Can you think of a sensible way to do this that wouldn't ruin the aesthetic? Maybe a panel that pops up when the mouse is moved but disappears after a few seconds?

@breck7
Copy link
Author

breck7 commented Sep 23, 2022

You could copy/paste Moustetrap on there (https://github.com/ccampbell/mousetrap). 2kb. Then could add keyboard shortcuts without adding any visual elements.

You could add a "pause" (probably triggered via spacebar).

One simple way to refactor the code would be to do something like:

class NightDriveApp {
  initCommand() {
 // run the code in your   init(); method
this._bindToDom()

 }

_bindToDom() {
document.getElementById('canvas').onclick = function() {
    if (this.playing) document.getElementById('audio').pause();
    else document.getElementById('audio').play();
    this.playing = !this.playing;
}

// now add keyboard shortcuts

}

playing = false
}

new NightDriveApp().initCommand()

@gingerbeardman
Copy link

I came from the blog and to find the repo I had to edit a link to some lines of source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants