mumuki-puzzle-runner 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metadata_hook.rb +4 -3
- data/lib/public/js/muzzle-editor.js +1 -0
- data/lib/public/js/muzzle.js +19 -4
- data/lib/version_hook.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 441d4b26b7b8308cc9ed1ec7aca6de3c03905a6018af2db5d1d5e9889b72b55d
|
4
|
+
data.tar.gz: 5ccb1d263bc6e5c60f62d247006faa81d9a5647518939c0e9b2159092a3fdc45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d68ffd2617b06416d0e377a46c0bbb89f2728267d79866e31dc7afbaea88d9c22f1df2390ae0bac3a662c610ecc1f8234dec6bd9ca658d9714eea4412ef8e2fb
|
7
|
+
data.tar.gz: 5c83e99fc78f6f4043e65b5da66a1587a4398a3247d322985d5140976601d69feec3ebadcf9c1de0e86b1ce2208055414af1c87da08e97bf809ee256ff856877
|
data/lib/metadata_hook.rb
CHANGED
@@ -3,14 +3,15 @@ class PuzzleMetadataHook < Mumukit::Hook
|
|
3
3
|
{
|
4
4
|
language: {
|
5
5
|
name: 'muzzle',
|
6
|
-
version:
|
6
|
+
version: PuzzleVersionHook::VERSION,
|
7
7
|
extension: 'js',
|
8
8
|
ace_mode: 'javascript'
|
9
9
|
},
|
10
10
|
test_framework: {
|
11
11
|
name: 'muzzle',
|
12
|
-
version:
|
13
|
-
test_extension: 'js'
|
12
|
+
version: PuzzleVersionHook::VERSION,
|
13
|
+
test_extension: 'js',
|
14
|
+
template: "// see more examples at https://github.com/mumuki/mumuki-puzzle-runner\nMuzzle.basic(3, 2, 'https://flbulgarelli.github.io/headbreaker/static/berni.jpg');"
|
14
15
|
},
|
15
16
|
layout_assets_urls: {
|
16
17
|
js: [
|
data/lib/public/js/muzzle.js
CHANGED
@@ -64,14 +64,14 @@ class MuzzleCanvas {
|
|
64
64
|
*
|
65
65
|
* @type {number}
|
66
66
|
*/
|
67
|
-
this.canvasWidth =
|
67
|
+
this.canvasWidth = 600;
|
68
68
|
|
69
69
|
/**
|
70
70
|
* Height of canvas
|
71
71
|
*
|
72
72
|
* @type {number}
|
73
73
|
*/
|
74
|
-
this.canvasHeight =
|
74
|
+
this.canvasHeight = 600;
|
75
75
|
|
76
76
|
/**
|
77
77
|
* Size of fill. Set null for perfect-match
|
@@ -80,6 +80,13 @@ class MuzzleCanvas {
|
|
80
80
|
*/
|
81
81
|
this.borderFill = null;
|
82
82
|
|
83
|
+
/**
|
84
|
+
* Canvas line width
|
85
|
+
*
|
86
|
+
* @type {number}
|
87
|
+
*/
|
88
|
+
this.strokeWidth = 1.5;
|
89
|
+
|
83
90
|
/**
|
84
91
|
* Piece size
|
85
92
|
*
|
@@ -141,7 +148,7 @@ class MuzzleCanvas {
|
|
141
148
|
pieceSize: this.pieceSize,
|
142
149
|
proximity: this.pieceSize / 5,
|
143
150
|
borderFill: this.borderFill === null ? this.pieceSize / 10 : this.borderFill,
|
144
|
-
strokeWidth:
|
151
|
+
strokeWidth: this.strokeWidth,
|
145
152
|
lineSoftness: 0.18
|
146
153
|
};
|
147
154
|
}
|
@@ -470,7 +477,15 @@ const Muzzle = new class extends MuzzleCanvas {
|
|
470
477
|
super();
|
471
478
|
this.aux = {};
|
472
479
|
}
|
473
|
-
|
480
|
+
|
481
|
+
/**
|
482
|
+
* Creates a suplementary canvas at the element
|
483
|
+
* of the given id
|
484
|
+
*
|
485
|
+
* @param {string} id
|
486
|
+
* @returns {MuzzleCanvas}
|
487
|
+
*/
|
488
|
+
another(id) {
|
474
489
|
const muzzle = new MuzzleCanvas(id);
|
475
490
|
Muzzle.aux[id] = muzzle
|
476
491
|
return muzzle;
|
data/lib/version_hook.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-puzzle-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|