Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grains
grains-web
Commits
259fce0f
Commit
259fce0f
authored
May 21, 2017
by
Jens-Christian Fischer
Browse files
Minor cleanups
parent
9a6f7058
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/grains/type.ex
View file @
259fce0f
defmodule
Grains
.
Type
do
@nr_types
1
@nr_types
4
def
select_type
(
uuid
)
do
{
i
,
_
}
=
Integer
.
parse
(
uuid
,
16
)
...
...
web/static/js/presencesketch.js
View file @
259fce0f
...
...
@@ -111,8 +111,8 @@ Boid.prototype.render = function() {
// Wraparound
Boid
.
prototype
.
borders
=
function
()
{
if
(
this
.
position
.
x
<
-
this
.
radius
)
this
.
position
.
x
=
PresenceSketch
.
width
+
this
.
radius
;
if
(
this
.
position
.
y
<
-
this
.
radius
)
this
.
position
.
y
=
PresenceSketch
.
height
+
this
.
radius
;
if
(
this
.
position
.
x
<
-
this
.
radius
)
this
.
position
.
x
=
PresenceSketch
.
width
+
this
.
radius
;
if
(
this
.
position
.
y
<
-
this
.
radius
)
this
.
position
.
y
=
PresenceSketch
.
height
+
this
.
radius
;
if
(
this
.
position
.
x
>
PresenceSketch
.
width
+
this
.
radius
)
this
.
position
.
x
=
-
this
.
radius
;
if
(
this
.
position
.
y
>
PresenceSketch
.
height
+
this
.
radius
)
this
.
position
.
y
=
-
this
.
radius
;
...
...
web/templates/grains/play.html.eex
View file @
259fce0f
...
...
@@ -5,7 +5,7 @@ P: <span id="pitch"></span><br/>
R:
<span
id=
"roll"
></span>
<div
id=
"svg-container"
>
<%=
if
assigns
[
:user_type
]
==
1
do
%>
<%=
if
assigns
[
:user_type
]
==
0
do
%>
<svg
xmlns=
"http://www.w3.org/2000/svg"
version=
"1.1"
x=
"0"
y=
"0"
...
...
@@ -32,7 +32,7 @@ R: <span id="roll"></span>
</svg>
<%
end
%>
<%=
if
assigns
[
:user_type
]
==
1
do
%>
<%=
if
assigns
[
:user_type
]
==
2
do
%>
<svg
xmlns=
"http://www.w3.org/2000/svg"
version=
"1.1"
x=
"10px"
y=
"0px"
viewBox=
"0 0 120 120"
...
...
@@ -46,7 +46,7 @@ R: <span id="roll"></span>
</svg>
<%
end
%>
<%=
if
assigns
[
:user_type
]
==
0
do
%>
<%=
if
assigns
[
:user_type
]
==
3
do
%>
<svg
xmlns=
"http://www.w3.org/2000/svg"
version=
"1.1"
x=
"0px"
y=
"0px"
viewBox=
"0 0 120 120"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment