forked from ppfun/pixelplanet
refactor
This commit is contained in:
parent
8c17f56b79
commit
718f2dc73d
|
@ -3,6 +3,7 @@
|
||||||
"plugin:flowtype/recommended",
|
"plugin:flowtype/recommended",
|
||||||
"airbnb"
|
"airbnb"
|
||||||
],
|
],
|
||||||
|
"parser":"@babel/eslint-parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaFeatures": {
|
"ecmaFeatures": {
|
||||||
"jsx": true
|
"jsx": true
|
||||||
|
@ -21,6 +22,8 @@
|
||||||
"browser": true
|
"browser": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"function-paren-newline": "off",
|
||||||
|
"function-call-argument-newline":"off",
|
||||||
"max-len": [1, 80, 2, {"ignoreComments": true}],
|
"max-len": [1, 80, 2, {"ignoreComments": true}],
|
||||||
"no-bitwise": 0,
|
"no-bitwise": 0,
|
||||||
"no-plusplus" : "off",
|
"no-plusplus" : "off",
|
||||||
|
@ -33,6 +36,7 @@
|
||||||
"jsx-a11y/no-static-element-interactions":"off",
|
"jsx-a11y/no-static-element-interactions":"off",
|
||||||
"no-continue": "off",
|
"no-continue": "off",
|
||||||
"no-multiple-empty-lines": "off",
|
"no-multiple-empty-lines": "off",
|
||||||
|
"react/function-component-definition": "off",
|
||||||
"lines-between-class-members":["warn", "always",{"exceptAfterSingleLine": true}]
|
"lines-between-class-members":["warn", "always",{"exceptAfterSingleLine": true}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
29
babel.config.js
Normal file
29
babel.config.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
module.exports = function (api) {
|
||||||
|
api.cache(true);
|
||||||
|
const plugins = [
|
||||||
|
'@babel/plugin-transform-flow-strip-types',
|
||||||
|
'@babel/plugin-proposal-throw-expressions',
|
||||||
|
// react-optimize
|
||||||
|
'@babel/transform-react-constant-elements',
|
||||||
|
'@babel/transform-react-inline-elements',
|
||||||
|
'transform-react-remove-prop-types',
|
||||||
|
'transform-react-pure-class-to-function',
|
||||||
|
];
|
||||||
|
|
||||||
|
const presets = [
|
||||||
|
[
|
||||||
|
"@babel/preset-env",
|
||||||
|
{
|
||||||
|
"targets": {
|
||||||
|
"node": "current"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@babel/react',
|
||||||
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
presets,
|
||||||
|
plugins
|
||||||
|
};
|
||||||
|
}
|
|
@ -286,22 +286,6 @@ msgstr ""
|
||||||
msgid "Server error occured"
|
msgid "Server error occured"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/routes/api/auth/register.js:31
|
|
||||||
msgid "E-Mail already in use."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/routes/api/auth/register.js:33
|
|
||||||
msgid "Username already in use."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/routes/api/auth/register.js:61
|
|
||||||
msgid "Failed to create new user :("
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/routes/api/auth/register.js:77
|
|
||||||
msgid "Failed to establish session after register :("
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/routes/api/auth/verify.js:25
|
#: src/routes/api/auth/verify.js:25
|
||||||
#: src/routes/api/auth/verify.js:32
|
#: src/routes/api/auth/verify.js:32
|
||||||
msgid "Mail verification"
|
msgid "Mail verification"
|
||||||
|
@ -321,6 +305,22 @@ msgstr ""
|
||||||
msgid "You are not even logged in."
|
msgid "You are not even logged in."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/routes/api/auth/register.js:31
|
||||||
|
msgid "E-Mail already in use."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/routes/api/auth/register.js:33
|
||||||
|
msgid "Username already in use."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/routes/api/auth/register.js:61
|
||||||
|
msgid "Failed to create new user :("
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/routes/api/auth/register.js:77
|
||||||
|
msgid "Failed to establish session after register :("
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/routes/api/auth/change_mail.js:41
|
#: src/routes/api/auth/change_mail.js:41
|
||||||
#: src/routes/api/auth/change_passwd.js:37
|
#: src/routes/api/auth/change_passwd.js:37
|
||||||
#: src/routes/api/auth/delete_account.js:38
|
#: src/routes/api/auth/delete_account.js:38
|
||||||
|
|
|
@ -162,7 +162,7 @@ msgstr ""
|
||||||
msgid "Look at past Canvases"
|
msgid "Look at past Canvases"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:586
|
#: src/components/Converter.jsx:559
|
||||||
#: src/components/CoordinatesBox.jsx:32
|
#: src/components/CoordinatesBox.jsx:32
|
||||||
msgid "Copy to Clipboard"
|
msgid "Copy to Clipboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -186,27 +186,6 @@ msgstr ""
|
||||||
msgid "Restore"
|
msgid "Restore"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/buttons/CanvasSwitchButton.jsx:23
|
|
||||||
#: src/components/windows/index.js:22
|
|
||||||
msgid "Canvas Selection"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/buttons/ExpandMenuButton.jsx:23
|
|
||||||
msgid "Close Menu"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/buttons/ExpandMenuButton.jsx:23
|
|
||||||
msgid "Open Menu"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/buttons/ChatButton.jsx:92
|
|
||||||
msgid "Close Chat"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/buttons/ChatButton.jsx:92
|
|
||||||
msgid "Open Chat"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/actions/fetch.js:40
|
#: src/actions/fetch.js:40
|
||||||
msgid "You made too many requests"
|
msgid "You made too many requests"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -236,6 +215,27 @@ msgstr ""
|
||||||
msgid "Server answered with gibberish :("
|
msgid "Server answered with gibberish :("
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/buttons/ChatButton.jsx:92
|
||||||
|
msgid "Close Chat"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/buttons/ChatButton.jsx:92
|
||||||
|
msgid "Open Chat"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/buttons/CanvasSwitchButton.jsx:23
|
||||||
|
#: src/components/windows/index.js:22
|
||||||
|
msgid "Canvas Selection"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/buttons/ExpandMenuButton.jsx:23
|
||||||
|
msgid "Close Menu"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/buttons/ExpandMenuButton.jsx:23
|
||||||
|
msgid "Open Menu"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/HistorySelect.jsx:144
|
#: src/components/HistorySelect.jsx:144
|
||||||
msgid "Loading"
|
msgid "Loading"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -260,6 +260,18 @@ msgstr ""
|
||||||
msgid "Resize"
|
msgid "Resize"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/buttons/GlobeButton.jsx:35
|
||||||
|
msgid "Globe View"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/buttons/PalselButton.jsx:31
|
||||||
|
msgid "Close Palette"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/buttons/PalselButton.jsx:31
|
||||||
|
msgid "Open Palette"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/buttons/HelpButton.jsx:23
|
#: src/components/buttons/HelpButton.jsx:23
|
||||||
#: src/components/windows/index.js:16
|
#: src/components/windows/index.js:16
|
||||||
msgid "Help"
|
msgid "Help"
|
||||||
|
@ -279,18 +291,6 @@ msgstr ""
|
||||||
msgid "Make Screenshot"
|
msgid "Make Screenshot"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/buttons/GlobeButton.jsx:35
|
|
||||||
msgid "Globe View"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/buttons/PalselButton.jsx:31
|
|
||||||
msgid "Close Palette"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/buttons/PalselButton.jsx:31
|
|
||||||
msgid "Open Palette"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/contextmenus/UserContextMenu.jsx:53
|
#: src/components/contextmenus/UserContextMenu.jsx:53
|
||||||
msgid "Ping"
|
msgid "Ping"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -538,6 +538,34 @@ msgstr ""
|
||||||
msgid "Partners:"
|
msgid "Partners:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/UserArea.jsx:27
|
||||||
|
msgid "Profile"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/UserArea.jsx:30
|
||||||
|
msgid "Ranking"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/UserArea.jsx:33
|
||||||
|
msgid "Converter"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/UserArea.jsx:39
|
||||||
|
msgid "Admintools"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/UserArea.jsx:39
|
||||||
|
msgid "Modtools"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/UserArea.jsx:40
|
||||||
|
msgid "Loading..."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/UserArea.jsx:47
|
||||||
|
msgid "Consider joining us on Guilded:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/windows/Settings.jsx:133
|
#: src/components/windows/Settings.jsx:133
|
||||||
msgid "Show Grid"
|
msgid "Show Grid"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -602,7 +630,7 @@ msgstr ""
|
||||||
msgid "For when you are playing on a potato."
|
msgid "For when you are playing on a potato."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:400
|
#: src/components/Converter.jsx:373
|
||||||
#: src/components/windows/Settings.jsx:195
|
#: src/components/windows/Settings.jsx:195
|
||||||
msgid "Light Grid"
|
msgid "Light Grid"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -631,79 +659,6 @@ msgstr ""
|
||||||
msgid "Select Language"
|
msgid "Select Language"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/windows/UserArea.jsx:27
|
|
||||||
msgid "Profile"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/UserArea.jsx:30
|
|
||||||
msgid "Ranking"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/UserArea.jsx:33
|
|
||||||
msgid "Converter"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/UserArea.jsx:39
|
|
||||||
msgid "Admintools"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/UserArea.jsx:39
|
|
||||||
msgid "Modtools"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/UserArea.jsx:40
|
|
||||||
msgid "Loading..."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/UserArea.jsx:47
|
|
||||||
msgid "Consider joining us on Guilded:"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/Register.jsx:81
|
|
||||||
msgid "Register new account here"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/Register.jsx:92
|
|
||||||
msgid "Name"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/ForgotPassword.jsx:82
|
|
||||||
#: src/components/windows/Register.jsx:100
|
|
||||||
msgid "Email"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/ChangeMail.jsx:80
|
|
||||||
#: src/components/DeleteAccount.jsx:62
|
|
||||||
#: src/components/LogInForm.jsx:83
|
|
||||||
#: src/components/windows/Register.jsx:108
|
|
||||||
msgid "Password"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/Register.jsx:116
|
|
||||||
msgid "Confirm Password"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/Admintools.jsx:311
|
|
||||||
#: src/components/Admintools.jsx:392
|
|
||||||
#: src/components/Admintools.jsx:467
|
|
||||||
#: src/components/Admintools.jsx:512
|
|
||||||
#: src/components/Admintools.jsx:595
|
|
||||||
#: src/components/windows/ForgotPassword.jsx:86
|
|
||||||
#: src/components/windows/Register.jsx:119
|
|
||||||
msgid "Submit"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/CanvasSelect.jsx:32
|
|
||||||
msgid ""
|
|
||||||
"Select the canvas you want to use. Every canvas is unique and has "
|
|
||||||
"different palettes, cooldown and requirements. Archive of closed canvases "
|
|
||||||
"can be accessed here:"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/CanvasSelect.jsx:40
|
|
||||||
msgid "Archive"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/Archive.jsx:20
|
#: src/components/windows/Archive.jsx:20
|
||||||
msgid ""
|
msgid ""
|
||||||
"While we tend to not delete canvases, some canvases are started for fun or "
|
"While we tend to not delete canvases, some canvases are started for fun or "
|
||||||
|
@ -737,6 +692,17 @@ msgid ""
|
||||||
"how the canvas was at that time."
|
"how the canvas was at that time."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/CanvasSelect.jsx:32
|
||||||
|
msgid ""
|
||||||
|
"Select the canvas you want to use. Every canvas is unique and has "
|
||||||
|
"different palettes, cooldown and requirements. Archive of closed canvases "
|
||||||
|
"can be accessed here:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/CanvasSelect.jsx:40
|
||||||
|
msgid "Archive"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/windows/Chat.jsx:146
|
#: src/components/windows/Chat.jsx:146
|
||||||
msgid "Channel settings"
|
msgid "Channel settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -753,6 +719,40 @@ msgstr ""
|
||||||
msgid "You must be logged in to chat"
|
msgid "You must be logged in to chat"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/Register.jsx:81
|
||||||
|
msgid "Register new account here"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/Register.jsx:92
|
||||||
|
msgid "Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/ForgotPassword.jsx:82
|
||||||
|
#: src/components/windows/Register.jsx:100
|
||||||
|
msgid "Email"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/ChangeMail.jsx:80
|
||||||
|
#: src/components/DeleteAccount.jsx:62
|
||||||
|
#: src/components/LogInForm.jsx:83
|
||||||
|
#: src/components/windows/Register.jsx:108
|
||||||
|
msgid "Password"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/windows/Register.jsx:116
|
||||||
|
msgid "Confirm Password"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/Admintools.jsx:311
|
||||||
|
#: src/components/Admintools.jsx:392
|
||||||
|
#: src/components/Admintools.jsx:467
|
||||||
|
#: src/components/Admintools.jsx:512
|
||||||
|
#: src/components/Admintools.jsx:595
|
||||||
|
#: src/components/windows/ForgotPassword.jsx:86
|
||||||
|
#: src/components/windows/Register.jsx:119
|
||||||
|
msgid "Submit"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/windows/ForgotPassword.jsx:60
|
#: src/components/windows/ForgotPassword.jsx:60
|
||||||
msgid "Sent you a mail with instructions to reset your password."
|
msgid "Sent you a mail with instructions to reset your password."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -809,11 +809,28 @@ msgstr ""
|
||||||
msgid "Password must be shorter than 60 characters."
|
msgid "Password must be shorter than 60 characters."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/ChangeMail.jsx:91
|
#: src/components/LogInArea.jsx:21
|
||||||
#: src/components/ChangeName.jsx:68
|
msgid "Login to access more features and stats."
|
||||||
#: src/components/ChangePassword.jsx:110
|
msgstr ""
|
||||||
#: src/components/LanguageSelect.jsx:73
|
|
||||||
msgid "Save"
|
#: src/components/LogInArea.jsx:23
|
||||||
|
msgid "Login with Name or Mail:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/LogInArea.jsx:30
|
||||||
|
msgid "I forgot my Password."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/LogInArea.jsx:31
|
||||||
|
msgid "or login with:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/LogInArea.jsx:72
|
||||||
|
msgid "or register here:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/LogInArea.jsx:79
|
||||||
|
msgid "Register"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/UserAreaContent.jsx:63
|
#: src/components/UserAreaContent.jsx:63
|
||||||
|
@ -861,30 +878,6 @@ msgstr ""
|
||||||
msgid "Social Settings"
|
msgid "Social Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/LogInArea.jsx:21
|
|
||||||
msgid "Login to access more features and stats."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/LogInArea.jsx:23
|
|
||||||
msgid "Login with Name or Mail:"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/LogInArea.jsx:30
|
|
||||||
msgid "I forgot my Password."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/LogInArea.jsx:31
|
|
||||||
msgid "or login with:"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/LogInArea.jsx:72
|
|
||||||
msgid "or register here:"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/LogInArea.jsx:79
|
|
||||||
msgid "Register"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/Rankings.jsx:28
|
#: src/components/Rankings.jsx:28
|
||||||
msgid "Total"
|
msgid "Total"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -975,77 +968,84 @@ msgstr ""
|
||||||
msgid "User Name"
|
msgid "User Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:260
|
#: src/components/Converter.jsx:236
|
||||||
msgid "Choose Canvas"
|
msgid "Choose Canvas"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:286
|
#: src/components/Converter.jsx:262
|
||||||
msgid "Palette Download"
|
msgid "Palette Download"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:288
|
#: src/components/Converter.jsx:264
|
||||||
#, javascript-format
|
#, javascript-format
|
||||||
msgid "Palette for ${ gimpLink }"
|
msgid "Palette for ${ gimpLink }"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:306
|
#: src/components/Converter.jsx:282
|
||||||
#, javascript-format
|
#, javascript-format
|
||||||
msgid "Credit for the Palette of the Moon goes to ${ starhouseLink }."
|
msgid "Credit for the Palette of the Moon goes to ${ starhouseLink }."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:309
|
#: src/components/Converter.jsx:285
|
||||||
msgid "Image Converter"
|
msgid "Image Converter"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:310
|
#: src/components/Converter.jsx:286
|
||||||
msgid "Convert an image to canvas colors"
|
msgid "Convert an image to canvas colors"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:332
|
#: src/components/Converter.jsx:305
|
||||||
msgid "Choose Strategy"
|
msgid "Choose Strategy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:349
|
#: src/components/Converter.jsx:322
|
||||||
msgid "Choose Color Mode"
|
msgid "Choose Color Mode"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:377
|
#: src/components/Converter.jsx:350
|
||||||
msgid "Add Grid (uncheck if you need a 1:1 template)"
|
msgid "Add Grid (uncheck if you need a 1:1 template)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:402
|
#: src/components/Converter.jsx:375
|
||||||
#: src/components/Converter.jsx:418
|
#: src/components/Converter.jsx:391
|
||||||
msgid "Offset"
|
msgid "Offset"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:448
|
#: src/components/Converter.jsx:421
|
||||||
msgid "Scale Image"
|
msgid "Scale Image"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:460
|
#: src/components/Converter.jsx:433
|
||||||
msgid "Width"
|
msgid "Width"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:490
|
#: src/components/Converter.jsx:463
|
||||||
msgid "Height"
|
msgid "Height"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:528
|
#: src/components/Converter.jsx:501
|
||||||
msgid "Keep Ratio"
|
msgid "Keep Ratio"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:541
|
#: src/components/Converter.jsx:514
|
||||||
msgid "Anti Aliasing"
|
msgid "Anti Aliasing"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:555
|
#: src/components/Converter.jsx:528
|
||||||
msgid "Reset"
|
msgid "Reset"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/Converter.jsx:574
|
#: src/components/Converter.jsx:547
|
||||||
msgid "Download Template"
|
msgid "Download Template"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/ChangeMail.jsx:91
|
||||||
|
#: src/components/ChangeName.jsx:68
|
||||||
|
#: src/components/ChangePassword.jsx:110
|
||||||
|
#: src/components/LanguageSelect.jsx:73
|
||||||
|
msgid "Save"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/CanvasItem.jsx:27
|
#: src/components/CanvasItem.jsx:27
|
||||||
msgid "Cooldown"
|
msgid "Cooldown"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1075,6 +1075,14 @@ msgstr ""
|
||||||
msgid "Dimensions"
|
msgid "Dimensions"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/LogInForm.jsx:76
|
||||||
|
msgid "Name or Email"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/LogInForm.jsx:87
|
||||||
|
msgid "LogIn"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/UserMessages.jsx:28
|
#: src/components/UserMessages.jsx:28
|
||||||
msgid ""
|
msgid ""
|
||||||
"Please verify your mail address \n"
|
"Please verify your mail address \n"
|
||||||
|
@ -1109,10 +1117,6 @@ msgstr ""
|
||||||
msgid "Confirm New Password"
|
msgid "Confirm New Password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/DeleteAccount.jsx:66
|
|
||||||
msgid "Yes, Delete My Account!"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/ChangeName.jsx:64
|
#: src/components/ChangeName.jsx:64
|
||||||
msgid "New Username"
|
msgid "New Username"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1127,6 +1131,10 @@ msgstr ""
|
||||||
msgid "New Mail"
|
msgid "New Mail"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/components/DeleteAccount.jsx:66
|
||||||
|
msgid "Yes, Delete My Account!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/SocialSettings.jsx:38
|
#: src/components/SocialSettings.jsx:38
|
||||||
msgid "Block all Private Messages"
|
msgid "Block all Private Messages"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1139,14 +1147,6 @@ msgstr ""
|
||||||
msgid "You have no users blocked"
|
msgid "You have no users blocked"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/LogInForm.jsx:76
|
|
||||||
msgid "Name or Email"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/LogInForm.jsx:87
|
|
||||||
msgid "LogIn"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/components/windows/Help.jsx:15
|
#: src/components/windows/Help.jsx:15
|
||||||
#: src/components/windows/Settings.jsx:134
|
#: src/components/windows/Settings.jsx:134
|
||||||
msgctxt "keybinds"
|
msgctxt "keybinds"
|
||||||
|
|
199
package-lock.json
generated
199
package-lock.json
generated
|
@ -67,6 +67,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.16.7",
|
"@babel/cli": "^7.16.7",
|
||||||
"@babel/core": "^7.16.7",
|
"@babel/core": "^7.16.7",
|
||||||
|
"@babel/eslint-parser": "^7.16.5",
|
||||||
"@babel/node": "^7.16.7",
|
"@babel/node": "^7.16.7",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
||||||
"@babel/plugin-proposal-decorators": "^7.16.7",
|
"@babel/plugin-proposal-decorators": "^7.16.7",
|
||||||
|
@ -93,7 +94,6 @@
|
||||||
"@babel/preset-react": "^7.16.7",
|
"@babel/preset-react": "^7.16.7",
|
||||||
"@babel/preset-typescript": "^7.16.7",
|
"@babel/preset-typescript": "^7.16.7",
|
||||||
"assets-webpack-plugin": "^7.1.1",
|
"assets-webpack-plugin": "^7.1.1",
|
||||||
"babel-eslint": "^10.1.0",
|
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
"babel-plugin-transform-react-pure-class-to-function": "^1.0.1",
|
"babel-plugin-transform-react-pure-class-to-function": "^1.0.1",
|
||||||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
||||||
|
@ -208,6 +208,24 @@
|
||||||
"url": "https://opencollective.com/babel"
|
"url": "https://opencollective.com/babel"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@babel/eslint-parser": {
|
||||||
|
"version": "7.16.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.16.5.tgz",
|
||||||
|
"integrity": "sha512-mUqYa46lgWqHKQ33Q6LNCGp/wPR3eqOYTUixHFsfrSQqRxH0+WOzca75iEjFr5RDGH1dDz622LaHhLOzOuQRUA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"eslint-scope": "^5.1.1",
|
||||||
|
"eslint-visitor-keys": "^2.1.0",
|
||||||
|
"semver": "^6.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^10.13.0 || ^12.13.0 || >=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@babel/core": ">=7.11.0",
|
||||||
|
"eslint": "^7.5.0 || ^8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@babel/generator": {
|
"node_modules/@babel/generator": {
|
||||||
"version": "7.16.7",
|
"version": "7.16.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz",
|
||||||
|
@ -2981,27 +2999,6 @@
|
||||||
"integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==",
|
"integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/babel-eslint": {
|
|
||||||
"version": "10.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz",
|
|
||||||
"integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==",
|
|
||||||
"deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/code-frame": "^7.0.0",
|
|
||||||
"@babel/parser": "^7.7.0",
|
|
||||||
"@babel/traverse": "^7.7.0",
|
|
||||||
"@babel/types": "^7.7.0",
|
|
||||||
"eslint-visitor-keys": "^1.0.0",
|
|
||||||
"resolve": "^1.12.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"eslint": ">= 4.12.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/babel-helper-is-react-class": {
|
"node_modules/babel-helper-is-react-class": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/babel-helper-is-react-class/-/babel-helper-is-react-class-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/babel-helper-is-react-class/-/babel-helper-is-react-class-1.0.0.tgz",
|
||||||
|
@ -5086,16 +5083,25 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-scope": {
|
"node_modules/eslint-scope": {
|
||||||
"version": "7.1.0",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||||
"integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==",
|
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esrecurse": "^4.3.0",
|
"esrecurse": "^4.3.0",
|
||||||
"estraverse": "^5.2.0"
|
"estraverse": "^4.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
"node": ">=8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/eslint-scope/node_modules/estraverse": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-utils": {
|
"node_modules/eslint-utils": {
|
||||||
|
@ -5116,7 +5122,7 @@
|
||||||
"eslint": ">=5"
|
"eslint": ">=5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-utils/node_modules/eslint-visitor-keys": {
|
"node_modules/eslint-visitor-keys": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
|
||||||
"integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
|
"integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
|
||||||
|
@ -5125,15 +5131,6 @@
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-visitor-keys": {
|
|
||||||
"version": "1.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
|
|
||||||
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/eslint/node_modules/ansi-styles": {
|
"node_modules/eslint/node_modules/ansi-styles": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
|
@ -5183,6 +5180,19 @@
|
||||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/eslint/node_modules/eslint-scope": {
|
||||||
|
"version": "7.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz",
|
||||||
|
"integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"esrecurse": "^4.3.0",
|
||||||
|
"estraverse": "^5.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/eslint/node_modules/eslint-visitor-keys": {
|
"node_modules/eslint/node_modules/eslint-visitor-keys": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz",
|
||||||
|
@ -8405,9 +8415,9 @@
|
||||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
||||||
},
|
},
|
||||||
"node_modules/picomatch": {
|
"node_modules/picomatch": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||||
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
|
@ -11321,28 +11331,6 @@
|
||||||
"url": "https://github.com/sponsors/epoberezkin"
|
"url": "https://github.com/sponsors/epoberezkin"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webpack/node_modules/eslint-scope": {
|
|
||||||
"version": "5.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
|
||||||
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"esrecurse": "^4.3.0",
|
|
||||||
"estraverse": "^4.1.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/webpack/node_modules/estraverse": {
|
|
||||||
"version": "4.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
|
||||||
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/webpack/node_modules/schema-utils": {
|
"node_modules/webpack/node_modules/schema-utils": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
|
||||||
|
@ -11802,6 +11790,17 @@
|
||||||
"source-map": "^0.5.0"
|
"source-map": "^0.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@babel/eslint-parser": {
|
||||||
|
"version": "7.16.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.16.5.tgz",
|
||||||
|
"integrity": "sha512-mUqYa46lgWqHKQ33Q6LNCGp/wPR3eqOYTUixHFsfrSQqRxH0+WOzca75iEjFr5RDGH1dDz622LaHhLOzOuQRUA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"eslint-scope": "^5.1.1",
|
||||||
|
"eslint-visitor-keys": "^2.1.0",
|
||||||
|
"semver": "^6.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@babel/generator": {
|
"@babel/generator": {
|
||||||
"version": "7.16.7",
|
"version": "7.16.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz",
|
||||||
|
@ -13773,20 +13772,6 @@
|
||||||
"integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==",
|
"integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"babel-eslint": {
|
|
||||||
"version": "10.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz",
|
|
||||||
"integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@babel/code-frame": "^7.0.0",
|
|
||||||
"@babel/parser": "^7.7.0",
|
|
||||||
"@babel/traverse": "^7.7.0",
|
|
||||||
"@babel/types": "^7.7.0",
|
|
||||||
"eslint-visitor-keys": "^1.0.0",
|
|
||||||
"resolve": "^1.12.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"babel-helper-is-react-class": {
|
"babel-helper-is-react-class": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/babel-helper-is-react-class/-/babel-helper-is-react-class-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/babel-helper-is-react-class/-/babel-helper-is-react-class-1.0.0.tgz",
|
||||||
|
@ -15247,6 +15232,16 @@
|
||||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"eslint-scope": {
|
||||||
|
"version": "7.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz",
|
||||||
|
"integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"esrecurse": "^4.3.0",
|
||||||
|
"estraverse": "^5.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"eslint-visitor-keys": {
|
"eslint-visitor-keys": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz",
|
||||||
|
@ -15491,13 +15486,21 @@
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"eslint-scope": {
|
"eslint-scope": {
|
||||||
"version": "7.1.0",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||||
"integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==",
|
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"esrecurse": "^4.3.0",
|
"esrecurse": "^4.3.0",
|
||||||
"estraverse": "^5.2.0"
|
"estraverse": "^4.1.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"estraverse": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint-utils": {
|
"eslint-utils": {
|
||||||
|
@ -15507,20 +15510,12 @@
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"eslint-visitor-keys": "^2.0.0"
|
"eslint-visitor-keys": "^2.0.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"eslint-visitor-keys": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint-visitor-keys": {
|
"eslint-visitor-keys": {
|
||||||
"version": "1.3.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
|
||||||
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
|
"integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"espree": {
|
"espree": {
|
||||||
|
@ -17909,9 +17904,9 @@
|
||||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
||||||
},
|
},
|
||||||
"picomatch": {
|
"picomatch": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||||
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"pify": {
|
"pify": {
|
||||||
|
@ -19895,22 +19890,6 @@
|
||||||
"uri-js": "^4.2.2"
|
"uri-js": "^4.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint-scope": {
|
|
||||||
"version": "5.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
|
||||||
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"esrecurse": "^4.3.0",
|
|
||||||
"estraverse": "^4.1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"estraverse": {
|
|
||||||
"version": "4.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
|
||||||
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"schema-utils": {
|
"schema-utils": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"build-en": "npm run extract && npm run minify-css",
|
"build-en": "npm run extract && npm run minify-css",
|
||||||
"webpack": "webpack --config ./webpack.config.web.babel.js && webpack --config ./webpack.config.client.babel.js",
|
"webpack": "webpack --config ./webpack.config.web.babel.js && webpack --config ./webpack.config.client.babel.js",
|
||||||
"minify-css": "babel-node scripts/minifyCss.js",
|
"minify-css": "babel-node scripts/minifyCss.js",
|
||||||
"extract": "webpack --env extract --config ./webpack.config.web.babel.js && webpack --env extract --env development --config ./webpack.config.client.babel.js",
|
"extract": "webpack --env extract --config ./webpack.config.web.babel.js && webpack --env extract --config ./webpack.config.client.babel.js",
|
||||||
"babel-node": "cd $INIT_CWD && babel-node",
|
"babel-node": "cd $INIT_CWD && babel-node",
|
||||||
"lint": "cd $INIT_CWD && eslint --ext .jsx --ext .js",
|
"lint": "cd $INIT_CWD && eslint --ext .jsx --ext .js",
|
||||||
"lint:src": "eslint --ext .jsx --ext .js src",
|
"lint:src": "eslint --ext .jsx --ext .js src",
|
||||||
|
@ -113,11 +113,11 @@
|
||||||
"@babel/preset-react": "^7.16.7",
|
"@babel/preset-react": "^7.16.7",
|
||||||
"@babel/preset-typescript": "^7.16.7",
|
"@babel/preset-typescript": "^7.16.7",
|
||||||
"assets-webpack-plugin": "^7.1.1",
|
"assets-webpack-plugin": "^7.1.1",
|
||||||
"babel-eslint": "^10.1.0",
|
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
"babel-plugin-transform-react-pure-class-to-function": "^1.0.1",
|
"babel-plugin-transform-react-pure-class-to-function": "^1.0.1",
|
||||||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
||||||
"babel-plugin-ttag": "^1.7.30",
|
"babel-plugin-ttag": "^1.7.30",
|
||||||
|
"@babel/eslint-parser": "^7.16.5",
|
||||||
"clean-css": "^5.2.2",
|
"clean-css": "^5.2.2",
|
||||||
"copy-webpack-plugin": "^10.2.0",
|
"copy-webpack-plugin": "^10.2.0",
|
||||||
"css-loader": "^6.5.1",
|
"css-loader": "^6.5.1",
|
||||||
|
|
|
@ -21,11 +21,13 @@ import ExpandMenuButton from './buttons/ExpandMenuButton';
|
||||||
import ModalRoot from './ModalRoot';
|
import ModalRoot from './ModalRoot';
|
||||||
import WindowManager from './WindowManager';
|
import WindowManager from './WindowManager';
|
||||||
|
|
||||||
|
const iconContextValue = { style: { verticalAlign: 'middle' } };
|
||||||
|
|
||||||
const App = () => (
|
const App = () => (
|
||||||
<div>
|
<div>
|
||||||
<Style />
|
<Style />
|
||||||
<div id="outstreamContainer" />
|
<div id="outstreamContainer" />
|
||||||
<IconContext.Provider value={{ style: { verticalAlign: 'middle' } }}>
|
<IconContext.Provider value={iconContextValue}>
|
||||||
<CanvasSwitchButton />
|
<CanvasSwitchButton />
|
||||||
<Menu />
|
<Menu />
|
||||||
<ChatButton />
|
<ChatButton />
|
||||||
|
|
|
@ -23,31 +23,6 @@ function downloadOutput() {
|
||||||
output.toBlob((blob) => fileDownload(blob, 'ppfunconvert.png'));
|
output.toBlob((blob) => fileDownload(blob, 'ppfunconvert.png'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function readFile(
|
|
||||||
file,
|
|
||||||
selectFile,
|
|
||||||
setScaleData,
|
|
||||||
) {
|
|
||||||
if (!file) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const fr = new FileReader();
|
|
||||||
fr.onload = () => {
|
|
||||||
const img = new Image();
|
|
||||||
img.onload = () => {
|
|
||||||
setScaleData({
|
|
||||||
enabled: false,
|
|
||||||
width: img.width,
|
|
||||||
height: img.height,
|
|
||||||
aa: true,
|
|
||||||
});
|
|
||||||
selectFile(img);
|
|
||||||
};
|
|
||||||
img.src = fr.result;
|
|
||||||
};
|
|
||||||
fr.readAsDataURL(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createCanvasFromImageData(imgData) {
|
function createCanvasFromImageData(imgData) {
|
||||||
const { width, height } = imgData;
|
const { width, height } = imgData;
|
||||||
const inputCanvas = document.createElement('canvas');
|
const inputCanvas = document.createElement('canvas');
|
||||||
|
@ -108,7 +83,7 @@ function scaleImage(imgData, width, height, doAA) {
|
||||||
for (let y = 0; y < height; y += 1) {
|
for (let y = 0; y < height; y += 1) {
|
||||||
for (let x = 0; x < width; x += 1) {
|
for (let x = 0; x < width; x += 1) {
|
||||||
let posi = (Math.round(x / scaleX) + Math.round(y / scaleY)
|
let posi = (Math.round(x / scaleX) + Math.round(y / scaleY)
|
||||||
* img.width) * 4;
|
* imgData.width) * 4;
|
||||||
let poso = (x + y * width) * 4;
|
let poso = (x + y * width) * 4;
|
||||||
datao[poso++] = datai[posi++];
|
datao[poso++] = datai[posi++];
|
||||||
datao[poso++] = datai[posi++];
|
datao[poso++] = datai[posi++];
|
||||||
|
@ -152,6 +127,7 @@ async function renderOutputImage(opts) {
|
||||||
// dither
|
// dither
|
||||||
const { colors, strategy, colorDist } = dither;
|
const { colors, strategy, colorDist } = dither;
|
||||||
const progEl = document.getElementById('qprog');
|
const progEl = document.getElementById('qprog');
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
image = await quantizeImage(colors, image, {
|
image = await quantizeImage(colors, image, {
|
||||||
strategy,
|
strategy,
|
||||||
colorDist,
|
colorDist,
|
||||||
|
@ -315,11 +291,8 @@ function Converter() {
|
||||||
const fileSel = evt.target;
|
const fileSel = evt.target;
|
||||||
const file = (!fileSel.files || !fileSel.files[0])
|
const file = (!fileSel.files || !fileSel.files[0])
|
||||||
? null : fileSel.files[0];
|
? null : fileSel.files[0];
|
||||||
if (!file) {
|
|
||||||
setInputImageData(null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const imageData = await getImageDataOfFile(file);
|
const imageData = await getImageDataOfFile(file);
|
||||||
|
setInputImageData(null);
|
||||||
setScaleData({
|
setScaleData({
|
||||||
enabled: false,
|
enabled: false,
|
||||||
width: imageData.width,
|
width: imageData.width,
|
||||||
|
|
|
@ -24,7 +24,7 @@ const DailyRankings = () => {
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{
|
{
|
||||||
totalDailyRanking.map((rank) => (
|
totalDailyRanking.map((rank) => (
|
||||||
<tr>
|
<tr>
|
||||||
<td>{rank.dailyRanking}</td>
|
<td>{rank.dailyRanking}</td>
|
||||||
|
|
|
@ -22,7 +22,7 @@ const TotalRankings = () => {
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{
|
{
|
||||||
totalRanking.map((rank) => (
|
totalRanking.map((rank) => (
|
||||||
<tr>
|
<tr>
|
||||||
<td>{rank.ranking}</td>
|
<td>{rank.ranking}</td>
|
||||||
|
|
|
@ -19,7 +19,7 @@ const WindowManager = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="wm">
|
<div id="wm">
|
||||||
{
|
{
|
||||||
windowIds.map((id) => (<Window key={id} id={id} />))
|
windowIds.map((id) => (<Window key={id} id={id} />))
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,7 +23,7 @@ export class ChatProvider {
|
||||||
this.infoUserId = 1;
|
this.infoUserId = 1;
|
||||||
this.eventUserId = 1;
|
this.eventUserId = 1;
|
||||||
this.caseCheck = /^[A-Z !.]*$/;
|
this.caseCheck = /^[A-Z !.]*$/;
|
||||||
this.cyrillic = new RegExp('[\u0436-\u043B]');
|
this.cyrillic = /[\u0436-\u043B]'/;
|
||||||
this.filters = [
|
this.filters = [
|
||||||
{
|
{
|
||||||
regexp: /ADMIN/gi,
|
regexp: /ADMIN/gi,
|
||||||
|
|
|
@ -139,8 +139,8 @@ export default class MString {
|
||||||
const chr = this.txt[zEnd];
|
const chr = this.txt[zEnd];
|
||||||
if (zEnd >= this.txt.length
|
if (zEnd >= this.txt.length
|
||||||
|| chr === '\n'
|
|| chr === '\n'
|
||||||
|| chr == '['
|
|| chr === '['
|
||||||
|| chr == '('
|
|| chr === '('
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ export default class MString {
|
||||||
}
|
}
|
||||||
zEnd += 1;
|
zEnd += 1;
|
||||||
}
|
}
|
||||||
if (zEnd < zStart + 1 || ( !z && zIsLink )) {
|
if (zEnd < zStart + 1 || (!z && zIsLink)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ export default class MString {
|
||||||
if (cIter < this.iter + 4) {
|
if (cIter < this.iter + 4) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* special case where someone pasted a http link after a text
|
/* special case where someone pasted a http link after a text
|
||||||
* without space in between
|
* without space in between
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -99,8 +99,8 @@ function parseMParagraph(text, opts, breakChar) {
|
||||||
* x decides what element it is
|
* x decides what element it is
|
||||||
* defaults to ordinary link
|
* defaults to ordinary link
|
||||||
*/
|
*/
|
||||||
let tag = 'l'
|
let tag = 'l';
|
||||||
let zIsLink = true;
|
const zIsLink = true;
|
||||||
if (x === '!') {
|
if (x === '!') {
|
||||||
tag = 'img';
|
tag = 'img';
|
||||||
oldPos -= 1;
|
oldPos -= 1;
|
||||||
|
|
|
@ -116,7 +116,7 @@ export function getCanvasBoundaries(canvasSize: number): number {
|
||||||
// z is assumed to be height here
|
// z is assumed to be height here
|
||||||
// in ui and rendeer, y is height
|
// in ui and rendeer, y is height
|
||||||
export function getOffsetOfPixel(
|
export function getOffsetOfPixel(
|
||||||
canvasSize: number = null,
|
canvasSize: number,
|
||||||
x: number,
|
x: number,
|
||||||
y: number,
|
y: number,
|
||||||
z: number = null,
|
z: number = null,
|
||||||
|
|
5
src/reducers/.eslintrc
Normal file
5
src/reducers/.eslintrc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"default-param-last": "off"
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,7 +13,7 @@ import { sweetAlert } from '../actions';
|
||||||
import { isWebGL2Available } from '../core/utils';
|
import { isWebGL2Available } from '../core/utils';
|
||||||
|
|
||||||
const dummyRenderer = {
|
const dummyRenderer = {
|
||||||
is3D: null,
|
is3D: null,
|
||||||
render: () => null,
|
render: () => null,
|
||||||
destructor: () => null,
|
destructor: () => null,
|
||||||
renderPixel: () => null,
|
renderPixel: () => null,
|
||||||
|
@ -41,7 +41,7 @@ export async function initRenderer(store, is3D: boolean) {
|
||||||
renderer = dummyRenderer;
|
renderer = dummyRenderer;
|
||||||
} else {
|
} else {
|
||||||
/* eslint-disable-next-line max-len */
|
/* eslint-disable-next-line max-len */
|
||||||
const module = await import(/* webpackChunkName: "voxel" */ '../ui/Renderer3D');
|
const module = await import(/* webpackChunkName: "voxel" */ './Renderer3D');
|
||||||
const Renderer3D = module.default;
|
const Renderer3D = module.default;
|
||||||
renderer = new Renderer3D(store);
|
renderer = new Renderer3D(store);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,15 +57,14 @@ export function getImageDataOfFile(file) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createPointContainerFromImageData(imageData) {
|
function* loadData(data, pointArray) {
|
||||||
const { width, height, data } = imageData;
|
|
||||||
console.log('create container from image data', data);
|
|
||||||
const pointContainer = new utils.PointContainer();
|
|
||||||
pointContainer.setWidth(width);
|
|
||||||
pointContainer.setHeight(height);
|
|
||||||
const pointArray = pointContainer.getPointArray();
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
while (i < data.length) {
|
while (i < data.length) {
|
||||||
|
/*
|
||||||
|
if (!(i % 80)) {
|
||||||
|
yield Math.floor(i / data.length);
|
||||||
|
}
|
||||||
|
*/
|
||||||
const point = utils.Point.createByRGBA(
|
const point = utils.Point.createByRGBA(
|
||||||
data[i++],
|
data[i++],
|
||||||
data[i++],
|
data[i++],
|
||||||
|
@ -74,7 +73,30 @@ function createPointContainerFromImageData(imageData) {
|
||||||
);
|
);
|
||||||
pointArray.push(point);
|
pointArray.push(point);
|
||||||
}
|
}
|
||||||
return pointContainer;
|
}
|
||||||
|
|
||||||
|
async function createPointContainerFromImageData(imageData, onProgress) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const { width, height, data } = imageData;
|
||||||
|
const pointContainer = new utils.PointContainer();
|
||||||
|
pointContainer.setWidth(width);
|
||||||
|
pointContainer.setHeight(height);
|
||||||
|
const pointArray = pointContainer.getPointArray();
|
||||||
|
|
||||||
|
const iterator = loadData(data, pointArray);
|
||||||
|
const next = () => {
|
||||||
|
const result = iterator.next();
|
||||||
|
if (result.done) {
|
||||||
|
resolve(pointContainer);
|
||||||
|
} else {
|
||||||
|
if (onProgress) {
|
||||||
|
onProgress(result.value);
|
||||||
|
}
|
||||||
|
setTimeout(next, 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
setTimeout(next, 0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createImageDataFromPointContainer(pointContainer) {
|
function createImageDataFromPointContainer(pointContainer) {
|
||||||
|
@ -90,12 +112,11 @@ function createImageDataFromPointContainer(pointContainer) {
|
||||||
return idata;
|
return idata;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function quantizeImage(colors, imageData, opts) {
|
function quantizePointContainer(colors, pointContainer, opts) {
|
||||||
console.log('quantize image');
|
const strategy = opts.strategy || 'Nearest';
|
||||||
|
const colorDist = opts.colorDist || 'Euclidean';
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const pointContainer = createPointContainerFromImageData(imageData);
|
|
||||||
const strategy = opts.strategy || 'Nearest';
|
|
||||||
const colorDist = opts.colorDist || 'Euclidean';
|
|
||||||
// create palette
|
// create palette
|
||||||
const palette = new utils.Palette();
|
const palette = new utils.Palette();
|
||||||
palette.add(utils.Point.createByRGBA(0, 0, 0, 0));
|
palette.add(utils.Point.createByRGBA(0, 0, 0, 0));
|
||||||
|
@ -104,7 +125,6 @@ export function quantizeImage(colors, imageData, opts) {
|
||||||
const point = utils.Point.createByRGBA(r, g, b, 255);
|
const point = utils.Point.createByRGBA(r, g, b, 255);
|
||||||
palette.add(point);
|
palette.add(point);
|
||||||
}
|
}
|
||||||
console.log('palette', palette);
|
|
||||||
// construct color distance calculator
|
// construct color distance calculator
|
||||||
let distCalc;
|
let distCalc;
|
||||||
switch (colorDist) {
|
switch (colorDist) {
|
||||||
|
@ -145,6 +165,7 @@ export function quantizeImage(colors, imageData, opts) {
|
||||||
distCalc = new distance.Euclidean();
|
distCalc = new distance.Euclidean();
|
||||||
}
|
}
|
||||||
// idk why i need this :/
|
// idk why i need this :/
|
||||||
|
// eslint-disable-next-line no-underscore-dangle
|
||||||
if (distCalc._setDefaults) distCalc._setDefaults();
|
if (distCalc._setDefaults) distCalc._setDefaults();
|
||||||
// construct image quantizer
|
// construct image quantizer
|
||||||
let imageQuantizer;
|
let imageQuantizer;
|
||||||
|
@ -161,20 +182,22 @@ export function quantizeImage(colors, imageData, opts) {
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
console.log('quantizer', imageQuantizer);
|
|
||||||
// quantize
|
// quantize
|
||||||
let outPointContainer;
|
|
||||||
const iterator = imageQuantizer.quantize(pointContainer, palette);
|
const iterator = imageQuantizer.quantize(pointContainer, palette);
|
||||||
const next = () => {
|
const next = () => {
|
||||||
try {
|
try {
|
||||||
const result = iterator.next();
|
const result = iterator.next();
|
||||||
if (result.done) {
|
if (result.done) {
|
||||||
resolve(createImageDataFromPointContainer(outPointContainer));
|
resolve(createImageDataFromPointContainer(pointContainer));
|
||||||
} else {
|
} else {
|
||||||
if (result.value.pointContainer) {
|
if (result.value.pointContainer) {
|
||||||
outPointContainer = result.value.pointContainer;
|
pointContainer = result.value.pointContainer;
|
||||||
|
}
|
||||||
|
if (opts.onProgress) {
|
||||||
|
opts.onProgress(
|
||||||
|
Math.floor(25 + result.value.progress * 3 / 4),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (opts.onProgress) opts.onProgress(result.value.progress);
|
|
||||||
setTimeout(next, 0);
|
setTimeout(next, 0);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -184,3 +207,18 @@ export function quantizeImage(colors, imageData, opts) {
|
||||||
setTimeout(next, 0);
|
setTimeout(next, 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function quantizeImage(colors, imageData, opts) {
|
||||||
|
return createPointContainerFromImageData(
|
||||||
|
imageData,
|
||||||
|
(value) => {
|
||||||
|
if (opts.onProgress) {
|
||||||
|
opts.onProgress(value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
).then((pointContainer) => quantizePointContainer(
|
||||||
|
colors,
|
||||||
|
pointContainer,
|
||||||
|
opts,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
|
@ -42,13 +42,6 @@ export function buildWebpackClientConfig(
|
||||||
}
|
}
|
||||||
|
|
||||||
const babelPlugins = [
|
const babelPlugins = [
|
||||||
'@babel/plugin-transform-flow-strip-types',
|
|
||||||
'@babel/plugin-proposal-throw-expressions',
|
|
||||||
// react-optimize
|
|
||||||
'@babel/transform-react-constant-elements',
|
|
||||||
'@babel/transform-react-inline-elements',
|
|
||||||
'transform-react-remove-prop-types',
|
|
||||||
'transform-react-pure-class-to-function',
|
|
||||||
['ttag', ttag],
|
['ttag', ttag],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -80,7 +73,7 @@ export function buildWebpackClientConfig(
|
||||||
alias: {
|
alias: {
|
||||||
ttag: 'ttag/dist/mock',
|
ttag: 'ttag/dist/mock',
|
||||||
},
|
},
|
||||||
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
|
extensions: ['.js', '.jsx'],
|
||||||
},
|
},
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
|
@ -114,25 +107,26 @@ export function buildWebpackClientConfig(
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
include: [
|
include: [
|
||||||
path.resolve(__dirname, 'src'),
|
path.resolve(__dirname, 'src'),
|
||||||
|
...['image-q'].map((moduleName) => (
|
||||||
|
path.resolve(__dirname + '/node_modules/' + moduleName)
|
||||||
|
))
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
// should be !extract and adhere to .po timestamps
|
// should be !extract and adhere to .po timestamps
|
||||||
// in cacheIdentifier
|
// in cacheIdentifier
|
||||||
cacheDirectory: false,
|
cacheDirectory: false,
|
||||||
babelrc: false,
|
|
||||||
presets: [
|
presets: [
|
||||||
['@babel/preset-env', {
|
['@babel/preset-env', {
|
||||||
targets: {
|
targets: {
|
||||||
browsers: pkg.browserslist,
|
browsers: pkg.browserslist,
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
useBuiltIns: 'usage',
|
useBuiltIns: 'usage',
|
||||||
corejs: {
|
corejs: {
|
||||||
version: 3,
|
version: 3,
|
||||||
},
|
},
|
||||||
debug: false,
|
*/
|
||||||
}],
|
}],
|
||||||
//'@babel/typescript',
|
|
||||||
'@babel/react',
|
|
||||||
],
|
],
|
||||||
plugins: babelPlugins,
|
plugins: babelPlugins,
|
||||||
},
|
},
|
||||||
|
|
|
@ -25,13 +25,6 @@ const basePackageValues = {
|
||||||
const ttag = {};
|
const ttag = {};
|
||||||
|
|
||||||
const babelPlugins = [
|
const babelPlugins = [
|
||||||
'@babel/plugin-transform-flow-strip-types',
|
|
||||||
'@babel/plugin-proposal-throw-expressions',
|
|
||||||
// react-optimize
|
|
||||||
'@babel/transform-react-constant-elements',
|
|
||||||
'@babel/transform-react-inline-elements',
|
|
||||||
'transform-react-remove-prop-types',
|
|
||||||
'transform-react-pure-class-to-function',
|
|
||||||
['ttag', ttag],
|
['ttag', ttag],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -66,21 +59,19 @@ export default ({
|
||||||
},
|
},
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
|
extensions: ['.js', '.jsx'],
|
||||||
},
|
},
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.(js|jsx|ts|tsx)$/,
|
test: /\.(js|jsx)$/,
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
include: [
|
include: [
|
||||||
path.resolve(__dirname, 'src'),
|
path.resolve(__dirname, 'src'),
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
cacheDirectory: false,
|
cacheDirectory: false,
|
||||||
|
|
||||||
babelrc: false,
|
|
||||||
presets: [
|
presets: [
|
||||||
['@babel/preset-env', {
|
['@babel/preset-env', {
|
||||||
targets: {
|
targets: {
|
||||||
|
@ -88,10 +79,7 @@ export default ({
|
||||||
},
|
},
|
||||||
modules: false,
|
modules: false,
|
||||||
useBuiltIns: false,
|
useBuiltIns: false,
|
||||||
debug: false,
|
|
||||||
}],
|
}],
|
||||||
'@babel/typescript',
|
|
||||||
'@babel/react',
|
|
||||||
],
|
],
|
||||||
plugins: babelPlugins,
|
plugins: babelPlugins,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user