Skip to content

Commit

Permalink
[gui] small fixes, mousemode fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kaliumxyz committed Sep 23, 2017
1 parent 8556f45 commit 455baa1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
6 changes: 5 additions & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ h1 {
padding: 10px;
width: 540px;
user-select: none;
z-index: -1; }
z-index: -1;
line-height: 0.8em; }
.terminal .line {
margin: 0;
padding: 0; }

.terminal-main {
background: black;
Expand Down
4 changes: 4 additions & 0 deletions assets/sass/style.sass
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ h1
width: 540px
user-select: none
z-index: -1
line-height: 0.8em
.line
margin: 0
padding: 0

.terminal-main
background: black
Expand Down
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ <h1>press space or tap the screen</h1>
<div class='terminal'>
<div class='terminal-ghost'></div>
<div class='options terminal-main'>
bounds? <span class='option option-bounds active'>y</span>/<span class='option option-bounds'>n</span>
gravity? <span class='option active'>[wiggly]</span>/<span class='option'>[wigglyInverse]</span>/<span class='option'>[regular]</span>
collisions? <span class='option option-collisions'>[boring]</span>/<span class='option option-collisions active'>[care]</span>
type? <span class='option option-type'>[round]</span>/<span class='option active option-type'>[square]</span>
<p class='line'>bounds? <span class='option option-bounds active'>y</span>/<span class='option option-bounds'>n</span></p>
<p class='line'>gravity? <span class='option active'>[wiggly]</span>/<span class='option'>[wigglyInverse]</span>/<span class='option'>[regular]</span></p>
<p class='line'>collisions? <span class='option option-collisions'>[boring]</span>/<span class='option option-collisions active'>[care]</span></p>
<p class='line'>type? <span class='option option-type'>[round]</span>/<span class='option active option-type'>[square]</span></p>

</div>
</div>
</div>
</div>
</div>

<canvas width='1000' height='1000'>If you can read this, your browser does not support HTML5 canvas.</canvas>
</body>
Expand Down
14 changes: 8 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ const mouse = {

function mouseNext() {
let flag
for (let mode in mouse.modus) {
if (flag)
return mouse.action = mouse.modus[mode]
flag = mouse.modus[mode] === window.onclick
}
for (let mode in mouse.modus) {
if (flag)
return mouse.action = mouse.modus[mode]
flag = mouse.modus[mode] === mouse.action
}
return mouse.action = mouse.modus.emit
}

Expand All @@ -149,13 +149,15 @@ window.onmousemove = ev => mouse.clone = ev

window.onclick = ev => mouse.clone = ev

window.onscroll = onScroll

/* Anything related to touch events.
************************************/

// Touchscreen handles very different from a mouse, make seperate actions!
const touch = {}

window.ontouchstart = window.onmousedown
// window.ontouchstart = window.onmousedown

window.ontouchend = window.onmouseup

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"nodemon": "^1.11.0"
},
"scripts": {
"watch-css": "node-sass -w -r ./app/assets/sass -o ./app/assets/css",
"watch-css": "node-sass -w -r ./assets/sass -o ./assets/css",
"test": "ava",
"start": "electron ."
}
Expand Down

0 comments on commit 455baa1

Please sign in to comment.