Compare commits
367 Commits
Author | SHA1 | Date | |
---|---|---|---|
f61682bb8d | |||
a9e04a4abd | |||
0021de35b4 | |||
1e693e4e36 | |||
a3a75b6096 | |||
2448e65ffa | |||
814db90e54 | |||
3585c2debd | |||
8b983414a6 | |||
4d53f5e3b7 | |||
9811a3a604 | |||
28912fc58f | |||
7554b3355c | |||
f7592f864b | |||
66fa71affd | |||
a0c9f2923e | |||
c9529dc65c | |||
a8f727fdcd | |||
48d1214a6d | |||
b859857b2d | |||
669d7a21cb | |||
a286d5926a | |||
92cc986fb6 | |||
da1f26291c | |||
a92e198519 | |||
91ffce0bfe | |||
acb6fd2172 | |||
055bcdb001 | |||
fe9875841a | |||
e5be581e19 | |||
6620f7e5a9 | |||
758cc6202a | |||
d96c1a9c06 | |||
551e15e67b | |||
d576c56068 | |||
fddec5c95c | |||
1abd6113a3 | |||
ef05cc4fd1 | |||
87341b049e | |||
9f31b2c7e4 | |||
3f992cbb4a | |||
0bdcf38d2f | |||
d254a9b72e | |||
d8d7f1adea | |||
d6a85aaf6f | |||
1bc85bfbca | |||
90c2ed3470 | |||
5a469202e9 | |||
8faa6db4c0 | |||
8d618fc31c | |||
e9c99a241f | |||
3209c50304 | |||
5d38804523 | |||
d17f235aee | |||
a0350ff2e8 | |||
d6351fccb3 | |||
a58b643a26 | |||
5367c75972 | |||
7d964c7fde | |||
d0acb625cf | |||
e6950e5c1a | |||
63449b2694 | |||
ed32ddc747 | |||
cbb97c60d0 | |||
ece3105893 | |||
069bfb9a90 | |||
96ab2dd781 | |||
1fe327495c | |||
089b4ea14d | |||
3853a78019 | |||
ee0a4c16aa | |||
84e26b28da | |||
cffb68c88c | |||
489298e87a | |||
dffe23746c | |||
8c629bd842 | |||
251ceae318 | |||
c7a80ebdec | |||
2280740421 | |||
c6287653f9 | |||
bd8eaa4307 | |||
c0fda032e5 | |||
744709b15b | |||
6a2f7fb58d | |||
479df8ced7 | |||
72edf47734 | |||
6b6674a04d | |||
754bc9b830 | |||
ff98670055 | |||
4e1f6bee3f | |||
6a4d3cb106 | |||
7048e1fd42 | |||
cd36c07a45 | |||
9f0aaceb5f | |||
99da69553c | |||
fdb5483e87 | |||
1208324d4d | |||
5437ad8651 | |||
c074217047 | |||
e0c9a46ed3 | |||
d962217f90 | |||
9800d85cb7 | |||
011b07c735 | |||
2fdc85556b | |||
7a8efc56b0 | |||
0d81865f3b | |||
12cfe16cb4 | |||
e773f9ae6d | |||
5c46cfe20a | |||
2d9001db6e | |||
8ff15fd0e1 | |||
8e4ea8437f | |||
48f24c0cf3 | |||
8d85093874 | |||
1beeb8d6e4 | |||
f9b07b29a9 | |||
9bc330e5e8 | |||
a51e20b370 | |||
ef6ef6256e | |||
4edbc29e72 | |||
b72c775a04 | |||
0c9f04bc71 | |||
034057dcd2 | |||
016316518d | |||
ac9ccd04e2 | |||
ce8d71f47e | |||
29cd0d80f3 | |||
d3f5a41c0d | |||
3f181c6248 | |||
8ae14281cc | |||
9de77c9f21 | |||
d31865a9ef | |||
cf62f2ac0b | |||
16362e1b13 | |||
aa79919496 | |||
6df145455e | |||
daceb326c5 | |||
5fbadc0d80 | |||
473bd4705c | |||
c570d8fd75 | |||
7909d4d94b | |||
138d5d02d2 | |||
0683583da1 | |||
1decd64a30 | |||
9e1cfef924 | |||
e384f7d2e2 | |||
be3d2cf20d | |||
54ae52e117 | |||
b480acc6a0 | |||
007e4d4e11 | |||
6070ebead5 | |||
5b081c8859 | |||
29e205d441 | |||
1f5272415c | |||
d1b12a07ac | |||
f2f8158efb | |||
77877c118f | |||
e0c16486d3 | |||
ba491736c1 | |||
0e817a88a7 | |||
5d4b8b87a3 | |||
94c29c2ff5 | |||
e260b36585 | |||
3d42ab25b2 | |||
0a6250141a | |||
3d58bcae6c | |||
281103c46e | |||
e6ed0c28a3 | |||
522006f67a | |||
e11355193b | |||
30cdb6d335 | |||
c40e27bc17 | |||
3d6cd3e576 | |||
4b7b18ca6f | |||
9e6e39e3d8 | |||
c600d62bd2 | |||
f114676db7 | |||
0ec3787fc4 | |||
40cced7be0 | |||
81a9e7a678 | |||
6328fe760f | |||
932974d744 | |||
eb4941417c | |||
93deb1c2c5 | |||
c9b581f6db | |||
6a6f75b3ce | |||
04a1633a90 | |||
b168e8ca76 | |||
fa6f2e5db6 | |||
1c66282b01 | |||
5cbb9b8664 | |||
6254490a23 | |||
43e60e300c | |||
fe95abca0f | |||
bcecd3058b | |||
68a807ccb5 | |||
7a355b39a0 | |||
0f1489727c | |||
bab3d6677e | |||
bcb709300c | |||
4f2f01ea36 | |||
8592cd2e53 | |||
b4c1a4c714 | |||
294af67099 | |||
3585a6f96e | |||
0914e2816e | |||
0b41c0f648 | |||
beb2fa6ba9 | |||
61fb6c5e6f | |||
d310a77893 | |||
84f366e7e4 | |||
561d016a45 | |||
334d6ad21f | |||
0382b3858b | |||
2aa87b5fac | |||
d7fef0f88b | |||
c7131678f8 | |||
5224c9ddd8 | |||
3265a96fe6 | |||
5831447f75 | |||
043f077408 | |||
25bb46d097 | |||
5cb1d0cd03 | |||
123ea31191 | |||
1df5d0da38 | |||
50f159c982 | |||
df5aef363b | |||
0642e17aa8 | |||
1402394d07 | |||
e1ba57c92f | |||
2db04fe7d6 | |||
dc61be27f0 | |||
7fd49aaccb | |||
cffaec09b2 | |||
62a7755407 | |||
2ab1e29365 | |||
fe110a3d8e | |||
5afec16258 | |||
fad483ce7a | |||
b10e87d2b7 | |||
61ee1d9b32 | |||
ce1a5c4918 | |||
796cd4466e | |||
0f49c884f2 | |||
c8dae1cb79 | |||
54837d0e21 | |||
001e35cf7b | |||
ac5083633b | |||
c32af500dc | |||
dc4de32162 | |||
243990a90f | |||
96ef362cf8 | |||
e1e029a849 | |||
fe5e8966a5 | |||
37aa6c3d72 | |||
d805e13d57 | |||
a7ef57b6ee | |||
ac08775406 | |||
6583d3d560 | |||
b5465ca066 | |||
258d13371d | |||
e3e6730b45 | |||
6ef99bba15 | |||
afe790e5e3 | |||
8989e984cb | |||
00dd660571 | |||
8a29b78af8 | |||
9ef46d5ec5 | |||
6445b44d02 | |||
9afe69cb87 | |||
508fb79c32 | |||
8ebdc4cd41 | |||
fab9c6e836 | |||
f7f9587520 | |||
12dcacea5a | |||
9325abb924 | |||
4ed7338f25 | |||
90845b3a62 | |||
125e332b7c | |||
e457209c8f | |||
8643f4402a | |||
92d7109ef7 | |||
6b32239fa1 | |||
8441f28ac1 | |||
e8db80a0ec | |||
7d9f8a8ccf | |||
073f46b0d7 | |||
32e528525c | |||
913ef272cf | |||
1a8f10c63d | |||
b2ab504422 | |||
35d4be5d3e | |||
efccfdc0c6 | |||
895a15524d | |||
006d72a195 | |||
13001bd7bd | |||
caebce5ec8 | |||
978319af20 | |||
a8788c83f1 | |||
56b1f421bc | |||
1955d3f8f5 | |||
17824ae1c4 | |||
34dbcedec3 | |||
e711050f75 | |||
844437dfc9 | |||
715c148908 | |||
b0ec276aac | |||
8d8c40e6a6 | |||
6d6e80c762 | |||
05e8f9adac | |||
1b99a22c1d | |||
280dd1a809 | |||
c1900a07f0 | |||
a43b20e182 | |||
b556143b66 | |||
19c99d1aa7 | |||
dc78c3cecd | |||
829bcb8ad1 | |||
56f008bda6 | |||
5350255eee | |||
d4884a2de5 | |||
581bd46dcd | |||
1e8315f32c | |||
cc8460cc26 | |||
aa375315a2 | |||
e5cb0717e2 | |||
6af04bb599 | |||
dfc3bfd181 | |||
ad3dd935e0 | |||
18ff6f88a7 | |||
b2fbe269d3 | |||
a8ce829e6c | |||
2fabf68282 | |||
b66d5ee93b | |||
982a5ab048 | |||
a6d70920e2 | |||
b311312260 | |||
665d2bd9bc | |||
4aac65fb9e | |||
4102e929f4 | |||
b3bb2472f1 | |||
a6d939cc9a | |||
304a5c06da | |||
707a69182f | |||
8f5ead43d9 | |||
41a4ee3f3d | |||
f8b6d7b0d3 | |||
84e757768e | |||
264e236473 | |||
96fc5f2418 | |||
26a463c4b4 | |||
8e425c64d4 | |||
bf9be5de2d | |||
2c235e659b | |||
a77168986a | |||
24186d5aec | |||
7b3f5ee858 | |||
939042a645 | |||
fa4e96e7e5 | |||
fa626532ba | |||
a2e2459169 | |||
8a70943b09 | |||
d126023c4a | |||
f2281d7125 | |||
3efa94dce5 | |||
bd7ebc5f7d | |||
89466d582a |
7
.gitignore
vendored
@ -5,6 +5,9 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
|
||||
# node webkit cache
|
||||
cache
|
||||
|
||||
# sublime text stuff (the -project should actually be shared, but then we'd have to share the same disk location)
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
@ -18,6 +21,10 @@ diff.txt
|
||||
|
||||
# build destination
|
||||
dest
|
||||
build/closure/closure_compiled_binary.js
|
||||
|
||||
# plato report directory
|
||||
report
|
||||
|
||||
# marked as private
|
||||
*.private.*
|
@ -1,6 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.8
|
||||
- 0.10
|
||||
before_install:
|
||||
- npm update -g npm
|
||||
- npm install -g grunt-cli
|
||||
@ -12,3 +12,4 @@ before_install:
|
||||
before_script:
|
||||
- phantomjs --version
|
||||
- casperjs --version
|
||||
sudo: false
|
||||
|
317
Gruntfile.js
@ -1,32 +1,44 @@
|
||||
/**
|
||||
* How to run grunt tasks:
|
||||
* - At project root, run 'npm install' - It will install nodedependencies declared in package,json in <root>/.node_modules
|
||||
* - install grunt CLI tools globally, run 'npm install -g grunt-cli'
|
||||
* - run a grunt target defined in Gruntfiles.js, ex: 'grunt lint'
|
||||
*
|
||||
* Note: The 'ghost' grunt task have special deps on CasperJS and phantomjs.
|
||||
* For now, It's configured to run only on TravisCI where these deps are
|
||||
* correctly defined.
|
||||
* If you run this task locally, it may require some env set up first.
|
||||
*/
|
||||
|
||||
var SOURCE_FOLDER = "src";
|
||||
|
||||
module.exports = function(grunt) {
|
||||
var mapToSrcFolder = function (path) {return [SOURCE_FOLDER, path].join('/');};
|
||||
var dateFormat = require('dateformat');
|
||||
var now = new Date();
|
||||
var version = '-' + dateFormat(now, "yyyy-mm-dd-hh-MM");
|
||||
|
||||
var piskelScripts = require('./src/piskel-script-list.js').scripts.map(mapToSrcFolder);
|
||||
var mapToSrcFolder = function (path) {
|
||||
return "src/" + path;
|
||||
};
|
||||
|
||||
var piskelScripts = require('./src/piskel-script-list.js').scripts.map(mapToSrcFolder).filter(function (path) {
|
||||
return path.indexOf('devtools') === -1;
|
||||
});
|
||||
var piskelStyles = require('./src/piskel-style-list.js').styles.map(mapToSrcFolder);
|
||||
|
||||
var getGhostConfig = function (delay) {
|
||||
var mapToCasperFolder = function (path) {
|
||||
return "test/casperjs/" + path;
|
||||
};
|
||||
|
||||
var casperEnvironments = {
|
||||
'local' : {
|
||||
suite : './test/casperjs/LocalTestSuite.js',
|
||||
delay : 50
|
||||
},
|
||||
'travis' : {
|
||||
suite : './test/casperjs/TravisTestSuite.js',
|
||||
delay : 10000
|
||||
}
|
||||
};
|
||||
|
||||
var getCasperConfig = function (env) {
|
||||
var conf = casperEnvironments[env];
|
||||
var tests = require(conf.suite).tests.map(mapToCasperFolder);
|
||||
return {
|
||||
filesSrc : ['test/integration/casperjs/*_test.js'],
|
||||
filesSrc : tests,
|
||||
options : {
|
||||
args : {
|
||||
baseUrl : 'http://localhost:' + '<%= connect.test.options.port %>/src/',
|
||||
baseUrl : 'http://localhost:' + '<%= express.test.options.port %>/',
|
||||
mode : '?debug',
|
||||
delay : delay
|
||||
delay : conf.delay
|
||||
},
|
||||
async : false,
|
||||
direct : false,
|
||||
logLevel : 'info',
|
||||
printCommand : false,
|
||||
@ -35,52 +47,67 @@ module.exports = function(grunt) {
|
||||
};
|
||||
};
|
||||
|
||||
var getExpressConfig = function (source, port, host) {
|
||||
var bases;
|
||||
if (typeof source === 'string') {
|
||||
bases = [source];
|
||||
} else if (Array.isArray(source)) {
|
||||
bases = source;
|
||||
}
|
||||
|
||||
return {
|
||||
options: {
|
||||
port: port,
|
||||
hostname : host || 'localhost',
|
||||
bases: bases
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// load all grunt tasks
|
||||
require('load-grunt-tasks')(grunt);
|
||||
|
||||
grunt.initConfig({
|
||||
clean: {
|
||||
before: ['dest'],
|
||||
after: ['build/closure/closure_compiled_binary.js']
|
||||
before: ['dest']
|
||||
},
|
||||
leadingIndent : {
|
||||
options: {
|
||||
indentation : "spaces"
|
||||
},
|
||||
css : ['src/css/**/*.css']
|
||||
},
|
||||
jscs : {
|
||||
options : {
|
||||
"preset": "google",
|
||||
"maximumLineLength": 120,
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
|
||||
"validateQuoteMarks": { "mark": "'", "escape": true },
|
||||
"disallowMultipleVarDecl": "exceptUndefined",
|
||||
"disallowSpacesInAnonymousFunctionExpression": null
|
||||
},
|
||||
js : [ 'src/js/**/*.js' , '!src/js/**/lib/**/*.js' ]
|
||||
},
|
||||
jshint: {
|
||||
options: {
|
||||
indent:2,
|
||||
undef : true,
|
||||
latedef : true,
|
||||
browser : true,
|
||||
trailing : true,
|
||||
curly : true,
|
||||
es3 : true,
|
||||
globals : {'$':true, 'jQuery' : true, 'pskl':true, 'Events':true, 'Constants':true, 'console' : true, 'module':true, 'require':true}
|
||||
globals : {'$':true, 'jQuery' : true, 'pskl':true, 'Events':true, 'Constants':true, 'console' : true, 'module':true, 'require':true, 'Q':true}
|
||||
},
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
'package.json',
|
||||
'src/js/**/*.js',
|
||||
'!src/js/lib/**/*.js' // Exclude lib folder (note the leading !)
|
||||
'!src/js/**/lib/**/*.js' // Exclude lib folder (note the leading !)
|
||||
]
|
||||
},
|
||||
connect : {
|
||||
test : {
|
||||
options : {
|
||||
base : '.',
|
||||
port : 4321
|
||||
}
|
||||
}
|
||||
},
|
||||
express: {
|
||||
regular: {
|
||||
options: {
|
||||
port: 9001,
|
||||
hostname : 'localhost',
|
||||
bases: ['dest']
|
||||
}
|
||||
},
|
||||
debug: {
|
||||
options: {
|
||||
port: 9901,
|
||||
hostname : 'localhost',
|
||||
bases: ['src']
|
||||
}
|
||||
}
|
||||
test: getExpressConfig(['src', 'test'], 9991),
|
||||
regular: getExpressConfig('dest', 9001),
|
||||
debug: getExpressConfig(['src', 'test'], 9901)
|
||||
},
|
||||
open : {
|
||||
regular : {
|
||||
@ -101,8 +128,8 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
ghost : {
|
||||
'default' : getGhostConfig(5000),
|
||||
local : getGhostConfig(50)
|
||||
'travis' : getCasperConfig('travis'),
|
||||
'local' : getCasperConfig('local')
|
||||
},
|
||||
concat : {
|
||||
js : {
|
||||
@ -110,149 +137,135 @@ module.exports = function(grunt) {
|
||||
separator : ';'
|
||||
},
|
||||
src : piskelScripts,
|
||||
dest : 'dest/js/piskel-packaged.js'
|
||||
dest : 'dest/js/piskel-packaged' + version + '.js'
|
||||
},
|
||||
css : {
|
||||
src : piskelStyles,
|
||||
dest : 'dest/css/piskel-style-packaged.css'
|
||||
dest : 'dest/css/piskel-style-packaged' + version + '.css'
|
||||
}
|
||||
},
|
||||
uglify : {
|
||||
options : {
|
||||
mangle : true
|
||||
},
|
||||
my_target : {
|
||||
js : {
|
||||
files : {
|
||||
'dest/js/piskel-packaged-min.js' : ['dest/js/piskel-packaged.js']
|
||||
'dest/js/piskel-packaged-min.js' : ['dest/js/piskel-packaged' + version + '.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
replace: {
|
||||
main: {
|
||||
options: {
|
||||
patterns: [
|
||||
{
|
||||
match: 'version',
|
||||
replacement: version
|
||||
}
|
||||
]
|
||||
},
|
||||
files: [
|
||||
{src: ['src/piskel-boot.js'], dest: 'dest/piskel-boot.js'}
|
||||
]
|
||||
},
|
||||
editor: {
|
||||
options: {
|
||||
patterns: [
|
||||
{
|
||||
match: /templates\//g,
|
||||
replacement: "../templates"+version+"/"
|
||||
},{
|
||||
match: /piskel-boot.js/g,
|
||||
replacement: "../piskel-boot"+version+".js"
|
||||
},{
|
||||
match: /^(.|[\r\n])*<!--body-main-start-->/,
|
||||
replacement: "",
|
||||
description : "Remove everything before body-main-start comment"
|
||||
},{
|
||||
match: /<!--body-main-end-->(.|[\r\n])*$/,
|
||||
replacement: "",
|
||||
description : "Remove everything after body-main-end comment"
|
||||
},{
|
||||
match: /([\r\n]) /g,
|
||||
replacement: "$1",
|
||||
description : "Decrease indentation by one"
|
||||
}
|
||||
]
|
||||
},
|
||||
files: [
|
||||
{src: ['src/index.html'], dest: 'dest/piskelapp-partials/main-partial.html'}
|
||||
]
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
main: {
|
||||
files: [
|
||||
{src: ['src/piskel-boot.js'], dest: 'dest/piskel-boot.js'},
|
||||
{src: ['dest/js/piskel-packaged-min.js'], dest: 'dest/js/piskel-packaged-min' + version + '.js'},
|
||||
{src: ['dest/piskel-boot.js'], dest: 'dest/piskel-boot' + version + '.js'},
|
||||
{src: ['src/logo.png'], dest: 'dest/logo.png'},
|
||||
{src: ['src/js/lib/iframeLoader.js'], dest: 'dest/js/lib/iframeLoader.js'},
|
||||
{src: ['src/js/lib/iframeLoader-0.1.0.js'], dest: 'dest/js/lib/iframeLoader-0.1.0.js'},
|
||||
{src: ['src/js/lib/gif/gif.ie.worker.js'], dest: 'dest/js/lib/gif/gif.ie.worker.js'},
|
||||
{expand: true, src: ['img/**'], cwd: 'src/', dest: 'dest/', filter: 'isFile'},
|
||||
{expand: true, src: ['css/fonts/**'], cwd: 'src/', dest: 'dest/', filter: 'isFile'},
|
||||
{expand: true, src: ['**/*.html'], cwd: 'src/', dest: 'dest/', filter: 'isFile'}
|
||||
]
|
||||
}
|
||||
},
|
||||
closureCompiler: {
|
||||
options: {
|
||||
// [REQUIRED] Path to closure compiler
|
||||
compilerFile: 'build/closure/closure_compiler_20130823.jar',
|
||||
|
||||
// [OPTIONAL] set to true if you want to check if files were modified
|
||||
// before starting compilation (can save some time in large sourcebases)
|
||||
//checkModified: true,
|
||||
|
||||
// [OPTIONAL] Set Closure Compiler Directives here
|
||||
compilerOpts: {
|
||||
/**
|
||||
* Keys will be used as directives for the compiler
|
||||
* values can be strings or arrays.
|
||||
* If no value is required use null
|
||||
*/
|
||||
//compilation_level: 'ADVANCED_OPTIMIZATIONS',
|
||||
compilation_level: 'SIMPLE_OPTIMIZATIONS',
|
||||
externs: ['build/closure/piskel-closure-externs.js'],
|
||||
// Inject some constants in JS code, could we use that for appengine wiring ?
|
||||
//define: ["'goog.DEBUG=false'"],
|
||||
warning_level: 'verbose',
|
||||
jscomp_off: ['checkTypes', 'fileoverviewTags'],
|
||||
summary_detail_level: 1,
|
||||
language_in: 'ECMASCRIPT3'
|
||||
//output_wrapper: '"(function(){%output%}).call(this);"'
|
||||
},
|
||||
execOpts: { // [OPTIONAL] Set exec method options
|
||||
maxBuffer: 999999 * 1024
|
||||
}
|
||||
|
||||
},
|
||||
compile: {
|
||||
|
||||
/**
|
||||
*[OPTIONAL] Here you can add new or override previous option of the Closure Compiler Directives.
|
||||
* IMPORTANT! The feature is enabled as a temporary solution to [#738](https://github.com/gruntjs/grunt/issues/738).
|
||||
* As soon as issue will be fixed this feature will be removed.
|
||||
*/
|
||||
TEMPcompilerOpts: {
|
||||
},
|
||||
src: [
|
||||
'src/js/**/*.js',
|
||||
'src/piskel-boot.js',
|
||||
'src/piskel-script-list.js',
|
||||
'!src/js/lib/**/*.js'
|
||||
],
|
||||
|
||||
// This generated JS binary is currently not used and even excluded from source control using .gitignore.
|
||||
dest: 'build/closure/closure_compiled_binary.js'
|
||||
karma: {
|
||||
unit: {
|
||||
configFile: 'karma.conf.js'
|
||||
}
|
||||
},
|
||||
nodewebkit: {
|
||||
options: {
|
||||
build_dir: './dest/desktop/', // destination folder of releases.
|
||||
mac: true,
|
||||
win: true,
|
||||
linux32: true,
|
||||
linux64: true
|
||||
windows : {
|
||||
options: {
|
||||
version : "0.11.5",
|
||||
build_dir: './dest/desktop/', // destination folder of releases.
|
||||
win: true,
|
||||
linux32: true,
|
||||
linux64: true
|
||||
},
|
||||
src: ['./dest/**/*', "./package.json", "!./dest/desktop/"]
|
||||
},
|
||||
src: ['./dest/**/*', "./package.json", "!./dest/desktop/"]
|
||||
macos : {
|
||||
options: {
|
||||
platforms : ['osx64'],
|
||||
version : "0.10.5",
|
||||
build_dir: './dest/desktop/'
|
||||
},
|
||||
src: ['./dest/**/*', "./package.json", "!./dest/desktop/"]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.config.set('leadingIndent.indentation', 'spaces');
|
||||
grunt.config.set('leadingIndent.jsFiles', {
|
||||
src: [
|
||||
'src/js/**/*.js',
|
||||
'!src/js/lib/**/*.js'
|
||||
]
|
||||
});
|
||||
grunt.config.set('leadingIndent.cssFiles', {
|
||||
src: ['src/css/**/*.css']
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-closure-tools');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-express');
|
||||
grunt.loadNpmTasks('grunt-ghost');
|
||||
grunt.loadNpmTasks('grunt-open');
|
||||
grunt.loadNpmTasks('grunt-leading-indent');
|
||||
grunt.loadNpmTasks('grunt-node-webkit-builder');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
|
||||
// Validate
|
||||
grunt.registerTask('lint', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint']);
|
||||
grunt.registerTask('lint', ['jscs:js', 'leadingIndent:css', 'jshint']);
|
||||
|
||||
// karma/unit-tests task
|
||||
grunt.registerTask('unit-test', ['karma']);
|
||||
|
||||
// Validate & Test
|
||||
grunt.registerTask('test', ['lint', 'compile', 'connect:test', 'ghost:default']);
|
||||
|
||||
grunt.registerTask('test-travis', ['lint', 'unit-test', 'express:test', 'ghost:travis']);
|
||||
// Validate & Test (faster version) will NOT work on travis !!
|
||||
grunt.registerTask('precommit', ['lint', 'compile', 'connect:test', 'ghost:local']);
|
||||
grunt.registerTask('test-local', ['lint', 'unit-test', 'express:test', 'ghost:local']);
|
||||
grunt.registerTask('test-local-nolint', ['unit-test', 'express:test', 'ghost:local']);
|
||||
|
||||
// Compile JS code (eg verify JSDoc annotation and types, no actual minified code generated).
|
||||
grunt.registerTask('compile', ['closureCompiler:compile', 'clean:after']);
|
||||
grunt.registerTask('test', ['test-travis']);
|
||||
grunt.registerTask('precommit', ['test-local']);
|
||||
|
||||
grunt.registerTask('merge', ['concat:js', 'concat:css', 'uglify', 'copy']);
|
||||
grunt.registerTask('build', ['concat:js', 'concat:css', 'uglify', 'replace:main', 'replace:editor', 'copy']);
|
||||
|
||||
// Validate & Build
|
||||
grunt.registerTask('default', ['clean:before', 'lint', 'compile', 'merge']);
|
||||
grunt.registerTask('default', ['clean:before', 'lint', 'build']);
|
||||
|
||||
// Build stand alone app with nodewebkit
|
||||
grunt.registerTask('desktop', ['default', 'nodewebkit']);
|
||||
|
||||
grunt.registerTask('server', ['merge', 'express:regular', 'open:regular', 'express-keepalive']);
|
||||
grunt.registerTask('desktop', ['default', 'nodewebkit:windows']);
|
||||
grunt.registerTask('desktop-mac', ['default', 'nodewebkit:macos']);
|
||||
|
||||
// Start webserver and watch for changes
|
||||
grunt.registerTask('server:watch', ['server', 'watch']);
|
||||
grunt.registerTask('serve', ['build', 'express:regular', 'open:regular', 'express-keepalive', 'watch']);
|
||||
|
||||
// Start webserver on src folder, in debug mode
|
||||
grunt.registerTask('server:debug', ['express:debug', 'open:debug', 'express-keepalive']);
|
||||
grunt.registerTask('serve-debug', ['express:debug', 'open:debug', 'express-keepalive']);
|
||||
grunt.registerTask('play', ['serve-debug']);
|
||||
};
|
||||
|
661
LICENSE
Normal file
@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
22
README.md
@ -32,12 +32,16 @@ Integrated in **[piskelapp.com](http://piskelapp.com)**, you can share everythin
|
||||
Piskel supports the following browsers :
|
||||
* **Chrome** (latest)
|
||||
* **Firefox** (latest)
|
||||
* **Internet Explorer** 10+
|
||||
* **Internet Explorer** 11+
|
||||
|
||||
... and a fairly recent computer.
|
||||
|
||||
We don't plan/want/could be forced into supporting older IEs. For Opera and Safari, we've never tested them but the gap shouldn't be huge.
|
||||
|
||||
## Offline version
|
||||
|
||||
Offline builds are available. More details in the [dedicated wiki page](https://github.com/juliandescottes/piskel/wiki/Desktop-applications).
|
||||
|
||||
## Built with
|
||||
|
||||
The Piskel editor is purely built in **JavaScript, HTML and CSS**. It uses Canvas extensively for displaying all them pretty sprites.
|
||||
@ -45,6 +49,7 @@ The Piskel editor is purely built in **JavaScript, HTML and CSS**. It uses Canva
|
||||
We also use the following **libraries** :
|
||||
* [spectrum](https://github.com/bgrins/spectrum) : awesome standalone colorpicker
|
||||
* [gifjs](http://jnordberg.github.io/gif.js/) : generate animated GIFs in javascript, using webworkers
|
||||
* [supergif](https://github.com/buzzfeed/libgif-js) : modified version of SuperGif to parse and import GIFs
|
||||
* [jszip](https://github.com/Stuk/jszip) : create, read and edit .zip files with Javascript
|
||||
* [canvas-toBlob](https://github.com/eligrey/canvas-toBlob.js/) : shim for canvas toBlob
|
||||
* [jquery](http://jquery.com/) : used sporadically in the application
|
||||
@ -62,9 +67,20 @@ Help is always welcome !
|
||||
* **Issues** : Found a problem when using the application, want to request a feature, [open an issue](https://github.com/juliandescottes/piskel/issues).
|
||||
* **Participate** : Have a look at the [wiki](https://github.com/juliandescottes/piskel/wiki) to set up the development environment
|
||||
|
||||
## Licensing
|
||||
## License
|
||||
|
||||
Probably need to pick one at some point ... Until then it's a "do whatever you want with it" license.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## Mobile/Tablets
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @fileoverview Externs for Piskel
|
||||
*
|
||||
* @externs
|
||||
*/
|
||||
|
||||
// Piskel externs.
|
||||
var exports;
|
||||
var pskl_exports;
|
||||
var $;
|
||||
var console;
|
||||
var pskl;
|
||||
|
||||
// Piskel libs externs.
|
||||
var define;
|
||||
var jQuery;
|
||||
var getComputedStyle;
|
||||
var URL;
|
69
karma.conf.js
Normal file
@ -0,0 +1,69 @@
|
||||
// Karma configuration
|
||||
// Generated on Tue Jul 22 2014 23:49:26 GMT+0200 (Romance Daylight Time)
|
||||
|
||||
module.exports = function(config) {
|
||||
|
||||
var mapToSrcFolder = function (path) {return ['src', path].join('/');};
|
||||
|
||||
var piskelScripts = require('./src/piskel-script-list.js').scripts.map(mapToSrcFolder);
|
||||
piskelScripts.push('test/js/testutils/**/*.js');
|
||||
piskelScripts.push('test/js/**/*.js');
|
||||
|
||||
config.set({
|
||||
|
||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||
basePath: '',
|
||||
|
||||
|
||||
// frameworks to use
|
||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: piskelScripts,
|
||||
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [],
|
||||
|
||||
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
},
|
||||
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress'
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: ['progress'],
|
||||
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
singleRun: true
|
||||
});
|
||||
};
|
68
misc/icons/SVG/eye.svg
Normal file
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="300"
|
||||
height="140.00085"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="eye.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="-6.0052729"
|
||||
inkscape:cy="93.159467"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1148"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-223.21875,-469.24915)">
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
d="m 373.21875,469.25 c -63.15236,-0.28299 -150,70 -150,70 0,0 78.75568,70 150,70 62.82091,0 150,-70 150,-70 0,0 -87.47199,-69.71981 -150,-70 z m -1.5,22.3125 c 27.44855,0 49.6875,22.23895 49.6875,49.6875 0,27.44855 -22.23895,49.6875 -49.6875,49.6875 C 344.2702,590.9375 322,568.69855 322,541.25 c 0,-27.44855 22.2702,-49.6875 49.71875,-49.6875 z m 0.0312,18.34375 c -17.85254,0 -32.34375,14.49121 -32.34375,32.34375 0,17.85254 14.49121,32.3125 32.34375,32.3125 17.85254,0 32.3125,-14.45996 32.3125,-32.3125 0,-17.85254 -14.45996,-32.34375 -32.3125,-32.34375 z"
|
||||
id="path2987"
|
||||
inkscape:export-filename="C:\Development\git\piskel\misc\icons\eye.png"
|
||||
inkscape:export-xdpi="28.799999"
|
||||
inkscape:export-ydpi="28.799999"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
88
misc/icons/SVG/flip.svg
Normal file
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="770.71875"
|
||||
height="581.4375"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="mirror.svg"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\flip.png"
|
||||
inkscape:export-xdpi="35.446629"
|
||||
inkscape:export-ydpi="35.446629">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.7"
|
||||
inkscape:cx="612.40785"
|
||||
inkscape:cy="222.08964"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1148"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-63.5625,-233.7818)">
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
d="m 359.2768,233.7907 -295.7143,581.4286 295.7143,0 z"
|
||||
id="rect2987"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\flip.png"
|
||||
inkscape:export-xdpi="35.446629"
|
||||
inkscape:export-ydpi="35.446629" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
d="m 538.5625,233.7818 295.71875,581.4375 -295.71875,0 0,-581.4375 z m 29.125,117.4375 0,434.28125 218.59375,0 L 567.6875,351.2193 z"
|
||||
id="rect2987-1"
|
||||
inkscape:connector-curvature="0"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\flip.png"
|
||||
inkscape:export-xdpi="35.446629"
|
||||
inkscape:export-ydpi="35.446629" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
d="m 435.5625,233.93805 0,41.28125 25.71875,0 0,-41.28125 -25.71875,0 z m 0,91.28125 0,40 25.71875,0 0,-40 -25.71875,0 z m 0,90 0,40 25.71875,0 0,-40 -25.71875,0 z m 0,90 0,40 25.71875,0 0,-40 -25.71875,0 z m 0,90 0,40 25.71875,0 0,-40 -25.71875,0 z m 0,90 0,40 25.71875,0 0,-40 -25.71875,0 z m 0,90 0,40 25.71875,0 0,-40 -25.71875,0 z"
|
||||
id="rect3796"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\flip.png"
|
||||
inkscape:export-xdpi="35.446629"
|
||||
inkscape:export-ydpi="35.446629"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
72
misc/icons/SVG/lasso.svg
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="224.38731"
|
||||
height="177.96065"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="New document 1">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.175"
|
||||
inkscape:cx="-1542.2107"
|
||||
inkscape:cy="-1434.6156"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1148"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-212.79148,-238.81242)">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:15;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:30, 30;stroke-dashoffset:0"
|
||||
d="m 429.0234,294.50503 c 0,26.68038 -49.13123,48.3091 -109.73768,48.3091 -60.60644,0 -110.61221,-39.48861 -96.16624,-73.3091 19.3392,-45.27639 60.80353,-4.92189 116.16624,-16.88052 101.16819,-21.85285 89.73768,15.20015 89.73768,41.88052 z"
|
||||
id="path3761"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssss" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 309.32357,338.9218 c 0,0 8.97064,20.56224 -30.34229,45.31736 -39.31294,24.75512 -40.99309,30.13484 -40.99309,30.13484"
|
||||
id="path3764"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="czc" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
99
misc/icons/SVG/onion.svg
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="484.83377"
|
||||
height="430.80322"
|
||||
id="svg3775"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="New document 3">
|
||||
<defs
|
||||
id="defs3777" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.04375"
|
||||
inkscape:cx="-429.81362"
|
||||
inkscape:cy="-202.97901"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1148"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" />
|
||||
<metadata
|
||||
id="metadata3780">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-108.38875,-334.08796)">
|
||||
<g
|
||||
id="g4409">
|
||||
<g
|
||||
id="g4402" />
|
||||
<g
|
||||
transform="translate(0,0.82903262)"
|
||||
id="g4395">
|
||||
<path
|
||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:25;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
|
||||
d="m 395.27679,333.25893 -27.75,24.625 -1.65625,-9 -15.87054,4.59375 0,30.6875 1.02679,21.75 16.5625,-14.6875 13.6875,-12.15625 c -0.38933,5.52995 -0.57204,11.36571 -0.1875,17.84375 0.60884,10.25666 3.42535,19.47486 9.03125,26.6875 5.6059,7.21264 13.15778,11.83264 21.53125,15.65625 16.74693,7.64722 37.6168,20.19024 63.19196,41.4465 48.42535,40.24771 54.41585,60.33492 63.14228,95.72811 8.30827,46.0064 -4.89609,79.1393 -23.94924,107.24539 -13.61329,20.08154 -30.46397,37.90172 -67.50554,45.41482 -37.04157,7.5131 -71.72672,9.9375 -96.53125,9.9375 l 0,25 c 26.40206,0 62.17269,-2.46078 101.5,-10.4375 39.32731,-7.97672 78.11592,-20.77325 101.8125,-45.5625 25.65093,-26.83371 50.16969,-75.46693 35.5,-151.5 l -0.0312,-0.125 -0.0312,-0.125 c -6.53497,-30.32511 -26.37349,-75.86993 -103.9375,-109.59375 -32.08342,-13.94946 -49.48883,-22.95257 -62.57589,-28.92857 -6.54353,-2.988 -10.31288,-6.85833 -12.36607,-9.5 -2.05319,-2.64167 -3.40095,-5.87935 -3.8125,-12.8125 -0.92607,-15.60085 1.34241,-27.46751 3.71875,-35.3125 2.37634,-7.84499 4.375,-10.875 4.375,-10.875 l -18.875,-16 z"
|
||||
id="path3783-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccsssscssccsscccsssssccc" />
|
||||
<path
|
||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:25;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
|
||||
d="m 368.02679,382.44643 c 0,0 -18.02679,-4.71234 -18.02679,1.3125 0,33.38646 -0.45698,39.28362 10.99554,62.875 11.45252,23.59138 26.22845,47.86253 48.53571,68.45982 42.18558,38.95183 38.76978,44.87254 45.77232,64.91071 2.57793,7.37689 3.66466,24.51253 1.875,37.96875 -1.78965,13.45623 -6.8081,31.21802 -13.40625,41.3125 -10.36811,15.86211 -18.71831,32.07642 -38.55357,43.09375 C 384.4983,713.88847 366.62548,716.375 350,716.375 l 0,25 c 20.82486,0 44.52967,-5.01706 69.5625,-15.125 25.03283,-10.10794 49.12742,-25.27054 63.71875,-47.59375 9.77369,-14.95272 20.06105,-37.72017 22.33202,-55.91561 2.27097,-18.19544 6.78209,-33.89274 -5.08281,-58.40387 -18.26325,-37.72918 -42.54947,-49.06002 -72.19845,-74.15863 -18.35479,-15.5378 -34.85805,-33.83125 -44.86772,-54.45046 -10.00967,-20.61921 -14.81706,-41.55822 -15.4375,-53.28125 z"
|
||||
id="path3783-9-4-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csssszssccssssssc" />
|
||||
<path
|
||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:25;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
|
||||
d="M 364.71429,398.50893 350,399.85268 c 0.74677,14.10988 0,43.14662 0,70.71875 0,13.09078 2.17726,28.99404 4.22321,39.97321 3.9423,21.15552 10.51352,34.8833 14.63393,48.16965 3.27485,10.5598 6.94665,25.34012 9.3884,31.02232 6.61244,15.3878 7.52886,34.1921 0.75446,55.84375 -6.86056,21.92704 -17.55684,42.94479 -35.42857,49.84375 L 350,716.625 c 25.86119,-9.9831 62.03992,-38.1333 71.93512,-69.75936 8.9188,-28.50537 3.28613,-54.26844 -4.84375,-73.1875 -4.92941,-11.47123 -9.61575,-19.37277 -14.86607,-28.9375 -6.46007,-11.76857 -20.1885,-26.52209 -24.11895,-38.53817 -3.57466,-10.92835 -7.82736,-24.14439 -8.92331,-37.66229 -2.1919,-27.03581 -3.63369,-54.77948 -4.46875,-70.03125 z"
|
||||
id="path3783-9-4-4-8-8"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccsssssccsssssc" />
|
||||
</g>
|
||||
</g>
|
||||
<path
|
||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:25;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
|
||||
d="m 306.33447,334.11887 27.75,24.625 1.65625,-9 15.87054,4.59375 0,30.6875 -1.02679,21.75 -16.5625,-14.6875 -13.6875,-12.15625 c 0.38933,5.52995 0.57204,11.36571 0.1875,17.84375 -0.60884,10.25666 0.61526,20.48501 -4.99064,27.69765 -5.6059,7.21264 -12.14763,16.88341 -20.5211,20.70702 -16.74693,7.64722 -36.60664,20.19024 -62.1818,41.4465 -48.42535,40.24771 -47.34479,51.24354 -56.07122,86.63673 -3.25751,47.01655 -5.92183,46.3581 4.75635,78.96112 6.45302,19.70261 22.38275,38.91187 59.42432,56.52649 34.13302,16.23151 85.86885,30.14056 110.67338,30.14056 l 0,25 c -26.40206,0 -62.17269,-2.46078 -101.5,-10.4375 -39.32731,-7.97672 -78.11592,-20.77325 -101.8125,-45.5625 -25.65093,-26.83371 -50.169693,-75.46693 -35.5,-151.5 l 0.0312,-0.125 0.0312,-0.125 c 6.53497,-30.32511 26.37349,-75.86993 103.9375,-109.59375 32.08342,-13.94946 49.48883,-22.95257 62.57589,-28.92857 6.54353,-2.988 10.31288,-6.85833 12.36607,-9.5 2.05319,-2.64167 3.40095,-5.87935 3.8125,-12.8125 0.92607,-15.60085 -1.34241,-27.46751 -3.71875,-35.3125 -2.37634,-7.84499 -4.375,-10.875 -4.375,-10.875 l 18.875,-16 z"
|
||||
id="path3783-2-4"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccsssscssccsscccsssssccc" />
|
||||
<path
|
||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:25;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
|
||||
d="m 343.97613,380.44701 9.00001,12.77232 c -0.74677,14.10988 0,43.14662 0,70.71875 0,13.09078 3.53703,30.42261 1.49108,41.40178 -3.9423,21.15552 -3.37067,28.45473 -7.49108,41.74108 -3.27485,10.5598 -6.94665,28.91155 -9.3884,34.59375 -6.61244,15.3878 -8.24315,50.62067 -1.46875,72.27232 6.86056,21.92704 11.12828,50.08764 21.85715,66.27232 l 3.98985,41.15013 C 338.24766,729.2435 314.3133,692.32754 304.4181,660.70148 c -8.9188,-28.50537 -8.28613,-78.55416 -0.15625,-97.47322 4.92941,-11.47123 9.61575,-22.9442 14.86607,-32.50893 6.46007,-11.76857 10.13774,-23.49163 13.05804,-36.51786 2.51528,-11.21964 6.93976,-29.49102 8.03571,-43.00892 2.1919,-27.03581 2.9194,-55.49377 3.75446,-70.74554 z"
|
||||
id="path3783-9-4-4-8-8-7"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccsssssccsssssc" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
72
misc/icons/SVG/swap-colors-sq.svg
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="435"
|
||||
height="409.28125"
|
||||
id="svg3768"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="New document 3">
|
||||
<defs
|
||||
id="defs3770" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="87.95854"
|
||||
inkscape:cy="195.23297"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1148"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata3773">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-151.0625,-197.71875)">
|
||||
<rect
|
||||
style="fill:none;stroke:#ffffff;stroke-width:35;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3784"
|
||||
width="400"
|
||||
height="374.28571"
|
||||
x="168.57143"
|
||||
y="215.21933" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
d="m 368.5625,209.5 0,97.0625 c -18.16488,0.20304 -36.33513,0.39071 -54.5,0.59375 l 0,-51.1875 c -36.22093,27.13868 -72.43533,54.2988 -108.65625,81.4375 l 107.375,91.46875 1.28125,-53.5 54.5,0.96875 0,62.25 c 20.86255,0.2332 41.73121,0.45431 62.59375,0.6875 l 0,-51.1875 C 467.37718,415.23243 503.59158,442.3613 539.8125,469.5 l -107.40625,91.5 -1.25,-53.5 -62.59375,1.09375 0,75.1875 200,0 0,-365.71875 -200,-8.5625 z"
|
||||
id="path4296"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
97
misc/icons/SVG/swap-colors.svg
Normal file
@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="305.0015"
|
||||
height="340.10172"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\swap.png"
|
||||
inkscape:export-xdpi="28.799999"
|
||||
inkscape:export-ydpi="28.799999"
|
||||
sodipodi:docname="swap-colors.svg">
|
||||
<defs
|
||||
id="defs2994" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1.979899"
|
||||
inkscape:cx="8.3838947"
|
||||
inkscape:cy="209.5365"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1148"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-253.81175,62.601668)">
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 281.31983,48.818994 c 3.33333,70.714286 6.66667,141.428566 10,212.142856 61.21871,3.33294 122.57845,5.69263 183.84823,2.1217 15.38711,-0.63513 30.77146,-1.33859 46.15177,-2.1217 3.33333,-70.71429 6.66667,-141.42857 10,-212.142856 -62.39939,12.482847 -126.73342,18.836303 -190.05871,9.668003 -20.08786,-2.492087 -40.09989,-5.6543 -59.94129,-9.668003 z"
|
||||
id="path3907"
|
||||
inkscape:connector-curvature="0"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\swap.png"
|
||||
inkscape:export-xdpi="28.799999"
|
||||
inkscape:export-ydpi="28.799999" />
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:15;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 261.31983,63.818994 c 0,-10 0,-20 0,-30 17.1189,-42.7715577 62.54009,-66.510405 106.22509,-72.841714 51.17865,-7.022275 108.04464,-2.652241 150.47229,29.6746917 14.38134,11.798678 28.46011,26.7242963 33.30262,44.9943353 0,9.390896 0,18.781791 0,28.172687"
|
||||
id="path3909"
|
||||
inkscape:connector-curvature="0"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\swap.png"
|
||||
inkscape:export-xdpi="28.799999"
|
||||
inkscape:export-ydpi="28.799999" />
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:35;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 364.53412,-41.538146 c 25.60486,-3.886191 51.66473,-4.881507 77.20839,0.0707 l 3.09159,0.466979 1.12859,0.176599"
|
||||
id="path3915"
|
||||
inkscape:connector-curvature="0"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\swap.png"
|
||||
inkscape:export-xdpi="28.799999"
|
||||
inkscape:export-ydpi="28.799999" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 154.55334,129.87795 0.68071,15.85947 c 0,0 -57.346456,21.06263 -57.436416,36.51009 -0.09,15.44746 36.662436,29.96772 55.746256,42.34379 19.08382,12.37606 46.83462,28.70031 47.51123,48.36912 C 200.90809,289.78491 152.86,310.7174 152.86,310.7174 l 0.68319,14.23203 111.11677,-2.02031 11.11168,-206.07112 z"
|
||||
id="path3764"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="translate(253.81175,-62.601668)"
|
||||
sodipodi:nodetypes="cczzcccccc"
|
||||
inkscape:export-filename="C:\Development\git\piskel\src\img\tools\swap.png"
|
||||
inkscape:export-xdpi="28.799999"
|
||||
inkscape:export-ydpi="28.799999" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.5 KiB |
BIN
misc/icons/noun-project/sheep/icon_8389.png
Normal file
After Width: | Height: | Size: 52 KiB |
41
misc/icons/noun-project/sheep/icon_8389.svg
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="99.997px" height="69.373px" viewBox="0 0 99.997 69.373" enable-background="new 0 0 99.997 69.373" xml:space="preserve">
|
||||
<path fill="#010101" d="M81.635,0.222c0.553-0.327,1.242-0.219,1.85-0.133c1.502,0.296,2.658,1.426,3.533,2.62
|
||||
c0.608-0.379,1.252-0.777,1.983-0.842c0.595-0.015,1.09,0.416,1.394,0.889c0.568,0.909,0.76,2.02,1.442,2.864
|
||||
C92,5.829,92.246,5.941,92.482,6.044c0.968,0.409,1.846,0.996,2.688,1.615c0.361,0.223,0.396,0.691,0.529,1.056
|
||||
c0.478,1.579,0.306,3.241,0.149,4.853c-0.035,0.812-0.104,1.659,0.172,2.438c0.42,0.954,1.229,1.655,1.746,2.547
|
||||
c1.191,2.13,2.146,4.467,2.229,6.937v0.088c-0.071,1.268-0.203,2.647-1.062,3.653c-0.707,0.846-1.85,1.101-2.896,1.223
|
||||
c-0.747,0.104-1.508,0.127-2.258,0.077c-1.912-0.275-3.812-0.628-5.724-0.911c-0.34-0.052-0.719-0.055-1,0.167
|
||||
c-0.391,0.281-0.494,0.786-0.537,1.235c-0.068,1.177,0.133,2.405-0.312,3.532c-0.227,0.604-0.768,0.999-1.266,1.371
|
||||
c-1.092,0.753-2.313,1.291-3.441,1.981c-0.164,0.115-0.125,0.348-0.125,0.521c0.075,0.916,0.332,1.821,0.253,2.747
|
||||
c-0.021,0.597-0.271,1.188-0.72,1.587c-0.768,0.709-1.434,1.519-2.068,2.346c-0.104,0.142-0.222,0.283-0.256,0.461
|
||||
c-0.264,1.272-0.385,2.576-0.74,3.83c-0.201,0.641-0.416,1.34-0.943,1.793c-0.633,0.492-1.456-0.342-2.098,0.164
|
||||
c-1.191,0.882-1.558,2.412-2.379,3.582c-0.469,0.595-1.104,1.039-1.805,1.319c-0.331,4.37-0.625,8.741-0.896,13.115h-5.166
|
||||
c0.16-2.783,0.32-5.567,0.486-8.351c0.203-1.728-0.097-3.444-0.312-5.152c-0.017-0.364-0.43-0.709-0.785-0.543
|
||||
c-1.037,0.3-2.131,0.459-3.204,0.289c-0.87-0.227-1.536-0.877-2.11-1.533c-1.765,1.695-4.326,2.275-6.712,2.025
|
||||
c-0.471-0.726-0.792-1.629-1.603-2.049c-0.539-0.324-1.198-0.155-1.729,0.098c-1.214,0.558-1.945,1.805-3.197,2.305
|
||||
c-1.1,0.51-2.359,0.188-3.41-0.291c-1.127-0.54-2.176-1.242-3.186-1.975c-0.52,0.236-0.837,0.728-1.123,1.195
|
||||
c-0.968,0.117-1.964,0.449-2.923,0.103c-1.548-0.399-2.625-1.652-3.94-2.472c-0.886,0.66-1.608,1.58-2.68,1.957
|
||||
c-0.698,0.24-1.468,0.399-2.196,0.207c-0.825-0.181-1.609-0.5-2.425-0.705c-0.27-0.078-0.558-0.037-0.807,0.082
|
||||
c-1.433,0.646-2.197,2.23-3.688,2.779c-0.307,0.148-0.632,0.043-0.936-0.047c-0.346,3.812-0.79,7.618-1.159,11.43
|
||||
c-1.811,0.006-3.623-0.002-5.434,0.004c-0.078-0.656-0.297-1.312-0.188-1.978c0.27-2.282,0.637-4.551,0.9-6.833
|
||||
c0.181-1.895-0.835-3.648-2.096-4.977c0.154-0.737-0.056-1.502-0.528-2.078c-1.24-1.65-3.362-2.342-4.546-4.043
|
||||
c-0.357-0.53-0.698-1.256-0.328-1.864c0.285-0.724,0.94-1.381,0.769-2.21c-0.04-0.262-0.165-0.502-0.347-0.691
|
||||
c-1.07-1.188-1.971-2.514-2.849-3.844c-0.403-0.59-0.372-1.338-0.438-2.02c-0.141-1.194,0.732-2.201,0.798-3.364
|
||||
c-0.196-0.665-0.84-1.073-1.192-1.654C0.638,31.785,0.077,30.231,0,28.62v-0.446c0.086-0.751,0.078-1.537,0.396-2.239
|
||||
c0.522-1.006,1.566-1.623,2.075-2.636c-0.222-0.968-0.747-1.833-0.966-2.799c-0.097-1.466,0.425-2.955,1.404-4.049
|
||||
c0.664-0.035,1.319-0.157,1.968-0.296c0.633-0.125,1.1-0.631,1.448-1.145c0.703-1.045,0.832-2.351,1.479-3.422
|
||||
c0.255-0.444,0.607-0.855,1.08-1.074c0.692-0.327,1.395-0.631,2.119-0.88c0.38-0.117,0.779-0.237,1.18-0.167
|
||||
c0.894,0.134,1.771,0.361,2.665,0.5c0.624,0.088,1.321-0.085,1.74-0.58c0.379-0.424,0.483-1.003,0.574-1.544
|
||||
c0.926-0.306,1.929-0.646,2.907-0.389c1.367,0.311,2.72,0.672,4.091,0.96c0.748-0.367,1.104-1.208,1.849-1.582
|
||||
c0.884-0.481,1.947-0.333,2.873-0.064c1.13,0.322,1.991,1.168,3.041,1.655c0.735-0.438,1.304-1.316,2.246-1.275
|
||||
c1.698,0.444,3.091,1.803,4.899,1.868c1.229,0.001,1.779-1.354,2.912-1.594c0.744-0.228,1.496,0.125,2.104,0.54
|
||||
c0.745,0.517,1.432,1.11,2.132,1.684c1.052-0.622,2.251-1.085,3.492-1.026c1.448,0.261,2.847,0.754,4.294,1.011
|
||||
c0.615-0.026,0.967-0.649,1.489-0.902c1.062-0.497,2.237-0.755,3.409-0.756c1.316,0.169,2.543,0.712,3.82,1.042
|
||||
c0.623-0.171,1.135-0.659,1.803-0.686c1.026-0.025,2.055-0.006,3.08-0.008c0.401-0.321,0.769-0.709,1.26-0.9
|
||||
c0.869-0.37,1.744-0.836,2.703-0.898c0.994,0.08,1.975,0.287,2.964,0.402c0.235-1.401,0.842-2.703,1.481-3.958
|
||||
c1.241-0.227,2.463-0.58,3.66-0.973C80.409,1.51,80.956,0.784,81.635,0.222z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 4.2 KiB |
8
misc/icons/noun-project/sheep/license.txt
Normal file
@ -0,0 +1,8 @@
|
||||
Thank you for using The Noun Project. This icon is licensed under Creative
|
||||
Commons Attribution and must be attributed as:
|
||||
|
||||
Sheep by Unrecognized MJ from The Noun Project
|
||||
|
||||
If you have a Premium Account or have purchased a license for this icon, you
|
||||
don't need to worry about attribution! We will share the profits from your
|
||||
purchase with this icon's designer.
|
@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="89.231px" height="100px" viewBox="0 0 89.231 100" enable-background="new 0 0 89.231 100" xml:space="preserve">
|
||||
<path d="M14.652,64.026c-0.603-2.09-1-4.267-1.15-6.511H0c0.18,3.858,0.86,7.586,1.962,11.13L14.652,64.026z"/>
|
||||
<path d="M14.332,88.192l8.684-10.35c-2.899-2.792-5.273-6.127-6.926-9.857L3.402,72.604C5.9,78.563,9.655,83.87,14.332,88.192z"/>
|
||||
<path d="M42.483,86.499c-6.051-0.409-11.626-2.559-16.245-5.943l-8.681,10.346c6.985,5.336,15.582,8.661,24.926,9.099V86.499z"/>
|
||||
<path d="M44.589,10.768V0L14.266,17.506l30.323,17.506V24.245c17.186,0,31.166,13.98,31.166,31.165 c0,16.477-12.854,29.999-29.061,31.087v13.502C70.337,98.896,89.231,79.32,89.231,55.41C89.231,30.794,69.205,10.768,44.589,10.768z "/>
|
||||
</svg>
|
After Width: | Height: | Size: 843 B |
8
misc/icons/noun-project/undo-kyle_levi_fox/license.txt
Normal file
@ -0,0 +1,8 @@
|
||||
Thank you for using The Noun Project. This icon is licensed under Creative
|
||||
Commons Attribution and must be attributed as:
|
||||
|
||||
Undo by Kyle Levi Fox from The Noun Project
|
||||
|
||||
If you have a Premium Account or have purchased a license for this icon, you
|
||||
don't need to worry about attribution! We will share the profits from your
|
||||
purchase with this icon's designer.
|
BIN
misc/icons/swap-colors-tests/swap-colors-square.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
misc/icons/swap-colors-tests/swap-colors-twirl-2.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
misc/icons/swap-colors-tests/swap-colors-twirl-3.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
misc/icons/swap-colors-tests/swap-colors-twirl.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
misc/icons/swap-colors-tests/swap.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
12
misc/scripts/build-mac-application.txt
Normal file
@ -0,0 +1,12 @@
|
||||
01 - Run grunt desktop on mac os x
|
||||
02 - Retrieve piskel.new.dmg.zip on Dropbox. Unzip it.
|
||||
03 - Retrieve nw.icns on Dropbox
|
||||
04 - Go to piskel/dest/desktop/releases/mac ; copy piskel.app to your working directory
|
||||
05 - Expand piskel.app
|
||||
06 - Replace nw.icns by the one from dropbox in Contents/Resources
|
||||
07 - Open piskel.new.dmg
|
||||
08 - Drag and drop piskel.app in it
|
||||
09 - Update readme.txt
|
||||
10 - Open disk utility, and open piskel.new.dmg in it
|
||||
11 - Convert image, piskel-x.y.z.dmg
|
||||
12 - Upload to Dropbox
|
@ -1,16 +0,0 @@
|
||||
setlocal
|
||||
@echo off
|
||||
|
||||
pushd ..\..
|
||||
set PISKEL_HOME=%cd%
|
||||
popd
|
||||
|
||||
echo "Updating Piskel icon"
|
||||
|
||||
ResHacker -addoverwrite "%PISKEL_HOME%\dest\desktop\releases\windows\piskel.exe", "%PISKEL_HOME%\dest\desktop\releases\windows\piskel-release.exe", "%PISKEL_HOME%\src\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033
|
||||
|
||||
pause
|
||||
|
||||
explorer "%PISKEL_HOME%\dest\desktop\releases\windows"
|
||||
|
||||
endlocal
|
21
misc/scripts/copy-to-piskel-website.cmd
Normal file
@ -0,0 +1,21 @@
|
||||
@ECHO off
|
||||
|
||||
SETLOCAL
|
||||
|
||||
SET PISKEL_PATH="C:\Development\git\piskel"
|
||||
SET PISKELAPP_PATH="C:\Development\git\piskel-website"
|
||||
|
||||
ECHO "Copying files to piskelapp"
|
||||
XCOPY "%PISKEL_PATH%\dest" "%PISKELAPP_PATH%\static\editor" /e /i /h /y
|
||||
|
||||
ECHO "Delete previous partial"
|
||||
DEL "%PISKELAPP_PATH%\templates\editor\main-partial.html"
|
||||
ECHO "Copy new partial"
|
||||
MOVE "%PISKELAPP_PATH%\static\editor\piskelapp-partials\main-partial.html" "%PISKELAPP_PATH%\templates\editor"
|
||||
ECHO "Delete temp partial"
|
||||
RMDIR "%PISKELAPP_PATH%\static\editor\piskelapp-partials\" /S /Q
|
||||
|
||||
PAUSE
|
||||
explorer "%PISKELAPP_PATH%\"
|
||||
|
||||
ENDLOCAL
|
@ -6,40 +6,17 @@ SETLOCAL
|
||||
set PISKEL_HOME=%cd%
|
||||
POPD
|
||||
|
||||
set VBOX_PATH="C:\Program Files (x86)\Enigma Virtual Box"
|
||||
set RESOURCE_HACKER_PATH="C:\Program Files (x86)\Resource Hacker"
|
||||
|
||||
set APP_BIN="%PISKEL_HOME%\dest\desktop\cache\win\0.9.2"
|
||||
set MISC_FOLDER=%PISKEL_HOME%\misc
|
||||
set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop\releases
|
||||
set DEST_FOLDER=%RELEASES_FOLDER%\win
|
||||
|
||||
ECHO "Building Piskel executable for Windows ..."
|
||||
|
||||
ECHO "Creating release directory ..."
|
||||
MKDIR "%DEST_FOLDER%"
|
||||
ECHO "DONE"
|
||||
|
||||
ECHO "Packaging executable ..."
|
||||
COPY /b "%APP_BIN%\nw.exe"+"%RELEASES_FOLDER%\piskel\piskel.nw" "%DEST_FOLDER%\piskel-raw.exe"
|
||||
ECHO "DONE"
|
||||
|
||||
ECHO "COPYing dependencies ..."
|
||||
COPY "%APP_BIN%\*.dll" "%DEST_FOLDER%\"
|
||||
COPY "%APP_BIN%\nw.pak" "%DEST_FOLDER%\"
|
||||
ECHO "DONE"
|
||||
set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop
|
||||
set DEST_FOLDER=%RELEASES_FOLDER%\piskel\win32
|
||||
|
||||
ECHO "Updating Piskel icon -- Using Resource Hacker"
|
||||
%RESOURCE_HACKER_PATH%\ResHacker -addoverwrite "%DEST_FOLDER%\piskel-raw.exe", "%DEST_FOLDER%\piskel-exploded.exe", "%MISC_FOLDER%\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033
|
||||
DEL "%DEST_FOLDER%\piskel-raw.exe"
|
||||
%RESOURCE_HACKER_PATH%\ResHacker -addoverwrite "%DEST_FOLDER%\piskel.exe", "%DEST_FOLDER%\piskel-logo.exe", "%MISC_FOLDER%\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033
|
||||
DEL "%DEST_FOLDER%\piskel.exe"
|
||||
ECHO "DONE"
|
||||
|
||||
ECHO "Boxing application to single file -- Using Enigma Virtual Box"
|
||||
%VBOX_PATH%\enigmavbconsole "%MISC_FOLDER%\desktop\package-piskel.evb"
|
||||
DEL "%DEST_FOLDER%\*.dll"
|
||||
DEL "%DEST_FOLDER%\nw.pak"
|
||||
DEL "%DEST_FOLDER%\piskel-exploded.exe"
|
||||
ECHO "DONE"
|
||||
|
||||
PAUSE
|
||||
explorer "%DEST_FOLDER%\"
|
||||
|
47
misc/selenium-ide/change-colors.html
Normal file
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="selenium.base" href="http://localhost:9901/?debug" />
|
||||
<title>change-colors</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr><td rowspan="1" colspan="3">change-colors</td></tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/?debug</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=div.sp-preview-inner</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=input.sp-input</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>css=input.sp-input</td>
|
||||
<td>rgb(170, 187, 204)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>id=preview-list-scroller</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=div.swap-colors-icon</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
</body>
|
||||
</html>
|
52
misc/selenium-ide/change-size.html
Normal file
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="selenium.base" href="http://localhost:9901/?debug" />
|
||||
<title>change-size</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr><td rowspan="1" colspan="3">change-size</td></tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/?debug</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=div.tool-icon.resize-icon</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>name=resize-width</td>
|
||||
<td>64</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>name=resize-height</td>
|
||||
<td>64</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>name=resize-content-checkbox</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>//input[@value='Resize']</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>id=column-wrapper</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
</body>
|
||||
</html>
|
82
misc/selenium-ide/select-tools.html
Normal file
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="selenium.base" href="http://localhost:9901/?debug" />
|
||||
<title>Select tools</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr><td rowspan="1" colspan="3">Select tools</td></tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/?debug</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[2]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[3]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[4]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[5]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[6]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[7]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[8]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[9]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[10]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[11]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[12]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseDown</td>
|
||||
<td>//ul[@id='tools-container']/li[13]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
</body>
|
||||
</html>
|
92
misc/selenium-ide/user-preferences.html
Normal file
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="selenium.base" href="http://localhost:9901/?debug" />
|
||||
<title>user-preferences</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr><td rowspan="1" colspan="3">user-preferences</td></tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/?debug</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=div.tool-icon.gear-icon</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=div.background-picker.lowcont-medium-picker-background</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=div.background-picker.medium-picker-background</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=div.background-picker.light-picker-background</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=grid-width</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>select</td>
|
||||
<td>id=grid-width</td>
|
||||
<td>label=Enabled - 1px wide</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=option[value="1"]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>select</td>
|
||||
<td>id=grid-width</td>
|
||||
<td>label=Enabled - 2px wide</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=option[value="2"]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=grid-width</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>select</td>
|
||||
<td>id=grid-width</td>
|
||||
<td>label=Enabled - 3px wide</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=option[value="3"]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>select</td>
|
||||
<td>id=grid-width</td>
|
||||
<td>label=Enabled - 4px wide</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>css=option[value="4"]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
</body>
|
||||
</html>
|
35
package.json
@ -3,7 +3,7 @@
|
||||
"name": "piskel",
|
||||
"main": "./dest/index.html",
|
||||
"description": "Web based 2d animations editor",
|
||||
"version": "0.1.0",
|
||||
"version": "0.5.5-SNAPSHOT",
|
||||
"homepage": "http://github.com/juliandescottes/piskel",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -14,21 +14,28 @@
|
||||
"start": "nodewebkit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-contrib-clean": "0.5.0",
|
||||
"grunt-contrib-connect": "0.3.0",
|
||||
"grunt-contrib-concat": "0.1.2",
|
||||
"grunt-contrib-copy": "0.5.0",
|
||||
"grunt-contrib-jshint": "0.5.4",
|
||||
"grunt-contrib-uglify": "0.2.2",
|
||||
"dateformat": "^1.0.11",
|
||||
"grunt": "~0.4.5",
|
||||
"grunt-contrib-clean": "^0.6.0",
|
||||
"grunt-contrib-concat": "^0.5.1",
|
||||
"grunt-contrib-copy": "^0.8.0",
|
||||
"grunt-contrib-jshint": "^0.11.1",
|
||||
"grunt-contrib-uglify": "^0.9.1",
|
||||
"grunt-contrib-watch": "0.6.1",
|
||||
"grunt-express": "1.0",
|
||||
"grunt-ghost": "1.0.12",
|
||||
"grunt-express": "1.4.1",
|
||||
"grunt-ghost": "1.1.0",
|
||||
"grunt-jscs": "^1.6.0",
|
||||
"grunt-karma": "^0.10.1",
|
||||
"grunt-leading-indent": "^0.2.0",
|
||||
"grunt-node-webkit-builder": "^1.0.2",
|
||||
"grunt-open": "0.2.3",
|
||||
"grunt-leading-indent": "0.1.0",
|
||||
"grunt-closure-tools": "~0.8.3",
|
||||
"grunt-node-webkit-builder": "0.1.19",
|
||||
"nodewebkit": "0.8.4"
|
||||
"grunt-replace": "^0.8.0",
|
||||
"karma": "0.12.31",
|
||||
"karma-chrome-launcher": "^0.1.4",
|
||||
"karma-jasmine": "^0.3.5",
|
||||
"karma-phantomjs-launcher": "^0.1.4",
|
||||
"jasmine-core": "^2.1.0",
|
||||
"load-grunt-tasks": "^3.1.0"
|
||||
},
|
||||
"window": {
|
||||
"title": "Piskel",
|
||||
|
2
src/css/bootstrap/bootstrap.css
vendored
@ -36,7 +36,7 @@
|
||||
}
|
||||
.tooltip {
|
||||
position: absolute;
|
||||
z-index: 1030;
|
||||
z-index: 30000;
|
||||
display: block;
|
||||
visibility: visible;
|
||||
padding: 5px;
|
||||
|
@ -27,12 +27,10 @@
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
padding: 50px;
|
||||
top: 50px;
|
||||
right: 50px;
|
||||
bottom: 50px;
|
||||
left: 50px;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing : border-box;
|
||||
@ -53,11 +51,15 @@
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.cheatsheet-container h3 {
|
||||
.cheatsheet-container .cheatsheet-title {
|
||||
font-size:24px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.cheatsheet-container .cheatsheet-title:nth-of-type(2) {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.cheatsheet-section {
|
||||
float: left;
|
||||
width : 33%;
|
||||
|
105
src/css/color-picker-slider.css
Normal file
@ -0,0 +1,105 @@
|
||||
.color-picker-slider * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.color-picker-slider input[type="range"] {
|
||||
-webkit-appearance: none;
|
||||
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
||||
width: 100%;
|
||||
border: none;
|
||||
padding: 1px 2px;
|
||||
border-radius: 3px;
|
||||
background-image: linear-gradient(to right, hsl(0, 30%, 70%) 0, hsl(359, 30%, 70%) 100%);
|
||||
box-shadow: inset 0 1px 0 0 #0d0e0f, inset 0 -1px 0 0 #3a3d42;
|
||||
outline: none; /* no focus outline */
|
||||
}
|
||||
|
||||
/* thumb */
|
||||
|
||||
.color-picker-slider input[type="range"]::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
cursor:pointer;
|
||||
width: 7px;
|
||||
height: 18px;
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #529de1), color-stop(100%, #245e8f)); /* android <= 2.2 */
|
||||
background-image: -webkit-linear-gradient(top , #529de1 0, #245e8f 100%); /* older mobile safari and android > 2.2 */;
|
||||
background-image: linear-gradient(to bottom, #529de1 0, #245e8f 100%); /* W3C */
|
||||
}
|
||||
.color-picker-slider input[type="range"]::-moz-range-thumb {
|
||||
width: 7px;
|
||||
height: 18px;
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
background-image: linear-gradient(to bottom, #529de1 0, #245e8f 100%); /* W3C */
|
||||
}
|
||||
|
||||
.color-picker-slider input[type="range"]::-ms-thumb {
|
||||
width: 7px;
|
||||
height: 18px;
|
||||
border-radius: 2px;
|
||||
border: 0;
|
||||
background-image: linear-gradient(to bottom, #529de1 0, #245e8f 100%); /* W3C */
|
||||
}
|
||||
|
||||
/*CROSS BROWSER RESET*/
|
||||
|
||||
|
||||
.color-picker-slider input[type="range"]::-moz-range-track {
|
||||
border: inherit;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.color-picker-slider input[type="range"]::-ms-track {
|
||||
border: inherit;
|
||||
color: transparent; /* don't drawn vertical reference line */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.color-picker-slider input[type="range"]::-ms-fill-lower,
|
||||
.color-picker-slider input[type="range"]::-ms-fill-upper {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.color-picker-slider input[type="range"]::-ms-tooltip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.color-picker-slider,
|
||||
.color-picker-input {
|
||||
padding: 0 10px;
|
||||
height : 25px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.color-picker-slider span{
|
||||
line-height : 25px;
|
||||
width : 10px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.color-picker-slider input[type="range"]{
|
||||
float:left;
|
||||
height : 10px;
|
||||
width : 100px;
|
||||
margin: 7px 1px 7px 8px;
|
||||
}
|
||||
|
||||
.color-picker-slider input[type="text"]{
|
||||
float:left;
|
||||
width : 47px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.color-picker-input {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.color-picker-input .textfield{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.color-picker-slider input[type="range"][data-dimension="h"] {
|
||||
background-image:linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
|
||||
}
|
38
src/css/dialogs-browse-local.css
Normal file
@ -0,0 +1,38 @@
|
||||
|
||||
/************************************************************************************************/
|
||||
/* Browse local piskels panel */
|
||||
/************************************************************************************************/
|
||||
|
||||
.local-piskel-list {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.local-piskel-item {
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
.local-piskel-name {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.local-piskel-save-date {
|
||||
font-weight : normal;
|
||||
}
|
||||
|
||||
.local-piskel-list a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.local-piskel-list a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.local-piskel-list-head {
|
||||
font-weight: bold;
|
||||
color: gold;
|
||||
}
|
||||
|
||||
.local-piskel-load-button,
|
||||
.local-piskel-delete-button {
|
||||
width : 75px;
|
||||
}
|
169
src/css/dialogs-create-palette.css
Normal file
@ -0,0 +1,169 @@
|
||||
#dialog-container.create-palette {
|
||||
width: 500px;
|
||||
height: 600px;
|
||||
top : 50%;
|
||||
left : 50%;
|
||||
position : absolute;
|
||||
margin-left: -250px;
|
||||
}
|
||||
|
||||
.show #dialog-container.create-palette {
|
||||
margin-top: -300px;
|
||||
}
|
||||
|
||||
.create-palette-section {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 50px;
|
||||
}
|
||||
|
||||
.create-palette-import-section {
|
||||
display : inline-block;
|
||||
}
|
||||
|
||||
.colors-container {
|
||||
position: absolute;
|
||||
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
top: 85px;
|
||||
|
||||
height: 460px;
|
||||
|
||||
border: 1px solid black;
|
||||
background: #333;
|
||||
}
|
||||
|
||||
.color-picker-container {
|
||||
position:absolute;
|
||||
left : 280px;
|
||||
top:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
background: #222;
|
||||
}
|
||||
|
||||
.create-palette-actions {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
|
||||
width:100%;
|
||||
height: 45px;
|
||||
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
padding:10px;
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
.color-preview {
|
||||
width: 170px;
|
||||
height: 70px;
|
||||
margin: 11px;
|
||||
}
|
||||
|
||||
.colors-list {
|
||||
overflow: auto;
|
||||
width: 280px;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.create-palette-color, .create-palette-new-color, .colors-list-drop-proxy{
|
||||
position:relative;
|
||||
float : left;
|
||||
|
||||
width : 44px;
|
||||
height : 44px;
|
||||
margin : 10px 0 0 10px;
|
||||
|
||||
box-sizing : border-box;
|
||||
|
||||
cursor : pointer;
|
||||
}
|
||||
|
||||
@-moz-document url-prefix() {
|
||||
.create-palette-color, .create-palette-new-color, .colors-list-drop-proxy{
|
||||
margin : 7px 0 0 7px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
||||
.create-palette-color, .create-palette-new-color, .colors-list-drop-proxy{
|
||||
margin : 7px 0 0 7px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.create-palette-color {
|
||||
border:1px solid #2c2c2c;
|
||||
transition : border-color 0.2s;
|
||||
}
|
||||
.create-palette-color:hover {
|
||||
border:1px solid gold;
|
||||
}
|
||||
|
||||
.colors-list-drop-proxy {
|
||||
border:2px dotted #eee;
|
||||
}
|
||||
|
||||
.create-palette-new-color {
|
||||
border:2px dotted gold;
|
||||
|
||||
border-radius: 2px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
color: gold;
|
||||
}
|
||||
|
||||
.create-palette-color.selected {
|
||||
border:2px solid gold;
|
||||
}
|
||||
|
||||
.create-palette-remove-color {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 2px 4px 0 0;
|
||||
opacity : 0.2;
|
||||
|
||||
font-weight: bold;
|
||||
color: rgb(255,255,255);
|
||||
text-shadow : 0 0 1px rgb(0,0,0);
|
||||
|
||||
transition : opacity 0.3s, color 0.1s;
|
||||
}
|
||||
|
||||
.light-color .create-palette-remove-color {
|
||||
color: rgb(0,0,0);
|
||||
text-shadow : 0 0 1px rgb(255,255,255);
|
||||
}
|
||||
|
||||
.selected .create-palette-remove-color {
|
||||
top: -1px;
|
||||
right: -1px;
|
||||
}
|
||||
|
||||
.create-palette-color:hover .create-palette-remove-color {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.create-palette-color .create-palette-remove-color:hover {
|
||||
opacity: 1;
|
||||
color: rgb(240,80,80);
|
||||
text-shadow : 0 0 1px rgb(0,0,0);
|
||||
}
|
||||
|
||||
/*SPECTRUM OVERRIDES*/
|
||||
|
||||
.create-palette .sp-container{
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
box-shadow : none;
|
||||
border-radius:0;
|
||||
padding:5px;
|
||||
}
|
101
src/css/dialogs-import-image.css
Normal file
@ -0,0 +1,101 @@
|
||||
/************************************************************************************************/
|
||||
/* Import dialog */
|
||||
/************************************************************************************************/
|
||||
|
||||
#dialog-container.import-image {
|
||||
width: 550px;
|
||||
height: 360px;
|
||||
top : 50%;
|
||||
left : 50%;
|
||||
position : absolute;
|
||||
margin-left: -250px;
|
||||
}
|
||||
|
||||
.show #dialog-container.import-image {
|
||||
margin-top: -150px;
|
||||
}
|
||||
|
||||
.import-subsection {
|
||||
margin-left: 25px;
|
||||
}
|
||||
|
||||
.import-section:not(.import-subsection) > .dialog-section-title {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.import-section-preview-title {
|
||||
position: absolute;
|
||||
margin-left: 50%;
|
||||
margin-top: -28px;
|
||||
}
|
||||
|
||||
.import-section-preview {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
border: 1px dashed #999;
|
||||
border-radius: 3px;
|
||||
margin-left: 50%;
|
||||
}
|
||||
|
||||
.import-section-preview img {
|
||||
max-width: 220px;
|
||||
max-height: 220px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.import-section-preview.no-border {
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.import-section-preview canvas {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.dialog-section-title {
|
||||
display : inline-block;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.dialog-section-radio {
|
||||
margin-top: 15px;
|
||||
vertical-align: sub;
|
||||
}
|
||||
|
||||
.import-size-field:nth-of-type(2) {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.import-image-file-name {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
|
||||
width: 200px;
|
||||
vertical-align: middle;
|
||||
|
||||
word-break : break-all;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
text-shadow: none;
|
||||
color: gold;
|
||||
}
|
||||
|
||||
[name=smooth-resize-checkbox] {
|
||||
margin : 0 8px;
|
||||
}
|
||||
|
||||
.dialog-import-body {
|
||||
padding: 10px 20px;
|
||||
font-size:1.3em
|
||||
}
|
||||
|
||||
.import-button {
|
||||
font-size: 1em;
|
||||
height: 28px;
|
||||
padding: 0px 10px;
|
||||
margin-top: 15px;
|
||||
}
|
@ -1,222 +0,0 @@
|
||||
.palette-manager-wrapper {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.palette-manager-body {
|
||||
position: absolute;
|
||||
top: 45px;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.palette-manager-head {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
background: gold;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
color: black;
|
||||
font-size: 1.8em;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.palette-manager-close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
line-height: 45px;
|
||||
margin-right: 10px;
|
||||
font-size: 1.3em;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.palette-manager-drawer {
|
||||
width: 200px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.palette-manager-list {
|
||||
position: absolute;
|
||||
top:40px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.palette-manager-actions {
|
||||
position: absolute;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.palette-manager-actions-button {
|
||||
width: 80px;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.palette-manager-palette-button,
|
||||
.palette-manager-actions-button {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.palette-manager-list li {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
padding-left:10px;
|
||||
|
||||
font-size: 1.4em;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
|
||||
border-bottom: 1px solid #666;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.palette-manager-list li:hover {
|
||||
background : #222;
|
||||
}
|
||||
|
||||
.palette-manager-list li.selected {
|
||||
color : gold;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.palette-manager-list li:nth-child(1) {
|
||||
border-top: 1px solid #666;
|
||||
}
|
||||
|
||||
.palette-manager-details {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 200px;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
|
||||
border-left:1px solid #666;
|
||||
}
|
||||
|
||||
.palette-manager-details-head {
|
||||
position: absolute;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
width: 100%;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.palette-manager-details-head-name {
|
||||
padding: 0 10px 0 20px;
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.palette-manager-details-head .edit-icon {
|
||||
width: 24px;
|
||||
display: inline-block;
|
||||
background-size: 16px;
|
||||
}
|
||||
|
||||
.palette-manager-details-head-actions {
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.palette-manager-details-body {
|
||||
position: absolute;
|
||||
top:40px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.palette-manager-color-card {
|
||||
width: 120px;
|
||||
height: 180px;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
margin: 20px 0 20px 20px;
|
||||
box-shadow: 0 0 0px 0px gold;
|
||||
transition: box-shadow 0.3s;
|
||||
}
|
||||
|
||||
.palette-manager-color-card:hover {
|
||||
box-shadow: 0 0 4px 1px gold;
|
||||
}
|
||||
|
||||
.palette-manager-delete-card {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 20px;
|
||||
|
||||
text-align: center;
|
||||
font-size: 1.6em;
|
||||
font-weight: bold;
|
||||
color: rgb(255,255,255);
|
||||
text-shadow : 0 0 2px rgb(0,0,0);
|
||||
cursor: pointer;
|
||||
|
||||
opacity : 0.2;
|
||||
transition : opacity 0.3s, color 0.1s;
|
||||
}
|
||||
|
||||
.palette-manager-color-card:hover .palette-manager-delete-card {
|
||||
opacity : 0.6;
|
||||
}
|
||||
|
||||
.palette-manager-color-card .palette-manager-delete-card:hover {
|
||||
opacity : 1;
|
||||
color: rgb(240,80,80);
|
||||
}
|
||||
|
||||
.palette-manager-new-color .palette-manager-color-square {
|
||||
border: 3px dotted #888;
|
||||
border-bottom-width: 0;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
border-radius: 3px 3px 0 0;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
color: #888;
|
||||
line-height: 120px;
|
||||
}
|
||||
|
||||
.palette-manager-color-square {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
cursor: pointer;
|
||||
/*background-image:url(../img/tools/eyedropper.png);*/
|
||||
}
|
||||
|
||||
.palette-manager-color-details {
|
||||
color : #666;
|
||||
background: #eee;
|
||||
height: 60px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.palette-manager-color-details li{
|
||||
line-height: 20px;
|
||||
font-weight: bold;
|
||||
}
|
@ -17,16 +17,16 @@
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
|
||||
transition: opacity 0.5s;
|
||||
|
||||
|
||||
color: white;
|
||||
}
|
||||
|
||||
#dialog-container-wrapper.animated {
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
#dialog-container-wrapper.show {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
transition: opacity 0.5s;
|
||||
}
|
||||
|
||||
#dialog-container {
|
||||
@ -34,17 +34,59 @@
|
||||
height: 100%;
|
||||
|
||||
margin-top: -1500px;
|
||||
transition:margin-top 0.5s;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing : border-box;
|
||||
|
||||
border-radius: 3px;
|
||||
background: rgba(0,0,0,1);
|
||||
border : 3px solid gold;
|
||||
background: #444;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.animated #dialog-container {
|
||||
transition:margin-top 0.2s;
|
||||
}
|
||||
|
||||
.show #dialog-container {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#dialog-container.browse-local {
|
||||
width: 700px;
|
||||
height: 500px;
|
||||
top : 50%;
|
||||
left : 50%;
|
||||
position : absolute;
|
||||
margin-left: -350px;
|
||||
}
|
||||
|
||||
.show #dialog-container.browse-local {
|
||||
margin-top: -250px;
|
||||
}
|
||||
|
||||
.dialog-wrapper {
|
||||
height: 100%;
|
||||
position : relative;
|
||||
}
|
||||
|
||||
.dialog-head {
|
||||
width: 100%;
|
||||
background: gold;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
color: black;
|
||||
font-size: 1.8em;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.dialog-close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
line-height: 45px;
|
||||
margin-right: 10px;
|
||||
font-size: 1.3em;
|
||||
cursor: pointer;
|
||||
}
|
96
src/css/font-icon.css
Normal file
@ -0,0 +1,96 @@
|
||||
@font-face {
|
||||
font-family: 'piskel';
|
||||
src:url('fonts/icomoon.eot?-3olv93');
|
||||
src:url('fonts/icomoon.eot?#iefix-3olv93') format('embedded-opentype'),
|
||||
url('fonts/icomoon.woff?-3olv93') format('woff'),
|
||||
url('fonts/icomoon.ttf?-3olv93') format('truetype'),
|
||||
url('fonts/icomoon.svg?-3olv93#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
[class^="piskel-icon-"], [class*=" piskel-icon-"] {
|
||||
font-family: 'piskel';
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.piskel-icon-eye:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.piskel-icon-onion:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.piskel-icon-download:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
||||
.piskel-icon-rotateleft:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
||||
.piskel-icon-rotateright:before {
|
||||
content: "\e604";
|
||||
}
|
||||
|
||||
.piskel-icon-fliph:before {
|
||||
content: "\e605";
|
||||
}
|
||||
|
||||
.piskel-icon-flipv:before {
|
||||
content: "\e606";
|
||||
}
|
||||
|
||||
.piskel-icon-trashplain:before {
|
||||
content: "\e607";
|
||||
}
|
||||
|
||||
.piskel-icon-trash:before {
|
||||
content: "\e608";
|
||||
}
|
||||
|
||||
.piskel-icon-merge:before {
|
||||
content: "\e609";
|
||||
}
|
||||
|
||||
.piskel-icon-pencil:before {
|
||||
content: "\e610";
|
||||
}
|
||||
|
||||
.piskel-icon-close:before {
|
||||
content: "\e611";
|
||||
}
|
||||
|
||||
.piskel-icon-minus:before {
|
||||
content: "\e60a";
|
||||
}
|
||||
|
||||
.piskel-icon-plus:before {
|
||||
content: "\e60b";
|
||||
}
|
||||
|
||||
.piskel-icon-arrow-up-fat:before {
|
||||
content: "\e60c";
|
||||
}
|
||||
|
||||
.piskel-icon-arrow-down-fat:before {
|
||||
content: "\e60d";
|
||||
}
|
||||
|
||||
.piskel-icon-arrow-up-thin:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
|
||||
.piskel-icon-arrow-down-thin:before {
|
||||
content: "\e60f";
|
||||
}
|
BIN
src/css/fonts/icomoon.eot
Normal file
28
src/css/fonts/icomoon.svg
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="icomoon" horiz-adv-x="512">
|
||||
<font-face units-per-em="512" ascent="480" descent="-32" />
|
||||
<missing-glyph horiz-adv-x="512" />
|
||||
<glyph unicode=" " d="" horiz-adv-x="256" />
|
||||
<glyph unicode="" d="M256 192l128 128h-96v128h-64v-128h-96zM372.363 244.364l-35.87-35.871 130.040-48.493-210.533-78.509-210.533 78.509 130.040 48.493-35.871 35.871-139.636-52.364v-128l256-96 256 96v128z" />
|
||||
<glyph unicode="" d="M327.755 416.174l-24.759-21.971-1.481 8.030-14.159-4.099v-27.379l0.914-19.404 26.988 23.949c-0.347-4.934-0.51-10.141-0.166-15.921 0.543-9.151 3.055-17.374 8.057-23.811s11.74-10.557 19.211-13.967c14.942-6.822 33.56-18.012 56.377-36.978 43.203-35.907 48.548-53.828 56.334-85.404 7.412-41.045-4.368-70.606-21.368-95.68-12.144-17.918-27.179-33.815-60.225-40.518s-63.992-8.866-86.123-8.866v-22.304c23.555 0 55.469 2.195 90.553 9.313s69.693 18.531 90.832 40.649c22.885 23.941 44.76 67.328 31.672 135.162l-0.055 0.223c-5.829 27.055-23.529 67.689-92.729 97.775-28.624 12.445-44.153 20.477-55.829 25.809-5.837 2.666-9.197 6.119-11.030 8.475s-3.034 5.246-3.401 11.43c-0.827 13.918 1.198 24.507 3.318 31.505s3.904 9.702 3.904 9.702l-16.84 14.276zM303.444 372.291c0 0-16.082 4.204-16.082-1.173 0-29.786-0.407-35.048 9.808-56.095s23.399-42.701 43.302-61.078c37.637-34.753 34.591-40.033 40.837-57.911 2.3-6.582 3.27-21.87 1.673-33.875s-6.074-27.851-11.959-36.856c-9.25-14.152-16.702-28.62-34.395-38.447-18.488-10.269-34.432-12.486-49.265-12.486v-22.304c18.579 0 39.728 4.476 62.060 13.494s43.831 22.548 56.848 42.462c8.719 13.341 17.897 33.653 19.924 49.887s6.051 30.237-4.534 52.106c-16.294 33.661-37.961 43.77-64.413 66.162-16.375 13.863-31.099 30.183-40.029 48.578s-13.219 37.077-13.772 47.536zM300.488 357.961l-13.128-1.2c0.667-12.589 0-38.494 0-63.093 0-11.679 1.942-25.867 3.768-35.663 3.517-18.873 9.378-31.122 13.056-42.974 2.921-9.421 6.195-22.61 8.376-27.676 5.897-13.728 6.717-30.505 0.674-49.822-6.121-19.563-15.663-38.313-31.608-44.469l5.736-18.915c23.072 8.907 55.35 34.019 64.177 62.238 7.959 25.431 2.932 48.415-4.32 65.295-4.397 10.236-8.579 17.284-13.263 25.818-5.764 10.5-18.011 23.661-21.517 34.382-3.19 9.75-6.983 21.54-7.96 33.601-1.955 24.118-3.242 48.871-3.986 62.479zM248.405 416.148l24.758-21.971 1.481 8.029 14.159-4.099v-27.379l-0.914-19.403-26.988 23.949c0.347-4.933 0.51-10.141 0.166-15.92-0.543-9.152 0.548-18.276-4.452-24.711s-10.838-15.063-18.308-18.475c-14.942-6.823-32.661-18.010-55.476-36.978-43.203-35.907-42.239-45.718-50.025-77.294-2.905-41.947-5.284-41.359 4.244-70.447 5.757-17.579 19.97-34.716 53.016-50.429 30.453-14.481 76.609-26.889 98.737-26.889v-22.304c-23.555 0-55.469 2.195-90.553 9.309s-69.692 18.531-90.832 40.649c-22.885 23.94-44.76 67.329-31.671 135.162l0.055 0.223c5.829 27.055 23.529 67.689 92.731 97.775 28.623 12.445 44.153 20.477 55.826 25.808 5.839 2.665 9.197 6.119 11.034 8.474s3.034 5.246 3.401 11.43c0.827 13.918-1.198 24.507-3.318 31.505s-3.903 9.702-3.903 9.702l16.84 14.274zM281.987 374.814l8.031-11.395c-0.667-12.589 0-38.494 0-63.093 0-11.68 3.154-27.141 1.329-36.938-3.517-18.873-3.009-25.387-6.684-37.239-2.921-9.421-6.195-25.794-8.376-30.864-5.897-13.728-7.354-45.161-1.31-64.478 6.121-19.563 9.928-44.689 19.498-59.125l3.56-36.712c-21.161 28.662-42.512 61.597-51.342 89.814-7.958 25.431-7.393 70.082-0.139 86.961 4.398 10.236 8.578 20.472 13.263 29.004 5.764 10.5 9.043 20.958 11.649 32.578 2.245 10.010 6.192 26.31 7.168 38.372 1.955 24.121 2.604 49.509 3.351 63.117z" horiz-adv-x="576" />
|
||||
<glyph unicode="" d="M256 384c-111.659 0-208.441-65.021-256-160 47.559-94.979 144.341-160 256-160 111.657 0 208.439 65.021 256 160-47.558 94.979-144.343 160-256 160zM382.225 299.148c30.081-19.187 55.571-44.887 74.717-75.148-19.146-30.261-44.637-55.961-74.718-75.149-37.797-24.108-81.445-36.851-126.224-36.851-44.78 0-88.428 12.743-126.225 36.852-30.080 19.186-55.57 44.886-74.717 75.148 19.146 30.262 44.637 55.962 74.717 75.148 1.959 1.25 3.938 2.461 5.929 3.65-4.979-13.664-7.704-28.411-7.704-43.798 0-70.692 57.308-128 128-128s128 57.308 128 128c0 15.387-2.725 30.134-7.704 43.799 1.99-1.189 3.969-2.401 5.929-3.651zM256 275c0-26.51-21.49-48-48-48s-48 21.49-48 48 21.49 48 48 48 48-21.49 48-48z" />
|
||||
<glyph unicode="" d="M256 448c-70.692 0-134.688-28.66-181.016-74.989l-74.984 74.989v-192h192l-71.766 71.761c34.748 34.746 82.746 56.239 135.766 56.239 106.034 0 192-85.962 192-192 0-57.348-25.146-108.818-65.009-144l42.333-48c53.151 46.908 86.676 115.538 86.676 192 0 141.385-114.615 256-256 256z" />
|
||||
<glyph unicode="" d="M0 192c0-76.462 33.524-145.092 86.675-192l42.333 48c-39.863 35.182-65.008 86.652-65.008 144 0 106.038 85.965 192 192 192 53.021 0 101.019-21.493 135.765-56.239l-71.765-71.761h192v192l-74.985-74.989c-46.327 46.329-110.322 74.989-181.015 74.989-141.385 0-256-114.615-256-256z" />
|
||||
<glyph unicode="" d="M0 288h512v192zM512 0v192h-512z" />
|
||||
<glyph unicode="" d="M288 480v-512h192zM0-32h192v512z" />
|
||||
<glyph unicode="" d="M96-32h320l32 352h-384zM320 416v64h-128v-64h-160v-96l32 32h384l32-32v96h-160zM288 416h-64v32h64v-32z" />
|
||||
<glyph unicode="" d="M400 416h-288c-26.51 0-48-21.49-48-48v-16h384v16c0 26.51-21.49 48-48 48zM316.16 448l7.058-50.5h-134.436l7.057 50.5h120.321zM320 480h-128c-13.2 0-25.495-10.696-27.321-23.769l-9.357-66.962c-1.827-13.073 7.478-23.769 20.678-23.769h160c13.2 0 22.505 10.696 20.679 23.769l-9.357 66.962c-1.827 13.073-14.122 23.769-27.322 23.769v0zM408 320h-304c-17.6 0-30.696-14.341-29.103-31.869l26.206-288.263c1.593-17.527 17.297-31.868 34.897-31.868h240c17.6 0 33.304 14.341 34.897 31.868l26.205 288.263c1.594 17.528-11.502 31.869-29.102 31.869zM192 32h-48l-16 224h64v-224zM288 32h-64v224h64v-224zM368 32h-48v224h64l-16-224z" />
|
||||
<glyph unicode="" d="M448 224h-80l-112-112-112 112h-80l-64-128v-32h512v32l-64 128zM0 32h512v-32h-512v32zM288 320v128h-64v-128h-112l144-144 144 144h-112z" />
|
||||
<glyph unicode="" d="M0 272v-96c0-8.836 7.164-16 16-16h480c8.836 0 16 7.164 16 16v96c0 8.836-7.164 16-16 16h-480c-8.836 0-16-7.164-16-16z" />
|
||||
<glyph unicode="" d="M496 288h-176v176c0 8.836-7.164 16-16 16h-96c-8.836 0-16-7.164-16-16v-176h-176c-8.836 0-16-7.164-16-16v-96c0-8.836 7.164-16 16-16h176v-176c0-8.836 7.164-16 16-16h96c8.836 0 16 7.164 16 16v176h176c8.836 0 16 7.164 16 16v96c0 8.836-7.164 16-16 16z" />
|
||||
<glyph unicode="" d="M256.001 480l-256.001-256h160v-255.999l192-0.001v256h160z" />
|
||||
<glyph unicode="" d="M256-32l256 256h-160v255.999l-192 0.001v-256h-160z" />
|
||||
<glyph unicode="" d="M438.627 278.627l-160 160c-12.496 12.497-32.757 12.497-45.254 0l-160-160c-12.497-12.497-12.497-32.758 0-45.255 12.497-12.498 32.758-12.498 45.255 0l105.372 105.373v-306.745c0-17.673 14.327-32 32-32s32 14.327 32 32v306.745l105.373-105.373c6.248-6.248 14.438-9.372 22.627-9.372s16.379 3.124 22.627 9.373c12.497 12.497 12.497 32.757 0 45.254z" />
|
||||
<glyph unicode="" d="M73.373 169.373l160-160c12.496-12.497 32.758-12.497 45.255 0l160 160c12.496 12.497 12.496 32.758 0 45.255-12.497 12.497-32.758 12.497-45.255 0l-105.373-105.373v306.745c0 17.673-14.327 32-32 32s-32-14.327-32-32v-306.745l-105.373 105.373c-6.248 6.248-14.438 9.372-22.627 9.372s-16.379-3.124-22.627-9.372c-12.497-12.497-12.497-32.758 0-45.255z" />
|
||||
<glyph unicode="" d="M432 480c44.182 0 80-35.817 80-80 0-18.010-5.955-34.629-16-48l-32-32-112 112 32 32c13.371 10.045 29.989 16 48 16zM32 112l-32-144 144 32 296 296-112 112-296-296zM357.789 298.211l-224-224-27.578 27.578 224 224 27.578-27.578z" />
|
||||
<glyph unicode="" d="M507.331 68.67c-0.002 0.002-0.004 0.004-0.006 0.005l-155.322 155.325 155.322 155.325c0.002 0.002 0.004 0.003 0.006 0.005 1.672 1.673 2.881 3.627 3.656 5.708 2.123 5.688 0.912 12.341-3.662 16.915l-73.373 73.373c-4.574 4.573-11.225 5.783-16.914 3.66-2.080-0.775-4.035-1.984-5.709-3.655 0-0.002-0.002-0.003-0.004-0.005l-155.324-155.326-155.324 155.325c-0.002 0.002-0.003 0.003-0.005 0.005-1.673 1.671-3.627 2.88-5.707 3.655-5.69 2.124-12.341 0.913-16.915-3.66l-73.374-73.374c-4.574-4.574-5.784-11.226-3.661-16.914 0.776-2.080 1.985-4.036 3.656-5.708 0.002-0.001 0.003-0.003 0.005-0.005l155.325-155.324-155.325-155.326c-0.001-0.002-0.003-0.003-0.004-0.005-1.671-1.673-2.88-3.627-3.657-5.707-2.124-5.688-0.913-12.341 3.661-16.915l73.374-73.373c4.575-4.574 11.226-5.784 16.915-3.661 2.080 0.776 4.035 1.985 5.708 3.656 0.001 0.002 0.003 0.003 0.005 0.005l155.324 155.325 155.324-155.325c0.002-0.001 0.004-0.003 0.006-0.004 1.674-1.672 3.627-2.881 5.707-3.657 5.689-2.123 12.342-0.913 16.914 3.661l73.373 73.374c4.574 4.574 5.785 11.227 3.662 16.915-0.776 2.080-1.985 4.034-3.657 5.707z" />
|
||||
</font></defs></svg>
|
After Width: | Height: | Size: 8.6 KiB |
BIN
src/css/fonts/icomoon.ttf
Normal file
BIN
src/css/fonts/icomoon.woff
Normal file
BIN
src/css/fonts/piskel.eot
Normal file
13
src/css/fonts/piskel.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="icomoon" horiz-adv-x="512">
|
||||
<font-face units-per-em="512" ascent="480" descent="-32" />
|
||||
<missing-glyph horiz-adv-x="512" />
|
||||
<glyph unicode=" " d="" horiz-adv-x="256" />
|
||||
<glyph unicode="" d="M548.568 479.997c-230.956 1.035-548.568-255.999-548.568-255.999s288.019-255.998 548.568-255.998c229.744 0 548.568 255.999 548.568 255.999s-319.896 254.974-548.568 255.999zM543.082 398.397c100.382 0 181.713-81.33 181.713-181.713s-81.331-181.713-181.713-181.713c-100.382 0-181.827 81.331-181.827 181.713s81.445 181.713 181.827 181.713zM543.197 331.312c-65.289 0-118.285-52.996-118.285-118.285s52.996-118.171 118.285-118.171c65.289 0 118.17 52.882 118.17 118.171s-52.882 118.285-118.17 118.285z" horiz-adv-x="1097" />
|
||||
<glyph unicode="" d="M333.139 442.196l-28.111-24.945-1.682 9.117-16.077-4.654v-31.086l1.038-22.032 30.642 27.192c-0.394-5.602-0.579-11.514-0.189-18.076 0.616-10.389 3.469-19.727 9.148-27.036s13.329-11.986 21.812-15.858c16.965-7.745 38.105-20.45 64.012-41.986 49.053-40.769 55.122-61.117 63.962-96.969 8.416-46.603-4.959-80.166-24.261-108.637-13.789-20.344-30.859-38.395-68.38-46.004s-72.657-10.067-97.784-10.067v-25.324c26.745 0 62.98 2.493 102.815 10.574s79.13 21.041 103.132 46.154c25.984 27.183 50.821 76.445 35.96 153.464l-0.063 0.253c-6.619 30.719-26.716 76.854-105.285 111.015-32.5 14.131-50.132 23.25-63.389 29.304-6.628 3.027-10.442 6.947-12.524 9.622s-3.445 5.956-3.862 12.978c-0.939 15.803 1.36 27.825 3.767 35.771s4.432 11.015 4.432 11.015l-19.12 16.209zM305.535 392.371c0 0-18.259 4.773-18.259-1.332 0-33.82-0.462-39.793 11.136-63.691s26.568-48.483 49.166-69.349c42.733-39.459 39.275-45.454 46.367-65.753 2.611-7.473 3.713-24.832 1.899-38.462s-6.896-31.623-13.579-41.846c-10.502-16.069-18.963-32.495-39.053-43.653-20.991-11.659-39.094-14.177-55.936-14.177v-25.324c21.094 0 45.108 5.082 70.464 15.322s49.766 25.601 64.546 48.212c9.899 15.147 20.321 38.209 22.622 56.641s6.87 34.332-5.148 59.162c-18.5 38.219-43.101 49.697-73.135 75.121-18.592 15.74-35.31 34.27-45.45 55.156s-15.009 42.098-15.636 53.973zM302.18 376.1l-14.906-1.362c0.757-14.293 0-43.707 0-71.637 0-13.26 2.204-29.37 4.278-40.492 3.993-21.428 10.649-35.336 14.823-48.794 3.317-10.697 7.035-25.671 9.51-31.424 6.695-15.587 7.627-34.636 0.765-56.569-6.95-22.212-17.785-43.502-35.888-50.49l6.513-21.476c26.197 10.113 62.845 38.626 72.867 70.666 9.036 28.875 3.329 54.971-4.906 74.137-4.993 11.622-9.74 19.624-15.059 29.314-6.544 11.921-20.45 26.866-24.431 39.038-3.621 11.070-7.929 24.458-9.038 38.151-2.22 27.384-3.681 55.489-4.526 70.94zM243.043 442.167l28.111-24.945 1.682 9.117 16.077-4.654v-31.086l-1.038-22.031-30.642 27.192c0.394-5.601 0.579-11.514 0.189-18.076-0.616-10.391 0.623-20.75-5.055-28.057s-12.305-17.102-20.787-20.976c-16.965-7.747-37.083-20.449-62.988-41.986-49.053-40.769-47.959-51.909-56.799-87.761-3.299-47.627-5.999-46.959 4.819-79.986 6.537-19.959 22.674-39.417 60.195-57.258 34.577-16.442 86.982-30.531 112.107-30.531v-25.324c-26.745 0-62.98 2.493-102.815 10.57s-79.129 21.041-103.132 46.154c-25.983 27.182-50.821 76.447-35.959 153.464l0.063 0.253c6.618 30.719 26.715 76.854 105.288 111.015 32.499 14.131 50.131 23.25 63.386 29.302 6.629 3.026 10.442 6.948 12.528 9.622s3.445 5.956 3.862 12.978c0.939 15.803-1.36 27.825-3.767 35.771s-4.431 11.015-4.431 11.015l19.12 16.207zM281.173 395.236l9.119-12.938c-0.757-14.293 0-43.707 0-71.637 0-13.261 3.582-30.816 1.509-41.939-3.993-21.428-3.416-28.824-7.589-42.282-3.317-10.697-7.035-29.287-9.51-35.043-6.695-15.587-8.351-51.277-1.488-73.21 6.95-22.212 11.272-50.74 22.139-67.131l4.043-41.683c-24.026 32.543-48.269 69.938-58.294 101.975-9.036 28.875-8.394 79.572-0.158 98.736 4.993 11.622 9.74 23.244 15.059 32.931 6.544 11.922 10.268 23.796 13.227 36.99 2.548 11.365 7.031 29.873 8.139 43.568 2.22 27.387 2.957 56.213 3.804 71.663z" horiz-adv-x="576" />
|
||||
<glyph unicode="" d="M256 384c-111.659 0-208.441-65.021-256-160 47.559-94.979 144.341-160 256-160 111.657 0 208.439 65.021 256 160-47.558 94.979-144.343 160-256 160zM382.225 299.148c30.081-19.187 55.571-44.887 74.717-75.148-19.146-30.261-44.637-55.961-74.718-75.149-37.797-24.108-81.445-36.851-126.224-36.851-44.78 0-88.428 12.743-126.225 36.852-30.080 19.186-55.57 44.886-74.717 75.148 19.146 30.262 44.637 55.962 74.717 75.148 1.959 1.25 3.938 2.461 5.929 3.65-4.979-13.664-7.704-28.411-7.704-43.798 0-70.692 57.308-128 128-128s128 57.308 128 128c0 15.387-2.725 30.134-7.704 43.799 1.99-1.189 3.969-2.401 5.929-3.651zM256 275c0-26.51-21.49-48-48-48s-48 21.49-48 48 21.49 48 48 48 48-21.49 48-48z" />
|
||||
</font></defs></svg>
|
After Width: | Height: | Size: 4.7 KiB |
BIN
src/css/fonts/piskel.ttf
Normal file
BIN
src/css/fonts/piskel.woff
Normal file
@ -3,14 +3,15 @@
|
||||
}
|
||||
|
||||
.textfield {
|
||||
box-sizing:border-box;
|
||||
|
||||
background : black;
|
||||
border : 1px solid #888;
|
||||
border-radius : 2px;
|
||||
padding : 3px 10px;
|
||||
color : white;
|
||||
|
||||
box-sizing:border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
height: 23px;
|
||||
}
|
||||
|
||||
.textfield[disabled=disabled] {
|
||||
@ -22,8 +23,8 @@
|
||||
}
|
||||
|
||||
.button {
|
||||
height: 24px;
|
||||
box-sizing: border-box;
|
||||
height: 24px;
|
||||
|
||||
background-color: #3f3f3f;
|
||||
border: 1px solid #333;
|
||||
@ -34,7 +35,7 @@
|
||||
text-decoration: none;
|
||||
|
||||
color: white;
|
||||
text-shadow: 0px -1px 0 black;
|
||||
text-shadow: 0 -1px 0 black;
|
||||
font-weight: bold;
|
||||
font-size: 1rem;
|
||||
text-align: center;
|
||||
@ -56,7 +57,7 @@
|
||||
border-bottom-color: rgb(151, 133, 0);
|
||||
|
||||
color: black;
|
||||
text-shadow: 0px 1px 0 #fff;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
.button-primary:hover {
|
||||
@ -69,8 +70,16 @@
|
||||
cursor:default;
|
||||
background-color: #aaa;
|
||||
color: #777;
|
||||
text-shadow: 0px 1px 0 #bbb;
|
||||
text-shadow: 0 1px 0 #bbb;
|
||||
border-color: #666;
|
||||
border-top-color: #999;
|
||||
border-bottom-color: #555;
|
||||
}
|
||||
|
||||
.import-size-field,
|
||||
.resize-size-field,
|
||||
.export-size-field {
|
||||
width: 50px;
|
||||
margin-right: 8px;
|
||||
text-align: right;
|
||||
}
|
@ -23,8 +23,8 @@
|
||||
-o-transition: all 500ms ease-out;
|
||||
transition: all 500ms ease-out;
|
||||
|
||||
background-image: linear-gradient(45deg, rgba(0,0,0, 0.8) 25%, transparent 25%, transparent 75%, rgba(0,0,0, 0.8) 75%, rgba(0,0,0, 0.8)),
|
||||
linear-gradient(-45deg, rgba(0,0,0, 0.8) 25%, transparent 25%, transparent 75%, rgba(0,0,0, 0.8) 75%, rgba(0,0,0, 0.8));
|
||||
background-image: linear-gradient(45deg, #1D1D1D 20%, transparent 25%, transparent 75%, #1D1D1D 80%, #1D1D1D),
|
||||
linear-gradient(-45deg, #1D1D1D 20%, transparent 25%, transparent 75%, #1D1D1D 80%, #1D1D1D);
|
||||
background-size: 29px 45px;
|
||||
background-repeat: repeat-x;
|
||||
background-position-x: 3px;
|
||||
@ -96,6 +96,10 @@
|
||||
border: #999 3px solid;
|
||||
}
|
||||
|
||||
.tile-view {
|
||||
position : relative;
|
||||
}
|
||||
|
||||
.preview-tile .tile-overlay {
|
||||
z-index: 10;
|
||||
position: absolute;
|
@ -5,6 +5,20 @@
|
||||
background-position: 50%;
|
||||
}
|
||||
|
||||
.action-icon.edit-icon {
|
||||
.edit-icon {
|
||||
background-image: url('../img/tools/pen.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.merge-icon {
|
||||
background-image: url('../img/merge-icon.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.plus-icon {
|
||||
font-size:15px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.delete-icon {
|
||||
}
|
153
src/css/layout.css
Normal file
@ -0,0 +1,153 @@
|
||||
/**
|
||||
* Application layout
|
||||
*/
|
||||
|
||||
.main-wrapper {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 0;
|
||||
bottom: 5px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.column-wrapper {
|
||||
text-align: center;
|
||||
font-size: 0;
|
||||
position: absolute;
|
||||
left: 100px; /* Reserve room for tools on the left edge of the screen. */
|
||||
top: 0;
|
||||
right: 50px; /* Reserve room for actions on the right edge of the screen. */
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.column {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.left-column {
|
||||
vertical-align: top;
|
||||
height: 100%;
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.main-column {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.right-column {
|
||||
vertical-align: top;
|
||||
margin-left: 10px;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.drawing-canvas-container {
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.sticky-section {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.sticky-section .sticky-section-wrap {
|
||||
display: table;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sticky-section .vertical-centerer {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.left-sticky-section.sticky-section {
|
||||
left: 0;
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
.left-sticky-section .tool-icon {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.cursor-coordinates {
|
||||
color:#888;
|
||||
font-size:12px;
|
||||
font-weight:bold;
|
||||
font-family:Courier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Canvases layout
|
||||
*/
|
||||
|
||||
.canvas {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.canvas-container {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.canvas-container .canvas-background {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.light-picker-background,
|
||||
.light-canvas-background .canvas-background {
|
||||
background: url(../img/canvas_background/light_canvas_background.png) repeat;
|
||||
}
|
||||
|
||||
.medium-picker-background,
|
||||
.medium-canvas-background .canvas-background {
|
||||
background: url(../img/canvas_background/medium_canvas_background.png) repeat;
|
||||
}
|
||||
|
||||
.lowcont-medium-picker-background,
|
||||
.lowcont-medium-canvas-background .canvas-background {
|
||||
background: url(../img/canvas_background/lowcont_medium_canvas_background.png) repeat;
|
||||
}
|
||||
|
||||
.lowcont-dark-picker-background,
|
||||
.lowcont-dark-canvas-background .canvas-background {
|
||||
background: url(../img/canvas_background/lowcont_dark_canvas_background.png) repeat;
|
||||
}
|
||||
|
||||
.canvas.onion-skin-canvas {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.canvas.canvas-overlay,
|
||||
.canvas.layers-canvas,
|
||||
.canvas.onion-skin-canvas {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.tools-wrapper,
|
||||
.options-wrapper,
|
||||
.palette-wrapper {
|
||||
float : left;
|
||||
}
|
||||
|
||||
/**
|
||||
* Z-indexes should match the drawing area canvas superposition order :
|
||||
* - 1 : draw layers below current layer
|
||||
* - 2 : draw current layer
|
||||
* - 3 : draw layers above current layer
|
||||
* - 4 : draw the tools overlay
|
||||
*/
|
||||
.canvas.layers-below-canvas {z-index: 7;}
|
||||
.canvas.drawing-canvas {z-index: 8;}
|
||||
.canvas.canvas-overlay {z-index: 9;}
|
||||
.canvas.onion-skin-canvas {z-index: 10;}
|
||||
.canvas.layers-above-canvas {z-index: 11;}
|
74
src/css/notifications.css
Normal file
@ -0,0 +1,74 @@
|
||||
.user-message {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 10px 47px;
|
||||
max-width: 300px;
|
||||
|
||||
border-top-left-radius: 7px;
|
||||
border: #F0C36D 1px solid;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
|
||||
color: #222;
|
||||
background-color: #F9EDBE;
|
||||
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
|
||||
z-index: 30000;
|
||||
}
|
||||
|
||||
.user-message .close {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 17px;
|
||||
|
||||
color: gray;
|
||||
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.user-message .close:hover {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.progress-bar-container {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
padding: 10px;
|
||||
width: 360px;
|
||||
border-top-right-radius: 2px;
|
||||
border: gold 2px solid;
|
||||
border-left: 0;
|
||||
border-bottom: 0;
|
||||
background-color: #444;
|
||||
font-size: 14px;
|
||||
z-index: 30000;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.progress-bar-item {
|
||||
float: left;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
.progress-bar-status {
|
||||
line-height: 20px;
|
||||
width : 40px;
|
||||
overflow : hidden;
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
border : 1px solid grey;
|
||||
margin-top: 8px;
|
||||
height : 4px;
|
||||
width : 300px;
|
||||
background : linear-gradient(to left, gold, gold) no-repeat -300px 0;
|
||||
background-color : black;
|
||||
}
|
@ -3,7 +3,7 @@ html, body {
|
||||
margin : 0;
|
||||
overflow: hidden;
|
||||
cursor : default;
|
||||
font-family: arial;
|
||||
font-family: Arial;
|
||||
font-size: 11px;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
@ -19,6 +19,17 @@ ul, li {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
/** Firefox overrides this with -moz-use-system-font */
|
||||
button,
|
||||
input,
|
||||
input[type="submit"] {
|
||||
font-family: Arial;
|
||||
}
|
||||
|
||||
/* IE11 applies a big default margin for range inputs */
|
||||
input[type="range"] {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Force apparition of scrollbars on leopard */
|
||||
::-webkit-scrollbar {
|
||||
@ -33,4 +44,8 @@ ul, li {
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: rgba(50, 50, 50, 0.4);
|
||||
}
|
||||
|
||||
a, a:visited {
|
||||
color:gold;
|
||||
}
|
61
src/css/settings-application.css
Normal file
@ -0,0 +1,61 @@
|
||||
/*******************************/
|
||||
/* Application Setting panel */
|
||||
/*******************************/
|
||||
|
||||
.background-picker-wrapper {
|
||||
overflow: hidden;
|
||||
padding: 5px 5px 2px 5px;
|
||||
}
|
||||
|
||||
.background-picker {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
height: 35px;
|
||||
width: 35px;
|
||||
background-color: transparent;
|
||||
margin-right: 15px;
|
||||
padding: 1px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.background-picker:after {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
right: -2px;
|
||||
bottom: -2px;
|
||||
left: -2px;
|
||||
}
|
||||
|
||||
.background-picker:hover:after {
|
||||
border: #eee 1px solid;
|
||||
}
|
||||
|
||||
.background-picker.selected:after {
|
||||
border: gold 1px solid;
|
||||
}
|
||||
|
||||
.layer-opacity-input {
|
||||
margin: 5px;
|
||||
vertical-align: middle;
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
.layer-opacity-text {
|
||||
height: 31px;
|
||||
display: inline-block;
|
||||
line-height: 30px;
|
||||
width: 40px;
|
||||
border: 1px solid grey;
|
||||
box-sizing: border-box;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.grid-width-select {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.settings-section--application-general > .settings-item > label {
|
||||
display: block;
|
||||
}
|
@ -1,35 +1,46 @@
|
||||
|
||||
/*******************************/
|
||||
/* Gif/Png Export Setting panel*/
|
||||
/*******************************/
|
||||
.gif-upload-button,
|
||||
.gif-download-button,
|
||||
.gif-render-button {
|
||||
/*float : right;*/
|
||||
margin-top : 10px;
|
||||
margin-right : 10px;
|
||||
}
|
||||
|
||||
.gif-export-radio-group {
|
||||
margin:10px 0;
|
||||
}
|
||||
|
||||
.gif-export-preview,
|
||||
.png-export-preview {
|
||||
margin-top:20px;
|
||||
max-width:240px;
|
||||
position:relative;
|
||||
margin-top:10px;
|
||||
max-height:32px;
|
||||
}
|
||||
|
||||
.png-export-preview {
|
||||
margin:10px 0;
|
||||
overflow: hidden;
|
||||
.gif-export-preview {
|
||||
max-width:32px;
|
||||
}
|
||||
|
||||
.png-export-preview img {
|
||||
max-height:32px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.png-upload-status {
|
||||
margin : 10px 0;
|
||||
.png-export-preview .light-picker-background {
|
||||
max-width:240px;
|
||||
}
|
||||
|
||||
.gif-upload-status {
|
||||
width: 180px;
|
||||
margin-left: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.gif-upload,
|
||||
.png-export-preview {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.gif-upload-status,
|
||||
.gif-export-preview {
|
||||
float : left;
|
||||
}
|
||||
|
||||
.preview-upload-ongoing:before{
|
||||
@ -44,4 +55,25 @@
|
||||
-moz-box-sizing:border-box;
|
||||
background: rgba(0,0,0,0.5);
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.scaling-factor {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.scaling-factor-input {
|
||||
margin: 5px;
|
||||
vertical-align: middle;
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
.scaling-factor-text {
|
||||
height: 31px;
|
||||
display: inline-block;
|
||||
line-height: 30px;
|
||||
width: 40px;
|
||||
border: 1px solid grey;
|
||||
box-sizing: border-box;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
18
src/css/settings-import.css
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/************************************************************************************************/
|
||||
/* Import panel */
|
||||
/************************************************************************************************/
|
||||
|
||||
.import-section,
|
||||
.resize-section {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.file-input-button {
|
||||
margin-right: 8px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.import-highlight {
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
103
src/css/settings-resize.css
Normal file
@ -0,0 +1,103 @@
|
||||
.resize-section-title {
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
padding-top: 5px;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
/*****************/
|
||||
/* ANCHOR WIDGET */
|
||||
/*****************/
|
||||
|
||||
.resize-origin-container {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 70px;
|
||||
margin-top: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.transition .resize-origin-option,
|
||||
.transition .resize-origin-option:before {
|
||||
transition: background-color 0.2s, border-color 0.2s;
|
||||
}
|
||||
|
||||
.resize-origin-option {
|
||||
float: left;
|
||||
position: relative;
|
||||
|
||||
box-sizing: border-box;
|
||||
margin: 0 1px 1px 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
|
||||
background : #888;
|
||||
|
||||
font-size: 8px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.disabled .resize-origin-option {
|
||||
cursor: default;
|
||||
background : #555;
|
||||
border-color: #555 !important;
|
||||
}
|
||||
|
||||
.resize-origin-option.selected {
|
||||
border : 3px solid gold;
|
||||
}
|
||||
|
||||
.resize-origin-option:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin: -2px;
|
||||
}
|
||||
|
||||
.resize-origin-option.selected:before {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: gold;
|
||||
}
|
||||
|
||||
.disabled .resize-origin-option.selected:before {
|
||||
background: #555;
|
||||
}
|
||||
|
||||
.disabled .resize-origin-option[data-neighbor]:before {
|
||||
border-color: #555 !important;
|
||||
}
|
||||
|
||||
.resize-origin-option[data-neighbor]:before {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-width: 4px;
|
||||
border-style: solid;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.resize-origin-option[data-neighbor="bottom"]:before {
|
||||
border-top-color: gold;
|
||||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.resize-origin-option[data-neighbor="left"]:before {
|
||||
border-right-color: gold;
|
||||
margin-top: -4px;
|
||||
margin-left: -6px;
|
||||
}
|
||||
|
||||
.resize-origin-option[data-neighbor="top"]:before {
|
||||
border-bottom-color: gold;
|
||||
margin-top: -6px;
|
||||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.resize-origin-option[data-neighbor="right"]:before {
|
||||
border-left-color: gold;
|
||||
margin-top: -4px;
|
||||
}
|
26
src/css/settings-save.css
Normal file
@ -0,0 +1,26 @@
|
||||
.save-field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.save-status {
|
||||
margin-top: 10px;
|
||||
margin-bottom: -10px;
|
||||
vertical-align: middle;
|
||||
font-weight: normal;
|
||||
text-shadow: none;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.save-file-name {
|
||||
white-space: nowrap;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.save-desktop-file-name {
|
||||
word-wrap: break-word;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
font-style: normal;
|
||||
}
|
@ -49,9 +49,9 @@
|
||||
background-size: 32px 32px;
|
||||
}
|
||||
|
||||
.tool-icon.upload-cloud-icon {
|
||||
background-image: url(../img/cloud_export.png);
|
||||
background-position: 4px 0px;
|
||||
.tool-icon.export-icon {
|
||||
background-image: url(../img/export.png);
|
||||
background-position: 7px 5px;
|
||||
background-size: 36px 36px;
|
||||
position: relative;
|
||||
}
|
||||
@ -70,7 +70,7 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.upload-cloud-icon .label {
|
||||
.tool-icon .label {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 4px;
|
||||
@ -121,16 +121,17 @@
|
||||
}
|
||||
|
||||
.settings-title {
|
||||
color : gold;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
text-transform: uppercase;
|
||||
border-bottom: 1px #aaa solid;
|
||||
padding-bottom: 5px;
|
||||
color: gold;
|
||||
}
|
||||
|
||||
.settings-description {
|
||||
margin : 0 0 10px 0;
|
||||
display : inline-block;
|
||||
}
|
||||
|
||||
.settings-form-section {
|
||||
@ -141,213 +142,6 @@
|
||||
margin : 10px 0;
|
||||
}
|
||||
|
||||
/************************************************************************************************/
|
||||
/* Application settings */
|
||||
/************************************************************************************************/
|
||||
|
||||
.background-picker-wrapper {
|
||||
overflow: hidden;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.background-picker {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
height: 35px;
|
||||
width: 35px;
|
||||
background-color: transparent;
|
||||
margin-right: 15px;
|
||||
padding: 1px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.background-picker:after {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
right: -2px;
|
||||
bottom: -2px;
|
||||
left: -2px;
|
||||
}
|
||||
|
||||
.background-picker:hover:after {
|
||||
border: #eee 1px solid;
|
||||
}
|
||||
|
||||
.background-picker.selected:after {
|
||||
border: gold 1px solid;
|
||||
}
|
||||
|
||||
/************************************************************************************************/
|
||||
/* Gif/Png Export panel */
|
||||
/************************************************************************************************/
|
||||
|
||||
.gif-upload-button,
|
||||
.gif-render-button {
|
||||
margin-top : 10px;
|
||||
margin-right : 10px;
|
||||
}
|
||||
|
||||
.gif-export-radio-group {
|
||||
margin:10px 0;
|
||||
}
|
||||
|
||||
.gif-export-progress-status {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.gif-export-progress-bar {
|
||||
margin-top:5px;
|
||||
height:3px;
|
||||
width: 0;
|
||||
background:gold;
|
||||
}
|
||||
|
||||
.gif-export-preview,
|
||||
.png-export-preview {
|
||||
margin-top:20px;
|
||||
max-width:240px;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.png-export-preview {
|
||||
margin:10px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.png-export-preview img {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.png-upload-status {
|
||||
margin : 10px 0;
|
||||
}
|
||||
|
||||
.preview-upload-ongoing:before{
|
||||
content: "Upload ongoing ...";
|
||||
position: absolute;
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding-top: 45%;
|
||||
box-sizing:border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
background: rgba(0,0,0,0.5);
|
||||
color: white;
|
||||
}
|
||||
|
||||
/************************************************************************************************/
|
||||
/* Import panel */
|
||||
/************************************************************************************************/
|
||||
|
||||
.import-section,
|
||||
.resize-section {
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.import-section-title {
|
||||
display : inline-block;
|
||||
}
|
||||
|
||||
.import-section-title-small {
|
||||
width: 35px;
|
||||
}
|
||||
|
||||
.import-section-disabled {
|
||||
color : #888;
|
||||
}
|
||||
|
||||
.import-section-preview {
|
||||
display : inline-block;
|
||||
height : 60px;
|
||||
width: 60px;
|
||||
border : 1px dashed #999;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.import-size-field,
|
||||
.resize-size-field {
|
||||
width: 50px;
|
||||
margin-right: 8px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.import-size-field:nth-of-type(2),
|
||||
.resize-size-field:nth-of-type(2) {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.file-input-button {
|
||||
margin-right: 8px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.file-input-status {
|
||||
display: inline-block;
|
||||
width: 130px;
|
||||
overflow: hidden;
|
||||
|
||||
height: 1.5rem;
|
||||
word-break : break-all;
|
||||
vertical-align: middle;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.save-field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#save-status {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.status {
|
||||
height: 1.5rem;
|
||||
vertical-align: middle;
|
||||
font-weight: normal;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
[name=smooth-resize-checkbox] {
|
||||
margin : 0 8px;
|
||||
}
|
||||
|
||||
[name*=checkbox] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************************************/
|
||||
/* Browse local piskels panel */
|
||||
/************************************************************************************************/
|
||||
|
||||
.local-piskels-list {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.local-piskel-item {
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
.local-piskel-name {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.local-piskel-save-date {
|
||||
font-weight : normal;
|
||||
}
|
||||
|
||||
.local-piskels-list a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.local-piskels-list a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.local-piskel-load-link {
|
||||
color : gold;
|
||||
}
|
||||
.local-piskel-delete-link {
|
||||
color : red;
|
||||
}
|
@ -1,9 +1,5 @@
|
||||
body {
|
||||
background: radial-gradient(circle, #000, #373737);
|
||||
/* 16/06/2013 : -webkit still needed for
|
||||
safari, safari mobile and android browser and chrome for android
|
||||
cf http://caniuse.com/css-gradients */
|
||||
background: -webkit-radial-gradient(circle, #000, #373737);
|
||||
background: #1D1D1D;
|
||||
}
|
||||
|
||||
/* Browser fixes */
|
||||
@ -20,235 +16,10 @@ body {
|
||||
user-select: initial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Application layout
|
||||
*/
|
||||
|
||||
.main-wrapper {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 0;
|
||||
bottom: 5px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.column-wrapper {
|
||||
text-align: center;
|
||||
font-size: 0;
|
||||
position: absolute;
|
||||
left: 100px; /* Reserve room for tools on the left edge of the screen. */
|
||||
top: 0;
|
||||
right: 50px; /* Reserve room for actions on the right edge of the screen. */
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.column {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.left-column {
|
||||
vertical-align: top;
|
||||
height: 100%;
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.main-column {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.right-column {
|
||||
vertical-align: top;
|
||||
margin-left: 10px;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.drawing-canvas-container {
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.sticky-section {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.sticky-section .sticky-section-wrap {
|
||||
display: table;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sticky-section .vertical-centerer {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.left-sticky-section.sticky-section {
|
||||
left: 0;
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
.left-sticky-section .tool-icon {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/**
|
||||
* Canvases layout
|
||||
*/
|
||||
|
||||
.canvas {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.canvas-container {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.canvas-container .canvas-background {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.light-picker-background,
|
||||
.light-canvas-background .canvas-background {
|
||||
background: url(../img/canvas_background/light_canvas_background.png) repeat;
|
||||
}
|
||||
|
||||
.medium-picker-background,
|
||||
.medium-canvas-background .canvas-background {
|
||||
background: url(../img/canvas_background/medium_canvas_background.png) repeat;
|
||||
}
|
||||
|
||||
.lowcont-medium-picker-background,
|
||||
.lowcont-medium-canvas-background .canvas-background {
|
||||
background: url(../img/canvas_background/lowcont_medium_canvas_background.png) repeat;
|
||||
}
|
||||
|
||||
.lowcont-dark-picker-background,
|
||||
.lowcont-dark-canvas-background .canvas-background {
|
||||
background: url(../img/canvas_background/lowcont_dark_canvas_background.png) repeat;
|
||||
}
|
||||
|
||||
.layers-canvas,
|
||||
.canvas.onion-skin-canvas {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.canvas.canvas-overlay,
|
||||
.canvas.layers-canvas,
|
||||
.canvas.onion-skin-canvas {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Z-indexes should match the drawing area canvas superposition order :
|
||||
* - 1 : draw layers below current layer
|
||||
* - 2 : draw current layer
|
||||
* - 3 : draw layers above current layer
|
||||
* - 4 : draw the tools overlay
|
||||
*/
|
||||
.canvas.layers-below-canvas {z-index: 7;}
|
||||
.canvas.drawing-canvas {z-index: 8;}
|
||||
.canvas.layers-above-canvas {z-index: 9;}
|
||||
.canvas.onion-skin-canvas {z-index: 10;}
|
||||
.canvas.canvas-overlay {z-index: 11;}
|
||||
|
||||
/**
|
||||
* Animated preview styles.
|
||||
*/
|
||||
|
||||
.preview-container {
|
||||
border : 0px Solid black;
|
||||
border-radius:5px 0px 0px 5px;
|
||||
box-shadow : 0px 0px 2px rgba(0,0,0,0.2);
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.preview-container .canvas-container {
|
||||
.no-overflow {
|
||||
overflow : hidden;
|
||||
}
|
||||
|
||||
.preview-container canvas {
|
||||
border : 0px Solid transparent;
|
||||
}
|
||||
|
||||
#animated-preview-container {
|
||||
background: #333;
|
||||
border-radius : 0 0 2px 2px;
|
||||
overflow : hidden;
|
||||
}
|
||||
|
||||
#animated-preview-canvas-container {
|
||||
height :200px;
|
||||
width : 200px;
|
||||
}
|
||||
|
||||
.tiled-frame-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
background-repeat : repeat;
|
||||
}
|
||||
|
||||
.display-fps {
|
||||
float: left;
|
||||
color: #aaa;
|
||||
font-size: 12px;
|
||||
min-width: 55px;
|
||||
vertical-align: bottom;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.range-fps {
|
||||
overflow: hidden;
|
||||
width: 120px;
|
||||
height : 24px;
|
||||
margin : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* User messages
|
||||
*/
|
||||
.user-message {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #F9EDBE;
|
||||
padding: 10px 47px;
|
||||
border-top-left-radius: 7px;
|
||||
color: #222;
|
||||
border: #F0C36D 1px solid;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
z-index: 30000;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.user-message .close {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 17px;
|
||||
color: gray;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.user-message .close:hover {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.image-link {
|
||||
color : gold;
|
||||
}
|
||||
@ -276,9 +47,42 @@ body {
|
||||
left:0;
|
||||
}
|
||||
|
||||
.cursor-coordinates {
|
||||
color:#888;
|
||||
font-size:12px;
|
||||
font-weight:bold;
|
||||
font-family:Courier;
|
||||
.uppercase {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.checkbox-fix {
|
||||
vertical-align: -2px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* TOOLTIPS
|
||||
*/
|
||||
.tooltip-shortcut {
|
||||
color:gold;
|
||||
}
|
||||
|
||||
.tooltip-container {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.tooltip-descriptor {
|
||||
color:#999;
|
||||
}
|
||||
|
||||
.tooltip-descriptor:last-child {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.tooltip-descriptor-button {
|
||||
padding: 2px;
|
||||
border: 1px Solid #999;
|
||||
font-size: 0.8em;
|
||||
margin-right: 5px;
|
||||
width: 35px;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
display: inline-block;
|
||||
line-height: 10px;
|
||||
}
|
135
src/css/toolbox-animated-preview.css
Normal file
@ -0,0 +1,135 @@
|
||||
/**
|
||||
* Animated preview styles.
|
||||
*/
|
||||
|
||||
.preview-container {
|
||||
border : 0 Solid black;
|
||||
border-radius:5px 0 0 5px;
|
||||
box-shadow : 0 0 2px rgba(0,0,0,0.2);
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.preview-container .canvas-container {
|
||||
overflow : hidden;
|
||||
}
|
||||
|
||||
.preview-container canvas {
|
||||
border : 0 Solid transparent;
|
||||
}
|
||||
|
||||
.canvas-container .animated-preview-canvas-background {
|
||||
position : relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#animated-preview-container {
|
||||
background: #333;
|
||||
border-radius : 0 0 2px 2px;
|
||||
overflow : hidden;
|
||||
}
|
||||
|
||||
.canvas-container-wrapper {
|
||||
height :200px;
|
||||
width : 200px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.preview-container .background-image-frame-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.display-fps {
|
||||
float: left;
|
||||
color: #aaa;
|
||||
font-size: 12px;
|
||||
min-width: 55px;
|
||||
vertical-align: bottom;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.range-fps {
|
||||
overflow: hidden;
|
||||
width: 100px;
|
||||
height : 26px;
|
||||
margin : 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.preview-toggle-onion-skin {
|
||||
font-size: 2rem;
|
||||
color: #aaa;
|
||||
float: left;
|
||||
line-height: 26px;
|
||||
height: 100%;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-right: 1px solid #222;
|
||||
transition: 0.2s linear;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.preview-toggle-onion-skin:hover {
|
||||
color : white;
|
||||
}
|
||||
|
||||
.preview-toggle-onion-skin-enabled,
|
||||
.preview-toggle-onion-skin-enabled:hover {
|
||||
color : gold;
|
||||
}
|
||||
|
||||
.preview-contextual-actions {
|
||||
position : absolute;
|
||||
z-index: 500;
|
||||
right : 10px;
|
||||
top : 10px;
|
||||
|
||||
cursor : pointer;
|
||||
|
||||
opacity: 0;
|
||||
transition: 0.3s opacity, 0.3s border-color;
|
||||
}
|
||||
|
||||
.minimap-container:hover .preview-contextual-actions {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.original-size-button {
|
||||
width : 18px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
margin: 0 5px;
|
||||
|
||||
border: 2px solid white;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
color: white;
|
||||
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
font-family: Tahoma;
|
||||
}
|
||||
|
||||
.original-size-button-enabled {
|
||||
color: gold;
|
||||
border-color: gold;
|
||||
}
|
||||
|
||||
.preview-contextual-action {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.open-popup-preview-button {
|
||||
width : 18px;
|
||||
height: 18px;
|
||||
|
||||
border : 2px solid white;
|
||||
background-image: url(../img/popup-preview-arrow-white.png);
|
||||
background-color : rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.open-popup-preview-button:hover {
|
||||
border-color: gold;
|
||||
background-image: url(../img/popup-preview-arrow-gold.png);
|
||||
}
|
@ -5,11 +5,36 @@
|
||||
.layers-list-container {
|
||||
}
|
||||
|
||||
.layers-title {
|
||||
/*.layers-title {
|
||||
background-image: url('../img/layers.svg');
|
||||
background-size: 22px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 97%;
|
||||
}*/
|
||||
|
||||
.layers-title {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.layers-toggle-preview {
|
||||
position: absolute;
|
||||
top: 0.3em;
|
||||
right: 0.5em;
|
||||
|
||||
color: #999;
|
||||
font-size: 1.3em;
|
||||
cursor: pointer;
|
||||
|
||||
transition: 0.2s linear;
|
||||
}
|
||||
|
||||
.layers-toggle-preview:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.layers-toggle-preview-enabled,
|
||||
.layers-toggle-preview-enabled:hover {
|
||||
color : gold;
|
||||
}
|
||||
|
||||
.layers-list {
|
||||
@ -24,22 +49,6 @@
|
||||
cursor : pointer;
|
||||
}
|
||||
|
||||
.layer-item .edit-icon {
|
||||
float: right;
|
||||
width: 30px;
|
||||
background-size: 12px;
|
||||
opacity: 0;
|
||||
transition : opacity 0.2s;
|
||||
}
|
||||
|
||||
.layer-item:hover .edit-icon {
|
||||
opacity : 0.6;
|
||||
}
|
||||
|
||||
.layer-item:hover .edit-icon:hover {
|
||||
opacity : 1;
|
||||
}
|
||||
|
||||
.layer-item:hover {
|
||||
background : #222;
|
||||
}
|
||||
@ -50,7 +59,21 @@
|
||||
color: gold;
|
||||
}
|
||||
|
||||
.layers-button-arrow {
|
||||
font-family : 'Lucida Grande', Calibri;
|
||||
padding : 2px 6px 0 6px;
|
||||
.layers-button-container {
|
||||
overflow : hidden;
|
||||
}
|
||||
|
||||
.layers-button {
|
||||
margin: 0;
|
||||
width: 16.66667%;
|
||||
float : left;
|
||||
}
|
||||
|
||||
/* @override */
|
||||
.layers-button-container .layers-button {
|
||||
border-left-width: 0;
|
||||
}
|
||||
|
||||
.layers-button:last-child {
|
||||
border-right-width: 0;
|
||||
}
|
@ -1,63 +1,152 @@
|
||||
.palettes-list-select {
|
||||
float:right;
|
||||
max-width:90px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.palettes-title {
|
||||
background-size: 22px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 97%;
|
||||
background-size: 22px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 97%;
|
||||
}
|
||||
|
||||
.palettes-list-colors {
|
||||
overflow: auto;
|
||||
max-height: 160px;
|
||||
overflow: auto;
|
||||
max-height: 160px;
|
||||
}
|
||||
.palettes-list-color {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
margin: 0 0 5px 5px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.palettes-list-color {
|
||||
cursor : pointer;
|
||||
float: left;
|
||||
margin : 0 0 5px 5px;
|
||||
width : 32px;
|
||||
height : 32px;
|
||||
position: relative;
|
||||
.palettes-list-color:nth-child(-n+10):after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
||||
background-color: black;
|
||||
color: gold;
|
||||
|
||||
font-family: Tahoma;
|
||||
font-size: 0.5em;
|
||||
font-weight: bold;
|
||||
|
||||
padding: 2px 3px 2px 3px;
|
||||
border-radius: 0 0 0 2px;
|
||||
}
|
||||
|
||||
|
||||
.palettes-list-color:nth-child(1):after {
|
||||
content: "1";
|
||||
}
|
||||
.palettes-list-color:nth-child(2):after {
|
||||
content: "2";
|
||||
}
|
||||
.palettes-list-color:nth-child(3):after {
|
||||
content: "3";
|
||||
}
|
||||
.palettes-list-color:nth-child(4):after {
|
||||
content: "4";
|
||||
}
|
||||
.palettes-list-color:nth-child(5):after {
|
||||
content: "5";
|
||||
}
|
||||
.palettes-list-color:nth-child(6):after {
|
||||
content: "6";
|
||||
}
|
||||
.palettes-list-color:nth-child(7):after {
|
||||
content: "7";
|
||||
}
|
||||
.palettes-list-color:nth-child(8):after {
|
||||
content: "8";
|
||||
}
|
||||
.palettes-list-color:nth-child(9):after {
|
||||
content: "9";
|
||||
}
|
||||
|
||||
.palettes-list-color:nth-child(-n+5) {
|
||||
margin-top: 5px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.palettes-list-color div{
|
||||
width : 32px;
|
||||
height : 32px;
|
||||
.palettes-list-color div {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.palettes-list-has-scrollbar .palettes-list-color,
|
||||
.palettes-list-has-scrollbar .palettes-list-color div{
|
||||
width: 29px
|
||||
.palettes-list-has-scrollbar .palettes-list-color, .palettes-list-has-scrollbar .palettes-list-color div {
|
||||
width: 29px
|
||||
}
|
||||
|
||||
.palettes-list-primary-color:before,
|
||||
.palettes-list-secondary-color:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 1px;
|
||||
display: inline-block;
|
||||
border: 7px solid gold;
|
||||
border-top-color: transparent;
|
||||
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
.palettes-list-primary-color:before, .palettes-list-secondary-color:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 1px;
|
||||
display: inline-block;
|
||||
border: 7px solid gold;
|
||||
border-top-color: transparent;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
.palettes-list-primary-color:before {
|
||||
left: 1px;
|
||||
border-right-color: transparent;
|
||||
left: 1px;
|
||||
border-right-color: transparent;
|
||||
}
|
||||
.palettes-list-secondary-color:before {
|
||||
right: 1px;
|
||||
border-left-color: transparent;
|
||||
}
|
||||
.palettes-list-actions {
|
||||
background-color: #3f3f3f;
|
||||
border-bottom-color: #222;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.palettes-list-button,
|
||||
.palettes-list-select {
|
||||
margin: 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.palettes-list-secondary-color:before {
|
||||
right: 1px;
|
||||
border-left-color: transparent;
|
||||
}
|
||||
.palettes-list-button {
|
||||
width: 16.66667%;
|
||||
}
|
||||
.palettes-list-select {
|
||||
width: 66.66667%;
|
||||
height: 100%;
|
||||
padding: 0 5px 0 5px;
|
||||
|
||||
border-style: solid;
|
||||
border-width: 1px 0 1px 0;
|
||||
|
||||
color: #aaa;
|
||||
font-size : 0.75em;
|
||||
|
||||
/*thanks firefox, you suck*/
|
||||
text-align:left;
|
||||
/*text-shadow:none;*/
|
||||
font-weight: normal;
|
||||
|
||||
transition : background-color 0.3s, color 0.3s;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.palettes-list-select:hover {
|
||||
color: white;
|
||||
background-color: #484848;
|
||||
}
|
||||
|
||||
.palettes-list-select:focus {
|
||||
background-color: #484848;
|
||||
color: white;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.palettes-list-actions .edit-icon {
|
||||
background-size: 15px;
|
||||
background-position: 50%;
|
||||
}
|
||||
.palettes-list-no-colors {
|
||||
height: 42px;
|
||||
width: 100%;
|
||||
color: grey;
|
||||
font-size: 0.7em;
|
||||
font-style: italic;
|
||||
line-height: 42px;
|
||||
text-align: center
|
||||
}
|
||||
|
@ -14,23 +14,4 @@
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
background: #222;
|
||||
}
|
||||
|
||||
.toolbox-button-container {
|
||||
overflow : hidden;
|
||||
}
|
||||
|
||||
.toolbox-button {
|
||||
margin: 0;
|
||||
width: 25%;
|
||||
float : left;
|
||||
}
|
||||
|
||||
/* @override */
|
||||
.button.toolbox-button {
|
||||
border-left-width: 0;
|
||||
}
|
||||
|
||||
.toolbox-button:last-child {
|
||||
border-right-width: 0;
|
||||
}
|
@ -1,10 +1,3 @@
|
||||
|
||||
.tools-wrapper,
|
||||
.options-wrapper,
|
||||
.palette-wrapper {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.tool-icon {
|
||||
position : relative;
|
||||
cursor : pointer;
|
||||
@ -82,14 +75,18 @@
|
||||
background-size: 24px 20px;
|
||||
}
|
||||
|
||||
.tool-icon.tool-lasso-select {
|
||||
background-image: url(../img/tools/lasso.png);
|
||||
}
|
||||
|
||||
.tool-icon.tool-shape-select {
|
||||
background-image: url(../img/tools/magicwand.png);
|
||||
}
|
||||
|
||||
.tool-icon.tool-lighten {
|
||||
background-image: url(../img/tools/lighten.png);
|
||||
background-size: 30px 30px;
|
||||
background-position: 8px 8px;
|
||||
background-size: 30px 30px;
|
||||
}
|
||||
|
||||
.tool-icon.tool-colorpicker {
|
||||
@ -97,11 +94,42 @@
|
||||
background-size: 23px 23px;
|
||||
}
|
||||
|
||||
.tool-icon.tool-colorswap {
|
||||
background-image: url(../img/tools/swap-colors.png);
|
||||
background-position: 6px 6px;
|
||||
background-size: 36px 36px;
|
||||
}
|
||||
|
||||
.tool-icon.tool-flip {
|
||||
background-image: url(../img/tools/flip.png);
|
||||
background-position: 7px 11px;
|
||||
background-size: 32px;
|
||||
}
|
||||
|
||||
.tool-icon.tool-rotate {
|
||||
background-image: url(../img/tools/rotate.png);
|
||||
background-position: 10px 9px;
|
||||
background-size: 26px;
|
||||
}
|
||||
|
||||
.tool-icon.tool-clone {
|
||||
background-image: url(../img/tools/clone.png);
|
||||
background-position: 9px 15px;
|
||||
background-size: 30px;
|
||||
}
|
||||
|
||||
.tool-icon.tool-dithering {
|
||||
background-image: url(../img/tools/dithering.png);
|
||||
background-position: 8px 9px;
|
||||
background-size: 30px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Tool cursors:
|
||||
*/
|
||||
|
||||
.tool-paint-bucket .drawing-canvas-container:hover {
|
||||
.tool-paint-bucket .drawing-canvas-container:hover,
|
||||
.tool-colorswap .drawing-canvas-container:hover {
|
||||
cursor: url(../img/icons/paint-bucket.png) 12 12, pointer;
|
||||
}
|
||||
|
||||
@ -110,7 +138,8 @@
|
||||
}
|
||||
|
||||
.tool-pen .drawing-canvas-container:hover,
|
||||
.tool-lighten .drawing-canvas-container:hover {
|
||||
.tool-lighten .drawing-canvas-container:hover,
|
||||
.tool-dithering .drawing-canvas-container:hover {
|
||||
cursor: url(../img/icons/pen.png) 0 15, pointer;
|
||||
}
|
||||
|
||||
@ -131,10 +160,11 @@
|
||||
}
|
||||
|
||||
.tool-move .drawing-canvas-container:hover {
|
||||
cursor: url(../img/icons/hand.png) 15 15, pointer;
|
||||
cursor: url(../img/icons/hand.png) 7 7, pointer;
|
||||
}
|
||||
|
||||
.tool-rectangle-select .drawing-canvas-container:hover {
|
||||
.tool-rectangle-select .drawing-canvas-container:hover,
|
||||
.tool-lasso-select .drawing-canvas-container:hover {
|
||||
cursor: crosshair;
|
||||
}
|
||||
|
||||
@ -228,4 +258,3 @@
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
4
src/css/transformations.css
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
.transformations-container .tool-icon {
|
||||
float:left;
|
||||
}
|
BIN
src/img/export.png
Normal file
After Width: | Height: | Size: 734 B |
BIN
src/img/merge-icon.png
Normal file
After Width: | Height: | Size: 438 B |
BIN
src/img/popup-preview-arrow-gold.png
Normal file
After Width: | Height: | Size: 133 B |
BIN
src/img/popup-preview-arrow-white.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
src/img/tools/clone.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
src/img/tools/dithering.png
Normal file
After Width: | Height: | Size: 642 B |
BIN
src/img/tools/flip.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
src/img/tools/lasso-dark.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
src/img/tools/lasso.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
src/img/tools/rotate.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src/img/tools/swap-colors.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
@ -22,7 +22,30 @@
|
||||
color:white;">
|
||||
<span style="top:45%">Loading Piskel ...</span>
|
||||
</div>
|
||||
<script type="text/javascript" src="js/lib/iframeLoader.js"></script>
|
||||
<script type="text/javascript" src="js/lib/iframeLoader-0.1.0.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
#main-wrapper {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.fake-piskelapp-header {
|
||||
text-align: center;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 24px;
|
||||
background: black;
|
||||
color: gold;
|
||||
}
|
||||
|
||||
.piskel-name.piskel-name-saving {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<div class="fake-piskelapp-header"><span class="piskel-name"></span></div>
|
||||
<!-- the comment below indicates the beginning of markup reused by the editor integrated in piskelapp.com -->
|
||||
<!-- do not delete, do not move :) -->
|
||||
<!--body-main-start-->
|
||||
<div id="main-wrapper" class="main-wrapper">
|
||||
<iframe src="templates/drawing-tools.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
|
||||
@ -40,6 +63,7 @@
|
||||
<div class="column right-column">
|
||||
<iframe src="templates/preview.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
<iframe src="templates/layers-list.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
<iframe src="templates/transformations.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
<iframe src="templates/palettes-list.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
<div class="pull-bottom cursor-coordinates"></div>
|
||||
</div>
|
||||
@ -50,13 +74,11 @@
|
||||
<iframe src="templates/settings.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
<div class="drawer vertical-centerer">
|
||||
<div class="drawer-content" id="drawer-container">
|
||||
<iframe src="templates/settings/save.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/settings/application.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/settings/resize.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/settings/save.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/settings/import.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/settings/localstorage.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/settings/export-gif.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/settings/export-png.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/settings/export.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -65,11 +87,20 @@
|
||||
|
||||
<div id="dialog-container-wrapper">
|
||||
<div id="dialog-container">
|
||||
<iframe src="templates/dialogs/manage-palettes.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/dialogs/create-palette.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/dialogs/import-image.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
<iframe src="templates/dialogs/browse-local.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<iframe src="templates/cheatsheet.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
<iframe src="templates/misc-templates.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
<iframe src="templates/popup-preview.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||
|
||||
<script type="text/javascript" src="piskel-boot.js"></script>
|
||||
<!--body-main-end-->
|
||||
<!-- the comment above indicates the end of the markup reused by the editor integrated in piskelapp.com -->
|
||||
<!-- do not delete, do not move :) -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -3,7 +3,8 @@ var Constants = {
|
||||
DEFAULT : {
|
||||
HEIGHT : 32,
|
||||
WIDTH : 32,
|
||||
FPS : 12
|
||||
FPS : 12,
|
||||
LAYER_OPACITY : 0.2
|
||||
},
|
||||
|
||||
MODEL_VERSION : 2,
|
||||
@ -11,6 +12,8 @@ var Constants = {
|
||||
MAX_HEIGHT : 1024,
|
||||
MAX_WIDTH : 1024,
|
||||
|
||||
MAX_PALETTE_COLORS : 100,
|
||||
|
||||
MINIMUM_ZOOM : 1,
|
||||
|
||||
PREVIEW_FILM_SIZE : 96,
|
||||
@ -19,45 +22,20 @@ var Constants = {
|
||||
DEFAULT_PEN_COLOR : '#000000',
|
||||
TRANSPARENT_COLOR : 'rgba(0, 0, 0, 0)',
|
||||
|
||||
OVERLAY_ONION_SKIN : 'onion-skin',
|
||||
OVERLAY_LAYER_PREVIEW : 'layer-preview',
|
||||
OVERLAY_DISABLED : 'no-overlay',
|
||||
|
||||
NO_PALETTE_ID : '__no-palette',
|
||||
CURRENT_COLORS_PALETTE_ID : '__current-colors',
|
||||
MANAGE_PALETTE_ID : '__manage-palettes',
|
||||
|
||||
// Used for Spectrum input
|
||||
PREFERRED_COLOR_FORMAT : 'rgb',
|
||||
|
||||
/*
|
||||
* Fake semi-transparent color used to highlight transparent
|
||||
* strokes and rectangles:
|
||||
*/
|
||||
SELECTION_TRANSPARENT_COLOR: 'rgba(255, 255, 255, 0.6)',
|
||||
SELECTION_TRANSPARENT_COLOR: 'rgba(160, 215, 240, 0.6)',
|
||||
|
||||
/*
|
||||
* When a tool is hovering the drawing canvas, we highlight the eventual
|
||||
* pixel target with this color:
|
||||
*/
|
||||
TOOL_TARGET_HIGHLIGHT_COLOR: 'rgba(255, 255, 255, 0.2)',
|
||||
|
||||
/*
|
||||
* Default entry point for piskel web service:
|
||||
*/
|
||||
STATIC : {
|
||||
URL : {
|
||||
SAVE : 'http://3.piskel-app.appspot.com/store',
|
||||
GET : 'http://3.piskel-app.appspot.com/get'
|
||||
}
|
||||
},
|
||||
APPENGINE : {
|
||||
URL : {
|
||||
SAVE : 'save'
|
||||
}
|
||||
},
|
||||
IMAGE_SERVICE_UPLOAD_URL : 'http://piskel-imgstore-a.appspot.com/__/upload',
|
||||
IMAGE_SERVICE_GET_URL : 'http://piskel-imgstore-a.appspot.com/img/',
|
||||
TOOL_HIGHLIGHT_COLOR_LIGHT: 'rgba(255, 255, 255, 0.2)',
|
||||
TOOL_HIGHLIGHT_COLOR_DARK: 'rgba(0, 0, 0, 0.2)',
|
||||
|
||||
ZOOMED_OUT_BACKGROUND_COLOR : '#A0A0A0',
|
||||
|
||||
@ -67,5 +45,13 @@ var Constants = {
|
||||
MOUSEMOVE_THROTTLING : 10,
|
||||
|
||||
ABSTRACT_FUNCTION : function () {throw 'abstract method should be implemented';},
|
||||
EMPTY_FUNCTION : function () {}
|
||||
};
|
||||
EMPTY_FUNCTION : function () {},
|
||||
|
||||
// TESTS
|
||||
DRAWING_TEST_FOLDER : 'drawing',
|
||||
|
||||
// SERVICE URLS
|
||||
APPENGINE_SAVE_URL : 'save',
|
||||
IMAGE_SERVICE_UPLOAD_URL : 'http://piskel-imgstore-b.appspot.com/__/upload',
|
||||
IMAGE_SERVICE_GET_URL : 'http://piskel-imgstore-b.appspot.com/img/'
|
||||
};
|
||||
|
@ -1,10 +1,13 @@
|
||||
// TODO(grosbouddha): put under pskl namespace.
|
||||
var Events = {
|
||||
|
||||
TOOL_SELECTED : "TOOL_SELECTED",
|
||||
TOOL_RELEASED : "TOOL_RELEASED",
|
||||
SELECT_PRIMARY_COLOR: "SELECT_PRIMARY_COLOR",
|
||||
SELECT_SECONDARY_COLOR: "SELECT_SECONDARY_COLOR",
|
||||
TOOL_SELECTED : 'TOOL_SELECTED',
|
||||
SELECT_TOOL : 'SELECT_TOOL',
|
||||
|
||||
TOOL_RELEASED : 'TOOL_RELEASED',
|
||||
TOOL_PRESSED : 'TOOL_PRESSED',
|
||||
SELECT_PRIMARY_COLOR: 'SELECT_PRIMARY_COLOR',
|
||||
SELECT_SECONDARY_COLOR: 'SELECT_SECONDARY_COLOR',
|
||||
PRIMARY_COLOR_SELECTED : 'PRIMARY_COLOR_SELECTED',
|
||||
SECONDARY_COLOR_SELECTED : 'SECONDARY_COLOR_SELECTED',
|
||||
|
||||
@ -23,29 +26,57 @@ var Events = {
|
||||
* 1st argument: Name of the settings
|
||||
* 2nd argument: New value
|
||||
*/
|
||||
USER_SETTINGS_CHANGED: "USER_SETTINGS_CHANGED",
|
||||
USER_SETTINGS_CHANGED: 'USER_SETTINGS_CHANGED',
|
||||
|
||||
CLOSE_SETTINGS_DRAWER : "CLOSE_SETTINGS_DRAWER",
|
||||
CLOSE_SETTINGS_DRAWER : 'CLOSE_SETTINGS_DRAWER',
|
||||
|
||||
/**
|
||||
* The framesheet was reseted and is now probably drastically different.
|
||||
* Number of frames, content of frames, color used for the palette may have changed.
|
||||
*/
|
||||
PISKEL_RESET: "PISKEL_RESET",
|
||||
PISKEL_SAVE_STATE: "PISKEL_SAVE_STATE",
|
||||
PISKEL_RESET: 'PISKEL_RESET',
|
||||
PISKEL_SAVE_STATE: 'PISKEL_SAVE_STATE',
|
||||
PISKEL_DESCRIPTOR_UPDATED : 'PISKEL_DESCRIPTOR_UPDATED',
|
||||
PISKEL_SAVED_STATUS_UPDATE : 'PISKEL_SAVED_STATUS_UPDATE',
|
||||
|
||||
PISKEL_SAVED: "PISKEL_SAVED",
|
||||
HISTORY_STATE_SAVED: 'HISTORY_STATE_SAVED',
|
||||
HISTORY_STATE_LOADED: 'HISTORY_STATE_LOADED',
|
||||
|
||||
FRAME_SIZE_CHANGED : "FRAME_SIZE_CHANGED",
|
||||
/**
|
||||
* Fired when a Piskel is successfully saved
|
||||
*/
|
||||
PISKEL_SAVED: 'PISKEL_SAVED',
|
||||
/**
|
||||
* Fired when a save action starts
|
||||
*/
|
||||
BEFORE_SAVING_PISKEL: 'BEFORE_SAVING_PISKEL',
|
||||
/**
|
||||
* Fired when a save action ends. Always fires, even if saving was not successful
|
||||
*/
|
||||
AFTER_SAVING_PISKEL: 'AFTER_SAVING_PISKEL',
|
||||
|
||||
SELECTION_CREATED: "SELECTION_CREATED",
|
||||
SELECTION_MOVE_REQUEST: "SELECTION_MOVE_REQUEST",
|
||||
SELECTION_DISMISSED: "SELECTION_DISMISSED",
|
||||
FRAME_SIZE_CHANGED : 'FRAME_SIZE_CHANGED',
|
||||
|
||||
SHOW_NOTIFICATION: "SHOW_NOTIFICATION",
|
||||
HIDE_NOTIFICATION: "HIDE_NOTIFICATION",
|
||||
SELECTION_CREATED: 'SELECTION_CREATED',
|
||||
SELECTION_MOVE_REQUEST: 'SELECTION_MOVE_REQUEST',
|
||||
SELECTION_DISMISSED: 'SELECTION_DISMISSED',
|
||||
|
||||
ZOOM_CHANGED : "ZOOM_CHANGED",
|
||||
SHOW_NOTIFICATION: 'SHOW_NOTIFICATION',
|
||||
HIDE_NOTIFICATION: 'HIDE_NOTIFICATION',
|
||||
|
||||
CURRENT_COLORS_UPDATED : "CURRENT_COLORS_UPDATED"
|
||||
};
|
||||
SHOW_PROGRESS: 'SHOW_PROGRESS',
|
||||
UPDATE_PROGRESS: 'UPDATE_PROGRESS',
|
||||
HIDE_PROGRESS: 'HIDE_PROGRESS',
|
||||
|
||||
ZOOM_CHANGED : 'ZOOM_CHANGED',
|
||||
|
||||
CURRENT_COLORS_UPDATED : 'CURRENT_COLORS_UPDATED',
|
||||
|
||||
// Tests
|
||||
MOUSE_EVENT : 'MOUSE_EVENT',
|
||||
KEYBOARD_EVENT : 'KEYBOARD_EVENT',
|
||||
TRANSFORMATION_EVENT : 'TRANSFORMATION_EVENT',
|
||||
TEST_RECORD_END : 'TEST_RECORD_END',
|
||||
TEST_CASE_END : 'TEST_CASE_END',
|
||||
TEST_SUITE_END : 'TEST_SUITE_END'
|
||||
};
|
||||
|
111
src/js/app.js
@ -3,7 +3,7 @@
|
||||
* @require Events
|
||||
*/
|
||||
(function () {
|
||||
var ns = $.namespace("pskl");
|
||||
var ns = $.namespace('pskl');
|
||||
/**
|
||||
* Main application controller
|
||||
*/
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
init : function () {
|
||||
/**
|
||||
* True when piskel is running in static mode (no back end needed).
|
||||
* When started from APP Engine, appEngineToken_ (Boolean) should be set on window.pskl
|
||||
*/
|
||||
this.isAppEngineVersion = !!pskl.appEngineToken_;
|
||||
@ -19,18 +18,14 @@
|
||||
this.shortcutService = new pskl.service.keyboard.ShortcutService();
|
||||
this.shortcutService.init();
|
||||
|
||||
var size = {
|
||||
height : Constants.DEFAULT.HEIGHT,
|
||||
width : Constants.DEFAULT.WIDTH
|
||||
};
|
||||
|
||||
var size = pskl.UserSettings.get(pskl.UserSettings.DEFAULT_SIZE);
|
||||
var descriptor = new pskl.model.piskel.Descriptor('New Piskel', '');
|
||||
var piskel = new pskl.model.Piskel(size.width, size.height, descriptor);
|
||||
|
||||
var layer = new pskl.model.Layer("Layer 1");
|
||||
var layer = new pskl.model.Layer('Layer 1');
|
||||
var frame = new pskl.model.Frame(size.width, size.height);
|
||||
layer.addFrame(frame);
|
||||
|
||||
layer.addFrame(frame);
|
||||
piskel.addLayer(layer);
|
||||
|
||||
this.corePiskelController = new pskl.controller.piskel.PiskelController(piskel);
|
||||
@ -39,29 +34,50 @@
|
||||
this.piskelController = new pskl.controller.piskel.PublicPiskelController(this.corePiskelController);
|
||||
this.piskelController.init();
|
||||
|
||||
this.paletteImportService = new pskl.service.palette.PaletteImportService();
|
||||
this.paletteService = new pskl.service.palette.PaletteService();
|
||||
this.paletteService.addDynamicPalette(new pskl.service.palette.CurrentColorsPalette());
|
||||
|
||||
this.selectedColorsService = new pskl.service.SelectedColorsService();
|
||||
this.selectedColorsService.init();
|
||||
|
||||
this.mouseStateService = new pskl.service.MouseStateService();
|
||||
this.mouseStateService.init();
|
||||
|
||||
this.paletteController = new pskl.controller.PaletteController();
|
||||
this.paletteController.init();
|
||||
|
||||
this.currentColorsService = new pskl.service.CurrentColorsService(this.piskelController);
|
||||
this.currentColorsService.init();
|
||||
|
||||
this.palettesListController = new pskl.controller.PalettesListController(this.paletteController, this.currentColorsService);
|
||||
this.palettesListController = new pskl.controller.PalettesListController(this.currentColorsService);
|
||||
this.palettesListController.init();
|
||||
|
||||
this.cursorCoordinatesController = new pskl.controller.CursorCoordinatesController(this.piskelController);
|
||||
this.cursorCoordinatesController.init();
|
||||
|
||||
this.drawingController = new pskl.controller.DrawingController(this.piskelController, this.paletteController, $('#drawing-canvas-container'));
|
||||
this.drawingController = new pskl.controller.DrawingController(
|
||||
this.piskelController,
|
||||
this.paletteController,
|
||||
$('#drawing-canvas-container'));
|
||||
this.drawingController.init();
|
||||
|
||||
this.animationController = new pskl.controller.AnimatedPreviewController(this.piskelController, $('#animated-preview-canvas-container'));
|
||||
this.animationController.init();
|
||||
this.previewController = new pskl.controller.preview.PreviewController(
|
||||
this.piskelController,
|
||||
$('#animated-preview-canvas-container'));
|
||||
this.previewController.init();
|
||||
|
||||
this.minimapController = new pskl.controller.MinimapController(this.piskelController, this.animationController, this.drawingController, $('#animated-preview-canvas-container'));
|
||||
this.minimapController = new pskl.controller.MinimapController(
|
||||
this.piskelController,
|
||||
this.previewController,
|
||||
this.drawingController,
|
||||
$('.minimap-container'));
|
||||
this.minimapController.init();
|
||||
|
||||
this.previewFilmController = new pskl.controller.PreviewFilmController(this.piskelController, $('#preview-list'));
|
||||
this.previewFilmController.init();
|
||||
this.framesListController = new pskl.controller.FramesListController(
|
||||
this.piskelController,
|
||||
$('#preview-list'));
|
||||
this.framesListController.init();
|
||||
|
||||
this.layersListController = new pskl.controller.LayersListController(this.piskelController);
|
||||
this.layersListController.init();
|
||||
@ -84,12 +100,30 @@
|
||||
this.notificationController = new pskl.controller.NotificationController();
|
||||
this.notificationController.init();
|
||||
|
||||
this.transformationsController = new pskl.controller.TransformationsController();
|
||||
this.transformationsController.init();
|
||||
|
||||
this.progressBarController = new pskl.controller.ProgressBarController();
|
||||
this.progressBarController.init();
|
||||
|
||||
this.canvasBackgroundController = new pskl.controller.CanvasBackgroundController();
|
||||
this.canvasBackgroundController.init();
|
||||
|
||||
this.localStorageService = new pskl.service.LocalStorageService(this.piskelController);
|
||||
this.localStorageService = new pskl.service.storage.LocalStorageService(this.piskelController);
|
||||
this.localStorageService.init();
|
||||
|
||||
this.fileDownloadStorageService = new pskl.service.storage.FileDownloadStorageService(this.piskelController);
|
||||
this.fileDownloadStorageService.init();
|
||||
|
||||
this.desktopStorageService = new pskl.service.storage.DesktopStorageService(this.piskelController);
|
||||
this.desktopStorageService.init();
|
||||
|
||||
this.galleryStorageService = new pskl.service.storage.GalleryStorageService(this.piskelController);
|
||||
this.galleryStorageService.init();
|
||||
|
||||
this.storageService = new pskl.service.storage.StorageService(this.piskelController);
|
||||
this.storageService.init();
|
||||
|
||||
this.imageUploadService = new pskl.service.ImageUploadService();
|
||||
this.imageUploadService.init();
|
||||
|
||||
@ -99,14 +133,19 @@
|
||||
this.savedStatusService = new pskl.service.SavedStatusService(this.piskelController);
|
||||
this.savedStatusService.init();
|
||||
|
||||
this.backupService = new pskl.service.BackupService(this.piskelController);
|
||||
this.backupService.init();
|
||||
|
||||
if (this.isAppEngineVersion) {
|
||||
this.storageService = new pskl.service.AppEngineStorageService(this.piskelController);
|
||||
} else {
|
||||
this.storageService = new pskl.service.GithubStorageService(this.piskelController);
|
||||
}
|
||||
this.storageService.init();
|
||||
this.beforeUnloadService = new pskl.service.BeforeUnloadService(this.piskelController);
|
||||
this.beforeUnloadService.init();
|
||||
|
||||
this.headerController = new pskl.controller.HeaderController(this.piskelController, this.savedStatusService);
|
||||
this.headerController.init();
|
||||
|
||||
this.fileDropperService = new pskl.service.FileDropperService(
|
||||
this.piskelController,
|
||||
document.querySelector('#drawing-canvas-container'));
|
||||
this.fileDropperService.init();
|
||||
|
||||
var drawingLoop = new pskl.rendering.DrawingLoop();
|
||||
drawingLoop.addCallback(this.render, this);
|
||||
@ -118,13 +157,24 @@
|
||||
if (piskelData && piskelData.piskel) {
|
||||
this.loadPiskel_(piskelData.piskel, piskelData.descriptor, piskelData.fps);
|
||||
}
|
||||
|
||||
if (pskl.devtools) {
|
||||
pskl.devtools.init();
|
||||
}
|
||||
|
||||
if (pskl.utils.Environment.detectNodeWebkit() && pskl.utils.UserAgent.isMac) {
|
||||
var gui = require('nw.gui');
|
||||
var mb = new gui.Menu({type:'menubar'});
|
||||
mb.createMacBuiltin('Piskel');
|
||||
gui.Window.get().menu = mb;
|
||||
}
|
||||
},
|
||||
|
||||
loadPiskel_ : function (serializedPiskel, descriptor, fps) {
|
||||
pskl.utils.serialization.Deserializer.deserialize(serializedPiskel, function (piskel) {
|
||||
piskel.setDescriptor(descriptor);
|
||||
pskl.app.piskelController.setPiskel(piskel);
|
||||
pskl.app.animationController.setFPS(fps);
|
||||
pskl.app.previewController.setFPS(fps);
|
||||
});
|
||||
},
|
||||
|
||||
@ -145,22 +195,21 @@
|
||||
|
||||
render : function (delta) {
|
||||
this.drawingController.render(delta);
|
||||
this.animationController.render(delta);
|
||||
this.previewFilmController.render(delta);
|
||||
this.previewController.render(delta);
|
||||
this.framesListController.render(delta);
|
||||
},
|
||||
|
||||
getFirstFrameAsPng : function () {
|
||||
var firstFrame = this.piskelController.getFrameAt(0);
|
||||
var canvasRenderer = new pskl.rendering.CanvasRenderer(firstFrame, 1);
|
||||
canvasRenderer.drawTransparentAs('rgba(0,0,0,0)');
|
||||
var firstFrameCanvas = canvasRenderer.render();
|
||||
return firstFrameCanvas.toDataURL("image/png");
|
||||
var firstFrameCanvas = pskl.utils.FrameUtils.toImage(firstFrame);
|
||||
return firstFrameCanvas.toDataURL('image/png');
|
||||
},
|
||||
|
||||
getFramesheetAsPng : function () {
|
||||
var renderer = new pskl.rendering.PiskelRenderer(this.piskelController);
|
||||
var framesheetCanvas = renderer.renderAsCanvas();
|
||||
return framesheetCanvas.toDataURL("image/png");
|
||||
return framesheetCanvas.toDataURL('image/png');
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
|
@ -1,125 +0,0 @@
|
||||
(function () {
|
||||
var ns = $.namespace("pskl.controller");
|
||||
|
||||
// Preview is a square of PREVIEW_SIZE x PREVIEW_SIZE
|
||||
var PREVIEW_SIZE = 200;
|
||||
|
||||
ns.AnimatedPreviewController = function (piskelController, container) {
|
||||
this.piskelController = piskelController;
|
||||
this.container = container;
|
||||
|
||||
this.elapsedTime = 0;
|
||||
this.currentIndex = 0;
|
||||
|
||||
this.setFPS(Constants.DEFAULT.FPS);
|
||||
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
|
||||
this.renderer = new pskl.rendering.frame.TiledFrameRenderer(this.container);
|
||||
this.updateZoom_();
|
||||
$.subscribe(Events.FRAME_SIZE_CHANGED, this.onFrameSizeChange_.bind(this));
|
||||
$.subscribe(Events.USER_SETTINGS_CHANGED, $.proxy(this.onUserSettingsChange_, this));
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.onUserSettingsChange_ = function () {
|
||||
this.updateZoom_();
|
||||
this.updateContainerDimensions_();
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.updateZoom_ = function () {
|
||||
var isTiled = pskl.UserSettings.get(pskl.UserSettings.TILED_PREVIEW);
|
||||
var zoom = isTiled ? 1 : this.calculateZoom_();
|
||||
this.renderer.setZoom(zoom);
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.getZoom = function () {
|
||||
return this.calculateZoom_();
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.getCoordinates = function(x, y) {
|
||||
var containerOffset = this.container.offset();
|
||||
x = x - containerOffset.left;
|
||||
y = y - containerOffset.top;
|
||||
var zoom = this.getZoom();
|
||||
return {
|
||||
x : Math.floor(x / zoom),
|
||||
y : Math.floor(y / zoom)
|
||||
};
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.init = function () {
|
||||
// the oninput event won't work on IE10 unfortunately, but at least will provide a
|
||||
// consistent behavior across all other browsers that support the input type range
|
||||
// see https://bugzilla.mozilla.org/show_bug.cgi?id=853670
|
||||
$("#preview-fps")[0].addEventListener('change', this.onFPSSliderChange.bind(this));
|
||||
document.querySelector(".right-column").style.width = Constants.ANIMATED_PREVIEW_WIDTH + 'px';
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.onFPSSliderChange = function (evt) {
|
||||
this.setFPS(parseInt($("#preview-fps")[0].value, 10));
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.setFPS = function (fps) {
|
||||
this.fps = fps;
|
||||
$("#preview-fps").val(this.fps);
|
||||
$("#display-fps").html(this.fps + " FPS");
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.getFPS = function () {
|
||||
return this.fps;
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.render = function (delta) {
|
||||
this.elapsedTime += delta;
|
||||
var index = Math.floor(this.elapsedTime / (1000/this.fps));
|
||||
if (index != this.currentIndex) {
|
||||
this.currentIndex = index;
|
||||
if (!this.piskelController.hasFrameAt(this.currentIndex)) {
|
||||
this.currentIndex = 0;
|
||||
this.elapsedTime = 0;
|
||||
}
|
||||
var frame = this.piskelController.getFrameAt(this.currentIndex);
|
||||
this.renderer.render(frame);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Calculate the preview zoom depending on the framesheet size
|
||||
*/
|
||||
ns.AnimatedPreviewController.prototype.calculateZoom_ = function () {
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
var previewSize = 200,
|
||||
hZoom = previewSize / frame.getHeight(),
|
||||
wZoom = previewSize / frame.getWidth();
|
||||
|
||||
return Math.min(hZoom, wZoom);
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.onFrameSizeChange_ = function () {
|
||||
this.updateZoom_();
|
||||
this.updateContainerDimensions_();
|
||||
};
|
||||
|
||||
ns.AnimatedPreviewController.prototype.updateContainerDimensions_ = function () {
|
||||
var containerEl = this.container.get(0);
|
||||
var isTiled = pskl.UserSettings.get(pskl.UserSettings.TILED_PREVIEW);
|
||||
var height, width;
|
||||
|
||||
if (isTiled) {
|
||||
height = PREVIEW_SIZE;
|
||||
width = PREVIEW_SIZE;
|
||||
} else {
|
||||
var zoom = this.getZoom();
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
height = frame.getHeight() * zoom;
|
||||
width = frame.getWidth() * zoom;
|
||||
}
|
||||
|
||||
containerEl.style.height = height + "px";
|
||||
containerEl.style.width = width + "px";
|
||||
containerEl.style.marginTop = ((PREVIEW_SIZE - height) / 2) + "px";
|
||||
containerEl.style.marginBottom = ((PREVIEW_SIZE - height) / 2) + "px";
|
||||
containerEl.style.marginLeft = ((PREVIEW_SIZE - width) / 2) + "px";
|
||||
containerEl.style.marginRight = ((PREVIEW_SIZE - width) / 2) + "px";
|
||||
};
|
||||
})();
|
@ -10,7 +10,6 @@
|
||||
this.updateBackgroundClass_(pskl.UserSettings.get(pskl.UserSettings.CANVAS_BACKGROUND));
|
||||
};
|
||||
|
||||
|
||||
ns.CanvasBackgroundController.prototype.onUserSettingsChange_ = function (evt, settingName, settingValue) {
|
||||
if (settingName == pskl.UserSettings.CANVAS_BACKGROUND) {
|
||||
this.updateBackgroundClass_(settingValue);
|
||||
@ -25,4 +24,4 @@
|
||||
this.body.classList.add(newClass);
|
||||
this.body.dataset.currentBackgroundClass = newClass;
|
||||
};
|
||||
})();
|
||||
})();
|
||||
|
@ -4,8 +4,10 @@
|
||||
ns.CursorCoordinatesController = function (piskelController) {
|
||||
this.piskelController = piskelController;
|
||||
this.origin = null;
|
||||
this.coordinates = {x:-1,y:-1};
|
||||
|
||||
this.coordinates = {
|
||||
x : -1,
|
||||
y : -1
|
||||
};
|
||||
};
|
||||
|
||||
ns.CursorCoordinatesController.prototype.init = function () {
|
||||
@ -31,9 +33,9 @@
|
||||
if (currentFrame.containsPixel(x, y)) {
|
||||
html += x + ':' + y;
|
||||
if (this.origin) {
|
||||
var dX = Math.abs(x-this.origin.x) + 1;
|
||||
var dY = Math.abs(y-this.origin.y) + 1;
|
||||
html += ' (' + dX + 'x' + dY +')';
|
||||
var dX = Math.abs(x - this.origin.x) + 1;
|
||||
var dY = Math.abs(y - this.origin.y) + 1;
|
||||
html += ' (' + dX + 'x' + dY + ')';
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +45,7 @@
|
||||
ns.CursorCoordinatesController.prototype.getFrameSizeHTML_ = function () {
|
||||
var w = this.piskelController.getWidth();
|
||||
var h = this.piskelController.getHeight();
|
||||
return '['+w+'x'+h+'] ';
|
||||
return '[' + w + 'x' + h + '] ';
|
||||
};
|
||||
|
||||
ns.CursorCoordinatesController.prototype.onCursorMoved_ = function (event, x, y) {
|
||||
@ -56,9 +58,8 @@
|
||||
this.redraw();
|
||||
};
|
||||
|
||||
ns.CursorCoordinatesController.prototype.onDragEnd_ = function (event, x, y) {
|
||||
ns.CursorCoordinatesController.prototype.onDragEnd_ = function (event) {
|
||||
this.origin = null;
|
||||
this.redraw();
|
||||
};
|
||||
|
||||
})();
|
||||
})();
|
||||
|
@ -1,6 +1,6 @@
|
||||
(function () {
|
||||
|
||||
var ns = $.namespace("pskl.controller");
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
ns.DrawingController = function (piskelController, paletteController, container) {
|
||||
/**
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
this.paletteController = paletteController;
|
||||
|
||||
this.dragHandler = new ns.drawing.DragHandler(this);
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
@ -20,20 +22,19 @@
|
||||
*/
|
||||
this.container = container;
|
||||
|
||||
// TODO(vincz): Store user prefs in a localstorage string ?
|
||||
var renderingOptions = {
|
||||
"zoom": this.calculateZoom_(),
|
||||
"supportGridRendering" : true,
|
||||
"height" : this.getContainerHeight_(),
|
||||
"width" : this.getContainerWidth_(),
|
||||
"xOffset" : 0,
|
||||
"yOffset" : 0
|
||||
var cfg = {
|
||||
'zoom': this.calculateZoom_(),
|
||||
'supportGridRendering' : true,
|
||||
'height' : this.getContainerHeight_(),
|
||||
'width' : this.getContainerWidth_(),
|
||||
'xOffset' : 0,
|
||||
'yOffset' : 0
|
||||
};
|
||||
|
||||
this.overlayRenderer = new pskl.rendering.frame.CachedFrameRenderer(this.container, renderingOptions, ["canvas-overlay"]);
|
||||
this.renderer = new pskl.rendering.frame.CachedFrameRenderer(this.container, renderingOptions, ["drawing-canvas"]);
|
||||
this.onionSkinRenderer = new pskl.rendering.OnionSkinRenderer(this.container, renderingOptions, piskelController);
|
||||
this.layersRenderer = new pskl.rendering.layer.LayersRenderer(this.container, renderingOptions, piskelController);
|
||||
this.overlayRenderer = new pskl.rendering.frame.CachedFrameRenderer(this.container, cfg, ['canvas-overlay']);
|
||||
this.renderer = new pskl.rendering.frame.CachedFrameRenderer(this.container, cfg, ['drawing-canvas']);
|
||||
this.onionSkinRenderer = pskl.rendering.OnionSkinRenderer.createInContainer(this.container, cfg, piskelController);
|
||||
this.layersRenderer = new pskl.rendering.layer.LayersRenderer(this.container, cfg, piskelController);
|
||||
|
||||
this.compositeRenderer = new pskl.rendering.CompositeRenderer();
|
||||
this.compositeRenderer
|
||||
@ -46,9 +47,6 @@
|
||||
this.isClicked = false;
|
||||
this.previousMousemoveTime = 0;
|
||||
this.currentToolBehavior = null;
|
||||
|
||||
// State of clicked button (need to be stateful here, see comment in getCurrentColor_)
|
||||
this.currentMouseButton_ = Constants.LEFT_BUTTON;
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.init = function () {
|
||||
@ -61,21 +59,24 @@
|
||||
|
||||
$(window).resize($.proxy(this.startResizeTimer_, this));
|
||||
|
||||
$.subscribe(Events.USER_SETTINGS_CHANGED, $.proxy(this.onUserSettingsChange_, this));
|
||||
$.subscribe(Events.FRAME_SIZE_CHANGED, $.proxy(this.onFrameSizeChanged_, this));
|
||||
$.subscribe(Events.USER_SETTINGS_CHANGED, this.onUserSettingsChange_.bind(this));
|
||||
$.subscribe(Events.FRAME_SIZE_CHANGED, this.onFrameSizeChange_.bind(this));
|
||||
|
||||
pskl.app.shortcutService.addShortcut('0', this.resetZoom_.bind(this));
|
||||
pskl.app.shortcutService.addShortcut('+', this.increaseZoom_.bind(this, 1));
|
||||
pskl.app.shortcutService.addShortcut('-', this.decreaseZoom_.bind(this, 1));
|
||||
|
||||
window.setTimeout(this.afterWindowResize_.bind(this), 100);
|
||||
window.setTimeout(function () {
|
||||
this.afterWindowResize_();
|
||||
this.resetZoom_();
|
||||
}.bind(this), 100);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.initMouseBehavior = function() {
|
||||
var body = $('body');
|
||||
this.container.mousedown($.proxy(this.onMousedown_, this));
|
||||
|
||||
if (pskl.utils.UserAgent.isChrome) {
|
||||
if (pskl.utils.UserAgent.isChrome || pskl.utils.UserAgent.isIE11) {
|
||||
this.container.on('mousewheel', $.proxy(this.onMousewheel_, this));
|
||||
} else {
|
||||
this.container.on('wheel', $.proxy(this.onMousewheel_, this));
|
||||
@ -87,6 +88,7 @@
|
||||
|
||||
// Deactivate right click:
|
||||
body.contextmenu(this.onCanvasContextMenu_);
|
||||
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.startResizeTimer_ = function () {
|
||||
@ -98,6 +100,7 @@
|
||||
|
||||
ns.DrawingController.prototype.afterWindowResize_ = function () {
|
||||
var initialWidth = this.compositeRenderer.getDisplaySize().width;
|
||||
|
||||
this.compositeRenderer.setDisplaySize(this.getContainerWidth_(), this.getContainerHeight_());
|
||||
this.centerColumnWrapperHorizontally_();
|
||||
var ratio = this.compositeRenderer.getDisplaySize().width / initialWidth;
|
||||
@ -111,9 +114,9 @@
|
||||
* @private
|
||||
*/
|
||||
ns.DrawingController.prototype.onUserSettingsChange_ = function (evt, settingsName, settingsValue) {
|
||||
if(settingsName == pskl.UserSettings.SHOW_GRID) {
|
||||
if (settingsName == pskl.UserSettings.SHOW_GRID) {
|
||||
console.warn('DrawingController:onUserSettingsChange_ not implemented !');
|
||||
} else if (settingsName == pskl.UserSettings.OVERLAY) {
|
||||
} else if (settingsName == pskl.UserSettings.ONION_SKIN || settingsName == pskl.UserSettings.LAYER_PREVIEW) {
|
||||
this.onionSkinRenderer.clear();
|
||||
this.onionSkinRenderer.flush();
|
||||
this.layersRenderer.clear();
|
||||
@ -122,7 +125,7 @@
|
||||
}
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.onFrameSizeChanged_ = function () {
|
||||
ns.DrawingController.prototype.onFrameSizeChange_ = function () {
|
||||
this.compositeRenderer.setDisplaySize(this.getContainerWidth_(), this.getContainerHeight_());
|
||||
this.centerColumnWrapperHorizontally_();
|
||||
this.compositeRenderer.setZoom(this.calculateZoom_());
|
||||
@ -134,22 +137,20 @@
|
||||
* @private
|
||||
*/
|
||||
ns.DrawingController.prototype.onMousedown_ = function (event) {
|
||||
$.publish(Events.MOUSE_EVENT, [event, this]);
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
var coords = this.renderer.getCoordinates(event.clientX, event.clientY);
|
||||
var coords = this.getSpriteCoordinates(event.clientX, event.clientY);
|
||||
|
||||
this.isClicked = true;
|
||||
|
||||
if (event.button === Constants.MIDDLE_BUTTON) {
|
||||
if (frame.containsPixel(coords.x, coords.y)) {
|
||||
$.publish(Events.SELECT_PRIMARY_COLOR, [frame.getPixel(coords.x, coords.y)]);
|
||||
}
|
||||
this.dragHandler.startDrag(event.clientX, event.clientY);
|
||||
} else {
|
||||
this.isClicked = true;
|
||||
this.setCurrentButton(event);
|
||||
this.currentToolBehavior.hideHighlightedPixel(this.overlayFrame);
|
||||
|
||||
$.publish(Events.TOOL_PRESSED);
|
||||
this.currentToolBehavior.applyToolAt(
|
||||
coords.x,
|
||||
coords.y,
|
||||
this.getCurrentColor_(),
|
||||
frame,
|
||||
this.overlayFrame,
|
||||
event
|
||||
@ -167,14 +168,72 @@
|
||||
var currentTime = new Date().getTime();
|
||||
// Throttling of the mousemove event:
|
||||
|
||||
if ((currentTime - this.previousMousemoveTime) > Constants.MOUSEMOVE_THROTTLING ) {
|
||||
if ((currentTime - this.previousMousemoveTime) > Constants.MOUSEMOVE_THROTTLING) {
|
||||
this.moveTool_(this._clientX, this._clientY, event);
|
||||
this.previousMousemoveTime = currentTime;
|
||||
}
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.resetZoom_ = function () {
|
||||
this.setZoom_(this.calculateZoom_());
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.DrawingController.prototype.onKeyup_ = function (event) {
|
||||
this.moveTool_(this._clientX, this._clientY, event);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.moveTool_ = function (x, y, event) {
|
||||
var coords = this.getSpriteCoordinates(x, y);
|
||||
var currentFrame = this.piskelController.getCurrentFrame();
|
||||
|
||||
if (this.isClicked) {
|
||||
if (pskl.app.mouseStateService.isMiddleButtonPressed()) {
|
||||
this.dragHandler.updateDrag(x, y);
|
||||
} else {
|
||||
$.publish(Events.MOUSE_EVENT, [event, this]);
|
||||
this.currentToolBehavior.moveToolAt(
|
||||
coords.x | 0,
|
||||
coords.y | 0,
|
||||
currentFrame,
|
||||
this.overlayFrame,
|
||||
event
|
||||
);
|
||||
}
|
||||
} else {
|
||||
this.currentToolBehavior.moveUnactiveToolAt(
|
||||
coords.x,
|
||||
coords.y,
|
||||
currentFrame,
|
||||
this.overlayFrame,
|
||||
event
|
||||
);
|
||||
}
|
||||
$.publish(Events.CURSOR_MOVED, [coords.x, coords.y]);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.onMousewheel_ = function (jQueryEvent) {
|
||||
var evt = jQueryEvent.originalEvent;
|
||||
// Ratio between wheelDeltaY (mousewheel event) and deltaY (wheel event) is -40
|
||||
var delta;
|
||||
if (pskl.utils.UserAgent.isChrome) {
|
||||
delta = evt.wheelDeltaY;
|
||||
} else if (pskl.utils.UserAgent.isIE11) {
|
||||
delta = evt.wheelDelta;
|
||||
} else if (pskl.utils.UserAgent.isFirefox) {
|
||||
delta = -40 * evt.deltaY;
|
||||
}
|
||||
var modifier = Math.abs(delta / 120);
|
||||
|
||||
if (pskl.utils.UserAgent.isMac ? evt.metaKey : evt.ctrlKey) {
|
||||
modifier = modifier * 5;
|
||||
// prevent default to prevent the default browser UI resize
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
if (delta > 0) {
|
||||
this.increaseZoom_(modifier);
|
||||
} else if (delta < 0) {
|
||||
this.decreaseZoom_(modifier);
|
||||
}
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.increaseZoom_ = function (zoomMultiplier) {
|
||||
@ -187,117 +246,53 @@
|
||||
this.setZoom_(this.renderer.getZoom() - step);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.getZoomStep_ = function () {
|
||||
return this.calculateZoom_() / 10;
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.setZoom_ = function (zoom) {
|
||||
this.compositeRenderer.setZoom(zoom);
|
||||
$.publish(Events.ZOOM_CHANGED);
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.DrawingController.prototype.onKeyup_ = function (event) {
|
||||
this.moveTool_(this._clientX, this._clientY, event);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.moveTool_ = function (x, y, event) {
|
||||
var coords = this.renderer.getCoordinates(x, y);
|
||||
var currentFrame = this.piskelController.getCurrentFrame();
|
||||
|
||||
if (this.isClicked) {
|
||||
// Warning : do not call setCurrentButton here
|
||||
// mousemove do not have the correct mouse button information on all browsers
|
||||
this.currentToolBehavior.moveToolAt(
|
||||
coords.x | 0,
|
||||
coords.y | 0,
|
||||
this.getCurrentColor_(),
|
||||
currentFrame,
|
||||
this.overlayFrame,
|
||||
event
|
||||
);
|
||||
} else {
|
||||
|
||||
this.currentToolBehavior.moveUnactiveToolAt(
|
||||
coords.x,
|
||||
coords.y,
|
||||
this.getCurrentColor_(),
|
||||
currentFrame,
|
||||
this.overlayFrame,
|
||||
event
|
||||
);
|
||||
}
|
||||
$.publish(Events.CURSOR_MOVED, [coords.x, coords.y]);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.onMousewheel_ = function (jQueryEvent) {
|
||||
var event = jQueryEvent.originalEvent;
|
||||
var delta = event.wheelDeltaY || (-2 * event.deltaY);
|
||||
var modifier = Math.abs(delta/120);
|
||||
if (delta > 0) {
|
||||
this.increaseZoom_(modifier);
|
||||
} else if (delta < 0) {
|
||||
this.decreaseZoom_(modifier);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.DrawingController.prototype.onMouseup_ = function (event) {
|
||||
if(this.isClicked) {
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
var coords = this.getSpriteCoordinates(event.clientX, event.clientY);
|
||||
if (this.isClicked) {
|
||||
// A mouse button was clicked on the drawing canvas before this mouseup event,
|
||||
// the user was probably drawing on the canvas.
|
||||
// Note: The mousemove movement (and the mouseup) may end up outside
|
||||
// of the drawing canvas.
|
||||
|
||||
this.isClicked = false;
|
||||
this.setCurrentButton(event);
|
||||
|
||||
var coords = this.renderer.getCoordinates(event.clientX, event.clientY);
|
||||
this.currentToolBehavior.releaseToolAt(
|
||||
coords.x,
|
||||
coords.y,
|
||||
this.getCurrentColor_(),
|
||||
this.piskelController.getCurrentFrame(),
|
||||
this.overlayFrame,
|
||||
event
|
||||
);
|
||||
if (pskl.app.mouseStateService.isMiddleButtonPressed()) {
|
||||
if (this.dragHandler.isDragging()) {
|
||||
this.dragHandler.stopDrag();
|
||||
} else if (frame.containsPixel(coords.x, coords.y)) {
|
||||
$.publish(Events.SELECT_PRIMARY_COLOR, [frame.getPixel(coords.x, coords.y)]);
|
||||
}
|
||||
} else {
|
||||
this.currentToolBehavior.releaseToolAt(
|
||||
coords.x,
|
||||
coords.y,
|
||||
this.piskelController.getCurrentFrame(),
|
||||
this.overlayFrame,
|
||||
event
|
||||
);
|
||||
|
||||
$.publish(Events.TOOL_RELEASED);
|
||||
$.publish(Events.TOOL_RELEASED);
|
||||
}
|
||||
$.publish(Events.MOUSE_EVENT, [event, this]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Translate absolute x,y screen coordinates into sprite coordinates
|
||||
* @param {Number} screenX
|
||||
* @param {Number} screenY
|
||||
* @return {Object} {x:Number, y:Number}
|
||||
*/
|
||||
ns.DrawingController.prototype.getSpriteCoordinates = function(event) {
|
||||
return this.renderer.getCoordinates(event.clientX, event.clientY);
|
||||
ns.DrawingController.prototype.getSpriteCoordinates = function(screenX, screenY) {
|
||||
return this.renderer.getCoordinates(screenX, screenY);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.setCurrentButton = function (event) {
|
||||
this.currentMouseButton_ = event.button;
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.DrawingController.prototype.getCurrentColor_ = function () {
|
||||
// WARNING : Do not rely on the current event to get the current color!
|
||||
// It might seem like a good idea, and works perfectly fine on Chrome
|
||||
// Sadly Firefox and IE found clever, for some reason, to set event.button to 0
|
||||
// on a mouse move event
|
||||
// This always matches a LEFT mouse button which is __really__ not helpful
|
||||
|
||||
if(this.currentMouseButton_ == Constants.RIGHT_BUTTON) {
|
||||
return this.paletteController.getSecondaryColor();
|
||||
} else if(this.currentMouseButton_ == Constants.LEFT_BUTTON) {
|
||||
return this.paletteController.getPrimaryColor();
|
||||
} else {
|
||||
return Constants.DEFAULT_PEN_COLOR;
|
||||
}
|
||||
ns.DrawingController.prototype.getScreenCoordinates = function(spriteX, spriteY) {
|
||||
return this.renderer.reverseCoordinates(spriteX, spriteY);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -319,10 +314,11 @@
|
||||
this.overlayFrame = pskl.model.Frame.createEmptyFromFrame(currentFrame);
|
||||
}
|
||||
|
||||
var overlaySetting = pskl.UserSettings.get(pskl.UserSettings.OVERLAY);
|
||||
if (overlaySetting === Constants.OVERLAY_ONION_SKIN) {
|
||||
if (pskl.UserSettings.get(pskl.UserSettings.ONION_SKIN)) {
|
||||
this.onionSkinRenderer.render();
|
||||
} else if (overlaySetting === Constants.OVERLAY_LAYER_PREVIEW) {
|
||||
}
|
||||
|
||||
if (pskl.UserSettings.get(pskl.UserSettings.LAYER_PREVIEW)) {
|
||||
this.layersRenderer.render();
|
||||
}
|
||||
|
||||
@ -334,10 +330,10 @@
|
||||
* @private
|
||||
*/
|
||||
ns.DrawingController.prototype.calculateZoom_ = function() {
|
||||
var frameHeight = this.piskelController.getCurrentFrame().getHeight(),
|
||||
frameWidth = this.piskelController.getCurrentFrame().getWidth();
|
||||
var frameHeight = this.piskelController.getCurrentFrame().getHeight();
|
||||
var frameWidth = this.piskelController.getCurrentFrame().getWidth();
|
||||
|
||||
return Math.min(this.getAvailableWidth_()/frameWidth, this.getAvailableHeight_()/frameHeight);
|
||||
return Math.min(this.getAvailableWidth_() / frameWidth, this.getAvailableHeight_() / frameHeight);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.getAvailableHeight_ = function () {
|
||||
@ -345,22 +341,24 @@
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.getAvailableWidth_ = function () {
|
||||
var leftSectionWidth = $('.left-column').outerWidth(true),
|
||||
rightSectionWidth = $('.right-column').outerWidth(true),
|
||||
toolsContainerWidth = $('#tool-section').outerWidth(true),
|
||||
settingsContainerWidth = $('#application-action-section').outerWidth(true),
|
||||
availableWidth = $('#main-wrapper').width() - leftSectionWidth - rightSectionWidth - toolsContainerWidth - settingsContainerWidth;
|
||||
var leftSectionWidth = $('.left-column').outerWidth(true);
|
||||
var rightSectionWidth = $('.right-column').outerWidth(true);
|
||||
var toolsContainerWidth = $('#tool-section').outerWidth(true);
|
||||
var settingsContainerWidth = $('#application-action-section').outerWidth(true);
|
||||
|
||||
var usedWidth = leftSectionWidth + rightSectionWidth + toolsContainerWidth + settingsContainerWidth;
|
||||
var availableWidth = $('#main-wrapper').width() - usedWidth;
|
||||
|
||||
var comfortMargin = 10;
|
||||
return availableWidth - comfortMargin;
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.getContainerHeight_ = function () {
|
||||
return this.calculateZoom_() * this.piskelController.getCurrentFrame().getHeight();
|
||||
return this.getAvailableHeight_();
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.getContainerWidth_ = function () {
|
||||
return this.calculateZoom_() * this.piskelController.getCurrentFrame().getWidth();
|
||||
return this.getAvailableWidth_();
|
||||
};
|
||||
|
||||
/**
|
||||
@ -378,8 +376,26 @@
|
||||
return this.compositeRenderer;
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.getOffset = function () {
|
||||
return this.compositeRenderer.getOffset();
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.setOffset = function (x, y) {
|
||||
this.compositeRenderer.setOffset(x, y);
|
||||
$.publish(Events.ZOOM_CHANGED);
|
||||
};
|
||||
})();
|
||||
|
||||
ns.DrawingController.prototype.resetZoom_ = function () {
|
||||
this.setZoom_(this.calculateZoom_());
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.getZoomStep_ = function () {
|
||||
return Math.max(0.1, this.renderer.getZoom() / 15);
|
||||
};
|
||||
|
||||
ns.DrawingController.prototype.setZoom_ = function (zoom) {
|
||||
this.compositeRenderer.setZoom(zoom);
|
||||
$.publish(Events.ZOOM_CHANGED);
|
||||
};
|
||||
|
||||
})();
|
||||
|
@ -1,5 +1,5 @@
|
||||
(function () {
|
||||
var ns = $.namespace("pskl.controller");
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
var ACTION = {
|
||||
SELECT : 'select',
|
||||
@ -8,16 +8,19 @@
|
||||
NEW_FRAME : 'newframe'
|
||||
};
|
||||
|
||||
ns.PreviewFilmController = function (piskelController, container) {
|
||||
|
||||
ns.FramesListController = function (piskelController, container) {
|
||||
this.piskelController = piskelController;
|
||||
this.container = container;
|
||||
this.refreshZoom_();
|
||||
|
||||
this.redrawFlag = true;
|
||||
|
||||
this.cachedFrameProcessor = new pskl.model.frame.CachedFrameProcessor();
|
||||
this.cachedFrameProcessor.setFrameProcessor(this.frameToPreviewCanvas_.bind(this));
|
||||
this.cachedFrameProcessor.setOutputCloner(this.clonePreviewCanvas_.bind(this));
|
||||
};
|
||||
|
||||
ns.PreviewFilmController.prototype.init = function() {
|
||||
ns.FramesListController.prototype.init = function() {
|
||||
$.subscribe(Events.TOOL_RELEASED, this.flagForRedraw_.bind(this));
|
||||
$.subscribe(Events.PISKEL_RESET, this.flagForRedraw_.bind(this));
|
||||
$.subscribe(Events.USER_SETTINGS_CHANGED, this.flagForRedraw_.bind(this));
|
||||
@ -29,30 +32,30 @@
|
||||
this.updateScrollerOverflows();
|
||||
};
|
||||
|
||||
ns.PreviewFilmController.prototype.flagForRedraw_ = function () {
|
||||
ns.FramesListController.prototype.flagForRedraw_ = function () {
|
||||
this.redrawFlag = true;
|
||||
};
|
||||
|
||||
ns.PreviewFilmController.prototype.refreshZoom_ = function () {
|
||||
ns.FramesListController.prototype.refreshZoom_ = function () {
|
||||
this.zoom = this.calculateZoom_();
|
||||
};
|
||||
|
||||
ns.PreviewFilmController.prototype.render = function () {
|
||||
ns.FramesListController.prototype.render = function () {
|
||||
if (this.redrawFlag) {
|
||||
// TODO(vincz): Full redraw on any drawing modification, optimize.
|
||||
this.createPreviews_();
|
||||
this.redrawFlag = false;
|
||||
}
|
||||
};
|
||||
|
||||
ns.PreviewFilmController.prototype.updateScrollerOverflows = function () {
|
||||
ns.FramesListController.prototype.updateScrollerOverflows = function () {
|
||||
var scroller = $('#preview-list-scroller');
|
||||
var scrollerHeight = scroller.height();
|
||||
var scrollTop = scroller.scrollTop();
|
||||
var scrollerContentHeight = $('#preview-list').height();
|
||||
var treshold = $('.top-overflow').height();
|
||||
var overflowTop = false,
|
||||
overflowBottom = false;
|
||||
var overflowTop = false;
|
||||
var overflowBottom = false;
|
||||
|
||||
if (scrollerHeight < scrollerContentHeight) {
|
||||
if (scrollTop > treshold) {
|
||||
overflowTop = true;
|
||||
@ -67,7 +70,7 @@
|
||||
wrapper.toggleClass('bottom-overflow-visible', overflowBottom);
|
||||
};
|
||||
|
||||
ns.PreviewFilmController.prototype.onContainerClick_ = function (event) {
|
||||
ns.FramesListController.prototype.onContainerClick_ = function (event) {
|
||||
var target = pskl.utils.Dom.getParentWithData(event.target, 'tileAction');
|
||||
if (!target) {
|
||||
return;
|
||||
@ -77,7 +80,6 @@
|
||||
|
||||
if (action === ACTION.CLONE) {
|
||||
this.piskelController.duplicateFrameAt(index);
|
||||
this.piskelController.setCurrentFrameIndex(index + 1);
|
||||
this.updateScrollerOverflows();
|
||||
} else if (action === ACTION.DELETE) {
|
||||
this.piskelController.removeFrameAt(index);
|
||||
@ -86,134 +88,152 @@
|
||||
this.piskelController.setCurrentFrameIndex(index);
|
||||
} else if (action === ACTION.NEW_FRAME) {
|
||||
this.piskelController.addFrame();
|
||||
this.piskelController.setCurrentFrameIndex(this.piskelController.getFrameCount() - 1);
|
||||
this.updateScrollerOverflows();
|
||||
}
|
||||
};
|
||||
|
||||
ns.PreviewFilmController.prototype.createPreviews_ = function () {
|
||||
|
||||
this.container.html("");
|
||||
ns.FramesListController.prototype.createPreviews_ = function () {
|
||||
this.container.html('');
|
||||
// Manually remove tooltips since mouseout events were shortcut by the DOM refresh:
|
||||
$(".tooltip").remove();
|
||||
$('.tooltip').remove();
|
||||
|
||||
var frameCount = this.piskelController.getFrameCount();
|
||||
|
||||
for (var i = 0, l = frameCount; i < l ; i++) {
|
||||
for (var i = 0 ; i < frameCount ; i++) {
|
||||
this.container.append(this.createPreviewTile_(i));
|
||||
}
|
||||
// Append 'new empty frame' button
|
||||
var newFrameButton = document.createElement("div");
|
||||
newFrameButton.id = "add-frame-action";
|
||||
newFrameButton.className = "add-frame-action";
|
||||
var newFrameButton = document.createElement('div');
|
||||
newFrameButton.id = 'add-frame-action';
|
||||
newFrameButton.className = 'add-frame-action';
|
||||
newFrameButton.setAttribute('data-tile-action', ACTION.NEW_FRAME);
|
||||
newFrameButton.innerHTML = "<p class='label'>Add new frame</p>";
|
||||
newFrameButton.innerHTML = '<p class="label">Add new frame</p>';
|
||||
this.container.append(newFrameButton);
|
||||
|
||||
var needDragndropBehavior = (frameCount > 1);
|
||||
if(needDragndropBehavior) {
|
||||
if (needDragndropBehavior) {
|
||||
this.initDragndropBehavior_();
|
||||
}
|
||||
this.updateScrollerOverflows();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.PreviewFilmController.prototype.initDragndropBehavior_ = function () {
|
||||
ns.FramesListController.prototype.initDragndropBehavior_ = function () {
|
||||
|
||||
$("#preview-list").sortable({
|
||||
placeholder: "preview-tile-drop-proxy",
|
||||
$('#preview-list').sortable({
|
||||
placeholder: 'preview-tile-drop-proxy',
|
||||
update: $.proxy(this.onUpdate_, this),
|
||||
items: ".preview-tile"
|
||||
items: '.preview-tile'
|
||||
});
|
||||
$("#preview-list").disableSelection();
|
||||
$('#preview-list').disableSelection();
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.PreviewFilmController.prototype.onUpdate_ = function( event, ui ) {
|
||||
var originFrameId = parseInt(ui.item.data("tile-number"), 10);
|
||||
ns.FramesListController.prototype.onUpdate_ = function (event, ui) {
|
||||
var originFrameId = parseInt(ui.item.data('tile-number'), 10);
|
||||
var targetInsertionId = $('.preview-tile').index(ui.item);
|
||||
|
||||
this.piskelController.moveFrame(originFrameId, targetInsertionId);
|
||||
this.piskelController.setCurrentFrameIndex(targetInsertionId);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* TODO(vincz): clean this giant rendering function & remove listeners.
|
||||
*/
|
||||
ns.PreviewFilmController.prototype.createPreviewTile_ = function(tileNumber) {
|
||||
ns.FramesListController.prototype.createPreviewTile_ = function(tileNumber) {
|
||||
var currentFrame = this.piskelController.getCurrentLayer().getFrameAt(tileNumber);
|
||||
|
||||
var previewTileRoot = document.createElement("li");
|
||||
previewTileRoot.setAttribute("data-tile-number", tileNumber);
|
||||
var previewTileRoot = document.createElement('li');
|
||||
previewTileRoot.setAttribute('data-tile-number', tileNumber);
|
||||
previewTileRoot.setAttribute('data-tile-action', ACTION.SELECT);
|
||||
previewTileRoot.classList.add("preview-tile");
|
||||
previewTileRoot.classList.add('preview-tile');
|
||||
if (this.piskelController.getCurrentFrame() == currentFrame) {
|
||||
previewTileRoot.classList.add("selected");
|
||||
previewTileRoot.classList.add('selected');
|
||||
}
|
||||
|
||||
var canvasContainer = document.createElement("div");
|
||||
canvasContainer.classList.add("canvas-container", pskl.UserSettings.get(pskl.UserSettings.CANVAS_BACKGROUND));
|
||||
var canvasContainer = document.createElement('div');
|
||||
canvasContainer.classList.add('canvas-container', pskl.UserSettings.get(pskl.UserSettings.CANVAS_BACKGROUND));
|
||||
|
||||
var height = this.zoom * this.piskelController.getCurrentFrame().getHeight();
|
||||
var horizontalMargin = (Constants.PREVIEW_FILM_SIZE - height) / 2;
|
||||
canvasContainer.style.marginTop = horizontalMargin + 'px';
|
||||
|
||||
var canvasBackground = document.createElement("div");
|
||||
canvasBackground.className = "canvas-background";
|
||||
var width = this.zoom * this.piskelController.getCurrentFrame().getWidth();
|
||||
var verticalMargin = (Constants.PREVIEW_FILM_SIZE - width) / 2;
|
||||
canvasContainer.style.marginLeft = verticalMargin + 'px';
|
||||
canvasContainer.style.marginRight = verticalMargin + 'px';
|
||||
|
||||
var canvasBackground = document.createElement('div');
|
||||
canvasBackground.className = 'canvas-background';
|
||||
canvasContainer.appendChild(canvasBackground);
|
||||
|
||||
var cloneFrameButton = document.createElement("button");
|
||||
var cloneFrameButton = document.createElement('button');
|
||||
cloneFrameButton.setAttribute('rel', 'tooltip');
|
||||
cloneFrameButton.setAttribute('data-placement', 'right');
|
||||
cloneFrameButton.setAttribute('data-tile-number', tileNumber);
|
||||
cloneFrameButton.setAttribute('data-tile-action', ACTION.CLONE);
|
||||
cloneFrameButton.setAttribute('title', 'Duplicate this frame');
|
||||
cloneFrameButton.className = "tile-overlay duplicate-frame-action";
|
||||
cloneFrameButton.className = 'tile-overlay duplicate-frame-action';
|
||||
previewTileRoot.appendChild(cloneFrameButton);
|
||||
|
||||
var canvasRenderer = new pskl.rendering.CanvasRenderer(currentFrame, this.zoom);
|
||||
canvasRenderer.drawTransparentAs(Constants.TRANSPARENT_COLOR);
|
||||
var canvas = canvasRenderer.render();
|
||||
canvas.classList.add('tile-view', 'canvas');
|
||||
canvasContainer.appendChild(canvas);
|
||||
canvasContainer.appendChild(this.getCanvasForFrame(currentFrame));
|
||||
previewTileRoot.appendChild(canvasContainer);
|
||||
|
||||
if(tileNumber > 0 || this.piskelController.getFrameCount() > 1) {
|
||||
if (tileNumber > 0 || this.piskelController.getFrameCount() > 1) {
|
||||
// Add 'remove frame' button.
|
||||
var deleteButton = document.createElement("button");
|
||||
var deleteButton = document.createElement('button');
|
||||
deleteButton.setAttribute('rel', 'tooltip');
|
||||
deleteButton.setAttribute('data-placement', 'right');
|
||||
deleteButton.setAttribute('title', 'Delete this frame');
|
||||
deleteButton.setAttribute('data-tile-number', tileNumber);
|
||||
deleteButton.setAttribute('data-tile-action', ACTION.DELETE);
|
||||
deleteButton.className = "tile-overlay delete-frame-action";
|
||||
deleteButton.className = 'tile-overlay delete-frame-action';
|
||||
previewTileRoot.appendChild(deleteButton);
|
||||
|
||||
// Add 'dragndrop handle'.
|
||||
var dndHandle = document.createElement("div");
|
||||
dndHandle.className = "tile-overlay dnd-action";
|
||||
var dndHandle = document.createElement('div');
|
||||
dndHandle.className = 'tile-overlay dnd-action';
|
||||
previewTileRoot.appendChild(dndHandle);
|
||||
}
|
||||
var tileCount = document.createElement("div");
|
||||
tileCount.className = "tile-overlay tile-count";
|
||||
var tileCount = document.createElement('div');
|
||||
tileCount.className = 'tile-overlay tile-count';
|
||||
tileCount.innerHTML = tileNumber + 1;
|
||||
previewTileRoot.appendChild(tileCount);
|
||||
|
||||
return previewTileRoot;
|
||||
};
|
||||
|
||||
ns.FramesListController.prototype.getCanvasForFrame = function (frame) {
|
||||
var canvas = this.cachedFrameProcessor.get(frame, this.zoom);
|
||||
return canvas;
|
||||
};
|
||||
|
||||
ns.FramesListController.prototype.frameToPreviewCanvas_ = function (frame) {
|
||||
var canvasRenderer = new pskl.rendering.CanvasRenderer(frame, this.zoom);
|
||||
canvasRenderer.drawTransparentAs(Constants.TRANSPARENT_COLOR);
|
||||
var canvas = canvasRenderer.render();
|
||||
canvas.classList.add('tile-view', 'canvas');
|
||||
return canvas;
|
||||
};
|
||||
|
||||
ns.FramesListController.prototype.clonePreviewCanvas_ = function (canvas) {
|
||||
var clone = pskl.utils.CanvasUtils.clone(canvas);
|
||||
clone.classList.add('tile-view', 'canvas');
|
||||
return clone;
|
||||
};
|
||||
|
||||
/**
|
||||
* Calculate the preview zoom depending on the piskel size
|
||||
*/
|
||||
ns.PreviewFilmController.prototype.calculateZoom_ = function () {
|
||||
var curFrame = this.piskelController.getCurrentFrame(),
|
||||
frameHeight = curFrame.getHeight(),
|
||||
frameWidth = curFrame.getWidth();
|
||||
ns.FramesListController.prototype.calculateZoom_ = function () {
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
var frameSize = Math.max(frame.getHeight(), frame.getWidth());
|
||||
|
||||
return Math.min(Constants.PREVIEW_FILM_SIZE/frameHeight, Constants.PREVIEW_FILM_SIZE/frameWidth);
|
||||
return Constants.PREVIEW_FILM_SIZE / frameSize;
|
||||
};
|
||||
})();
|
||||
})();
|
55
src/js/controller/HeaderController.js
Normal file
@ -0,0 +1,55 @@
|
||||
(function () {
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
/**
|
||||
* When embedded in piskelapp.com, the page adds a header containing the name of the currently edited sprite
|
||||
* This controller will keep the displayed name in sync with the actual piskel name
|
||||
*/
|
||||
ns.HeaderController = function (piskelController, savedStatusService) {
|
||||
this.piskelController = piskelController;
|
||||
this.savedStatusService = savedStatusService;
|
||||
};
|
||||
|
||||
ns.HeaderController.prototype.init = function () {
|
||||
this.piskelName_ = document.querySelector('.piskel-name');
|
||||
|
||||
$.subscribe(Events.BEFORE_SAVING_PISKEL, this.onBeforeSavingPiskelEvent_.bind(this));
|
||||
$.subscribe(Events.AFTER_SAVING_PISKEL, this.onAfterSavingPiskelEvent_.bind(this));
|
||||
|
||||
$.subscribe(Events.PISKEL_DESCRIPTOR_UPDATED, this.updateHeader_.bind(this));
|
||||
$.subscribe(Events.PISKEL_RESET, this.updateHeader_.bind(this));
|
||||
$.subscribe(Events.PISKEL_SAVED_STATUS_UPDATE, this.updateHeader_.bind(this));
|
||||
|
||||
this.updateHeader_();
|
||||
};
|
||||
|
||||
ns.HeaderController.prototype.updateHeader_ = function () {
|
||||
try {
|
||||
var name = this.piskelController.getPiskel().getDescriptor().name;
|
||||
if (this.savedStatusService.isDirty()) {
|
||||
name = name + ' *';
|
||||
}
|
||||
|
||||
if (this.piskelName_) {
|
||||
this.piskelName_.innerHTML = name;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Could not update header : ' + e.message);
|
||||
}
|
||||
};
|
||||
|
||||
ns.HeaderController.prototype.onBeforeSavingPiskelEvent_ = function () {
|
||||
if (!this.piskelName_) {
|
||||
return;
|
||||
}
|
||||
this.piskelName_.classList.add('piskel-name-saving');
|
||||
};
|
||||
|
||||
ns.HeaderController.prototype.onAfterSavingPiskelEvent_ = function () {
|
||||
if (!this.piskelName_) {
|
||||
return;
|
||||
}
|
||||
this.piskelName_.classList.remove('piskel-name-saving');
|
||||
};
|
||||
|
||||
})();
|
@ -1,26 +1,84 @@
|
||||
(function () {
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
var TOGGLE_LAYER_SHORTCUT = 'alt+L';
|
||||
|
||||
ns.LayersListController = function (piskelController) {
|
||||
this.piskelController = piskelController;
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.init = function () {
|
||||
this.layerItemTemplate_ = pskl.utils.Template.get('layer-item-template');
|
||||
this.rootEl = document.querySelectorAll('.layers-list-container')[0];
|
||||
this.layersListEl = document.querySelectorAll('.layers-list')[0];
|
||||
this.rootEl = document.querySelector('.layers-list-container');
|
||||
this.layersListEl = document.querySelector('.layers-list');
|
||||
this.toggleLayerPreviewEl = document.querySelector('.layers-toggle-preview');
|
||||
|
||||
this.rootEl.addEventListener('click', this.onClick_.bind(this));
|
||||
this.toggleLayerPreviewEl.addEventListener('click', this.toggleLayerPreview_.bind(this));
|
||||
|
||||
$.subscribe(Events.PISKEL_RESET, this.renderLayerList_.bind(this));
|
||||
this.initToggleLayerPreview_();
|
||||
|
||||
this.renderLayerList_();
|
||||
this.updateToggleLayerPreview_();
|
||||
|
||||
$.subscribe(Events.PISKEL_RESET, this.renderLayerList_.bind(this));
|
||||
$.subscribe(Events.USER_SETTINGS_CHANGED, $.proxy(this.onUserSettingsChange_, this));
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.renderLayerList_ = function () {
|
||||
this.layersListEl.innerHTML = '';
|
||||
var layers = this.piskelController.getLayers();
|
||||
layers.forEach(this.addLayerItem.bind(this));
|
||||
this.updateButtonStatus_();
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.initToggleLayerPreview_ = function () {
|
||||
var descriptors = [{description : 'Opacity defined in PREFERENCES'}];
|
||||
var helpText = 'Preview all layers';
|
||||
|
||||
var toggleLayerPreviewTooltip = pskl.utils.TooltipFormatter.format(helpText, TOGGLE_LAYER_SHORTCUT, descriptors);
|
||||
this.toggleLayerPreviewEl.setAttribute('title', toggleLayerPreviewTooltip);
|
||||
|
||||
pskl.app.shortcutService.addShortcut(TOGGLE_LAYER_SHORTCUT, this.toggleLayerPreview_.bind(this));
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.updateButtonStatus_ = function () {
|
||||
var layers = this.piskelController.getLayers();
|
||||
var currentLayer = this.piskelController.getCurrentLayer();
|
||||
var index = this.piskelController.getCurrentLayerIndex();
|
||||
|
||||
var isLast = index === 0;
|
||||
var isOnly = layers.length === 1;
|
||||
var isFirst = index === layers.length - 1;
|
||||
|
||||
this.toggleButtonDisabledState_('up', isFirst);
|
||||
this.toggleButtonDisabledState_('down', isLast);
|
||||
this.toggleButtonDisabledState_('merge', isLast);
|
||||
this.toggleButtonDisabledState_('delete', isOnly);
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.toggleButtonDisabledState_ = function (buttonAction, isDisabled) {
|
||||
var button = document.querySelector('.layers-button[data-action="' + buttonAction + '"]');
|
||||
if (isDisabled) {
|
||||
button.setAttribute('disabled', 'disabled');
|
||||
} else {
|
||||
button.removeAttribute('disabled');
|
||||
}
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.updateToggleLayerPreview_ = function () {
|
||||
var enabledClassname = 'layers-toggle-preview-enabled';
|
||||
if (pskl.UserSettings.get(pskl.UserSettings.LAYER_PREVIEW)) {
|
||||
this.toggleLayerPreviewEl.classList.add(enabledClassname);
|
||||
} else {
|
||||
this.toggleLayerPreviewEl.classList.remove(enabledClassname);
|
||||
}
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.onUserSettingsChange_ = function (evt, name, value) {
|
||||
if (name == pskl.UserSettings.LAYER_PREVIEW) {
|
||||
this.updateToggleLayerPreview_();
|
||||
}
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.addLayerItem = function (layer, index) {
|
||||
@ -42,21 +100,25 @@
|
||||
} else if (el.classList.contains('layer-item')) {
|
||||
index = el.dataset.layerIndex;
|
||||
this.piskelController.setCurrentLayerIndex(parseInt(index, 10));
|
||||
} else if (el.classList.contains('edit-icon')) {
|
||||
index = el.parentNode.dataset.layerIndex;
|
||||
this.renameLayerAt_(index);
|
||||
}
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.renameLayerAt_ = function (index) {
|
||||
var layer = this.piskelController.getLayerAt(index);
|
||||
var name = window.prompt("Please enter the layer name", layer.getName());
|
||||
ns.LayersListController.prototype.renameCurrentLayer_ = function () {
|
||||
var layer = this.piskelController.getCurrentLayer();
|
||||
var name = window.prompt('Please enter the layer name', layer.getName());
|
||||
if (name) {
|
||||
var index = this.piskelController.getCurrentLayerIndex();
|
||||
this.piskelController.renameLayerAt(index, name);
|
||||
this.renderLayerList_();
|
||||
}
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.mergeDownCurrentLayer_ = function () {
|
||||
var index = this.piskelController.getCurrentLayerIndex();
|
||||
this.piskelController.mergeDownLayerAt(index);
|
||||
this.renderLayerList_();
|
||||
};
|
||||
|
||||
ns.LayersListController.prototype.onButtonClick_ = function (button) {
|
||||
var action = button.getAttribute('data-action');
|
||||
if (action == 'up') {
|
||||
@ -67,6 +129,22 @@
|
||||
this.piskelController.createLayer();
|
||||
} else if (action == 'delete') {
|
||||
this.piskelController.removeCurrentLayer();
|
||||
} else if (action == 'merge') {
|
||||
this.mergeDownCurrentLayer_();
|
||||
} else if (action == 'edit') {
|
||||
this.renameCurrentLayer_();
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
ns.LayersListController.prototype.toggleLayerPreview_ = function () {
|
||||
var currentValue = pskl.UserSettings.get(pskl.UserSettings.LAYER_PREVIEW);
|
||||
var currentLayerOpacity = pskl.UserSettings.get(pskl.UserSettings.LAYER_OPACITY);
|
||||
|
||||
var showLayerPreview = !currentValue;
|
||||
pskl.UserSettings.set(pskl.UserSettings.LAYER_PREVIEW, showLayerPreview);
|
||||
|
||||
if (showLayerPreview && currentLayerOpacity === 0) {
|
||||
pskl.UserSettings.set(pskl.UserSettings.LAYER_OPACITY, Constants.DEFAULT.LAYER_OPACITY);
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
@ -1,21 +1,22 @@
|
||||
(function () {
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
ns.MinimapController = function (piskelController, animationController, drawingController, container) {
|
||||
ns.MinimapController = function (piskelController, previewController, drawingController, container) {
|
||||
this.piskelController = piskelController;
|
||||
this.animationController = animationController;
|
||||
this.previewController = previewController;
|
||||
this.drawingController = drawingController;
|
||||
this.container = container;
|
||||
|
||||
this.isClicked = false;
|
||||
this.isVisible = false;
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.init = function () {
|
||||
// Create minimap DOM elements
|
||||
this.cropFrame = document.createElement('DIV');
|
||||
this.cropFrame.className = 'minimap-crop-frame';
|
||||
this.cropFrame.style.display = 'none';
|
||||
$(this.container).append(this.cropFrame);
|
||||
this.minimapEl = document.createElement('DIV');
|
||||
this.minimapEl.className = 'minimap-crop-frame';
|
||||
this.minimapEl.style.display = 'none';
|
||||
$(this.container).append(this.minimapEl);
|
||||
|
||||
// Init mouse events
|
||||
$(this.container).mousedown(this.onMinimapMousedown_.bind(this));
|
||||
@ -26,34 +27,81 @@
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.renderMinimap_ = function () {
|
||||
var zoomRatio = this.getDrawingAreaZoomRatio_();
|
||||
if (zoomRatio > 1) {
|
||||
this.displayCropFrame_(zoomRatio, this.drawingController.getRenderer().getOffset());
|
||||
var verticalRatio = this.getVerticalRatio_();
|
||||
var horizontalRatio = this.getHorizontalRatio_();
|
||||
if (verticalRatio > 1 || horizontalRatio > 1) {
|
||||
this.displayMinimap_();
|
||||
} else {
|
||||
this.hideCropFrame_();
|
||||
this.hideMinimap_();
|
||||
}
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.displayCropFrame_ = function (ratio, offset) {
|
||||
this.cropFrame.style.display = 'block';
|
||||
this.cropFrame.style.top = (offset.y * this.animationController.getZoom()) + 'px';
|
||||
this.cropFrame.style.left = (offset.x * this.animationController.getZoom()) + 'px';
|
||||
var zoomRatio = this.getDrawingAreaZoomRatio_();
|
||||
this.cropFrame.style.width = (this.container.width() / zoomRatio) + 'px';
|
||||
this.cropFrame.style.height = (this.container.height() / zoomRatio) + 'px';
|
||||
ns.MinimapController.prototype.displayMinimap_ = function () {
|
||||
var minimapSize = this.getMinimapSize_();
|
||||
var previewSize = this.getPreviewSize_();
|
||||
|
||||
var containerHeight = this.container.height();
|
||||
var containerWidth = this.container.width();
|
||||
|
||||
// offset(x, y) in frame pixels
|
||||
var offset = this.drawingController.getRenderer().getOffset();
|
||||
|
||||
// the preview is centered in a square container
|
||||
// if the sprite is not a square, a margin is needed on the appropriate coordinate
|
||||
// before adding the offset coming from the drawing area
|
||||
var leftMargin = (containerWidth - Math.max(minimapSize.width, previewSize.width)) / 2;
|
||||
var leftOffset = offset.x * this.previewController.getZoom();
|
||||
var left = leftMargin + leftOffset;
|
||||
|
||||
var topMargin = (containerHeight - Math.max(minimapSize.height, previewSize.height)) / 2;
|
||||
var topOffset = offset.y * this.previewController.getZoom();
|
||||
var top = topMargin + topOffset;
|
||||
|
||||
this.minimapEl.style.display = 'block';
|
||||
this.minimapEl.style.width = Math.min(minimapSize.width, containerWidth) + 'px';
|
||||
this.minimapEl.style.height = Math.min(minimapSize.height, containerHeight) + 'px';
|
||||
this.minimapEl.style.left = Math.max(0, left) + 'px';
|
||||
this.minimapEl.style.top = Math.max(0, top) + 'px';
|
||||
|
||||
this.isVisible = true;
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.hideCropFrame_ = function () {
|
||||
this.cropFrame.style.display = 'none';
|
||||
ns.MinimapController.prototype.getMinimapSize_ = function () {
|
||||
// Calculate the ratio to translate drawing area sizes to animated preview sizes
|
||||
var drawingAreaZoom = this.drawingController.getRenderer().getZoom();
|
||||
var animatedPreviewZoom = this.previewController.getZoom();
|
||||
var ratio = drawingAreaZoom / animatedPreviewZoom;
|
||||
|
||||
var displaySize = this.drawingController.getRenderer().getDisplaySize();
|
||||
var minimapWidth = displaySize.width / ratio;
|
||||
var minimapHeight = displaySize.height / ratio;
|
||||
|
||||
return {
|
||||
width : minimapWidth,
|
||||
height: minimapHeight
|
||||
};
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.getPreviewSize_ = function () {
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
var previewWidth = frame.getWidth() * this.previewController.getZoom();
|
||||
var previewHeight = frame.getHeight() * this.previewController.getZoom();
|
||||
|
||||
return {
|
||||
width : previewWidth,
|
||||
height: previewHeight
|
||||
};
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.hideMinimap_ = function () {
|
||||
this.minimapEl.style.display = 'none';
|
||||
this.isVisible = false;
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.onMinimapMousemove_ = function (evt) {
|
||||
if (this.isClicked) {
|
||||
if (this.getDrawingAreaZoomRatio_() > 1) {
|
||||
var coords = this.getCoordinatesCenteredAround_(evt.clientX, evt.clientY);
|
||||
this.drawingController.setOffset(coords.x, coords.y);
|
||||
}
|
||||
if (this.isVisible && this.isClicked) {
|
||||
var coords = this.getCoordinatesCenteredAround_(evt.clientX, evt.clientY);
|
||||
this.drawingController.setOffset(coords.x, coords.y);
|
||||
}
|
||||
};
|
||||
|
||||
@ -66,25 +114,35 @@
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.getCoordinatesCenteredAround_ = function (x, y) {
|
||||
var frameCoords = this.animationController.getCoordinates(x, y);
|
||||
var zoomRatio = this.getDrawingAreaZoomRatio_();
|
||||
var frameCoords = this.previewController.getCoordinates(x, y);
|
||||
|
||||
var frameWidth = this.piskelController.getCurrentFrame().getWidth();
|
||||
var frameHeight = this.piskelController.getCurrentFrame().getHeight();
|
||||
|
||||
var width = frameWidth / zoomRatio;
|
||||
var height = frameHeight / zoomRatio;
|
||||
var width = frameWidth / this.getHorizontalRatio_();
|
||||
var height = frameHeight / this.getVerticalRatio_();
|
||||
|
||||
return {
|
||||
x : frameCoords.x - (width/2),
|
||||
y : frameCoords.y - (height/2)
|
||||
x : frameCoords.x - (width / 2),
|
||||
y : frameCoords.y - (height / 2)
|
||||
};
|
||||
};
|
||||
|
||||
ns.MinimapController.prototype.getDrawingAreaZoomRatio_ = function () {
|
||||
ns.MinimapController.prototype.getVerticalRatio_ = function () {
|
||||
var drawingAreaZoom = this.drawingController.getRenderer().getZoom();
|
||||
var drawingAreaFullHeight = this.piskelController.getCurrentFrame().getHeight() * drawingAreaZoom;
|
||||
var zoomRatio = drawingAreaFullHeight / this.drawingController.getRenderer().getDisplaySize().height;
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
var frameTotalHeight = frame.getHeight() * drawingAreaZoom;
|
||||
var frameDisplayHeight = this.drawingController.getRenderer().getDisplaySize().height;
|
||||
|
||||
return zoomRatio;
|
||||
return frameTotalHeight / frameDisplayHeight;
|
||||
};
|
||||
})();
|
||||
|
||||
ns.MinimapController.prototype.getHorizontalRatio_ = function () {
|
||||
var drawingAreaZoom = this.drawingController.getRenderer().getZoom();
|
||||
var frame = this.piskelController.getCurrentFrame();
|
||||
var frameTotalWidth = frame.getWidth() * drawingAreaZoom;
|
||||
var frameDisplayWidth = this.drawingController.getRenderer().getDisplaySize().width;
|
||||
|
||||
return frameTotalWidth / frameDisplayWidth;
|
||||
};
|
||||
})();
|
||||
|
@ -1,5 +1,5 @@
|
||||
(function () {
|
||||
var ns = $.namespace("pskl.controller");
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
ns.NotificationController = function () {};
|
||||
|
||||
@ -18,22 +18,27 @@
|
||||
this.removeMessage_();
|
||||
|
||||
var message = document.createElement('div');
|
||||
message.id = "user-message";
|
||||
message.className = "user-message";
|
||||
message.id = 'user-message';
|
||||
message.className = 'user-message';
|
||||
message.innerHTML = messageInfo.content;
|
||||
message.innerHTML = message.innerHTML + "<div title='Close message' class='close'>x</div>";
|
||||
message.innerHTML = message.innerHTML + '<div title="Close message" class="close">x</div>';
|
||||
document.body.appendChild(message);
|
||||
$(message).find(".close").click($.proxy(this.removeMessage_, this));
|
||||
if(messageInfo.behavior) {
|
||||
|
||||
message.querySelector('.close').addEventListener('click', this.removeMessage_.bind(this));
|
||||
if (messageInfo.behavior) {
|
||||
messageInfo.behavior(message);
|
||||
}
|
||||
|
||||
if (messageInfo.hideDelay) {
|
||||
window.setTimeout(this.removeMessage_.bind(this), messageInfo.hideDelay);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.NotificationController.prototype.removeMessage_ = function (evt) {
|
||||
var message = $("#user-message");
|
||||
var message = $('#user-message');
|
||||
if (message.length) {
|
||||
message.remove();
|
||||
}
|
||||
|
@ -1,10 +1,7 @@
|
||||
(function () {
|
||||
var ns = $.namespace("pskl.controller");
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
ns.PaletteController = function () {
|
||||
this.primaryColor = Constants.DEFAULT_PEN_COLOR;
|
||||
this.secondaryColor = Constants.TRANSPARENT_COLOR;
|
||||
};
|
||||
ns.PaletteController = function () {};
|
||||
|
||||
/**
|
||||
* @public
|
||||
@ -50,10 +47,10 @@
|
||||
*/
|
||||
ns.PaletteController.prototype.onPickerChange_ = function(evt, isPrimary) {
|
||||
var inputPicker = $(evt.target);
|
||||
if(evt.data.isPrimary) {
|
||||
this.setPrimaryColor(inputPicker.val());
|
||||
if (evt.data.isPrimary) {
|
||||
this.setPrimaryColor_(inputPicker.val());
|
||||
} else {
|
||||
this.setSecondaryColor(inputPicker.val());
|
||||
this.setSecondaryColor_(inputPicker.val());
|
||||
}
|
||||
};
|
||||
|
||||
@ -62,42 +59,31 @@
|
||||
*/
|
||||
ns.PaletteController.prototype.onColorSelected_ = function(args, evt, color) {
|
||||
var inputPicker = $(evt.target);
|
||||
if(args.isPrimary) {
|
||||
this.setPrimaryColor(color);
|
||||
if (args.isPrimary) {
|
||||
this.setPrimaryColor_(color);
|
||||
} else {
|
||||
this.setSecondaryColor(color);
|
||||
this.setSecondaryColor_(color);
|
||||
}
|
||||
};
|
||||
|
||||
ns.PaletteController.prototype.setPrimaryColor = function (color) {
|
||||
this.primaryColor = color;
|
||||
ns.PaletteController.prototype.setPrimaryColor_ = function (color) {
|
||||
this.updateColorPicker_(color, $('#color-picker'));
|
||||
$.publish(Events.PRIMARY_COLOR_SELECTED, [color]);
|
||||
};
|
||||
|
||||
ns.PaletteController.prototype.setSecondaryColor = function (color) {
|
||||
this.secondaryColor = color;
|
||||
ns.PaletteController.prototype.setSecondaryColor_ = function (color) {
|
||||
this.updateColorPicker_(color, $('#secondary-color-picker'));
|
||||
$.publish(Events.SECONDARY_COLOR_SELECTED, [color]);
|
||||
};
|
||||
|
||||
ns.PaletteController.prototype.getPrimaryColor = function () {
|
||||
return this.primaryColor;
|
||||
};
|
||||
|
||||
ns.PaletteController.prototype.getSecondaryColor = function () {
|
||||
return this.secondaryColor;
|
||||
};
|
||||
|
||||
ns.PaletteController.prototype.swapColors = function () {
|
||||
var primaryColor = this.getPrimaryColor();
|
||||
this.setPrimaryColor(this.getSecondaryColor());
|
||||
this.setSecondaryColor(primaryColor);
|
||||
var primaryColor = pskl.app.selectedColorsService.getPrimaryColor();
|
||||
this.setPrimaryColor_(pskl.app.selectedColorsService.getSecondaryColor());
|
||||
this.setSecondaryColor_(primaryColor);
|
||||
};
|
||||
|
||||
ns.PaletteController.prototype.resetColors = function () {
|
||||
this.setPrimaryColor(Constants.DEFAULT_PEN_COLOR);
|
||||
this.setSecondaryColor(Constants.TRANSPARENT_COLOR);
|
||||
pskl.app.selectedColorsService.reset();
|
||||
};
|
||||
|
||||
/**
|
||||
@ -114,10 +100,10 @@
|
||||
// The colorpicker can't be set to a transparent state.
|
||||
// We set its background to white and insert the
|
||||
// string "TRANSPARENT" to mimic this state:
|
||||
colorPicker.spectrum("set", Constants.TRANSPARENT_COLOR);
|
||||
colorPicker.spectrum('set', Constants.TRANSPARENT_COLOR);
|
||||
colorPicker.val(Constants.TRANSPARENT_COLOR);
|
||||
} else {
|
||||
colorPicker.spectrum("set", color);
|
||||
colorPicker.spectrum('set', color);
|
||||
}
|
||||
this.setTitleOnPicker_(color, colorPicker);
|
||||
};
|
||||
@ -127,6 +113,3 @@
|
||||
colorPicker.next(spectrumInputSelector).attr('title', title);
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
@ -10,104 +10,157 @@
|
||||
// I apologize to my future self for this one.
|
||||
var NO_SCROLL_MAX_COLORS = 20;
|
||||
|
||||
var MAX_COLORS = 100;
|
||||
|
||||
ns.PalettesListController = function (paletteController, usedColorService) {
|
||||
ns.PalettesListController = function (usedColorService) {
|
||||
this.usedColorService = usedColorService;
|
||||
this.paletteController = paletteController;
|
||||
this.paletteService = pskl.app.paletteService;
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.init = function () {
|
||||
this.paletteColorTemplate_ = pskl.utils.Template.get('palette-color-template');
|
||||
|
||||
this.colorListContainer_ = document.querySelector('.palettes-list-colors');
|
||||
this.colorPaletteSelect_ = document.querySelector('.palettes-list-select');
|
||||
this.paletteListOptGroup_ = document.querySelector('.palettes-list-select-group');
|
||||
|
||||
var createPaletteButton_ = document.querySelector('.create-palette-button');
|
||||
var editPaletteButton_ = document.querySelector('.edit-palette-button');
|
||||
|
||||
this.colorPaletteSelect_.addEventListener('change', this.onPaletteSelected_.bind(this));
|
||||
this.colorListContainer_.addEventListener('mouseup', this.onColorContainerMouseup.bind(this));
|
||||
this.colorListContainer_.addEventListener('contextmenu', this.onColorContainerContextMenu.bind(this));
|
||||
|
||||
createPaletteButton_.addEventListener('click', this.onCreatePaletteClick_.bind(this));
|
||||
editPaletteButton_.addEventListener('click', this.onEditPaletteClick_.bind(this));
|
||||
|
||||
$.subscribe(Events.PALETTE_LIST_UPDATED, this.onPaletteListUpdated.bind(this));
|
||||
$.subscribe(Events.CURRENT_COLORS_UPDATED, this.fillColorListContainer.bind(this));
|
||||
$.subscribe(Events.PRIMARY_COLOR_SELECTED, this.highlightSelectedColors.bind(this));
|
||||
$.subscribe(Events.SECONDARY_COLOR_SELECTED, this.highlightSelectedColors.bind(this));
|
||||
$.subscribe(Events.USER_SETTINGS_CHANGED, $.proxy(this.onUserSettingsChange_, this));
|
||||
|
||||
pskl.app.shortcutService.addShortcuts(['>', 'shift+>'], this.selectNextColor_.bind(this));
|
||||
pskl.app.shortcutService.addShortcut('<', this.selectPreviousColor_.bind(this));
|
||||
pskl.app.shortcutService.addShortcuts('123465789'.split(''), this.selectColorForKey_.bind(this));
|
||||
|
||||
this.fillPaletteList();
|
||||
this.selectPaletteFromUserSettings();
|
||||
this.updateFromUserSettings();
|
||||
this.fillColorListContainer();
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.fillPaletteList = function () {
|
||||
var palettes = [{
|
||||
id : Constants.NO_PALETTE_ID,
|
||||
name : 'No palette'
|
||||
}];
|
||||
palettes = palettes.concat(this.retrievePalettes());
|
||||
var palettes = this.paletteService.getPalettes();
|
||||
|
||||
var html = palettes.map(function (palette) {
|
||||
return pskl.utils.Template.replace('<option value="{{id}}">{{name}}</option>', palette);
|
||||
}).join('');
|
||||
this.paletteListOptGroup_.innerHTML = html;
|
||||
this.colorPaletteSelect_.innerHTML = html;
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.fillColorListContainer = function () {
|
||||
|
||||
var colors = this.getSelectedPaletteColors_();
|
||||
|
||||
var html = colors.map(function (color) {
|
||||
return pskl.utils.Template.replace(this.paletteColorTemplate_, {color : color});
|
||||
}.bind(this)).join('');
|
||||
this.colorListContainer_.innerHTML = html;
|
||||
if (colors.length > 0) {
|
||||
var html = colors.map(function (color, index) {
|
||||
return pskl.utils.Template.replace(this.paletteColorTemplate_, {color : color, index : index});
|
||||
}.bind(this)).join('');
|
||||
this.colorListContainer_.innerHTML = html;
|
||||
|
||||
this.highlightSelectedColors();
|
||||
this.highlightSelectedColors();
|
||||
|
||||
var hasScrollbar = colors.length > NO_SCROLL_MAX_COLORS;
|
||||
if (hasScrollbar && !pskl.utils.UserAgent.isChrome) {
|
||||
this.colorListContainer_.classList.add(HAS_SCROLL_CLASSNAME);
|
||||
var hasScrollbar = colors.length > NO_SCROLL_MAX_COLORS;
|
||||
if (hasScrollbar && !pskl.utils.UserAgent.isChrome) {
|
||||
this.colorListContainer_.classList.add(HAS_SCROLL_CLASSNAME);
|
||||
} else {
|
||||
this.colorListContainer_.classList.remove(HAS_SCROLL_CLASSNAME);
|
||||
}
|
||||
} else {
|
||||
this.colorListContainer_.classList.remove(HAS_SCROLL_CLASSNAME);
|
||||
this.colorListContainer_.innerHTML = pskl.utils.Template.get('palettes-list-no-colors-partial');
|
||||
}
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.selectPalette = function (paletteId) {
|
||||
pskl.UserSettings.set(pskl.UserSettings.SELECTED_PALETTE, paletteId);
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.getSelectedPaletteColors_ = function () {
|
||||
var colors = [];
|
||||
var paletteId = this.colorPaletteSelect_.value;
|
||||
if (paletteId === Constants.CURRENT_COLORS_PALETTE_ID) {
|
||||
colors = this.usedColorService.getCurrentColors();
|
||||
} else {
|
||||
var palette = this.getPaletteById(paletteId, this.retrievePalettes());
|
||||
if (palette) {
|
||||
colors = palette.colors;
|
||||
}
|
||||
var palette = this.getSelectedPalette_();
|
||||
if (palette) {
|
||||
colors = palette.getColors();
|
||||
}
|
||||
|
||||
if (colors.length > MAX_COLORS) {
|
||||
colors = colors.slice(0, MAX_COLORS);
|
||||
if (colors.length > Constants.MAX_PALETTE_COLORS) {
|
||||
colors = colors.slice(0, Constants.MAX_PALETTE_COLORS);
|
||||
}
|
||||
|
||||
return colors;
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.selectPalette = function (paletteId) {
|
||||
this.colorPaletteSelect_.value = paletteId;
|
||||
ns.PalettesListController.prototype.getSelectedPalette_ = function () {
|
||||
var paletteId = pskl.UserSettings.get(pskl.UserSettings.SELECTED_PALETTE);
|
||||
return this.paletteService.getPaletteById(paletteId);
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.selectPaletteFromUserSettings = function () {
|
||||
this.selectPalette(pskl.UserSettings.get(pskl.UserSettings.SELECTED_PALETTE));
|
||||
ns.PalettesListController.prototype.selectNextColor_ = function () {
|
||||
this.selectColor_(this.getCurrentColorIndex_() + 1);
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.selectPreviousColor_ = function () {
|
||||
this.selectColor_(this.getCurrentColorIndex_() - 1);
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.getCurrentColorIndex_ = function () {
|
||||
var currentIndex = 0;
|
||||
var selectedColor = document.querySelector('.' + PRIMARY_COLOR_CLASSNAME);
|
||||
if (selectedColor) {
|
||||
currentIndex = parseInt(selectedColor.dataset.colorIndex, 10);
|
||||
}
|
||||
return currentIndex;
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.selectColorForKey_ = function (key) {
|
||||
var index = parseInt(key, 10);
|
||||
index = (index + 9) % 10;
|
||||
this.selectColor_(index);
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.selectColor_ = function (index) {
|
||||
var colors = this.getSelectedPaletteColors_();
|
||||
var color = colors[index];
|
||||
if (color) {
|
||||
$.publish(Events.SELECT_PRIMARY_COLOR, [color]);
|
||||
}
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.onUserSettingsChange_ = function (evt, name, value) {
|
||||
if (name == pskl.UserSettings.SELECTED_PALETTE) {
|
||||
this.updateFromUserSettings();
|
||||
}
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.updateFromUserSettings = function () {
|
||||
var paletteId = pskl.UserSettings.get(pskl.UserSettings.SELECTED_PALETTE);
|
||||
this.fillColorListContainer();
|
||||
this.colorPaletteSelect_.value = paletteId;
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.onPaletteSelected_ = function (evt) {
|
||||
var paletteId = this.colorPaletteSelect_.value;
|
||||
if (paletteId === Constants.MANAGE_PALETTE_ID) {
|
||||
$.publish(Events.DIALOG_DISPLAY, 'manage-palettes');
|
||||
this.selectPaletteFromUserSettings();
|
||||
} else {
|
||||
pskl.UserSettings.set(pskl.UserSettings.SELECTED_PALETTE, paletteId);
|
||||
}
|
||||
|
||||
this.fillColorListContainer();
|
||||
this.selectPalette(paletteId);
|
||||
this.colorPaletteSelect_.blur();
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.onCreatePaletteClick_ = function (evt) {
|
||||
$.publish(Events.DIALOG_DISPLAY, 'create-palette');
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.onEditPaletteClick_ = function (evt) {
|
||||
var paletteId = this.colorPaletteSelect_.value;
|
||||
$.publish(Events.DIALOG_DISPLAY, {
|
||||
dialogId : 'create-palette',
|
||||
initArgs : paletteId
|
||||
});
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.onColorContainerContextMenu = function (event) {
|
||||
event.preventDefault();
|
||||
@ -130,13 +183,13 @@
|
||||
this.removeClass_(PRIMARY_COLOR_CLASSNAME);
|
||||
this.removeClass_(SECONDARY_COLOR_CLASSNAME);
|
||||
|
||||
var colorContainer = this.getColorContainer_(this.paletteController.getSecondaryColor());
|
||||
var colorContainer = this.getColorContainer_(pskl.app.selectedColorsService.getSecondaryColor());
|
||||
if (colorContainer) {
|
||||
colorContainer.classList.remove(PRIMARY_COLOR_CLASSNAME);
|
||||
colorContainer.classList.add(SECONDARY_COLOR_CLASSNAME);
|
||||
}
|
||||
|
||||
colorContainer = this.getColorContainer_(this.paletteController.getPrimaryColor());
|
||||
colorContainer = this.getColorContainer_(pskl.app.selectedColorsService.getPrimaryColor());
|
||||
if (colorContainer) {
|
||||
colorContainer.classList.remove(SECONDARY_COLOR_CLASSNAME);
|
||||
colorContainer.classList.add(PRIMARY_COLOR_CLASSNAME);
|
||||
@ -144,7 +197,7 @@
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.getColorContainer_ = function (color) {
|
||||
return this.colorListContainer_.querySelector('.palettes-list-color[data-color="'+color+'"]');
|
||||
return this.colorListContainer_.querySelector('.palettes-list-color[data-color="' + color + '"]');
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.removeClass_ = function (cssClass) {
|
||||
@ -156,24 +209,6 @@
|
||||
|
||||
ns.PalettesListController.prototype.onPaletteListUpdated = function () {
|
||||
this.fillPaletteList();
|
||||
this.selectPaletteFromUserSettings();
|
||||
this.fillColorListContainer();
|
||||
this.updateFromUserSettings();
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.getPaletteById = function (paletteId, palettes) {
|
||||
var match = null;
|
||||
|
||||
palettes.forEach(function (palette) {
|
||||
if (palette.id === paletteId) {
|
||||
match = palette;
|
||||
}
|
||||
});
|
||||
|
||||
return match;
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.retrievePalettes = function () {
|
||||
var palettesString = window.localStorage.getItem('piskel.palettes');
|
||||
return JSON.parse(palettesString) || [];
|
||||
};
|
||||
})();
|
||||
})();
|
||||
|
61
src/js/controller/ProgressBarController.js
Normal file
@ -0,0 +1,61 @@
|
||||
(function () {
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
ns.ProgressBarController = function () {
|
||||
this.template = pskl.utils.Template.get('progress-bar-template');
|
||||
this.progressBar = null;
|
||||
this.progressBarStatus = null;
|
||||
|
||||
this.showProgressTimer_ = 0;
|
||||
};
|
||||
|
||||
ns.ProgressBarController.prototype.init = function () {
|
||||
$.subscribe(Events.SHOW_PROGRESS, $.proxy(this.showProgress_, this));
|
||||
$.subscribe(Events.UPDATE_PROGRESS, $.proxy(this.updateProgress_, this));
|
||||
$.subscribe(Events.HIDE_PROGRESS, $.proxy(this.hideProgress_, this));
|
||||
};
|
||||
|
||||
ns.ProgressBarController.prototype.showProgress_ = function (event, progressInfo) {
|
||||
this.removeProgressBar_();
|
||||
this.showProgressTimer_ = window.setTimeout(this.onTimerExpired_.bind(this, progressInfo), 300);
|
||||
};
|
||||
|
||||
ns.ProgressBarController.prototype.onTimerExpired_ = function (progressInfo) {
|
||||
var progressBarHtml = pskl.utils.Template.replace(this.template, {
|
||||
name : progressInfo.name,
|
||||
status : 0
|
||||
});
|
||||
|
||||
var progressBarEl = pskl.utils.Template.createFromHTML(progressBarHtml);
|
||||
document.body.appendChild(progressBarEl);
|
||||
|
||||
this.progressBar = document.querySelector('.progress-bar');
|
||||
this.progressBarStatus = document.querySelector('.progress-bar-status');
|
||||
};
|
||||
|
||||
ns.ProgressBarController.prototype.updateProgress_ = function (event, progressInfo) {
|
||||
if (this.progressBar && this.progressBarStatus) {
|
||||
var progress = progressInfo.progress;
|
||||
var width = this.progressBar.offsetWidth;
|
||||
var progressWidth = width - ((progress * width) / 100);
|
||||
this.progressBar.style.backgroundPosition = (-progressWidth) + 'px 0';
|
||||
this.progressBarStatus.innerHTML = progress + '%';
|
||||
}
|
||||
};
|
||||
|
||||
ns.ProgressBarController.prototype.hideProgress_ = function (event, progressInfo) {
|
||||
if (this.showProgressTimer_) {
|
||||
window.clearTimeout(this.showProgressTimer_);
|
||||
}
|
||||
this.removeProgressBar_();
|
||||
};
|
||||
|
||||
ns.ProgressBarController.prototype.removeProgressBar_ = function () {
|
||||
var progressBarContainer = document.querySelector('.progress-bar-container');
|
||||
if (progressBarContainer) {
|
||||
progressBarContainer.parentNode.removeChild(progressBarContainer);
|
||||
this.progressBar = null;
|
||||
this.progressBarStatus = null;
|
||||
}
|
||||
};
|
||||
})();
|
@ -1,5 +1,5 @@
|
||||
(function () {
|
||||
var ns = $.namespace("pskl.controller");
|
||||
var ns = $.namespace('pskl.controller');
|
||||
|
||||
ns.ToolController = function () {
|
||||
var toDescriptor = function (id, shortcut, instance) {
|
||||
@ -7,22 +7,24 @@
|
||||
};
|
||||
|
||||
this.tools = [
|
||||
toDescriptor('simplePen', 'P', new pskl.drawingtools.SimplePen()),
|
||||
toDescriptor('verticalMirrorPen', 'V', new pskl.drawingtools.VerticalMirrorPen()),
|
||||
toDescriptor('eraser', 'E', new pskl.drawingtools.Eraser()),
|
||||
toDescriptor('paintBucket', 'B', new pskl.drawingtools.PaintBucket()),
|
||||
toDescriptor('stroke', 'L', new pskl.drawingtools.Stroke()),
|
||||
toDescriptor('rectangle', 'R', new pskl.drawingtools.Rectangle()),
|
||||
toDescriptor('circle', 'C', new pskl.drawingtools.Circle()),
|
||||
toDescriptor('move', 'M', new pskl.drawingtools.Move()),
|
||||
toDescriptor('rectangleSelect', 'S', new pskl.drawingtools.RectangleSelect()),
|
||||
toDescriptor('shapeSelect', 'Z', new pskl.drawingtools.ShapeSelect()),
|
||||
toDescriptor('lighten', 'U', new pskl.drawingtools.Lighten()),
|
||||
toDescriptor('colorPicker', 'O', new pskl.drawingtools.ColorPicker())
|
||||
toDescriptor('simplePen', 'P', new pskl.tools.drawing.SimplePen()),
|
||||
toDescriptor('verticalMirrorPen', 'V', new pskl.tools.drawing.VerticalMirrorPen()),
|
||||
toDescriptor('paintBucket', 'B', new pskl.tools.drawing.PaintBucket()),
|
||||
toDescriptor('colorSwap', 'A', new pskl.tools.drawing.ColorSwap()),
|
||||
toDescriptor('eraser', 'E', new pskl.tools.drawing.Eraser()),
|
||||
toDescriptor('stroke', 'L', new pskl.tools.drawing.Stroke()),
|
||||
toDescriptor('rectangle', 'R', new pskl.tools.drawing.Rectangle()),
|
||||
toDescriptor('circle', 'C', new pskl.tools.drawing.Circle()),
|
||||
toDescriptor('move', 'M', new pskl.tools.drawing.Move()),
|
||||
toDescriptor('shapeSelect', 'Z', new pskl.tools.drawing.selection.ShapeSelect()),
|
||||
toDescriptor('rectangleSelect', 'S', new pskl.tools.drawing.selection.RectangleSelect()),
|
||||
toDescriptor('lassoSelect', 'H', new pskl.tools.drawing.selection.LassoSelect()),
|
||||
toDescriptor('lighten', 'U', new pskl.tools.drawing.Lighten()),
|
||||
toDescriptor('dithering', 'T', new pskl.tools.drawing.DitheringTool()),
|
||||
toDescriptor('colorPicker', 'O', new pskl.tools.drawing.ColorPicker())
|
||||
];
|
||||
|
||||
this.currentSelectedTool = this.tools[0];
|
||||
this.previousSelectedTool = this.tools[0];
|
||||
this.toolIconRenderer = new pskl.tools.IconMarkupRenderer();
|
||||
};
|
||||
|
||||
/**
|
||||
@ -36,21 +38,30 @@
|
||||
// Set SimplePen as default selected tool:
|
||||
this.selectTool_(this.tools[0]);
|
||||
// Activate listener on tool panel:
|
||||
$("#tool-section").mousedown($.proxy(this.onToolIconClicked_, this));
|
||||
$('#tool-section').mousedown($.proxy(this.onToolIconClicked_, this));
|
||||
|
||||
$.subscribe(Events.SELECT_TOOL, this.onSelectToolEvent_.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.ToolController.prototype.activateToolOnStage_ = function(tool) {
|
||||
var stage = $("body");
|
||||
var previousSelectedToolClass = stage.data("selected-tool-class");
|
||||
if(previousSelectedToolClass) {
|
||||
var stage = $('body');
|
||||
var previousSelectedToolClass = stage.data('selected-tool-class');
|
||||
if (previousSelectedToolClass) {
|
||||
stage.removeClass(previousSelectedToolClass);
|
||||
stage.removeClass(pskl.drawingtools.Move.TOOL_ID);
|
||||
stage.removeClass(pskl.tools.drawing.Move.TOOL_ID);
|
||||
}
|
||||
stage.addClass(tool.instance.toolId);
|
||||
stage.data("selected-tool-class", tool.instance.toolId);
|
||||
stage.data('selected-tool-class', tool.instance.toolId);
|
||||
};
|
||||
|
||||
ns.ToolController.prototype.onSelectToolEvent_ = function(event, toolId) {
|
||||
var tool = this.getToolById_(toolId);
|
||||
if (tool) {
|
||||
this.selectTool_(tool);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -74,9 +85,9 @@
|
||||
*/
|
||||
ns.ToolController.prototype.onToolIconClicked_ = function(evt) {
|
||||
var target = $(evt.target);
|
||||
var clickedTool = target.closest(".tool-icon");
|
||||
var clickedTool = target.closest('.tool-icon');
|
||||
|
||||
if(clickedTool.length) {
|
||||
if (clickedTool.length) {
|
||||
var toolId = clickedTool.data().toolId;
|
||||
var tool = this.getToolById_(toolId);
|
||||
if (tool) {
|
||||
@ -95,52 +106,26 @@
|
||||
};
|
||||
|
||||
ns.ToolController.prototype.getToolById_ = function (toolId) {
|
||||
for(var i = 0 ; i < this.tools.length ; i++) {
|
||||
var tool = this.tools[i];
|
||||
if (tool.instance.toolId == toolId) {
|
||||
return tool;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return pskl.utils.Array.find(this.tools, function (tool) {
|
||||
return tool.instance.toolId == toolId;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.ToolController.prototype.createToolsDom_ = function() {
|
||||
var toolMarkup = '';
|
||||
for(var i = 0 ; i < this.tools.length ; i++) {
|
||||
toolMarkup += this.getToolMarkup_(this.tools[i]);
|
||||
var html = '';
|
||||
for (var i = 0 ; i < this.tools.length ; i++) {
|
||||
var tool = this.tools[i];
|
||||
html += this.toolIconRenderer.render(tool.instance, tool.shortcut);
|
||||
}
|
||||
$('#tools-container').html(toolMarkup);
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.ToolController.prototype.getToolMarkup_ = function(tool) {
|
||||
var toolId = tool.instance.toolId;
|
||||
|
||||
var classList = ['tool-icon', toolId];
|
||||
if (this.currentSelectedTool == tool) {
|
||||
classList.push('selected');
|
||||
}
|
||||
|
||||
var tpl = pskl.utils.Template.get('drawing-tool-item-template');
|
||||
return pskl.utils.Template.replace(tpl, {
|
||||
cssclass : classList.join(' '),
|
||||
toolid : toolId,
|
||||
title : this.getTooltipText_(tool)
|
||||
});
|
||||
};
|
||||
|
||||
ns.ToolController.prototype.getTooltipText_ = function (tool) {
|
||||
return tool.instance.helpText + ' (' + tool.shortcut + ')';
|
||||
$('#tools-container').html(html);
|
||||
};
|
||||
|
||||
ns.ToolController.prototype.addKeyboardShortcuts_ = function () {
|
||||
for(var i = 0 ; i < this.tools.length ; i++) {
|
||||
for (var i = 0 ; i < this.tools.length ; i++) {
|
||||
pskl.app.shortcutService.addShortcut(this.tools[i].shortcut, this.onKeyboardShortcut_.bind(this));
|
||||
}
|
||||
};
|
||||
})();
|
||||
})();
|
||||
|