commit f0f1c87d070809e483dd1f057c9f1b1fef3bf474 Author: kicap1992 Date: Wed Jun 23 17:39:54 2021 +0800 project done before diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e1e597 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.DS_Store + +# Generated by package manager +node_modules/ + +# Generated by Cordova +/plugins/ +/platforms/ diff --git a/.vscode/plugins.json b/.vscode/plugins.json new file mode 100644 index 0000000..60dc675 --- /dev/null +++ b/.vscode/plugins.json @@ -0,0 +1 @@ +{"plugins":["cordova-plugin-whitelist","cordova-plugin-screen-orientation","es6-promise-plugin","cordova-plugin-x-socialsharing","cordova-plugin-androidx","cordova-plugin-androidx-adapter"]} \ No newline at end of file diff --git a/.vscode/typings/cordova/cordova.d.ts b/.vscode/typings/cordova/cordova.d.ts new file mode 100644 index 0000000..2f78178 --- /dev/null +++ b/.vscode/typings/cordova/cordova.d.ts @@ -0,0 +1,80 @@ +// Type definitions for Apache Cordova +// Project: http://cordova.apache.org +// Definitions by: Microsoft Open Technologies Inc. +// Definitions: https://github.com/borisyankov/DefinitelyTyped +// +// Copyright (c) Microsoft Open Technologies, Inc. +// Licensed under the MIT license. + +interface Cordova { + /** Invokes native functionality by specifying corresponding service name, action and optional parameters. + * @param success A success callback function. + * @param fail An error callback function. + * @param service The service name to call on the native side (corresponds to a native class). + * @param action The action name to call on the native side (generally corresponds to the native class method). + * @param args An array of arguments to pass into the native environment. + */ + exec(success: () => any, fail: () => any, service: string, action: string, args?: string[]): void; + /** Gets the operating system name. */ + platformId: string; + /** Gets Cordova framework version */ + version: string; + /** Defines custom logic as a Cordova module. Other modules can later access it using module name provided. */ + define(moduleName: string, factory: (require: any, exports: any, module: any) => any): void; + /** Access a Cordova module by name. */ + require(moduleName: string): any; + /** Namespace for Cordova plugin functionality */ + plugins:CordovaPlugins; +} + +interface CordovaPlugins {} + +interface Document { + addEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + + removeEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + + addEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; +} + +interface Window { + cordova:Cordova; +} + +// cordova/argscheck module +interface ArgsCheck { + checkArgs(argsSpec: string, functionName: string, args: any[], callee?: any): void; + getValue(value?: any, defaultValue?: any): any; + enableChecks: boolean; +} + +// cordova/urlutil module +interface UrlUtil { + makeAbsolute(url: string): string +} + +/** Apache Cordova instance */ +declare var cordova: Cordova; + +declare module 'cordova' { + export = cordova; +} diff --git a/config.xml b/config.xml new file mode 100644 index 0000000..dc8225b --- /dev/null +++ b/config.xml @@ -0,0 +1,25 @@ + + + Irwan_Shirt + + A sample Apache Cordova application that responds to the deviceready event. + + + Apache Cordova Team + + + + + + + + + + + + + + + + + diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/jsconfig.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..843b065 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,764 @@ +{ + "name": "com.irwan_image.app", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@netflix/nerror": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@netflix/nerror/-/nerror-1.1.3.tgz", + "integrity": "sha512-b+MGNyP9/LXkapreJzNUzcvuzZslj/RGgdVVJ16P2wSlYatfLycPObImqVJSmNAdyeShvNeM/pl3sVZsObFueg==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "extsprintf": "^1.4.0", + "lodash": "^4.17.15" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "android-versions": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.6.0.tgz", + "integrity": "sha512-ojC2Ig7b/KJ6iNtR8e4bacmOsJyEkoERk3CKMIsnH7kJz5z6551NMbrVaRb7KXYavu1d74Uhml/bfcmqT3nAcg==", + "dev": true, + "requires": { + "semver": "^5.7.1" + } + }, + "ansi": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", + "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=", + "dev": true + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "big-integer": { + "version": "1.6.48", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", + "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", + "dev": true + }, + "bplist-parser": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", + "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "dev": true, + "requires": { + "big-integer": "^1.6.44" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cordova-android": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-9.0.0.tgz", + "integrity": "sha512-2ZEgApK4LPMYW0zh/mLAH3CabzCaKE0yxQTzA2wTf0Eo2HHTJnRtDCf9spGf3nPOkubyXS6+pvzz5QzNHpVTqQ==", + "dev": true, + "requires": { + "android-versions": "^1.5.0", + "cordova-common": "^4.0.1", + "execa": "^4.0.2", + "fs-extra": "^9.0.1", + "nopt": "^4.0.3", + "properties-parser": "^0.3.1", + "which": "^2.0.2" + } + }, + "cordova-common": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-4.0.2.tgz", + "integrity": "sha512-od7aNShyuBajzPY83mUEO8tERwwWdFklXETHiXP5Ft87CWeo/tSuwNPFztyTy8XYc74yXdogXKPTJeUHuVzB8Q==", + "dev": true, + "requires": { + "@netflix/nerror": "^1.1.3", + "ansi": "^0.3.1", + "bplist-parser": "^0.2.0", + "cross-spawn": "^7.0.1", + "elementtree": "^0.1.7", + "endent": "^1.4.1", + "fast-glob": "^3.2.2", + "fs-extra": "^9.0.0", + "glob": "^7.1.6", + "plist": "^3.0.1", + "q": "^1.5.1", + "read-chunk": "^3.2.0", + "strip-bom": "^4.0.0", + "underscore": "^1.9.2" + } + }, + "cordova-plugin-androidx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-androidx/-/cordova-plugin-androidx-3.0.0.tgz", + "integrity": "sha512-niMnhcxKsu4/oKTUbL0jRAnh6/cdoIVxRxJqj3uEyv8CVOlAj1sWhX+9b1XiAo9+bejAM9BbA21YK0mChfbVTA==", + "dev": true + }, + "cordova-plugin-androidx-adapter": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cordova-plugin-androidx-adapter/-/cordova-plugin-androidx-adapter-1.1.3.tgz", + "integrity": "sha512-W1SImn0cCCvOSTSfWWp5TnanIQrSuh2Bch+dcZXIzEn0km3Qb7VryeAqHhgBQYwwzC5Ollk1DtUAk/AJSojuZA==", + "dev": true, + "requires": { + "q": "^1.5.1", + "recursive-readdir": "^2.2.2" + } + }, + "cordova-plugin-screen-orientation": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/cordova-plugin-screen-orientation/-/cordova-plugin-screen-orientation-3.0.2.tgz", + "integrity": "sha512-2w6CMC+HGvbhogJetalwGurL2Fx8DQCCPy3wlSZHN1/W7WoQ5n9ujVozcoKrY4VaagK6bxrPFih+ElkO8Uqfzg==", + "dev": true + }, + "cordova-plugin-whitelist": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.4.tgz", + "integrity": "sha512-EYC5eQFVkoYXq39l7tYKE6lEjHJ04mvTmKXxGL7quHLdFPfJMNzru/UYpn92AOfpl3PQaZmou78C7EgmFOwFQQ==", + "dev": true + }, + "cordova-plugin-x-socialsharing": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-6.0.3.tgz", + "integrity": "sha512-pnrE2CXsz4G0n0WoFDAasLS1VT3nIsNpddvXgfpiqX3wyOlSjO2NdF+sjYaTvs1B+f7z8EWbYCHpCrgBQiMLIg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "elementtree": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.7.tgz", + "integrity": "sha1-mskb5uUvtuYkTE5UpKw+2K6OKcA=", + "dev": true, + "requires": { + "sax": "1.1.4" + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "endent": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/endent/-/endent-1.4.1.tgz", + "integrity": "sha512-buHTb5c8AC9NshtP6dgmNLYkiT+olskbq1z6cEGvfGCF3Qphbu/1zz5Xu+yjTDln8RbxNhPoUyJ5H8MSrp1olQ==", + "dev": true, + "requires": { + "dedent": "^0.7.0", + "fast-json-parse": "^1.0.3", + "objectorarray": "^1.0.4" + } + }, + "es6-promise-plugin": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/es6-promise-plugin/-/es6-promise-plugin-4.2.2.tgz", + "integrity": "sha512-uoA4aVplXI9oqUYJFBAVRwAqIN9/n9JgrTAUGX3qPbnSZVE5yY1+6/MsoN5f4xsaPO62WjPHOdtts6okMN6tNA==", + "dev": true + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "extsprintf": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz", + "integrity": "sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=", + "dev": true + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fast-json-parse": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-json-parse/-/fast-json-parse-1.0.3.tgz", + "integrity": "sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==", + "dev": true + }, + "fastq": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", + "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fs-extra": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "objectorarray": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/objectorarray/-/objectorarray-1.0.4.tgz", + "integrity": "sha512-91k8bjcldstRz1bG6zJo8lWD7c6QXcB4nTDUqiEvIL1xAsLoZlOOZZG+nd6YPz+V7zY1580J4Xxh1vZtyv4i/w==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "plist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", + "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", + "dev": true, + "requires": { + "base64-js": "^1.2.3", + "xmlbuilder": "^9.0.7", + "xmldom": "0.1.x" + } + }, + "properties-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz", + "integrity": "sha1-ExbpU5/7/ZOEXjabIRAiq9R4dxo=", + "dev": true, + "requires": { + "string.prototype.codepointat": "^0.2.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "read-chunk": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/read-chunk/-/read-chunk-3.2.0.tgz", + "integrity": "sha512-CEjy9LCzhmD7nUpJ1oVOE6s/hBkejlcJEgLQHVnQznOSilOPb+kpKktlLfFDK3/WP43+F80xkUTM2VOkYoSYvQ==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "with-open-file": "^0.1.6" + } + }, + "recursive-readdir": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "dev": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true + }, + "sax": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz", + "integrity": "sha1-dLbTPJrh4AFRDxeakRaFiPGu2qk=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "string.prototype.codepointat": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz", + "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==", + "dev": true + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "underscore": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.0.tgz", + "integrity": "sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ==", + "dev": true + }, + "universalify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "with-open-file": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/with-open-file/-/with-open-file-0.1.7.tgz", + "integrity": "sha512-ecJS2/oHtESJ1t3ZfMI3B7KIDKyfN0O16miWxdn30zdh66Yd3LsRFebXZXq6GU4xfxLf6nVxp9kIqElb5fqczA==", + "dev": true, + "requires": { + "p-finally": "^1.0.0", + "p-try": "^2.1.0", + "pify": "^4.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", + "dev": true + }, + "xmldom": { + "version": "0.1.31", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", + "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e32429c --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "com.irwan_image.app", + "displayName": "Irwan_Shirt", + "version": "1.0.0", + "description": "A sample Apache Cordova application that responds to the deviceready event.", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [ + "ecosystem:cordova" + ], + "author": "Apache Cordova Team", + "license": "Apache-2.0", + "devDependencies": { + "cordova-android": "^9.0.0", + "cordova-plugin-androidx": "^3.0.0", + "cordova-plugin-androidx-adapter": "^1.1.3", + "cordova-plugin-screen-orientation": "^3.0.2", + "cordova-plugin-whitelist": "^1.3.4", + "cordova-plugin-x-socialsharing": "^6.0.3", + "es6-promise-plugin": "^4.2.2" + }, + "cordova": { + "plugins": { + "cordova-plugin-whitelist": {}, + "cordova-plugin-screen-orientation": {}, + "cordova-plugin-x-socialsharing": {}, + "cordova-plugin-androidx": {}, + "cordova-plugin-androidx-adapter": {} + }, + "platforms": [ + "android" + ] + } +} \ No newline at end of file diff --git a/readme.rst b/readme.rst new file mode 100644 index 0000000..fb812c0 --- /dev/null +++ b/readme.rst @@ -0,0 +1,15 @@ +################### +T-Shirt Designer +################### + +Mobile App T-Shirt Designer + +******************* +Contact +******************* + +- Facebook https://www.facebook.com/kicap.karan> +- Portfolio Website https://www.kicap-karan.com/ +- Linkedin https://www.linkedin.com/in/kicap-karan-85588b203/ +- Whatsapp +6282293246583 + diff --git a/typings/cordova-typings.d.ts b/typings/cordova-typings.d.ts new file mode 100644 index 0000000..6fe567c --- /dev/null +++ b/typings/cordova-typings.d.ts @@ -0,0 +1,2 @@ + +/// \ No newline at end of file diff --git a/www/about.html b/www/about.html new file mode 100644 index 0000000..2c6fade --- /dev/null +++ b/www/about.html @@ -0,0 +1,123 @@ + + + + + + + + Irwan T-Shirt Design + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Irwan T-Shirt

+

Sebuah Aplikasi dari Irwan Untuk Mendesain T-Shirt Berdasarkan Keinginan Pengguna

+ Mulai Mendesain +
+
+ + +
+
+ +
+ + + + + Designed by Irwan +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/assets/css/style.css b/www/assets/css/style.css new file mode 100644 index 0000000..bf27acc --- /dev/null +++ b/www/assets/css/style.css @@ -0,0 +1,1281 @@ +/** +* Template Name: Kelly - v2.0.0 +* Template URL: https://bootstrapmade.com/kelly-free-bootstrap-cv-resume-html-template/ +* Author: BootstrapMade.com +* License: https://bootstrapmade.com/license/ +*/ + +/*-------------------------------------------------------------- +# General +--------------------------------------------------------------*/ +body { + font-family: "Open Sans", sans-serif; + color: #444444; +} + +a { + color: #34b7a7; +} + +a:hover { + color: #51cdbe; + text-decoration: none; +} + +h1, h2, h3, h4, h5, h6 { + font-family: "Raleway", sans-serif; +} + +#main { + margin-top: 50px; +} + +@media (max-width: 992px) { + #main { + margin-top: 30px; + } +} + +/*-------------------------------------------------------------- +# Preloader +--------------------------------------------------------------*/ +#preloader { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 9999; + overflow: hidden; + background: #fff; +} + +#preloader:before { + content: ""; + position: fixed; + top: calc(50% - 30px); + left: calc(50% - 30px); + border: 6px solid #34b7a7; + border-top-color: #dcf5f2; + border-radius: 50%; + width: 60px; + height: 60px; + -webkit-animation: animate-preloader 1s linear infinite; + animation: animate-preloader 1s linear infinite; +} + +@-webkit-keyframes animate-preloader { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +@keyframes animate-preloader { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +/*-------------------------------------------------------------- +# Back to top button +--------------------------------------------------------------*/ +.back-to-top { + position: fixed; + display: none; + right: 15px; + bottom: 15px; + z-index: 99999; +} + +.back-to-top i { + display: flex; + align-items: center; + justify-content: center; + font-size: 24px; + width: 40px; + height: 40px; + border-radius: 50px; + background: #34b7a7; + color: #fff; + transition: all 0.4s; +} + +.back-to-top i:hover { + background: #3dc8b7; + color: #fff; +} + +/*-------------------------------------------------------------- +# Header +--------------------------------------------------------------*/ +#header { + background: #e9e8e6; + box-shadow: 0px 0px 25px 0 rgba(0, 0, 0, 0.08); + z-index: 997; + padding: 15px 0; +} + +#header .logo { + font-size: 32px; + margin: 0; + padding: 0; + line-height: 1; + font-weight: 400; + letter-spacing: 2px; + text-transform: uppercase; +} + +#header .logo a { + color: #222222; +} + +#header .logo img { + max-height: 40px; +} + +@media (max-width: 992px) { + #header .logo { + font-size: 28px; + } +} + +/*-------------------------------------------------------------- +# Navigation Menu +--------------------------------------------------------------*/ +/* Desktop Navigation */ +.nav-menu ul { + margin: 0; + padding: 0; + list-style: none; +} + +.nav-menu > ul { + display: flex; +} + +.nav-menu > ul > li { + position: relative; + white-space: nowrap; + padding: 10px 0 10px 28px; +} + +.nav-menu a { + display: block; + position: relative; + color: #888888; + transition: 0.3s; + font-size: 15px; + font-family: "Raleway", sans-serif; + font-weight: 600; +} + +.nav-menu > ul > li > a:before { + content: ""; + position: absolute; + width: 0; + height: 2px; + bottom: -5px; + left: 0; + background-color: #34b7a7; + visibility: hidden; + width: 0px; + transition: all 0.3s ease-in-out 0s; +} + +.nav-menu a:hover:before, .nav-menu li:hover > a:before, .nav-menu .active > a:before { + visibility: visible; + width: 25px; +} + +.nav-menu a:hover, .nav-menu .active > a, .nav-menu li:hover > a { + color: #222222; +} + +.nav-menu .drop-down ul { + display: block; + position: absolute; + left: 28px; + top: calc(100% + 30px); + z-index: 99; + opacity: 0; + visibility: hidden; + padding: 10px 0; + background: #fff; + box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25); + transition: 0.3s; +} + +.nav-menu .drop-down:hover > ul { + opacity: 1; + top: 100%; + visibility: visible; +} + +.nav-menu .drop-down li { + min-width: 180px; + position: relative; +} + +.nav-menu .drop-down ul a { + padding: 10px 20px; + font-size: 14px; + font-weight: 500; + text-transform: none; + color: #222222; +} + +.nav-menu .drop-down ul a:hover, .nav-menu .drop-down ul .active > a, .nav-menu .drop-down ul li:hover > a { + color: #34b7a7; +} + +.nav-menu .drop-down > a:after { + content: "\ea99"; + font-family: IcoFont; + padding-left: 5px; +} + +.nav-menu .drop-down .drop-down ul { + top: 0; + left: calc(100% - 30px); +} + +.nav-menu .drop-down .drop-down:hover > ul { + opacity: 1; + top: 0; + left: 100%; +} + +.nav-menu .drop-down .drop-down > a { + padding-right: 35px; +} + +.nav-menu .drop-down .drop-down > a:after { + content: "\eaa0"; + font-family: IcoFont; + position: absolute; + right: 15px; +} + +@media (max-width: 1366px) { + .nav-menu .drop-down .drop-down ul { + left: -90%; + } + .nav-menu .drop-down .drop-down:hover > ul { + left: -100%; + } + .nav-menu .drop-down .drop-down > a:after { + content: "\ea9d"; + } +} + +/* Mobile Navigation */ +.mobile-nav-toggle { + position: fixed; + right: 15px; + top: 17px; + z-index: 9998; + border: 0; + background: none; + font-size: 24px; + transition: all 0.4s; + outline: none !important; + line-height: 1; + cursor: pointer; + text-align: right; +} + +.mobile-nav-toggle i { + color: #34b7a7; +} + +.mobile-nav { + position: fixed; + top: 55px; + right: 15px; + bottom: 15px; + left: 15px; + z-index: 9999; + overflow-y: auto; + background: #fff; + transition: ease-in-out 0.2s; + opacity: 0; + visibility: hidden; + border-radius: 10px; + padding: 10px 0; +} + +.mobile-nav * { + margin: 0; + padding: 0; + list-style: none; +} + +.mobile-nav a { + display: block; + position: relative; + color: #222222; + padding: 10px 20px; + font-weight: 500; + outline: none; +} + +.mobile-nav a:hover, .mobile-nav .active > a, .mobile-nav li:hover > a { + color: #34b7a7; + text-decoration: none; +} + +.mobile-nav .drop-down > a:after { + content: "\ea99"; + font-family: IcoFont; + padding-left: 10px; + position: absolute; + right: 15px; +} + +.mobile-nav .active.drop-down > a:after { + content: "\eaa1"; +} + +.mobile-nav .drop-down > a { + padding-right: 35px; +} + +.mobile-nav .drop-down ul { + display: none; + overflow: hidden; +} + +.mobile-nav .drop-down li { + padding-left: 20px; +} + +.mobile-nav-overly { + width: 100%; + height: 100%; + z-index: 9997; + top: 0; + left: 0; + position: fixed; + background: rgba(9, 9, 9, 0.6); + overflow: hidden; + display: none; + transition: ease-in-out 0.2s; +} + +.mobile-nav-active { + overflow: hidden; +} + +.mobile-nav-active .mobile-nav { + opacity: 1; + visibility: visible; +} + +.mobile-nav-active .mobile-nav-toggle i { + color: #fff; +} + +/*-------------------------------------------------------------- +# Header Social Links +--------------------------------------------------------------*/ +.header-social-links { + padding-left: 20px; +} + +.header-social-links a { + color: #222222; + padding-left: 6px; + display: inline-block; + line-height: 1px; + transition: 0.3s; + font-size: 16px; +} + +.header-social-links a:hover { + color: #34b7a7; +} + +@media (max-width: 992px) { + .header-social-links { + padding: 0 48px 0 0; + } +} + +/*-------------------------------------------------------------- +# Hero Section +--------------------------------------------------------------*/ +#hero { + width: 100%; + height: 100vh; + background: url("../img/hero-bg.jpg") top right; + background-size: cover; +} + +#hero .container { + padding-top: 70px; + position: relative; +} + +@media (max-width: 992px) { + #hero .container { + padding-top: 58px; + } +} + +#hero h1 { + margin: 0; + font-size: 48px; + font-weight: 700; + line-height: 56px; + color: #222222; +} + +#hero h2 { + color: #6f6f6f; + margin: 10px 0 0 0; + font-size: 22px; +} + +#hero .btn-about { + font-family: "Raleway", sans-serif; + text-transform: uppercase; + font-weight: 600; + font-size: 12px; + letter-spacing: 1px; + display: inline-block; + padding: 12px 40px; + border-radius: 50px; + transition: 0.5s; + margin-top: 30px; + color: #fff; + background: #34b7a7; +} + +#hero .btn-about:hover { + background: #3dc8b7; +} + +@media (min-width: 1024px) { + #hero { + background-attachment: fixed; + } +} + +@media (max-width: 992px) { + #hero:before { + content: ""; + background: rgba(255, 255, 255, 0.8); + position: absolute; + bottom: 0; + top: 0; + left: 0; + right: 0; + } + #hero h1 { + font-size: 28px; + line-height: 36px; + } + #hero h2 { + font-size: 18px; + line-height: 24px; + } +} + +/*-------------------------------------------------------------- +# Sections General +--------------------------------------------------------------*/ +section { + padding: 60px 0; +} + +.section-bg { + background-color: #e7f8f6; +} + +.section-title { + text-align: center; + padding-bottom: 30px; +} + +.section-title h2 { + font-size: 32px; + font-weight: bold; + text-transform: uppercase; + margin-bottom: 20px; + padding-bottom: 20px; + position: relative; +} + +.section-title h2::after { + content: ''; + position: absolute; + display: block; + width: 50px; + height: 3px; + background: #34b7a7; + bottom: 0; + left: calc(50% - 25px); +} + +.section-title p { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +# Cta +--------------------------------------------------------------*/ +.cta { + background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("../img/bg-1.jpg") fixed center center; + background-size: cover; + padding: 80px 0; +} + +.cta h3 { + color: #fff; + font-size: 28px; + font-weight: 700; +} + +.cta p { + color: #fff; +} + +.cta .cta-btn { + font-family: "Raleway", sans-serif; + text-transform: uppercase; + font-weight: 500; + font-size: 16px; + letter-spacing: 1px; + display: inline-block; + padding: 8px 20px; + border-radius: 2px; + transition: 0.5s; + margin: 10px; + border: 2px solid #fff; + color: #fff; +} + +.cta .cta-btn:hover { + background: #34b7a7; + border: 2px solid #34b7a7; +} + +@media (max-width: 1024px) { + .cta { + background-attachment: scroll; + } +} + +@media (min-width: 769px) { + .cta .cta-btn-container { + display: flex; + align-items: center; + justify-content: flex-end; + } +} + +/*-------------------------------------------------------------- +# About +--------------------------------------------------------------*/ +.about .content h3 { + font-weight: 700; + font-size: 26px; + color: #555555; +} + +.about .content ul { + list-style: none; + padding: 0; +} + +.about .content ul li { + padding-bottom: 10px; +} + +.about .content ul i { + font-size: 20px; + padding-right: 2px; + color: #34b7a7; +} + +.about .content p:last-child { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +# Skills +--------------------------------------------------------------*/ +.skills .progress { + height: 50px; + display: block; + background: none; +} + +.skills .progress .skill { + padding: 10px 0; + margin: 0 0 6px 0; + text-transform: uppercase; + display: block; + font-weight: 600; + font-family: "Poppins", sans-serif; + color: #222222; +} + +.skills .progress .skill .val { + float: right; + font-style: normal; +} + +.skills .progress-bar-wrap { + background: #f3f3f3; +} + +.skills .progress-bar { + width: 1px; + height: 10px; + transition: .9s; + background-color: #34b7a7; +} + +/*-------------------------------------------------------------- +# Facts +--------------------------------------------------------------*/ +.facts .counters span { + font-size: 48px; + display: block; + color: #34b7a7; +} + +.facts .counters p { + padding: 0; + margin: 0 0 20px 0; + font-family: "Raleway", sans-serif; + font-size: 14px; +} + +/*-------------------------------------------------------------- +# Testimonials +--------------------------------------------------------------*/ +.testimonials .section-header { + margin-bottom: 40px; +} + +.testimonials .testimonial-item { + text-align: center; +} + +.testimonials .testimonial-item .testimonial-img { + width: 120px; + border-radius: 50%; + border: 4px solid #fff; + margin: 0 auto; +} + +.testimonials .testimonial-item h3 { + font-size: 20px; + font-weight: bold; + margin: 10px 0 5px 0; + color: #111; +} + +.testimonials .testimonial-item h4 { + font-size: 14px; + color: #999; + margin: 0 0 15px 0; +} + +.testimonials .testimonial-item .quote-icon-left, .testimonials .testimonial-item .quote-icon-right { + color: #c8efea; + font-size: 26px; +} + +.testimonials .testimonial-item .quote-icon-left { + display: inline-block; + left: -5px; + position: relative; +} + +.testimonials .testimonial-item .quote-icon-right { + display: inline-block; + right: -5px; + position: relative; + top: 10px; +} + +.testimonials .testimonial-item p { + font-style: italic; + margin: 0 auto 15px auto; +} + +.testimonials .owl-nav, .testimonials .owl-dots { + margin-top: 5px; + text-align: center; +} + +.testimonials .owl-dot { + display: inline-block; + margin: 0 5px; + width: 12px; + height: 12px; + border-radius: 50%; + background-color: #ddd !important; +} + +.testimonials .owl-dot.active { + background-color: #34b7a7 !important; +} + +@media (min-width: 992px) { + .testimonials .testimonial-item p { + width: 80%; + } +} + +/*-------------------------------------------------------------- +# Resume +--------------------------------------------------------------*/ +.resume .resume-title { + font-size: 26px; + font-weight: 400; + margin-top: 20px; + margin-bottom: 20px; + color: #222222; +} + +.resume .resume-item { + padding: 0 0 20px 20px; + margin-top: -2px; + border-left: 2px solid #34b7a7; + position: relative; +} + +.resume .resume-item h4 { + line-height: 18px; + font-size: 18px; + font-weight: 600; + font-family: "Poppins", sans-serif; + color: #1d685f; + margin-bottom: 10px; +} + +.resume .resume-item h5 { + font-size: 16px; + background: #effbf9; + padding: 5px 15px; + display: inline-block; + font-weight: 600; + margin-bottom: 10px; + color: #34b7a7; +} + +.resume .resume-item ul { + padding-left: 20px; +} + +.resume .resume-item ul li { + padding-bottom: 10px; +} + +.resume .resume-item:last-child { + padding-bottom: 0; +} + +.resume .resume-item::before { + content: ""; + position: absolute; + width: 16px; + height: 16px; + border-radius: 50px; + left: -9px; + top: 0; + background: #fff; + border: 2px solid #34b7a7; +} + +/*-------------------------------------------------------------- +# Services +--------------------------------------------------------------*/ +.services .icon-box { + text-align: center; + padding: 70px 20px 80px 20px; + transition: all ease-in-out 0.3s; + background: #fff; + box-shadow: 0px 0 35px 0 rgba(0, 0, 0, 0.08); +} + +.services .icon-box .icon { + margin: 0 auto; + width: 100px; + height: 100px; + display: flex; + align-items: center; + justify-content: center; + transition: ease-in-out 0.3s; + position: relative; +} + +.services .icon-box .icon i { + font-size: 36px; + transition: 0.5s; + position: relative; +} + +.services .icon-box .icon svg { + position: absolute; + top: 0; + left: 0; +} + +.services .icon-box .icon svg path { + transition: 0.5s; + fill: #f5f5f5; +} + +.services .icon-box h4 { + font-weight: 600; + margin: 10px 0 15px 0; + font-size: 22px; +} + +.services .icon-box h4 a { + color: #222222; + transition: ease-in-out 0.3s; +} + +.services .icon-box p { + line-height: 24px; + font-size: 14px; + margin-bottom: 0; +} + +.services .iconbox-blue i { + color: #47aeff; +} + +.services .iconbox-blue:hover .icon i { + color: #fff; +} + +.services .iconbox-blue:hover .icon path { + fill: #47aeff; +} + +.services .iconbox-orange i { + color: #ffa76e; +} + +.services .iconbox-orange:hover .icon i { + color: #fff; +} + +.services .iconbox-orange:hover .icon path { + fill: #ffa76e; +} + +.services .iconbox-pink i { + color: #e80368; +} + +.services .iconbox-pink:hover .icon i { + color: #fff; +} + +.services .iconbox-pink:hover .icon path { + fill: #e80368; +} + +.services .iconbox-yellow i { + color: #ffbb2c; +} + +.services .iconbox-yellow:hover .icon i { + color: #fff; +} + +.services .iconbox-yellow:hover .icon path { + fill: #ffbb2c; +} + +.services .iconbox-red i { + color: #ff5828; +} + +.services .iconbox-red:hover .icon i { + color: #fff; +} + +.services .iconbox-red:hover .icon path { + fill: #ff5828; +} + +.services .iconbox-teal i { + color: #11dbcf; +} + +.services .iconbox-teal:hover .icon i { + color: #fff; +} + +.services .iconbox-teal:hover .icon path { + fill: #11dbcf; +} + +/*-------------------------------------------------------------- +# Portfolio +--------------------------------------------------------------*/ +.portfolio .portfolio-item { + margin-bottom: 30px; +} + +.portfolio #portfolio-flters { + padding: 0; + margin: 0 auto 20px auto; + list-style: none; + text-align: center; +} + +.portfolio #portfolio-flters li { + cursor: pointer; + display: inline-block; + padding: 8px 16px 10px 16px; + font-size: 13px; + font-weight: 500; + line-height: 1; + text-transform: uppercase; + color: #444444; + margin-bottom: 5px; + transition: all 0.3s ease-in-out; + border-radius: 50px; +} + +.portfolio #portfolio-flters li:hover, .portfolio #portfolio-flters li.filter-active { + color: #fff; + background: #34b7a7; +} + +.portfolio #portfolio-flters li:last-child { + margin-right: 0; +} + +.portfolio .portfolio-wrap { + transition: 0.3s; + position: relative; + overflow: hidden; + z-index: 1; + background: rgba(34, 34, 34, 0.6); +} + +.portfolio .portfolio-wrap::before { + content: ""; + background: rgba(34, 34, 34, 0.6); + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + transition: all ease-in-out 0.3s; + z-index: 2; + opacity: 0; +} + +.portfolio .portfolio-wrap img { + transition: all ease-in-out 0.3s; +} + +.portfolio .portfolio-wrap .portfolio-info { + opacity: 0; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 3; + transition: all ease-in-out 0.3s; + display: flex; + flex-direction: column; + justify-content: flex-end; + align-items: flex-start; + padding: 20px; +} + +.portfolio .portfolio-wrap .portfolio-info h4 { + font-size: 20px; + color: #fff; + font-weight: 600; +} + +.portfolio .portfolio-wrap .portfolio-info p { + color: rgba(255, 255, 255, 0.7); + font-size: 14px; + text-transform: uppercase; + padding: 0; + margin: 0; + font-style: italic; +} + +.portfolio .portfolio-wrap .portfolio-links { + text-align: center; + z-index: 4; +} + +.portfolio .portfolio-wrap .portfolio-links a { + color: #fff; + margin: 0 5px 0 0; + font-size: 28px; + display: inline-block; + transition: 0.3s; +} + +.portfolio .portfolio-wrap .portfolio-links a:hover { + color: #78d9cd; +} + +.portfolio .portfolio-wrap:hover::before { + opacity: 1; +} + +.portfolio .portfolio-wrap:hover img { + transform: scale(1.2); +} + +.portfolio .portfolio-wrap:hover .portfolio-info { + opacity: 1; +} + +/*-------------------------------------------------------------- +# Portfolio Details +--------------------------------------------------------------*/ +.portfolio-details { + padding: 0; +} + +.portfolio-details .portfolio-title { + font-size: 26px; + font-weight: 700; + margin-bottom: 20px; +} + +.portfolio-details .portfolio-details-carousel .owl-nav, .portfolio-details .portfolio-details-carousel .owl-dots { + margin-top: 5px; + text-align: center; +} + +.portfolio-details .portfolio-details-carousel .owl-dot { + display: inline-block; + margin: 0 5px; + width: 12px; + height: 12px; + border-radius: 50%; + background-color: #ddd !important; +} + +.portfolio-details .portfolio-details-carousel .owl-dot.active { + background-color: #34b7a7 !important; +} + +.portfolio-details .portfolio-info { + padding-top: 45px; +} + +.portfolio-details .portfolio-info h3 { + font-size: 22px; + font-weight: 400; + margin-bottom: 20px; +} + +.portfolio-details .portfolio-info ul { + list-style: none; + padding: 0; + font-size: 15px; +} + +.portfolio-details .portfolio-info ul li + li { + margin-top: 10px; +} + +.portfolio-details .portfolio-info p { + font-size: 15px; + padding: 15px 0 0 0; +} + +@media (max-width: 992px) { + .portfolio-details .portfolio-info { + padding-top: 20px; + } +} + +/*-------------------------------------------------------------- +# Contact +--------------------------------------------------------------*/ +.contact .info { + width: 100%; + background: #fff; +} + +.contact .info i { + font-size: 20px; + color: #34b7a7; + float: left; + width: 44px; + height: 44px; + background: #effbf9; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50px; + transition: all 0.3s ease-in-out; +} + +.contact .info h4 { + padding: 0 0 0 60px; + font-size: 22px; + font-weight: 600; + margin-bottom: 5px; + color: #222222; +} + +.contact .info p { + padding: 0 0 0 60px; + margin-bottom: 0; + font-size: 14px; + color: #555555; +} + +.contact .info .email, .contact .info .phone { + margin-top: 40px; +} + +.contact .info .email:hover i, .contact .info .address:hover i, .contact .info .phone:hover i { + background: #34b7a7; + color: #fff; +} + +.contact .php-email-form { + width: 100%; + background: #fff; +} + +.contact .php-email-form .form-group { + padding-bottom: 8px; +} + +.contact .php-email-form .validate { + display: none; + color: red; + margin: 0 0 15px 0; + font-weight: 400; + font-size: 13px; +} + +.contact .php-email-form .error-message { + display: none; + color: #fff; + background: #ed3c0d; + text-align: center; + padding: 15px; + font-weight: 600; +} + +.contact .php-email-form .sent-message { + display: none; + color: #fff; + background: #18d26e; + text-align: center; + padding: 15px; + font-weight: 600; +} + +.contact .php-email-form .loading { + display: none; + background: #fff; + text-align: center; + padding: 15px; +} + +.contact .php-email-form .loading:before { + content: ""; + display: inline-block; + border-radius: 50%; + width: 24px; + height: 24px; + margin: 0 10px -6px 0; + border: 3px solid #18d26e; + border-top-color: #eee; + -webkit-animation: animate-loading 1s linear infinite; + animation: animate-loading 1s linear infinite; +} + +.contact .php-email-form input, .contact .php-email-form textarea { + border-radius: 4px; + box-shadow: none; + font-size: 14px; +} + +.contact .php-email-form input:focus, .contact .php-email-form textarea:focus { + border-color: #34b7a7; +} + +.contact .php-email-form input { + height: 44px; +} + +.contact .php-email-form textarea { + padding: 10px 12px; +} + +.contact .php-email-form button[type="submit"] { + background: #34b7a7; + border: 0; + padding: 10px 30px 12px 30px; + color: #fff; + transition: 0.4s; + border-radius: 50px; +} + +.contact .php-email-form button[type="submit"]:hover { + background: #3dc8b7; +} + +@-webkit-keyframes animate-loading { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +@keyframes animate-loading { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +/*-------------------------------------------------------------- +# Footer +--------------------------------------------------------------*/ +#footer { + background: #e9e8e6; + padding: 30px 0; + color: #222222; + font-size: 14px; + text-align: center; +} + +#footer .credits { + padding-top: 5px; + font-size: 13px; +} + +#footer .credits a { + color: #34b7a7; +} diff --git a/www/assets/fabric.min.js b/www/assets/fabric.min.js new file mode 100644 index 0000000..a01c6f8 --- /dev/null +++ b/www/assets/fabric.min.js @@ -0,0 +1 @@ +var fabric=fabric||{version:"4.1.0"};if("undefined"!=typeof exports?exports.fabric=fabric:"function"==typeof define&&define.amd&&define([],function(){return fabric}),"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?fabric.document=document:fabric.document=document.implementation.createHTMLDocument(""),fabric.window=window;else{var jsdom=require("jsdom"),virtualWindow=new jsdom.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;fabric.document=virtualWindow.document,fabric.jsdomImplForWrapper=require("jsdom/lib/jsdom/living/generated/utils").implForWrapper,fabric.nodeCanvas=require("jsdom/lib/jsdom/utils").Canvas,fabric.window=virtualWindow,DOMParser=fabric.window.DOMParser}function resizeCanvasIfNeeded(t){var e=t.targetCanvas,i=e.width,r=e.height,n=t.destinationWidth,s=t.destinationHeight;i===n&&r===s||(e.width=n,e.height=s)}function copyGLTo2DDrawImage(t,e){var i=t.canvas,r=e.targetCanvas,n=r.getContext("2d");n.translate(0,r.height),n.scale(1,-1);var s=i.height-r.height;n.drawImage(i,0,s,r.width,r.height,0,0,r.width,r.height)}function copyGLTo2DPutImageData(t,e){var i=e.targetCanvas.getContext("2d"),r=e.destinationWidth,n=e.destinationHeight,s=r*n*4,o=new Uint8Array(this.imageBuffer,0,s),a=new Uint8ClampedArray(this.imageBuffer,0,s);t.readPixels(0,0,r,n,t.RGBA,t.UNSIGNED_BYTE,o);var h=new ImageData(a,r,n);i.putImageData(h,0,0)}fabric.isTouchSupported="ontouchstart"in fabric.window||"ontouchstart"in fabric.document||fabric.window&&fabric.window.navigator&&0p)for(var m=1,b=c.length;m/g,">")},graphemeSplit:function(t){var e,i=0,r=[];for(i=0;it.x&&this.y>t.y},gte:function(t){return this.x>=t.x&&this.y>=t.y},lerp:function(t,e){return void 0===e&&(e=.5),e=Math.max(Math.min(1,e),0),new i(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)},distanceFrom:function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},midPointFrom:function(t){return this.lerp(t)},min:function(t){return new i(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new i(Math.max(this.x,t.x),Math.max(this.y,t.y))},toString:function(){return this.x+","+this.y},setXY:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setFromPoint:function(t){return this.x=t.x,this.y=t.y,this},swap:function(t){var e=this.x,i=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=i},clone:function(){return new i(this.x,this.y)}}}("undefined"!=typeof exports?exports:this),function(t){"use strict";var f=t.fabric||(t.fabric={});function d(t){this.status=t,this.points=[]}f.Intersection?f.warn("fabric.Intersection is already defined"):(f.Intersection=d,f.Intersection.prototype={constructor:d,appendPoint:function(t){return this.points.push(t),this},appendPoints:function(t){return this.points=this.points.concat(t),this}},f.Intersection.intersectLineLine=function(t,e,i,r){var n,s=(r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x),o=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),a=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==a){var h=s/a,c=o/a;0<=h&&h<=1&&0<=c&&c<=1?(n=new d("Intersection")).appendPoint(new f.Point(t.x+h*(e.x-t.x),t.y+h*(e.y-t.y))):n=new d}else n=new d(0===s||0===o?"Coincident":"Parallel");return n},f.Intersection.intersectLinePolygon=function(t,e,i){var r,n,s,o,a=new d,h=i.length;for(o=0;o=h&&(c.x-=h),c.x<=-h&&(c.x+=h),c.y>=h&&(c.y-=h),c.y<=h&&(c.y+=h),c.x-=o.offsetX,c.y-=o.offsetY,c}function m(t){return t.flipX&&!t.flipY||!t.flipX&&t.flipY}function b(t,e,i,r,n){if(0!==t[e]){var s=n/t._getTransformedDimensions()[r]*t[i];t.set(i,s)}}function u(t,e,i,r){var n,s=e.target,o=s._getTransformedDimensions(0,s.skewY),a=A(e,e.originX,e.originY,i,r),h=Math.abs(2*a.x)-o.x,c=s.skewX;h<2?n=0:(n=v(Math.atan2(h/s.scaleX,o.y/s.scaleY)),e.originX===f&&e.originY===p&&(n=-n),e.originX===g&&e.originY===d&&(n=-n),m(s)&&(n=-n));var l=c!==n;if(l){var u=s._getTransformedDimensions().y;s.set("skewX",n),b(s,"skewY","scaleY","y",u),O("skewing",E(t,e,i,r))}return l}function _(t,e,i,r){var n,s=e.target,o=s._getTransformedDimensions(s.skewX,0),a=A(e,e.originX,e.originY,i,r),h=Math.abs(2*a.y)-o.y,c=s.skewY;h<2?n=0:(n=v(Math.atan2(h/s.scaleY,o.x/s.scaleX)),e.originX===f&&e.originY===p&&(n=-n),e.originX===g&&e.originY===d&&(n=-n),m(s)&&(n=-n));var l=c!==n;if(l){var u=s._getTransformedDimensions().x;s.set("skewY",n),b(s,"skewX","scaleX","x",u),O("skewing",E(t,e,i,r))}return l}function y(t,e,i,r,n){n=n||{};var s,o,a,h,c,l,u=e.target,f=u.lockScalingX,d=u.lockScalingY,g=n.by,p=k(t,u),v=P(u,g,p),m=e.gestureScale;if(v)return!1;if(m)o=e.scaleX*m,a=e.scaleY*m;else{if(s=A(e,e.originX,e.originY,i,r),c="y"!==g?T(s.x):1,l="x"!==g?T(s.y):1,e.signX||(e.signX=c),e.signY||(e.signY=l),u.lockScalingFlip&&(e.signX!==c||e.signY!==l))return!1;if(h=u._getTransformedDimensions(),p&&!g){var b,_=Math.abs(s.x)+Math.abs(s.y),y=e.original,x=_/(Math.abs(h.x*y.scaleX/u.scaleX)+Math.abs(h.y*y.scaleY/u.scaleY));o=y.scaleX*x,a=y.scaleY*x}else o=Math.abs(s.x*u.scaleX/h.x),a=Math.abs(s.y*u.scaleY/h.y);D(e)&&(o*=2,a*=2),e.signX!==c&&"y"!==g&&(e.originX=w[e.originX],o*=-1,e.signX=c),e.signY!==l&&"x"!==g&&(e.originY=w[e.originY],a*=-1,e.signY=l)}var C=u.scaleX,S=u.scaleY;return g?("x"===g&&u.set("scaleX",o),"y"===g&&u.set("scaleY",a)):(!f&&u.set("scaleX",o),!d&&u.set("scaleY",a)),(b=C!==u.scaleX||S!==u.scaleY)&&O("scaling",E(t,e,i,r)),b}n.scaleCursorStyleHandler=function(t,e,i){var r=k(t,i),n="";if(0!==e.x&&0===e.y?n="x":0===e.x&&0!==e.y&&(n="y"),P(i,n,r))return"not-allowed";var s=a(i,e);return o[s]+"-resize"},n.skewCursorStyleHandler=function(t,e,i){var r="not-allowed";if(0!==e.x&&i.lockSkewingY)return r;if(0!==e.y&&i.lockSkewingX)return r;var n=a(i,e)%4;return s[n]+"-resize"},n.scaleSkewCursorStyleHandler=function(t,e,i){return t[i.canvas.altActionKey]?n.skewCursorStyleHandler(t,e,i):n.scaleCursorStyleHandler(t,e,i)},n.rotationWithSnapping=c(function(t,e,i,r){var n=e,s=n.target,o=s.translateToOriginPoint(s.getCenterPoint(),n.originX,n.originY);if(s.lockRotation)return!1;var a,h=Math.atan2(n.ey-o.y,n.ex-o.x),c=Math.atan2(r-o.y,i-o.x),l=v(c-h+n.theta);if(0o.r2,c=this.gradientTransform?this.gradientTransform.concat():fabric.iMatrix.concat(),l=-this.offsetX,u=-this.offsetY,f=!!e.additionalTransform,d="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(a.sort(function(t,e){return t.offset-e.offset}),"objectBoundingBox"===d?(l/=t.width,u/=t.height):(l+=t.width/2,u+=t.height/2),"path"===t.type&&(l-=t.pathOffset.x,u-=t.pathOffset.y),c[4]-=l,c[5]-=u,s='id="SVGID_'+this.id+'" gradientUnits="'+d+'"',s+=' gradientTransform="'+(f?e.additionalTransform+" ":"")+fabric.util.matrixToSVG(c)+'" ',"linear"===this.type?n=["\n']:"radial"===this.type&&(n=["\n']),"radial"===this.type){if(h)for((a=a.concat()).reverse(),i=0,r=a.length;i\n')}return n.push("linear"===this.type?"\n":"\n"),n.join("")},toLive:function(t){var e,i,r,n=fabric.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(n.x1,n.y1,n.x2,n.y2):"radial"===this.type&&(e=t.createRadialGradient(n.x1,n.y1,n.r1,n.x2,n.y2,n.r2)),i=0,r=this.colorStops.length;i\n\n\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e=this.source;if(!e)return"";if(void 0!==e.src){if(!e.complete)return"";if(0===e.naturalWidth||0===e.naturalHeight)return""}return t.createPattern(e,this.repeat)}})}(),function(t){"use strict";var o=t.fabric||(t.fabric={}),a=o.util.toFixed;o.Shadow?o.warn("fabric.Shadow is already defined."):(o.Shadow=o.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(t){for(var e in"string"==typeof t&&(t=this._parseShadow(t)),t)this[e]=t[e];this.id=o.Object.__uid++},_parseShadow:function(t){var e=t.trim(),i=o.Shadow.reOffsetsAndBlur.exec(e)||[];return{color:(e.replace(o.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseInt(i[1],10)||0,offsetY:parseInt(i[2],10)||0,blur:parseInt(i[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(t){var e=40,i=40,r=o.Object.NUM_FRACTION_DIGITS,n=o.util.rotateVector({x:this.offsetX,y:this.offsetY},o.util.degreesToRadians(-t.angle)),s=new o.Color(this.color);return t.width&&t.height&&(e=100*a((Math.abs(n.x)+this.blur)/t.width,r)+20,i=100*a((Math.abs(n.y)+this.blur)/t.height,r)+20),t.flipX&&(n.x*=-1),t.flipY&&(n.y*=-1),'\n\t\n\t\n\t\n\t\n\t\n\t\t\n\t\t\n\t\n\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},i=o.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(t){this[t]!==i[t]&&(e[t]=this[t])},this),e}}),o.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:px)?(?:\s?|$))?(-?\d+(?:px)?(?:\s?|$))?(\d+(?:px)?)?(?:\s?|$)(?:$|\s)/)}("undefined"!=typeof exports?exports:this),function(){"use strict";if(fabric.StaticCanvas)fabric.warn("fabric.StaticCanvas is already defined.");else{var n=fabric.util.object.extend,t=fabric.util.getElementOffset,c=fabric.util.removeFromArray,a=fabric.util.toFixed,s=fabric.util.transformPoint,o=fabric.util.invertTransform,i=fabric.util.getNodeCanvas,r=fabric.util.createCanvasElement,e=new Error("Could not initialize `canvas` element");fabric.StaticCanvas=fabric.util.createClass(fabric.CommonMethods,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:fabric.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(t,e){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this.interactive||this._initRetinaScaling(),e.overlayImage&&this.setOverlayImage(e.overlayImage,i),e.backgroundImage&&this.setBackgroundImage(e.backgroundImage,i),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor,i),e.overlayColor&&this.setOverlayColor(e.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1!==fabric.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?fabric.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var t=fabric.devicePixelRatio;this.__initRetinaScaling(t,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(t,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(t,e,i){e.setAttribute("width",this.width*t),e.setAttribute("height",this.height*t),i.scale(t,t)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(t,e,i){return this.__setBgOverlayImage("overlayImage",t,e,i)},setBackgroundImage:function(t,e,i){return this.__setBgOverlayImage("backgroundImage",t,e,i)},setOverlayColor:function(t,e){return this.__setBgOverlayColor("overlayColor",t,e)},setBackgroundColor:function(t,e){return this.__setBgOverlayColor("backgroundColor",t,e)},__setBgOverlayImage:function(r,t,n,s){return"string"==typeof t?fabric.util.loadImage(t,function(t,e){if(t){var i=new fabric.Image(t,s);(this[r]=i).canvas=this}n&&n(t,e)},this,s&&s.crossOrigin):(s&&t.setOptions(s),(this[r]=t)&&(t.canvas=this),n&&n(t,!1)),this},__setBgOverlayColor:function(t,e,i){return this[t]=e,this._initGradient(e,t),this._initPattern(e,t,i),this},_createCanvasElement:function(){var t=r();if(!t)throw e;if(t.style||(t.style={}),void 0===t.getContext)throw e;return t},_initOptions:function(t){var e=this.lowerCanvasEl;this._setOptions(t),this.width=this.width||parseInt(e.width,10)||0,this.height=this.height||parseInt(e.height,10)||0,this.lowerCanvasEl.style&&(e.width=this.width,e.height=this.height,e.style.width=this.width+"px",e.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(t){t&&t.getContext?this.lowerCanvasEl=t:this.lowerCanvasEl=fabric.util.getById(t)||this._createCanvasElement(),fabric.util.addClass(this.lowerCanvasEl,"lower-canvas"),this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(t,e){return this.setDimensions({width:t},e)},setHeight:function(t,e){return this.setDimensions({height:t},e)},setDimensions:function(t,e){var i;for(var r in e=e||{},t)i=t[r],e.cssOnly||(this._setBackstoreDimension(r,t[r]),i+="px",this.hasLostContext=!0),e.backstoreOnly||this._setCssDimension(r,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),e.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(t,e){return this.lowerCanvasEl[t]=e,this.upperCanvasEl&&(this.upperCanvasEl[t]=e),this.cacheCanvasEl&&(this.cacheCanvasEl[t]=e),this[t]=e,this},_setCssDimension:function(t,e){return this.lowerCanvasEl.style[t]=e,this.upperCanvasEl&&(this.upperCanvasEl.style[t]=e),this.wrapperEl&&(this.wrapperEl.style[t]=e),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(t){var e,i,r,n=this._activeObject;for(this.viewportTransform=t,i=0,r=this._objects.length;i\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this.clipPath&&i.push("\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",e),i.push(""),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('\n','\n')},_setSVGHeader:function(t,e){var i,r=e.width||this.width,n=e.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',o=fabric.Object.NUM_FRACTION_DIGITS;e.viewBox?s='viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,s='viewBox="'+a(-i[4]/i[0],o)+" "+a(-i[5]/i[3],o)+" "+a(this.width/i[0],o)+" "+a(this.height/i[3],o)+'" '),t.push("\n',"Created with Fabric.js ",fabric.version,"\n","\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"\n")},createSVGClipPathMarkup:function(t){var e=this.clipPath;return e?(e.clipPathId="CLIPPATH_"+fabric.Object.__uid++,'\n'+this.clipPath.toClipPathSVG(t.reviver)+"\n"):""},createSVGRefElementsMarkup:function(){var s=this;return["background","overlay"].map(function(t){var e=s[t+"Color"];if(e&&e.toLive){var i=s[t+"Vpt"],r=s.viewportTransform,n={width:s.width/(i?r[0]:1),height:s.height/(i?r[3]:1)};return e.toSVG(n,{additionalTransform:i?fabric.util.matrixToSVG(r):""})}}).join("")},createSVGFontFacesMarkup:function(){var t,e,i,r,n,s,o,a,h="",c={},l=fabric.fontPaths,u=[];for(this._objects.forEach(function t(e){u.push(e),e._objects&&e._objects.forEach(t)}),o=0,a=u.length;o',"\n",h,"","\n"].join("")),h},_setSVGObjects:function(t,e){var i,r,n,s=this._objects;for(r=0,n=s.length;r\n")}else t.push('\n")},sendToBack:function(t){if(!t)return this;var e,i,r,n=this._activeObject;if(t===n&&"activeSelection"===t.type)for(e=(r=n._objects).length;e--;)i=r[e],c(this._objects,i),this._objects.unshift(i);else c(this._objects,t),this._objects.unshift(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(t){if(!t)return this;var e,i,r,n=this._activeObject;if(t===n&&"activeSelection"===t.type)for(r=n._objects,e=0;e"}}),n(fabric.StaticCanvas.prototype,fabric.Observable),n(fabric.StaticCanvas.prototype,fabric.Collection),n(fabric.StaticCanvas.prototype,fabric.DataURLExporter),n(fabric.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=r();if(!e||!e.getContext)return null;var i=e.getContext("2d");if(!i)return null;switch(t){case"setLineDash":return void 0!==i.setLineDash;default:return null}}}),fabric.StaticCanvas.prototype.toJSON=fabric.StaticCanvas.prototype.toObject,fabric.isLikelyNode&&(fabric.StaticCanvas.prototype.createPNGStream=function(){var t=i(this.lowerCanvasEl);return t&&t.createPNGStream()},fabric.StaticCanvas.prototype.createJPEGStream=function(t){var e=i(this.lowerCanvasEl);return e&&e.createJPEGStream(t)})}}(),fabric.BaseBrush=fabric.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,_setBrushStyles:function(){var t=this.canvas.contextTop;t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,fabric.StaticCanvas.supports("setLineDash")&&t.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(t){var e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},_setShadow:function(){if(this.shadow){var t=this.canvas,e=this.shadow,i=t.contextTop,r=t.getZoom();t&&t._isRetinaScaling()&&(r*=fabric.devicePixelRatio),i.shadowColor=e.color,i.shadowBlur=e.blur*r,i.shadowOffsetX=e.offsetX*r,i.shadowOffsetY=e.offsetY*r}},needsFullRender:function(){return new fabric.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0}}),fabric.PencilBrush=fabric.util.createClass(fabric.BaseBrush,{decimate:.4,initialize:function(t){this.canvas=t,this._points=[]},_drawSegment:function(t,e,i){var r=e.midPointFrom(i);return t.quadraticCurveTo(e.x,e.y,r.x,r.y),r},onMouseDown:function(t,e){this.canvas._isMainEvent(e.e)&&(this._prepareForDrawing(t),this._captureDrawingPath(t),this._render())},onMouseMove:function(t,e){if(this.canvas._isMainEvent(e.e)&&this._captureDrawingPath(t)&&1t[e-2].x?1:n.x===t[e-2].x?0:-1,h=n.y>t[e-2].y?1:n.y===t[e-2].y?0:-1),i.push("L ",n.x+a*r," ",n.y+h*r),i},createPath:function(t){var e=new fabric.Path(t,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,e.shadow=new fabric.Shadow(this.shadow)),e},decimatePoints:function(t,e){if(t.length<=2)return t;var i,r=this.canvas.getZoom(),n=Math.pow(e/r,2),s=t.length-1,o=t[0],a=[o];for(i=1;i"},getObjectScaling:function(){var t=x.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(t.scaleX),scaleY:Math.abs(t.scaleY)}},getTotalObjectScaling:function(){var t=this.getObjectScaling(),e=t.scaleX,i=t.scaleY;if(this.canvas){var r=this.canvas.getZoom(),n=this.canvas.getRetinaScaling();e*=r*n,i*=r*n}return{scaleX:e,scaleY:i}},getObjectOpacity:function(){var t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t},_set:function(t,e){var i="scaleX"===t||"scaleY"===t,r=this[t]!==e,n=!1;return i&&(e=this._constrainScale(e)),"scaleX"===t&&e<0?(this.flipX=!this.flipX,e*=-1):"scaleY"===t&&e<0?(this.flipY=!this.flipY,e*=-1):"shadow"!==t||!e||e instanceof x.Shadow?"dirty"===t&&this.group&&this.group.set("dirty",e):e=new x.Shadow(e),this[t]=e,r&&(n=this.group&&this.group.isOnACache(),-1=t.x&&n.left+n.width<=e.x&&n.top>=t.y&&n.top+n.height<=e.y},containsPoint:function(t,e,i,r){var n=this._getCoords(i,r),s=(e=e||this._getImageLines(n),this._findCrossPoints(t,e));return 0!==s&&s%2==1},isOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.getCoords(!0,t).some(function(t){return t.x<=i.x&&t.x>=e.x&&t.y<=i.y&&t.y>=e.y})||(!!this.intersectsWithRect(e,i,!0,t)||this._containsCenterOfCanvas(e,i,t))},_containsCenterOfCanvas:function(t,e,i){var r={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(r,null,!0,i)},isPartiallyOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.intersectsWithRect(e,i,!0,t)||this.getCoords(!0,t).every(function(t){return(t.x>=i.x||t.x<=e.x)&&(t.y>=i.y||t.y<=e.y)})&&this._containsCenterOfCanvas(e,i,t)},_getImageLines:function(t){return{topline:{o:t.tl,d:t.tr},rightline:{o:t.tr,d:t.br},bottomline:{o:t.br,d:t.bl},leftline:{o:t.bl,d:t.tl}}},_findCrossPoints:function(t,e){var i,r,n,s=0;for(var o in e)if(!((n=e[o]).o.y=t.y&&n.d.y>=t.y||(n.o.x===n.d.x&&n.o.x>=t.x?r=n.o.x:(0,i=(n.d.y-n.o.y)/(n.d.x-n.o.x),r=-(t.y-0*t.x-(n.o.y-i*n.o.x))/(0-i)),r>=t.x&&(s+=1),2!==s)))break;return s},getBoundingRect:function(t,e){var i=this.getCoords(t,e);return c.makeBoundingBoxFromPoints(i)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(t){return Math.abs(t)\n')}},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})},toClipPathSVG:function(t){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})},_createBaseClipPathSVGMarkup:function(t,e){var i=(e=e||{}).reviver,r=e.additionalTransform||"",n=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),s=t.indexOf("COMMON_PARTS");return t[s]=n,i?i(t.join("")):t.join("")},_createBaseSVGMarkup:function(t,e){var i,r,n=(e=e||{}).noStyle,s=e.reviver,o=n?"":'style="'+this.getSvgStyles()+'" ',a=e.withShadow?'style="'+this.getSvgFilter()+'" ':"",h=this.clipPath,c=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",l=h&&h.absolutePositioned,u=this.stroke,f=this.fill,d=this.shadow,g=[],p=t.indexOf("COMMON_PARTS"),v=e.additionalTransform;return h&&(h.clipPathId="CLIPPATH_"+fabric.Object.__uid++,r='\n'+h.toClipPathSVG(s)+"\n"),l&&g.push("\n"),g.push("\n"),i=[o,c,n?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),t[p]=i,f&&f.toLive&&g.push(f.toSVG(this)),u&&u.toLive&&g.push(u.toSVG(this)),d&&g.push(d.toSVG(this)),h&&g.push(r),g.push(t.join("")),g.push("\n"),l&&g.push("\n"),s?s(g.join("")):g.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var n=fabric.util.object.extend,r="stateProperties";function s(e,t,i){var r={};i.forEach(function(t){r[t]=e[t]}),n(e[t],r,!0)}fabric.util.object.extend(fabric.Object.prototype,{hasStateChanged:function(t){var e="_"+(t=t||r);return Object.keys(this[e]).length\n']}}),s.Line.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),s.Line.fromElement=function(t,e,i){i=i||{};var r=s.parseAttributes(t,s.Line.ATTRIBUTE_NAMES),n=[r.x1||0,r.y1||0,r.x2||0,r.y2||0];e(new s.Line(n,o(r,i)))},s.Line.fromObject=function(t,e){var i=r(t,!0);i.points=[t.x1,t.y1,t.x2,t.y2],s.Object._fromObject("Line",i,function(t){delete t.points,e&&e(t)},"points")})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var a=t.fabric||(t.fabric={}),h=Math.PI;a.Circle?a.warn("fabric.Circle is already defined."):(a.Circle=a.util.createClass(a.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*h,cacheProperties:a.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),"radius"===t&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,e=(this.endAngle-this.startAngle)%(2*h);if(0===e)t=["\n'];else{var i=a.util.cos(this.startAngle)*this.radius,r=a.util.sin(this.startAngle)*this.radius,n=a.util.cos(this.endAngle)*this.radius,s=a.util.sin(this.endAngle)*this.radius,o=h\n"]}return t},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(t)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(t){return this.radius=t,this.set("width",2*t).set("height",2*t)}}),a.Circle.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),a.Circle.fromElement=function(t,e){var i,r=a.parseAttributes(t,a.Circle.ATTRIBUTE_NAMES);if(!("radius"in(i=r)&&0<=i.radius))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,e(new a.Circle(r))},a.Circle.fromObject=function(t,e){return a.Object._fromObject("Circle",t,e)})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var r=t.fabric||(t.fabric={});r.Triangle?r.warn("fabric.Triangle is already defined"):(r.Triangle=r.util.createClass(r.Object,{type:"triangle",width:100,height:100,_render:function(t){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,i),t.lineTo(0,-i),t.lineTo(e,i),t.closePath(),this._renderPaintInOrder(t)},_renderDashedStroke:function(t){var e=this.width/2,i=this.height/2;t.beginPath(),r.util.drawDashedLine(t,-e,i,0,-i,this.strokeDashArray),r.util.drawDashedLine(t,0,-i,e,i,this.strokeDashArray),r.util.drawDashedLine(t,e,i,-e,i,this.strokeDashArray),t.closePath()},_toSVG:function(){var t=this.width/2,e=this.height/2;return["']}}),r.Triangle.fromObject=function(t,e){return r.Object._fromObject("Triangle",t,e)})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var r=t.fabric||(t.fabric={}),e=2*Math.PI;r.Ellipse?r.warn("fabric.Ellipse is already defined."):(r.Ellipse=r.util.createClass(r.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:r.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this.set("rx",t&&t.rx||0),this.set("ry",t&&t.ry||0)},_set:function(t,e){switch(this.callSuper("_set",t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["\n']},_render:function(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,e,!1),t.restore(),this._renderPaintInOrder(t)}}),r.Ellipse.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),r.Ellipse.fromElement=function(t,e){var i=r.parseAttributes(t,r.Ellipse.ATTRIBUTE_NAMES);i.left=(i.left||0)-i.rx,i.top=(i.top||0)-i.ry,e(new r.Ellipse(i))},r.Ellipse.fromObject=function(t,e){return r.Object._fromObject("Ellipse",t,e)})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var s=t.fabric||(t.fabric={}),o=s.util.object.extend;s.Rect?s.warn("fabric.Rect is already defined"):(s.Rect=s.util.createClass(s.Object,{stateProperties:s.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(t){var e=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,r=this.width,n=this.height,s=-this.width/2,o=-this.height/2,a=0!==e||0!==i,h=.4477152502;t.beginPath(),t.moveTo(s+e,o),t.lineTo(s+r-e,o),a&&t.bezierCurveTo(s+r-h*e,o,s+r,o+h*i,s+r,o+i),t.lineTo(s+r,o+n-i),a&&t.bezierCurveTo(s+r,o+n-h*i,s+r-h*e,o+n,s+r-e,o+n),t.lineTo(s+e,o+n),a&&t.bezierCurveTo(s+h*e,o+n,s,o+n-h*i,s,o+n-i),t.lineTo(s,o+i),a&&t.bezierCurveTo(s,o+h*i,s+h*e,o,s+e,o),t.closePath(),this._renderPaintInOrder(t)},_renderDashedStroke:function(t){var e=-this.width/2,i=-this.height/2,r=this.width,n=this.height;t.beginPath(),s.util.drawDashedLine(t,e,i,e+r,i,this.strokeDashArray),s.util.drawDashedLine(t,e+r,i,e+r,i+n,this.strokeDashArray),s.util.drawDashedLine(t,e+r,i+n,e,i+n,this.strokeDashArray),s.util.drawDashedLine(t,e,i+n,e,i,this.strokeDashArray),t.closePath()},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["\n']}}),s.Rect.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),s.Rect.fromElement=function(t,e,i){if(!t)return e(null);i=i||{};var r=s.parseAttributes(t,s.Rect.ATTRIBUTE_NAMES);r.left=r.left||0,r.top=r.top||0,r.height=r.height||0,r.width=r.width||0;var n=new s.Rect(o(i?s.util.object.clone(i):{},r));n.visible=n.visible&&0\n']},commonRender:function(t){var e,i=this.points.length,r=this.pathOffset.x,n=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;t.beginPath(),t.moveTo(this.points[0].x-r,this.points[0].y-n);for(var s=0;s"},toObject:function(t){return n(this.callSuper("toObject",t),{path:this.path.map(function(t){return t.slice()})})},toDatalessObject:function(t){var e=this.toObject(["sourcePath"].concat(t));return e.sourcePath&&delete e.path,e},_toSVG:function(){return["\n"]},_getOffsetTransform:function(){var t=f.Object.NUM_FRACTION_DIGITS;return" translate("+e(-this.pathOffset.x,t)+", "+e(-this.pathOffset.y,t)+")"},toClipPathSVG:function(t){var e=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},toSVG:function(t){var e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var t,e,i=[],r=[],n=0,s=0,o=0,a=0,h=0,c=this.path.length;h"},addWithUpdate:function(t){return this._restoreObjectsState(),c.util.resetObjectTransform(this),t&&(this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},removeWithUpdate:function(t){return this._restoreObjectsState(),c.util.resetObjectTransform(this),this.remove(t),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(t){this.dirty=!0,t.group=this,t._set("canvas",this.canvas)},_onObjectRemoved:function(t){this.dirty=!0,delete t.group},_set:function(t,e){var i=this._objects.length;if(this.useSetOnGroup)for(;i--;)this._objects[i].setOnGroup(t,e);if("canvas"===t)for(;i--;)this._objects[i]._set(t,e);c.Object.prototype._set.call(this,t,e)},toObject:function(r){var n=this.includeDefaultValues,t=this._objects.map(function(t){var e=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toObject(r);return t.includeDefaultValues=e,i}),e=c.Object.prototype.toObject.call(this,r);return e.objects=t,e},toDatalessObject:function(r){var t,e=this.sourcePath;if(e)t=e;else{var n=this.includeDefaultValues;t=this._objects.map(function(t){var e=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toDatalessObject(r);return t.includeDefaultValues=e,i})}var i=c.Object.prototype.toDatalessObject.call(this,r);return i.objects=t,i},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=c.Object.prototype.shouldCache.call(this);if(t)for(var e=0,i=this._objects.length;e\n"],i=0,r=this._objects.length;i\n"),e},getSvgStyles:function(){var t=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,r=this._objects.length;i"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(t,e,i){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",t,e),void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var r=0,n=this._objects.length;r\n','\t\n',"\n"),o=' clip-path="url(#imageCrop_'+h+')" '}if(this.imageSmoothing||(a='" image-rendering="optimizeSpeed'),i.push("\t\n"),this.stroke||this.strokeDashArray){var c=this.fill;this.fill=null,t=["\t\n'],this.fill=c}return e="fill"!==this.paintFirst?e.concat(t,i):e.concat(i,t)},getSrc:function(t){var e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src"):e.src:this.src||""},setSrc:function(t,i,r){return fabric.util.loadImage(t,function(t,e){this.setElement(t,r),this._setWidthHeight(),i&&i(this,e)},this,r&&r.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var t=this.resizeFilter,e=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),r=i.scaleX,n=i.scaleY,s=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||e=t;for(var a=["highp","mediump","lowp"],h=0;h<3;h++)if(void 0,i="precision "+a[h]+" float;\nvoid main(){}",r=(e=s).createShader(e.FRAGMENT_SHADER),e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)){fabric.webGlPrecision=a[h];break}}return this.isSupported=o},(fabric.WebglFilterBackend=t).prototype={tileSize:2048,resources:{},setupGLContext:function(t,e){this.dispose(),this.createWebGLCanvas(t,e),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(t,e)},chooseFastestCopyGLTo2DMethod:function(t,e){var i,r=void 0!==window.performance;try{new ImageData(1,1),i=!0}catch(t){i=!1}var n="undefined"!=typeof ArrayBuffer,s="undefined"!=typeof Uint8ClampedArray;if(r&&i&&n&&s){var o=fabric.util.createCanvasElement(),a=new ArrayBuffer(t*e*4);if(fabric.forceGLPutImageData)return this.imageBuffer=a,void(this.copyGLTo2D=copyGLTo2DPutImageData);var h,c,l={imageBuffer:a,destinationWidth:t,destinationHeight:e,targetCanvas:o};o.width=t,o.height=e,h=window.performance.now(),copyGLTo2DDrawImage.call(l,this.gl,l),c=window.performance.now()-h,h=window.performance.now(),copyGLTo2DPutImageData.call(l,this.gl,l),window.performance.now()-h 0.0) {\n"+this.fragmentSource[t]+"}\n}"},retrieveShader:function(t){var e,i=this.type+"_"+this.mode;return t.programCache.hasOwnProperty(i)||(e=this.buildSource(this.mode),t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},applyTo2d:function(t){var e,i,r,n,s,o,a,h=t.imageData.data,c=h.length,l=1-this.alpha;e=(a=new f.Color(this.color).getSource())[0]*this.alpha,i=a[1]*this.alpha,r=a[2]*this.alpha;for(var u=0;u'},_getCacheCanvasDimensions:function(){var t=this.callSuper("_getCacheCanvasDimensions"),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t},_render:function(t){this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")},_renderText:function(t){"stroke"===this.paintFirst?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))},_setTextStyles:function(t,e,i){t.textBaseline="alphabetic",t.font=this._getFontDeclaration(e,i)},calcTextWidth:function(){for(var t=this.getLineWidth(0),e=1,i=this._textLines.length;ethis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=e):(this.selectionStart=e,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===r||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(t,e,i){var r=i.slice(0,t),n=fabric.util.string.graphemeSplit(r).length;if(t===e)return{selectionStart:n,selectionEnd:n};var s=i.slice(t,e);return{selectionStart:n,selectionEnd:n+fabric.util.string.graphemeSplit(s).length}},fromGraphemeToStringSelection:function(t,e,i){var r=i.slice(0,t).join("").length;return t===e?{selectionStart:r,selectionEnd:r}:{selectionStart:r,selectionEnd:r+i.slice(t,e).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var t=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=t.selectionEnd,this.inCompositionMode||(this.selectionStart=t.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),i=this.get2DCursorLocation(t),r=i.lineIndex,n=i.charIndex,s=this.getValueOfPropertyAt(r,n,"fontSize")*this.lineHeight,o=e.leftOffset,a=this.calcTransformMatrix(),h={x:e.left+o,y:e.top+e.topOffset+s},c=this.canvas.getRetinaScaling(),l=this.canvas.upperCanvasEl,u=l.width/c,f=l.height/c,d=u-s,g=f-s,p=l.clientWidth/u,v=l.clientHeight/f;return h=fabric.util.transformPoint(h,a),(h=fabric.util.transformPoint(h,this.canvas.viewportTransform)).x*=p,h.y*=v,h.x<0&&(h.x=0),h.x>d&&(h.x=d),h.y<0&&(h.y=0),h.y>g&&(h.y=g),h.x+=this.canvas._offset.left,h.y+=this.canvas._offset.top,{left:h.x+"px",top:h.y+"px",fontSize:s+"px",charHeight:s}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var t=this._textBeforeEdit!==this.text,e=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,e&&(e.blur&&e.blur(),e.parentNode&&e.parentNode.removeChild(e)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),t&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var t in this.styles)this._textLines[t]||delete this.styles[t]},removeStyleFromTo:function(t,e){var i,r,n=this.get2DCursorLocation(t,!0),s=this.get2DCursorLocation(e,!0),o=n.lineIndex,a=n.charIndex,h=s.lineIndex,c=s.charIndex;if(o!==h){if(this.styles[o])for(i=a;it?this.selectionStart=t:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>t?this.selectionEnd=t:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),fabric.util.object.extend(fabric.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(t){if(this.canvas){this.__newClickTime=+new Date;var e=t.pointer;this.isTripleClick(e)&&(this.fire("tripleclick",t),this._stopEvent(t.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=e,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(t){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===t.x&&this.__lastPointer.y===t.y},_stopEvent:function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(t){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(t.e))},tripleClickHandler:function(t){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(t.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(t.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(t){if(this.__isMousedown=!1,!(!this.editable||this.group||t.transform&&t.transform.actionPerformed||t.e.button&&1!==t.e.button)){if(this.canvas){var e=this.canvas._activeObject;if(e&&e!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(t.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(t){var e=this.getSelectionStartFromPointer(t),i=this.selectionStart,r=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(i,r,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(t){for(var e=this.getLocalPointer(t),i=0,r=0,n=0,s=0,o=0,a=0,h=this._textLines.length;athis._text.length&&(a=this._text.length),a}}),fabric.util.object.extend(fabric.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=fabric.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var t=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+t.top+"; left: "+t.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingーtop: "+t.fontSize+";",fabric.document.body.appendChild(this.hiddenTextarea),fabric.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),fabric.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),fabric.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),fabric.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),fabric.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),fabric.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),fabric.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),fabric.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),fabric.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(fabric.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(t){if(this.isEditing){if(t.keyCode in this.keysMap)this[this.keysMap[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown&&(t.ctrlKey||t.metaKey)))return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),33<=t.keyCode&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(t){var e=this.fromPaste;if(this.fromPaste=!1,t&&t.stopPropagation(),this.isEditing){var i,r,n,s,o,a=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,h=this._text.length,c=a.length,l=c-h,u=this.selectionStart,f=this.selectionEnd,d=u!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),p=u>g.selectionStart;d?(i=this._text.slice(u,f),l+=f-u):c=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)},moveCursorUp:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)},_moveCursorUpOrDown:function(t,e){var i=this["get"+t+"CursorOffset"](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(t){var e="left"===this._selectionDirection?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t},moveCursorWithoutShift:function(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t},moveCursorLeft:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)},_move:function(t,e,i){var r;if(t.altKey)r=this["findWordBoundary"+i](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===i?-1:1,!0;r=this["findLineBoundary"+i](this[e])}if(void 0!==typeof r&&this[e]!==r)return this[e]=r,!0},_moveLeft:function(t,e){return this._move(t,e,"Left")},_moveRight:function(t,e){return this._move(t,e,"Right")},moveCursorLeftWithoutShift:function(t){var e=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e},moveCursorLeftWithShift:function(t){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(t,"selectionStart")):void 0},moveCursorRight:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)},_moveCursorLeftOrRight:function(t,e){var i="moveCursor"+t+"With";this._currentCursorOpacity=1,e.shiftKey?i+="Shift":i+="outShift",this[i](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(t){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(t,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(t){var e=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e},removeChars:function(t,e){void 0===e&&(e=t+1),this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(t,e,i,r){void 0===r&&(r=i),i",t.textSpans.join(""),"\n"]},_getSVGTextAndBg:function(t,e){var i,r=[],n=[],s=t;this._setSVGBg(n);for(var o=0,a=this._textLines.length;o",fabric.util.string.escapeXml(t),""].join("")},_setSVGTextLineText:function(t,e,i,r){var n,s,o,a,h,c=this.getHeightOfLine(e),l=-1!==this.textAlign.indexOf("justify"),u="",f=0,d=this._textLines[e];r+=c*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,p=d.length-1;g<=p;g++)h=g===p||this.charSpacing,u+=d[g],o=this.__charBounds[e][g],0===f?(i+=o.kernedWidth-o.width,f+=o.width):f+=o.kernedWidth,l&&!h&&this._reSpaceAndTab.test(d[g])&&(h=!0),h||(n=n||this.getCompleteStyleDeclaration(e,g),s=this.getCompleteStyleDeclaration(e,g+1),h=this._hasStyleChangedForSvg(n,s)),h&&(a=this._getStyleDeclaration(e,g)||{},t.push(this._createTextCharSpan(u,a,i,r)),u="",n=s,i+=f,f=0)},_pushTextBgRect:function(t,e,i,r,n,s){var o=fabric.Object.NUM_FRACTION_DIGITS;t.push("\t\t\n')},_setSVGTextLineBg:function(t,e,i,r){for(var n,s,o=this._textLines[e],a=this.getHeightOfLine(e)/this.lineHeight,h=0,c=0,l=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),u=0,f=o.length;uthis.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(t){for(var e=0,i=0,r=0,n={},s=0;sthis.dynamicMinWidth&&(this.dynamicMinWidth=g-v+r),o},isEndOfWrapping:function(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line},missingNewlineOffset:function(t){return this.splitByGrapheme?this.isEndOfWrapping(t)?1:0:1},_splitTextIntoLines:function(t){for(var e=b.Text.prototype._splitTextIntoLines.call(this,t),i=this._wrapText(e.lines,this.width),r=new Array(i.length),n=0;nWarna Baju Harus Terpilih Terlebih Dahulu"); + $("#pilih_baju_select").focus(); + } + else + { + window.location.replace("desain_2.html?color="+color) + } +} diff --git a/www/assets/js/desain_2.js b/www/assets/js/desain_2.js new file mode 100644 index 0000000..e7ce755 --- /dev/null +++ b/www/assets/js/desain_2.js @@ -0,0 +1,938 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// Wait for the deviceready event before using any of Cordova's device APIs. +// See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready +document.addEventListener('deviceready', onDeviceReady, false); + +function onDeviceReady() { + // screen.orientation.lock('potrait'); +} + +////// get warna baju ////// + function $_GET(param) { + var vars = {}; + window.location.href.replace( location.hash, '' ).replace( + /[?&]+([^=&]+)=?([^&]*)?/gi, // regexp + function( m, key, value ) { // callback + vars[key] = value !== undefined ? value : ''; + } + ); + + if ( param ) { + return vars[param] ? vars[param] : null; + } + return vars; + } + + var color = $_GET('color'); + + + $("#sini_div_baju_color").attr("style","background-image: url(assets/img/"+color+".PNG); height: 350px; width: 100%;background-size: 100% 100%;"); +///// end get warna baju /////// + +function toastnya(id,mesej){ + toastr.options = { + "closeButton": true, + "debug": false, + "progressBar": true, + "positionClass": "toast-top-right", + "showDuration": "300", + "hideDuration": "1000", + "timeOut": "5000", + "extendedTimeOut": "1000", + "showEasing": "swing", + "hideEasing": "linear", + "showMethod": "fadeIn", + "hideMethod": "fadeOut" + }; + + toastr.error("
"+mesej+"
"); + $("#"+id).focus(); +} + +////// ini icon delete ////// + var deleteIcon = "data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Ebene_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='595.275px' height='595.275px' viewBox='200 215 230 470' xml:space='preserve'%3E%3Ccircle style='fill:%23F44336;' cx='299.76' cy='439.067' r='218.516'/%3E%3Cg%3E%3Crect x='267.162' y='307.978' transform='matrix(0.7071 -0.7071 0.7071 0.7071 -222.6202 340.6915)' style='fill:white;' width='65.545' height='262.18'/%3E%3Crect x='266.988' y='308.153' transform='matrix(0.7071 0.7071 -0.7071 0.7071 398.3889 -83.3116)' style='fill:white;' width='65.544' height='262.179'/%3E%3C/g%3E%3C/svg%3E"; + + var img = document.createElement('img'); + img.src = deleteIcon; +//// end icon delete ///// + +///// responsive canvas ///// + function resizeCanvas() { + const outerCanvasContainer = $('#sini_div_canvas')[0]; + + const ratio = canvas.getWidth() / canvas.getHeight(); + const containerWidth = outerCanvasContainer.clientWidth; + const containerHeight = outerCanvasContainer.clientHeight; + + const scale = containerWidth / canvas.getWidth(); + const zoom = canvas.getZoom() * scale; + canvas.setDimensions({width: containerWidth, height: outerCanvasContainer.clientHeight}); + canvas.setViewportTransform([zoom, 0, 0, zoom, 0, 0]); + } + + $("#sini_div_canvas").resize(resizeCanvas); +//// end responsive canvas /// + +var canvas = this.__canvas = new fabric.Canvas('c',{width: 900, + height: 1050}); +// var canvas = new fabric.Canvas('c',{backgroundColor : "red"}); +// canvas.backgroundColor= color; +canvas.renderTop(); + +canvas.isDrawingMode = false; + + + +resizeCanvas(); + +var drawing_width = 1; // ini utk drawing width +var drawing_color = null; // ini utk drawing color + +///// ini change div editor ///// + function change_editor(e){ + if (e == 'bentuk') { + canvas.isDrawingMode = false; + $("#div_upload_image").attr('style','display : none') + var html= '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + // '
'+ + // ''+ + // ''+ + // '
'+ + '
'+ + '' + '
'; + $("#sini_div_editor").html(html) + canvas.isDrawingMode = false; + } + if (e == 'drawing') { + canvas.isDrawingMode = false; + $("#div_upload_image").attr('style','display : none') + drawing_color = null; + drawing_width = 1; + var html= '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + '' + '
'; + $("#sini_div_editor").html(html) + + } + if (e == 'teks') { + canvas.isDrawingMode = false; + $("#div_upload_image").attr('style','display : none') + drawing_color = null; + drawing_width = 1; + var html= '
'+ + ''+ + // ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + '' + '
'; + $("#sini_div_editor").html(html) + + } + if (e == 'image') { + canvas.isDrawingMode = false; + $("#div_upload_image").attr('style','display : block') + image_base64 = null; + $("#sini_div_editor").html(null) + + } + } +//// end change div editor //// + + +var idnya = 1; // ini id tiap object +var save_data = null; // ini data editor + +////// render icon delete supaya bole delete ////// + fabric.Object.prototype.controls.deleteControl = new fabric.Control({ + x: 0.5, + y: -0.5, + offsetY: 16, + cursorStyle: 'pointer', + mouseUpHandler: deleteObject, + render: renderIcon, + cornerSize: 24 + }); + + + function deleteObject(eventData, target) { + + var datanya = JSON.parse(save_data); + console.log(target); + // datanya.filter(function(item){ console.log(item) }) + var myNewArray = datanya.filter(function(item){ return item['id'] != target['id'] }) + myNewArray = JSON.stringify(myNewArray) + if (myNewArray == "[]") { + myNewArray = null; + } + save_data = myNewArray + console.log(JSON.parse(save_data)); + + if (save_data == null) { + $("#save_datanya11").attr('disabled',''); + } + + var canvas = target.canvas; + canvas.remove(target); + canvas.requestRenderAll(); + } + + function renderIcon(ctx, left, top, styleOverride, fabricObject) { + var size = this.cornerSize; + ctx.save(); + ctx.translate(left, top); + ctx.rotate(fabric.util.degreesToRadians(fabricObject.angle)); + ctx.drawImage(img, -size/2, -size/2, size, size); + ctx.restore(); + } +////// end render icon delete ////// + +//// ini untuk bentuk persegi //// + var variable_segi = null; + function change_persegi(kat,nilai){ + var segi; + if (variable_segi == null) { + if (kat == 1) { + segi = [{"segi" : nilai ,"fill" : '' , 'stroke' : '' }]; + } + else if (kat == 2) { + segi = [{"segi" : '' ,"fill" : nilai , 'stroke' : '' }]; + } + + else if (kat == 3) { + segi = [{"segi" : '' ,"fill" : '' , 'stroke' : nilai }]; + } + + + + variable_segi = JSON.stringify(segi) + } + else + { + // console.log(variable_segi) + variable_segi = JSON.parse(variable_segi); + // console.log(variable_segi) + if (kat == 1) { + variable_segi[0].segi = nilai; + } + else if (kat == 2) { + variable_segi[0].fill = nilai; + } + else if (kat == 3) { + variable_segi[0].stroke = nilai; + } + + variable_segi = JSON.stringify(variable_segi) + // console.log(variable_segi) + + } + } + + function add_bentuk(){ + if (variable_segi == null) { + toastnya('select_bentuk','Bentuk Harus Terpilih'); + } + else + { + var segi = JSON.parse(variable_segi); + if (segi[0].segi == '' || segi[0].segi == null || segi[0].fill == '' || segi[0].fill == null || segi[0].stroke == '' || segi[0].stroke == null ) { + toastnya('select_bentuk','Semua Pilihan Harus DIpilih'); + } + else + { + var fillnya; + if (segi[0].fill == 'no_color') { + fillnya = 'rgba(0,0,0,0)' + } + else + { + fillnya = segi[0].fill + } + + if (segi[0].segi == 'rect') { + segi_empat(fillnya,segi[0].stroke,'segi_empat'); + // console.log(segi[0].stroke_width) + } + else if (segi[0].segi == 'tri') { + segi_tiga(fillnya,segi[0].stroke,'segi_tiga'); + // console.log(segi[0].stroke_width) + } + else if (segi[0].segi == 'cir') { + segi_lingkaran(fillnya,segi[0].stroke,'lingkaran'); + // console.log(segi[0].stroke_width) + + } + + // variable_segi = null; + // $("#sini_div_editor").html(null) + document.getElementById("back_to_top").click(); + // $("#editor_select").val($("#editor_select option:first").val()); + + } + + } + } + + function segi_empat(fillnya,stroke,bentuk) { + var rect = new fabric.Rect({ + id : idnya, + kategori : bentuk, + angle:0, + left: 400, + top: 350, + fill: fillnya, + width: 200, + height: 200, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + // padding : 5 + }); + + + var datanya = [{"id" : idnya ,"kategori" : bentuk, "left" : 400 , "top" : 350, "width" : 200 , "height" : 200 , "angle" :0 , "fill" : fillnya , "stroke" : stroke }]; + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + + + canvas.add(rect); + canvas.setActiveObject(rect); + idnya = idnya + 1; + $("#save_datanya11").removeAttr('disabled'); + } + + function segi_tiga(fillnya,stroke,bentuk) { + var tri = new fabric.Triangle({ + id : idnya, + kategori : bentuk, + angle:0, + left: 400, + top: 350, + fill: fillnya, + width: 200, + height: 200, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + // padding : 5 + }); + + var datanya = [{"id" : idnya ,"kategori" : bentuk, "left" : 400 , "top" : 350, "width" : 200 , "height" : 200 , "angle" :0 , "fill" : fillnya , "stroke" : stroke }]; + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + + canvas.add(tri); + canvas.setActiveObject(tri); + idnya = idnya + 1; + $("#save_datanya11").removeAttr('disabled'); + } + + function segi_lingkaran(fillnya,stroke,bentuk) { + var cir = new fabric.Circle({ + id : idnya, + kategori : bentuk, + angle:0, + left: 400, + top: 350, + fill: fillnya, + radius : 200, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + // padding : 5 + }); + + var datanya = [{"id" : idnya ,"kategori" : bentuk, "left" : 400 , "top" : 350, "radius" : 200 , "angle" :0 , "fill" : fillnya , "stroke" : stroke , "scaleX" : 1, "scaleY" : 1}]; + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + + console.log(cir); + canvas.add(cir); + canvas.setActiveObject(cir); + idnya = idnya + 1; + $("#save_datanya11").removeAttr('disabled'); + } +//// end untuk bentuk persegi //// + +//// ini untuk free drawing //// + function free_drawing(kat,nilai){ + // console.log(kat,nilai) + var draw; + if (kat == 1) { + drawing_color = nilai; + } + else if (kat == 2) { + drawing_width = nilai; + } + } + + function add_drawing(){ + // console.log(variable_free_drawing) + if (drawing_color == null) { + toastnya('select_drawing_color','Warna Harus Dipilih'); + } + else + { + // console.log("jalankan") + // drawing = JSON.parse(variable_free_drawing) + canvas.isDrawingMode = true; + canvas.freeDrawingBrush.width = drawing_width; + canvas.freeDrawingBrush.color = drawing_color; + // variable_segi = null; + var html = '
'+ + '' + '
'; + $("#sini_div_editor").html(html) + document.getElementById("back_to_top").click(); + $("#editor_select").val($("#editor_select option:first").val()); + + + } + } + + canvas.on('path:created', function(opt) { + // opt.path is a fabric.Path ready to use and already on the canvas + // console.log(opt.path instanceof fabric.Path) + // this is the path data + // console.log(opt.path); + // console.log(JSON.stringify(opt.path.path)); + var path = opt.path.path.map(chunk => {return chunk.join(' ');}).join(' '); + // console.log(opt.path.height) + console.log(opt.path) + var datanya = [{"id" : idnya ,"kategori" : 'free_drawing', "path" : path , "left" : opt.path.left , "top" : opt.path.top, "width" : opt.path.width , "height" : opt.path.height , "stroke_width" : opt.path.strokeWidth , "stroke" : opt.path.stroke }]; + console.log(datanya) + opt.path.idnya = fabric.Object.__uid++ + opt.path.id = idnya + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + console.log(save_data) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + console.log(save_data) + } + idnya = idnya + 1; + $("#save_datanya11").removeAttr('disabled'); + + }); + + function stop_drawing(){ + canvas.isDrawingMode = false; + $("#sini_div_editor").html(null) + document.getElementById("back_to_top").click(); + } + + // function hapus_path() { + // canvas.getObjects('path').forEach((path) => { + // // if(path.senderId === client.id){ + // canvas.remove(path); + // // } + // }); + // } + +//// end utk free drawing //// + +//// ini utk input teks //// + var teks_inputan = null; + var teks_font = null; + var teks_color = "black"; + + function teks_input(kat,nilai){ + // console.log(kat,nilai) + if (kat == 1) { + teks_inputan = nilai; + } + else if (kat == 2) { + teks_font = nilai; + // console.log(teks_font) + } + else if (kat == 3) { + teks_color = nilai; + } + } + + function add_teks(){ + // console.log(variable_free_drawing) + if (teks_inputan == null) { + toastnya('input_teks','Inputan Harus Terisi'); + } + else if (teks_font == null) { + toastnya('select_teks_font','Font Harus Terpilih'); + } + else + { + tambah_teks(teks_inputan,teks_color,teks_font) + document.getElementById("back_to_top").click(); + } + } + + function tambah_teks(input,fill,family){ + var text = new fabric.Text(input, { + id : idnya, + fill: fill , + fontSize: 100, + left: 400, + top: 350, + fontFamily: family, + }); + + var datanya = [{"id" : idnya ,"kategori" : "teks", "input_teks" : input, "left" : 400 , "top" : 350, "width" : "" , "height" : "200" , "angle" :0 , "fill" : fill , "fontFamily" : family , "angle" : 0 , "scaleX" : 1, "scaleY" : 1}]; + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + + // text + // Render the Text on Canvas + // console.log(text.kategori); + text.kategori = "teks" + console.log(text) + canvas.add(text); + canvas.setActiveObject(text); + idnya = idnya + 1; + $("#save_datanya11").removeAttr('disabled'); + } +//// end utk input teks //// + +//// ini utk upload image //// + var image_base64 = null; + + $("#input_upload_image").change(function(){ + readImage( this ); + // console.log("berubah") + // console.log(image_base64) + }); + + function readImage(input) { + if ( input.files && input.files[0] ) { + var FR= new FileReader(); + var size = input.files[0].size / 1024 + var type = input.files[0].type; + + + // console.log(size) + console.log(type) + if (size > 1500) { + toastnya("input_upload_image","Image yang diupload maksimal 1,4 MB") + $("#input_upload_image").val(null) + image_base64 = null + } + + else if (type != 'image/jpeg' && type != 'image/png') { + toastnya("input_upload_image","File yang diupload harus berekstensi foto") + $("#input_upload_image").val(null) + image_base64 = null + } + else + { + FR.onload = function(e) { + // $('#img').attr( "src", e.target.result ); + // $('#base').text( e.target.result ); + // console.log(e.target.result) + // simpan_image(e.target.result) + image_base64 = e.target.result + + }; + FR.readAsDataURL( input.files[0] ); + } + } + } + + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + + function add_image(){ + + var x = document.createElement("IMG"); + x.setAttribute("src", image_base64); + x.setAttribute("id", 'img_yg_terupload_'+idnya); + x.async = true; + document.getElementById("sini_tampung_image").appendChild(x); + // await sleep(500); + setTimeout(function(){ + console.log("heheheh dulu") + var imgElement = document.getElementById('img_yg_terupload_'+idnya); + var imgInstance = new fabric.Image(imgElement, { + id : idnya, + left: 400, + top: 350, + angle: 0, + opacity: 1 + }); + imgInstance.kategori = "foto" + canvas.add(imgInstance); + canvas.setActiveObject(imgInstance); + var datanya = [{"id" : idnya ,"kategori" : "foto", "detail" : image_base64, "scaleX" : 1 , "scaleY" : 1 , "left" : 400 , "top" : 350, "angle" :0 }]; + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + idnya = idnya + 1; + document.getElementById("back_to_top").click(); + $("#save_datanya11").removeAttr('disabled'); + }, 200); + + + } + + // function try_remove(){ + // document.getElementById("img_yg_terupload_1").remove(); + // // var elem = document.getElementById(id); + // } +//// end utk upload image //// + +//// sini canvas event ///// + canvas.on('object:moved', function(options) { + // console.log(options) + var obj = canvas.getActiveObject(); + var datanya = JSON.parse(save_data); + var id; + + for (var i = 0; i < datanya.length; ++i) { + if (datanya[i].id == options['target']['id']) { + id = i; + break; + } + } + + + if (options['target']['kategori'] == 'segi_empat' || options['target']['kategori'] == 'segi_tiga' ) { + datanya[id].angle = options['target']['angle']; + datanya[id].height = Math.floor(obj.getScaledHeight()); + datanya[id].left = options['target']['left']; + datanya[id].top = options['target']['top']; + datanya[id].width = Math.floor(obj.getScaledWidth()); + } + + if (options['target']['kategori'] == 'foto' || options['target']['kategori'] == 'teks' || options['target']['kategori'] == 'lingkaran' ) { + // console.log(options['target']) + datanya[id].angle = options['target']['angle']; + datanya[id].height = Math.floor(obj.getScaledHeight()); + datanya[id].left = options['target']['left']; + datanya[id].top = options['target']['top']; + datanya[id].scaleY = options['target']['scaleY']; + datanya[id].scaleX = options['target']['scaleX']; + datanya[id].width = Math.floor(obj.getScaledWidth()); + } + + + save_data = JSON.stringify(datanya); + // console.log(JSON.parse(save_data) ) + // console.log(save_data) + // console.log(options['target']['kategori']) + // simpan(datanya,'update',kategori,id); + }); + + canvas.on('object:rotated', function(options) { + // console.log(options) + var obj = canvas.getActiveObject(); + var datanya = JSON.parse(save_data); + var id; + + for (var i = 0; i < datanya.length; ++i) { + if (datanya[i].id == options['target']['id']) { + id = i; + break; + } + } + + + if (options['target']['kategori'] == 'segi_empat' || options['target']['kategori'] == 'segi_tiga' ) { + datanya[id].angle = options['target']['angle']; + datanya[id].height = Math.floor(obj.getScaledHeight()); + datanya[id].left = options['target']['left']; + datanya[id].top = options['target']['top']; + datanya[id].width = Math.floor(obj.getScaledWidth()); + } + + if (options['target']['kategori'] == 'foto' || options['target']['kategori'] == 'teks' || options['target']['kategori'] == 'lingkaran' ) { + // console.log(options['target']) + datanya[id].angle = options['target']['angle']; + datanya[id].height = Math.floor(obj.getScaledHeight()); + datanya[id].left = options['target']['left']; + datanya[id].top = options['target']['top']; + datanya[id].scaleY = options['target']['scaleY']; + datanya[id].scaleX = options['target']['scaleX']; + datanya[id].width = Math.floor(obj.getScaledWidth()); + } + + + save_data = JSON.stringify(datanya); + // console.log(JSON.parse(save_data) ) + console.log(save_data) + }); + + canvas.on('object:scaled', function(options) { + console.log(options) + var obj = canvas.getActiveObject(); + var datanya = JSON.parse(save_data); + var id; + + for (var i = 0; i < datanya.length; ++i) { + if (datanya[i].id == options['target']['id']) { + id = i; + break; + } + } + + + if (options['target']['kategori'] == 'segi_empat' || options['target']['kategori'] == 'segi_tiga' ) { + datanya[id].angle = options['target']['angle']; + datanya[id].height = Math.floor(obj.getScaledHeight()); + datanya[id].left = options['target']['left']; + datanya[id].top = options['target']['top']; + datanya[id].width = Math.floor(obj.getScaledWidth()); + } + + if (options['target']['kategori'] == 'foto' || options['target']['kategori'] == 'teks' || options['target']['kategori'] == 'lingkaran' ) { + // console.log(options['target']) + datanya[id].angle = options['target']['angle']; + datanya[id].height = Math.floor(obj.getScaledHeight()); + datanya[id].left = options['target']['left']; + datanya[id].top = options['target']['top']; + datanya[id].scaleY = options['target']['scaleY']; + datanya[id].scaleX = options['target']['scaleX']; + datanya[id].width = Math.floor(obj.getScaledWidth()); + } + + // console.log(save_data) + save_data = JSON.stringify(datanya); + // console.log(JSON.parse(save_data) ) + console.log(save_data) + + }); + + canvas.on('selection:created', function(options) { + // console.log(options['target']) + + if (options['target']['strokeLineCap'] == 'round' && options['target']['strokeLineJoin'] == 'round') { + // console.log('ini free drawing') + var id = options['target']['idnya'] + // console.log("ini idnya : "+id) + var ini_array; + // console.log(canvas['_objects']) + var object_canvas = canvas['_objects']; + for (var i = 0; i < object_canvas.length; i++) { + // console.log(object_canvas[i].idnya) + if (object_canvas[i].idnya == options['target']['idnya']) { + ini_array = i; + break; + } + } + // console.log("ini id array nya : "+ini_array) + canvas['_objects'][ini_array].lockScalingX = true; + canvas['_objects'][ini_array].lockScalingY = true; + canvas['_objects'][ini_array].lockRotation = true; + canvas['_objects'][ini_array].lockMovementX = true; + canvas['_objects'][ini_array].lockMovementY = true; + // this.__canvases.push(canvas); + } + }); + + canvas.on('selection:updated', function(options) { + // console.log(options['target']) + + // console.log(options) + if (options['target']['strokeLineCap'] == 'round' && options['target']['strokeLineJoin'] == 'round') { + // console.log('ini free drawing') + var id = options['target']['idnya'] + // console.log("ini idnya : "+id) + var ini_array; + // console.log(canvas['_objects']) + var object_canvas = canvas['_objects']; + for (var i = 0; i < object_canvas.length; i++) { + // console.log(object_canvas[i].idnya) + if (object_canvas[i].idnya == options['target']['idnya']) { + ini_array = i; + break; + } + } + // console.log("ini id array nya : "+ini_array) + canvas['_objects'][ini_array].lockScalingX = true; + canvas['_objects'][ini_array].lockScalingY = true; + canvas['_objects'][ini_array].lockRotation = true; + canvas['_objects'][ini_array].lockMovementX = true; + canvas['_objects'][ini_array].lockMovementY = true; + // this.__canvases.push(canvas); + } + }); +//// end canvas event ///// + +function save_desain() { + var penyimpanan = localStorage.getItem('simpanan') + var a = JSON.parse(save_data); + var id = 1; + if (penyimpanan == null) { + var ini = [{"id" : id ,"canvas" : color ,"isi" : a}]; + // localStorage.setItem('coba2', JSON.stringify(ini)); + } + else + { + id = JSON.parse(penyimpanan); + id = id[id.length-1].id + 1 + var ini = [{"id" : id ,"canvas" : color ,"isi" : a}]; + penyimpanan = JSON.parse(penyimpanan) + ini = penyimpanan.concat(ini); + // localStorage.setItem('coba2', JSON.stringify(ini)); + } + localStorage.setItem('simpanan', JSON.stringify(ini)); + window.location.replace("desain_complete.html?id="+id); +} + +function cek_simpanan(){ + // localStorage.removeItem('simpanan') + // alert(localStorage.getItem('coba2')) + console.log(JSON.parse(localStorage.getItem('simpanan'))) +} + + + + + + + + diff --git a/www/assets/js/desain_2_backup.js b/www/assets/js/desain_2_backup.js new file mode 100644 index 0000000..004724d --- /dev/null +++ b/www/assets/js/desain_2_backup.js @@ -0,0 +1,763 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// Wait for the deviceready event before using any of Cordova's device APIs. +// See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready +document.addEventListener('deviceready', onDeviceReady, false); + +function onDeviceReady() { + // screen.orientation.lock('potrait'); +} + +////// get warna baju ////// +function $_GET(param) { + var vars = {}; + window.location.href.replace( location.hash, '' ).replace( + /[?&]+([^=&]+)=?([^&]*)?/gi, // regexp + function( m, key, value ) { // callback + vars[key] = value !== undefined ? value : ''; + } + ); + + if ( param ) { + return vars[param] ? vars[param] : null; + } + return vars; +} + +var color = $_GET('color'); + +if (color == 'white') { + color = 'rgba(0,0,0,0)'; +} +///// end get warna baju /////// + +function toastnya(id,mesej){ + toastr.options = { + "closeButton": true, + "debug": false, + "progressBar": true, + "positionClass": "toast-top-right", + "showDuration": "300", + "hideDuration": "1000", + "timeOut": "5000", + "extendedTimeOut": "1000", + "showEasing": "swing", + "hideEasing": "linear", + "showMethod": "fadeIn", + "hideMethod": "fadeOut" + }; + + toastr.error("
"+mesej+"
"); + $("#"+id).focus(); +} + +////// ini icon delete ////// +var deleteIcon = "data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Ebene_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='595.275px' height='595.275px' viewBox='200 215 230 470' xml:space='preserve'%3E%3Ccircle style='fill:%23F44336;' cx='299.76' cy='439.067' r='218.516'/%3E%3Cg%3E%3Crect x='267.162' y='307.978' transform='matrix(0.7071 -0.7071 0.7071 0.7071 -222.6202 340.6915)' style='fill:white;' width='65.545' height='262.18'/%3E%3Crect x='266.988' y='308.153' transform='matrix(0.7071 0.7071 -0.7071 0.7071 398.3889 -83.3116)' style='fill:white;' width='65.544' height='262.179'/%3E%3C/g%3E%3C/svg%3E"; + +var img = document.createElement('img'); +img.src = deleteIcon; +//// end icon delete ///// + +///// responsive canvas ///// +function resizeCanvas() { + const outerCanvasContainer = $('.fabric-canvas-wrapper')[0]; + + const ratio = canvas.getWidth() / canvas.getHeight(); + const containerWidth = outerCanvasContainer.clientWidth; + const containerHeight = outerCanvasContainer.clientHeight; + + const scale = containerWidth / canvas.getWidth(); + const zoom = canvas.getZoom() * scale; + canvas.setDimensions({width: containerWidth, height: containerWidth / ratio}); + canvas.setViewportTransform([zoom, 0, 0, zoom, 0, 0]); +} + +$(window).resize(resizeCanvas); +//// end responsive canvas /// + +var canvas = this.__canvas = new fabric.Canvas('c',{backgroundColor : color,width: 1050, + height: 950}); +// var canvas = new fabric.Canvas('c',{backgroundColor : "red"}); +canvas.backgroundColor= color; +canvas.renderTop(); + +canvas.isDrawingMode = false; + + + +resizeCanvas(); + +var drawing_width = 1; // ini utk drawing width +var drawing_color = null; // ini utk drawing color + +///// ini change div editor ///// + function change_editor(e){ + if (e == 'bentuk') { + let html= '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + // '
'+ + // ''+ + // ''+ + // '
'+ + '
'+ + '' + '
'; + $("#sini_div_editor").html(html) + canvas.isDrawingMode = false; + } + if (e == 'drawing') { + drawing_color = null; + drawing_width = 1; + let html= '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + '' + '
'; + $("#sini_div_editor").html(html) + + } + if (e == 'teks') { + drawing_color = null; + drawing_width = 1; + let html= '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + '' + '
'; + $("#sini_div_editor").html(html) + + } + } +//// end change div editor //// + + +var idnya = 1; // ini id tiap object +var save_data = null; // ini data editor + +////// render icon delete supaya bole delete ////// + fabric.Object.prototype.controls.deleteControl = new fabric.Control({ + x: 0.5, + y: -0.5, + offsetY: 16, + cursorStyle: 'pointer', + mouseUpHandler: deleteObject, + render: renderIcon, + cornerSize: 24 + }); + + + function deleteObject(eventData, target) { + + let datanya = JSON.parse(save_data); + // console.log(target); + // datanya.filter(function(item){ console.log(item) }) + let myNewArray = datanya.filter(function(item){ return item['id'] != target['id'] }) + myNewArray = JSON.stringify(myNewArray) + if (myNewArray == "[]") { + myNewArray = null; + } + save_data = myNewArray + console.log(JSON.parse(save_data)); + + var canvas = target.canvas; + canvas.remove(target); + canvas.requestRenderAll(); + } + + function renderIcon(ctx, left, top, styleOverride, fabricObject) { + var size = this.cornerSize; + ctx.save(); + ctx.translate(left, top); + ctx.rotate(fabric.util.degreesToRadians(fabricObject.angle)); + ctx.drawImage(img, -size/2, -size/2, size, size); + ctx.restore(); + } +////// end render icon delete ////// + +//// ini untuk bentuk persegi //// + var variable_segi = null; + function change_persegi(kat,nilai){ + let segi; + if (variable_segi == null) { + if (kat == 1) { + segi = [{"segi" : nilai ,"fill" : '' , 'stroke' : '' }]; + } + else if (kat == 2) { + segi = [{"segi" : '' ,"fill" : nilai , 'stroke' : '' }]; + } + + else if (kat == 3) { + segi = [{"segi" : '' ,"fill" : '' , 'stroke' : nilai }]; + } + + + + variable_segi = JSON.stringify(segi) + } + else + { + // console.log(variable_segi) + variable_segi = JSON.parse(variable_segi); + // console.log(variable_segi) + if (kat == 1) { + variable_segi[0].segi = nilai; + } + else if (kat == 2) { + variable_segi[0].fill = nilai; + } + else if (kat == 3) { + variable_segi[0].stroke = nilai; + } + + variable_segi = JSON.stringify(variable_segi) + // console.log(variable_segi) + + } + } + + function add_bentuk(){ + if (variable_segi == null) { + toastnya('select_bentuk','Bentuk Harus Terpilih'); + } + else + { + let segi = JSON.parse(variable_segi); + if (segi[0].segi == '' || segi[0].segi == null || segi[0].fill == '' || segi[0].fill == null || segi[0].stroke == '' || segi[0].stroke == null ) { + toastnya('select_bentuk','Semua Pilihan Harus DIpilih'); + } + else + { + let fillnya; + if (segi[0].fill == 'no_color') { + fillnya = 'rgba(0,0,0,0)' + } + else + { + fillnya = segi[0].fill + } + + if (segi[0].segi == 'rect') { + segi_empat(fillnya,segi[0].stroke,'segi_empat'); + // console.log(segi[0].stroke_width) + } + else if (segi[0].segi == 'tri') { + segi_tiga(fillnya,segi[0].stroke,'segi_tiga'); + // console.log(segi[0].stroke_width) + } + else if (segi[0].segi == 'cir') { + segi_lingkaran(fillnya,segi[0].stroke,'lingkaran'); + // console.log(segi[0].stroke_width) + + } + + variable_segi = null; + $("#sini_div_editor").html(null) + document.getElementById("back_to_top").click(); + $("#editor_select").val($("#editor_select option:first").val()); + + } + + } + } + + function segi_empat(fillnya,stroke,bentuk) { + var rect = new fabric.Rect({ + id : idnya, + kategori : bentuk, + angle:0, + left: 400, + top: 350, + fill: fillnya, + width: 200, + height: 200, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + // padding : 5 + }); + + + let datanya = [{"id" : idnya ,"kategori" : bentuk, "left" : 400 , "top" : 350, "width" : 200 , "height" : 200 , "angle" :0 , "fill" : fillnya , "stroke" : stroke }]; + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + + + canvas.add(rect); + canvas.setActiveObject(rect); + idnya = idnya + 1; + } + + function segi_tiga(fillnya,stroke,bentuk) { + var tri = new fabric.Triangle({ + id : idnya, + kategori : bentuk, + angle:0, + left: 400, + top: 350, + fill: fillnya, + width: 200, + height: 200, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + // padding : 5 + }); + + let datanya = [{"id" : idnya ,"kategori" : bentuk, "left" : 400 , "top" : 350, "width" : 200 , "height" : 200 , "angle" :0 , "fill" : fillnya , "stroke" : stroke }]; + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + + canvas.add(tri); + canvas.setActiveObject(tri); + idnya = idnya + 1; + } + + function segi_lingkaran(fillnya,stroke,bentuk) { + var cir = new fabric.Circle({ + id : idnya, + kategori : bentuk, + angle:0, + left: 400, + top: 350, + fill: fillnya, + radius : 200, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + // padding : 5 + }); + + let datanya = [{"id" : idnya ,"kategori" : bentuk, "left" : 400 , "top" : 350, "radius" : 200 , "angle" :0 , "fill" : fillnya , "stroke" : stroke }]; + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + + // console.log(cir); + canvas.add(cir); + canvas.setActiveObject(cir); + idnya = idnya + 1; + } +//// end untuk bentuk persegi //// + +//// ini untuk free drawing //// + function free_drawing(kat,nilai){ + // console.log(kat,nilai) + let draw; + if (kat == 1) { + drawing_color = nilai; + } + else if (kat == 2) { + drawing_width = nilai; + } + } + + function add_drawing(){ + // console.log(variable_free_drawing) + if (drawing_color == null) { + toastnya('select_drawing_color','Warna Harus Dipilih'); + } + else + { + // console.log("jalankan") + // drawing = JSON.parse(variable_free_drawing) + canvas.isDrawingMode = true; + canvas.freeDrawingBrush.width = drawing_width; + canvas.freeDrawingBrush.color = drawing_color; + // variable_segi = null; + let html = '
'+ + '' + '
'; + $("#sini_div_editor").html(html) + document.getElementById("back_to_top").click(); + $("#editor_select").val($("#editor_select option:first").val()); + + + } + } + + canvas.on('path:created', function(opt) { + // opt.path is a fabric.Path ready to use and already on the canvas + // console.log(opt.path instanceof fabric.Path) + // this is the path data + // console.log(opt.path); + // console.log(JSON.stringify(opt.path.path)); + let path = opt.path.path.map(chunk => {return chunk.join(' ');}).join(' '); + // console.log(opt.path.height) + console.log(opt.path) + let datanya = [{"id" : idnya ,"kategori" : 'free_drawing', "path" : path , "left" : opt.path.left , "top" : opt.path.top, "width" : opt.path.width , "height" : opt.path.height , "stroke_width" : opt.path.strokeWidth , "stroke" : opt.path.stroke }]; + console.log(datanya) + opt.path.idnya = fabric.Object.__uid++ + opt.path.id = idnya + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + console.log(save_data) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + console.log(save_data) + } + idnya = idnya + 1; + + + }); + + function stop_drawing(){ + canvas.isDrawingMode = false; + $("#sini_div_editor").html(null) + document.getElementById("back_to_top").click(); + } + + // function hapus_path() { + // canvas.getObjects('path').forEach((path) => { + // // if(path.senderId === client.id){ + // canvas.remove(path); + // // } + // }); + // } + +//// end utk free drawing //// + +//// ini utk input teks //// + var teks_inputan = null; + var teks_font = null; + var teks_color = "black"; + + function teks_input(kat,nilai){ + // console.log(kat,nilai) + if (kat == 1) { + teks_inputan = nilai; + } + else if (kat == 2) { + teks_font = nilai; + console.log(teks_font) + } + else if (kat == 3) { + teks_color = nilai; + } + } + + function add_teks(){ + // console.log(variable_free_drawing) + if (teks_inputan == null) { + toastnya('input_teks','Inputan Harus Terisi'); + } + else if (teks_font == null) { + toastnya('select_teks_font','Font Harus Terpilih'); + } + else + { + tambah_teks(teks_inputan,teks_color,teks_font) + document.getElementById("back_to_top").click(); + } + } + + function tambah_teks(input,fill,family){ + var text = new fabric.Text(input, { + id : idnya, + fill: fill , + fontSize: 53, + left: 400, + top: 350, + fontFamily: family, + }); + + let datanya = [{"id" : idnya ,"kategori" : "teks", "left" : 400 , "top" : 350, "width" : "" , "height" : "200" , "angle" :0 , "fill" : fill , "fontFamily" : family }]; + + if (save_data == null) { + datanya = JSON.stringify(datanya); + save_data = datanya; + // console.log(JSON.parse(save_data)) + } + else + { + save_data = JSON.parse(save_data); + save_data = save_data.concat(datanya) + save_data = JSON.stringify(save_data); + // console.log(JSON.parse(save_data)) + // console.log(save_data) + } + + // Render the Text on Canvas + canvas.add(text); + canvas.setActiveObject(text); + idnya = idnya + 1; + } +//// end utk input teks //// + + +canvas.on('object:moved', function(options) { + console.log(options) + // let obj = canvas.getActiveObject(); + // let datanya = JSON.parse(save_data); + // let id; + + // for (var i = 0; i < datanya.length; ++i) { + // if (datanya[i].id == options['target']['id']) { + // id = i; + // break; + // } + // } + + + // if (options['target']['kategori'] == 'segi_empat' || options['target']['kategori'] == 'segi_tiga' || options['target']['kategori'] == 'lingkaran') { + // datanya[id].angle = options['target']['angle']; + // datanya[id].height = Math.floor(obj.getScaledHeight()); + // datanya[id].left = options['target']['left']; + // datanya[id].top = options['target']['top']; + // datanya[id].width = Math.floor(obj.getScaledWidth()); + // } + + + // save_data = JSON.stringify(datanya); + // // console.log(JSON.parse(save_data) ) + // // console.log(save_data) + // // console.log(options['target']['kategori']) + // // simpan(datanya,'update',kategori,id); +}); + +canvas.on('object:rotated', function(options) { + // console.log(options) + let obj = canvas.getActiveObject(); + let datanya = JSON.parse(save_data); + let id; + + for (var i = 0; i < datanya.length; ++i) { + if (datanya[i].id == options['target']['id']) { + id = i; + break; + } + } + + + if (options['target']['kategori'] == 'segi_empat' || options['target']['kategori'] == 'segi_tiga' || options['target']['kategori'] == 'lingkaran') { + datanya[id].angle = options['target']['angle']; + datanya[id].height = Math.floor(obj.getScaledHeight()); + datanya[id].left = options['target']['left']; + datanya[id].top = options['target']['top']; + datanya[id].width = Math.floor(obj.getScaledWidth()); + } + + + save_data = JSON.stringify(datanya); + // console.log(JSON.parse(save_data) ) + // console.log(save_data) +}); + +canvas.on('object:scaled', function(options) { + // console.log(options) + let obj = canvas.getActiveObject(); + let datanya = JSON.parse(save_data); + let id; + + for (var i = 0; i < datanya.length; ++i) { + if (datanya[i].id == options['target']['id']) { + id = i; + break; + } + } + + + if (options['target']['kategori'] == 'segi_empat' || options['target']['kategori'] == 'segi_tiga' || options['target']['kategori'] == 'lingkaran') { + datanya[id].angle = options['target']['angle']; + datanya[id].height = Math.floor(obj.getScaledHeight()); + datanya[id].left = options['target']['left']; + datanya[id].top = options['target']['top']; + datanya[id].width = Math.floor(obj.getScaledWidth()); + } + + + save_data = JSON.stringify(datanya); + // console.log(JSON.parse(save_data) ) + // console.log(save_data) + +}); + +canvas.on('selection:created', function(options) { + // console.log(options['target']) + + if (options['target']['strokeLineCap'] == 'round' && options['target']['strokeLineJoin'] == 'round') { + // console.log('ini free drawing') + let id = options['target']['idnya'] + // console.log("ini idnya : "+id) + let ini_array; + // console.log(canvas['_objects']) + let object_canvas = canvas['_objects']; + for (var i = 0; i < object_canvas.length; i++) { + // console.log(object_canvas[i].idnya) + if (object_canvas[i].idnya == options['target']['idnya']) { + ini_array = i; + break; + } + } + // console.log("ini id array nya : "+ini_array) + canvas['_objects'][ini_array].lockScalingX = true; + canvas['_objects'][ini_array].lockScalingY = true; + canvas['_objects'][ini_array].lockRotation = true; + canvas['_objects'][ini_array].lockMovementX = true; + canvas['_objects'][ini_array].lockMovementY = true; + // this.__canvases.push(canvas); + } +}); + +canvas.on('selection:updated', function(options) { + // console.log(options['target']) + + // console.log(options) + if (options['target']['strokeLineCap'] == 'round' && options['target']['strokeLineJoin'] == 'round') { + // console.log('ini free drawing') + let id = options['target']['idnya'] + // console.log("ini idnya : "+id) + let ini_array; + // console.log(canvas['_objects']) + let object_canvas = canvas['_objects']; + for (var i = 0; i < object_canvas.length; i++) { + // console.log(object_canvas[i].idnya) + if (object_canvas[i].idnya == options['target']['idnya']) { + ini_array = i; + break; + } + } + // console.log("ini id array nya : "+ini_array) + canvas['_objects'][ini_array].lockScalingX = true; + canvas['_objects'][ini_array].lockScalingY = true; + canvas['_objects'][ini_array].lockRotation = true; + canvas['_objects'][ini_array].lockMovementX = true; + canvas['_objects'][ini_array].lockMovementY = true; + // this.__canvases.push(canvas); + } +}); + +// Create a new Text instance + + + +// function cek_warna(e){ +// // console.log(e) +// alert(e) +// } + + + + + + + + diff --git a/www/assets/js/desain_3.js b/www/assets/js/desain_3.js new file mode 100644 index 0000000..661aa42 --- /dev/null +++ b/www/assets/js/desain_3.js @@ -0,0 +1,332 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// Wait for the deviceready event before using any of Cordova's device APIs. +// See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready +document.addEventListener('deviceready', onDeviceReady, false); + +function onDeviceReady() { + // screen.orientation.lock('potrait'); + var i = screen.orientation.lock('portrait'); + console.log('Orientation is ' + screen.orientation.type); +} + +////// get warna baju ////// + + + function $_GET(param) { + var vars = {}; + window.location.href.replace( location.hash, '' ).replace( + /[?&]+([^=&]+)=?([^&]*)?/gi, // regexp + function( m, key, value ) { // callback + vars[key] = value !== undefined ? value : ''; + } + ); + + if ( param ) { + return vars[param] ? vars[param] : null; + } + return vars; + } + + var id_desain = $_GET('id'); + +///// end get warna baju /////// + +var list_desain = JSON.parse(localStorage.getItem('simpanan')); + +function hapus_desain(){ + swal({ + title: "Yakin ingin Hapus Desain ini?", + text: "Desain akan terhapus permanen dari aplikasi", + icon: "warning", + buttons: true, + dangerMode: true, + }) + .then((logout) => { + if (logout) { + var list_desain_baru = list_desain.filter(function(item){ + return item['id'] != id_desain + // console.log(item) + }) + // console.log(JSON.stringify(list_desain_baru)) + if (JSON.stringify(list_desain_baru) == '[]') { + // console.log("desain tiada") + localStorage.removeItem('simpanan') + window.location.replace("desain_1.html") + + } + else + { + localStorage.setItem('simpanan',JSON.stringify(list_desain_baru)) + window.location.replace("desain_1.html") + } + } + }); + + +} + +// console.log(list_desain) +var baju_color; +var detail_desain; +// console.log(list_desain) +for (var i = 0; i < list_desain.length; i++) { + // console.log(list_desain[i].id); + if (list_desain[i].id == id_desain) { + baju_color = list_desain[i].canvas + detail_desain = list_desain[i].isi; + console.log(detail_desain) + break; + } +} + +$("#sini_div_baju_color").attr("style","background-image: url(assets/img/"+baju_color+".PNG); height: 350px; width: 100%;background-size: 100% 100%;"); + +function toastnya(id,mesej){ + toastr.options = { + "closeButton": true, + "debug": false, + "progressBar": true, + "positionClass": "toast-top-right", + "showDuration": "300", + "hideDuration": "1000", + "timeOut": "5000", + "extendedTimeOut": "1000", + "showEasing": "swing", + "hideEasing": "linear", + "showMethod": "fadeIn", + "hideMethod": "fadeOut" + }; + + toastr.error("
"+mesej+"
"); + $("#"+id).focus(); +} + +///// responsive canvas ///// + function resizeCanvas() { + const outerCanvasContainer = $('#sini_div_canvas')[0]; + + const ratio = canvas.getWidth() / canvas.getHeight(); + const containerWidth = outerCanvasContainer.clientWidth; + const containerHeight = outerCanvasContainer.clientHeight; + + const scale = containerWidth / canvas.getWidth(); + const zoom = canvas.getZoom() * scale; + canvas.setDimensions({width: containerWidth, height: outerCanvasContainer.clientHeight}); + canvas.setViewportTransform([zoom, 0, 0, zoom, 0, 0]); + } + + $("#sini_div_canvas").resize(resizeCanvas); +//// end responsive canvas /// + +var canvas = this.__canvas = new fabric.Canvas('c',{width: 900,height: 1050}); +canvas.renderTop(); +resizeCanvas(); + + + for (var i = 0; i < detail_desain.length; ++i) { + // if (detail_desain[i].kategori == 'segi_empat') { + // segi_empat(detail_desain[i].id,detail_desain[i].angle,detail_desain[i].left,detail_desain[i].top,detail_desain[i].fill,detail_desain[i].width,detail_desain[i].heightdetail_desain[i].stroke) + // console.log(detail_desain[i]); + // } + if (detail_desain[i].kategori == "segi_empat") { + // console.log('ada segi empat') + segi_empat(detail_desain[i].id,detail_desain[i].angle,detail_desain[i].left,detail_desain[i].top,detail_desain[i].fill,detail_desain[i].width,detail_desain[i].height,detail_desain[i].stroke) + } + else if (detail_desain[i].kategori == "segi_tiga") { + // console.log('ada segi empat') + segi_tiga(detail_desain[i].id,detail_desain[i].angle,detail_desain[i].left,detail_desain[i].top,detail_desain[i].fill,detail_desain[i].width,detail_desain[i].height,detail_desain[i].stroke) + } + else if (detail_desain[i].kategori == "lingkaran") { + // console.log('ada segi empat') + segi_lingkaran(detail_desain[i].id,detail_desain[i].angle,detail_desain[i].left,detail_desain[i].top,detail_desain[i].fill,detail_desain[i].radius,detail_desain[i].stroke,detail_desain[i].scaleX,detail_desain[i].scaleY) + } + else if (detail_desain[i].kategori == "free_drawing") { + // console.log('ada segi empat') + free_draw(detail_desain[i].id,detail_desain[i].path,detail_desain[i].left,detail_desain[i].top,detail_desain[i].height,detail_desain[i].width,detail_desain[i].stroke_width,detail_desain[i].stroke) + } + else if (detail_desain[i].kategori == "teks") { + // console.log('ada segi empat') + // tambah_teks(id,input,fill,family,top,left,width,height,scaleX,scaleY) + tambah_teks(detail_desain[i].id,detail_desain[i].input_teks,detail_desain[i].fill,detail_desain[i].fontFamily,detail_desain[i].top,detail_desain[i].left,detail_desain[i].width,detail_desain[i].height,detail_desain[i].angle,detail_desain[i].scaleX,detail_desain[i].scaleY) + } + else if (detail_desain[i].kategori == "foto") { + // console.log('ada segi empat') + // add_image(id,base,scaleX,scaleX,left,top,angle) + add_image(detail_desain[i].id,detail_desain[i].detail,detail_desain[i].scaleX,detail_desain[i].scaleY,detail_desain[i].left,detail_desain[i].top,detail_desain[i].angle ) + } + } + + + + + function add_image(id,base,scaleX,scaleY,left,top,angle){ + + var x = document.createElement("IMG"); + x.setAttribute("src", base); + x.setAttribute("id", 'img_yg_terupload_'+id); + x.async = true; + document.getElementById("sini_tampung_image").appendChild(x); + + setTimeout(function(){ + var imgElement = document.getElementById('img_yg_terupload_'+id); + var imgInstance = new fabric.Image(imgElement, { + id : id, + left: left, + top: top, + angle: angle, + opacity: 1, + scaleX : scaleX, + scaleY : scaleY + }); + canvas.add(imgInstance); + }, 200) + } + + function segi_empat(id,angle,left,top,fillnya,width,height,stroke) { + var rect = new fabric.Rect({ + id : id, + // kategori : bentuk, + angle:angle, + left: left, + top: top, + fill: fillnya, + width: width, + height: height, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + // padding : 5 + }); + + + canvas.add(rect); + } + + function segi_tiga(id,angle,left,top,fillnya,width,height,stroke) { + var tri = new fabric.Triangle({ + id : id, + // kategori : bentuk, + angle:angle, + left: left, + top: top, + fill: fillnya, + width: width, + height: height, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + // padding : 5 + }); + + + canvas.add(tri); + } + + function segi_lingkaran(id,angle,left,top,fillnya,radius,stroke,scaleX,scaleY) { + var cir = new fabric.Circle({ + id : id, + angle:angle, + left: left, + top: top, + fill: fillnya, + radius : radius, + // objectCaching: true, + stroke: stroke, + strokeWidth: 10, + scaleX : scaleX, + scaleY : scaleY + // padding : 5 + }); + + + + // console.log(cir); + canvas.add(cir); + } + + + function free_draw(id,path,top,left,height,width,stroke_width,stroke){ + var garis = new fabric.Path(path); + + garis.set({ + id : id, + fill: null, + // top: top, + // left: left, + // height: height, + // width: width, + strokeWidth: stroke_width, + stroke: stroke + }); + + canvas.add(garis); + } + + function tambah_teks(id,input,fill,family,top,left,width,height,angle,scaleX,scaleY){ + var text = new fabric.Text(input, { + id : id, + angle:angle, + fill: fill , + fontSize: 100, + left: left, + top: top, + width : width, + height : height, + fontFamily: family, + scaleX : scaleX, + scaleY : scaleY + }); + console.log(text) + canvas.add(text); + } + + + + + + + + + function takeshot() { + var div = document.getElementById('sini_div_baju_color'); + + // Use the html2canvas + // function to take a screenshot + // and append it + // to the output div + html2canvas(div).then( + function (canvas) { + document + .getElementById('output') + .appendChild(canvas); + var base64URL = canvas.toDataURL('image/jpeg'); + console.log(base64URL) + $("#ini_untuk_share").attr('onclick',"window.plugins.socialsharing.share(null, 'Irwan T-Shirt Design', '"+base64URL+"', null)"); + var x = document.createElement("IMG"); + x.setAttribute("src", base64URL); + x.setAttribute("id", 'img_yg_terupload_'+id_desain); + x.async = true; + document.getElementById("sini_tampung_image").appendChild(x); + setTimeout(function(){ + $('#ini_untuk_share').trigger('click'); + }, 200); + }) + } \ No newline at end of file diff --git a/www/assets/js/html2canvas.js b/www/assets/js/html2canvas.js new file mode 100644 index 0000000..43fc7a5 --- /dev/null +++ b/www/assets/js/html2canvas.js @@ -0,0 +1,3519 @@ +/* + html2canvas 0.5.0-beta3 + Copyright (c) 2016 Niklas von Hertzen + + Released under License +*/ + +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.html2canvas=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + while (length--) { + array[length] = fn(array[length]); + } + return array; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings. + * @private + * @param {String} domain The domain name. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + return map(string.split(regexSeparators), fn).join('.'); + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * http://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols to a Punycode string of ASCII-only + * symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name to Unicode. Only the + * Punycoded parts of the domain name will be converted, i.e. it doesn't + * matter if you call it on a string that has already been converted to + * Unicode. + * @memberOf punycode + * @param {String} domain The Punycode domain name to convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(domain) { + return mapDomain(domain, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name to Punycode. Only the + * non-ASCII parts of the domain name will be converted, i.e. it doesn't + * matter if you call it with a domain that's already in ASCII. + * @memberOf punycode + * @param {String} domain The domain name to convert, as a Unicode string. + * @returns {String} The Punycode representation of the given domain name. + */ + function toASCII(domain) { + return mapDomain(domain, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.2.4', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],2:[function(_dereq_,module,exports){ +var log = _dereq_('./log'); + +function restoreOwnerScroll(ownerDocument, x, y) { + if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) { + ownerDocument.defaultView.scrollTo(x, y); + } +} + +function cloneCanvasContents(canvas, clonedCanvas) { + try { + if (clonedCanvas) { + clonedCanvas.width = canvas.width; + clonedCanvas.height = canvas.height; + clonedCanvas.getContext("2d").putImageData(canvas.getContext("2d").getImageData(0, 0, canvas.width, canvas.height), 0, 0); + } + } catch(e) { + log("Unable to copy canvas content from", canvas, e); + } +} + +function cloneNode(node, javascriptEnabled) { + var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false); + + var child = node.firstChild; + while(child) { + if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') { + clone.appendChild(cloneNode(child, javascriptEnabled)); + } + child = child.nextSibling; + } + + if (node.nodeType === 1) { + clone._scrollTop = node.scrollTop; + clone._scrollLeft = node.scrollLeft; + if (node.nodeName === "CANVAS") { + cloneCanvasContents(node, clone); + } else if (node.nodeName === "TEXTAREA" || node.nodeName === "SELECT") { + clone.value = node.value; + } + } + + return clone; +} + +function initNode(node) { + if (node.nodeType === 1) { + node.scrollTop = node._scrollTop; + node.scrollLeft = node._scrollLeft; + + var child = node.firstChild; + while(child) { + initNode(child); + child = child.nextSibling; + } + } +} + +module.exports = function(ownerDocument, containerDocument, width, height, options, x ,y) { + var documentElement = cloneNode(ownerDocument.documentElement, options.javascriptEnabled); + var container = containerDocument.createElement("iframe"); + + container.className = "html2canvas-container"; + container.style.visibility = "hidden"; + container.style.position = "fixed"; + container.style.left = "-10000px"; + container.style.top = "0px"; + container.style.border = "0"; + container.width = width; + container.height = height; + container.scrolling = "no"; // ios won't scroll without it + containerDocument.body.appendChild(container); + + return new Promise(function(resolve) { + var documentClone = container.contentWindow.document; + + /* Chrome doesn't detect relative background-images assigned in inline + + + + + + + + + + +
+ + +
+
+ +
+

Mulai Desain

+

Silakan pilh warna baju dari pilihan yang berada di bawah ini

+
+ +
+ +
+ +
+
+ +
+
+
+ +
+ +
+ +
+
+ +
+ + +
+
+ +
+ + + + + Designed by Irwan +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/desain_2.html b/www/desain_2.html new file mode 100644 index 0000000..8b9ced8 --- /dev/null +++ b/www/desain_2.html @@ -0,0 +1,178 @@ + + + + + + + + Irwan T-Shirt Design + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ +
+

Mulai Desain

+

Desain Sesuai Keinginan Anda

+
+ +
+ +
+ + + +
+
+
+
+ +
+
+ +
+
+
+ +
+
+ + + + +
+ + +
+ +
+ +
+
+ +
+ + +
+
+ +
+ + + + + Designed by Irwan +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/desain_complete.html b/www/desain_complete.html new file mode 100644 index 0000000..2729f16 --- /dev/null +++ b/www/desain_complete.html @@ -0,0 +1,164 @@ + + + + + + + + Irwan T-Shirt Design + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ +
+

Desain Selesai

+

Tekan Tombol Share Jika Ingin Berkongsi Ke Media Sosial

+
+ + +
+ +
+
+
+   +
 
+ +
+
+ +
+
+
+
+ +
+
+
+
+
 
+
+ +
+ +
+
+ +
+ + +
+
+ +
+ + + + + Designed by Irwan +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/html_lama/css/index.css b/www/html_lama/css/index.css new file mode 100644 index 0000000..ecea7e8 --- /dev/null +++ b/www/html_lama/css/index.css @@ -0,0 +1,110 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +* { + -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ +} + +body { + -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ + -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ + -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ + background-color:#E4E4E4; + background-image:linear-gradient(to bottom, #A7A7A7 0%, #E4E4E4 51%); + font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif; + font-size:12px; + height:100vh; + margin:0px; + padding:0px; + /* Padding to avoid the "unsafe" areas behind notches in the screen */ + padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); + text-transform:uppercase; + width:100%; +} + +/* Portrait layout (default) */ +.app { + background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ + position:absolute; /* position in the center of the screen */ + left:50%; + top:50%; + height:50px; /* text area height */ + width:225px; /* text area width */ + text-align:center; + padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ + margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */ + /* offset horizontal: half of text area width */ +} + +/* Landscape layout (with min-width) */ +@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { + .app { + background-position:left center; + padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */ + margin:-90px 0px 0px -198px; /* offset vertical: half of image height */ + /* offset horizontal: half of image width and text area width */ + } +} + +h1 { + font-size:24px; + font-weight:normal; + margin:0px; + overflow:visible; + padding:0px; + text-align:center; +} + +.event { + border-radius:4px; + color:#FFFFFF; + font-size:12px; + margin:0px 30px; + padding:2px 0px; +} + +.event.listening { + background-color:#333333; + display:block; +} + +.event.received { + background-color:#4B946A; + display:none; +} + +#deviceready.ready .event.listening { display: none; } +#deviceready.ready .event.received { display: block; } + +@keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.4; } + to { opacity: 1.0; } +} + +.blink { + animation:fade 3000ms infinite; + -webkit-animation:fade 3000ms infinite; +} + + +@media screen and (prefers-color-scheme: dark) { + body { + background-image:linear-gradient(to bottom, #585858 0%, #1B1B1B 51%); + } +} diff --git a/www/html_lama/img/logo.png b/www/html_lama/img/logo.png new file mode 100644 index 0000000..9519e7d Binary files /dev/null and b/www/html_lama/img/logo.png differ diff --git a/www/html_lama/index.html b/www/html_lama/index.html new file mode 100644 index 0000000..c465987 --- /dev/null +++ b/www/html_lama/index.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + Hello World + + +
+

Apache Cordova

+ +
+ + + + diff --git a/www/html_lama/js/index.js b/www/html_lama/js/index.js new file mode 100644 index 0000000..6fc66e5 --- /dev/null +++ b/www/html_lama/js/index.js @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// Wait for the deviceready event before using any of Cordova's device APIs. +// See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready +document.addEventListener('deviceready', onDeviceReady, false); + +function onDeviceReady() { + // Cordova is now initialized. Have fun! + + console.log('Running cordova-' + cordova.platformId + '@' + cordova.version); + document.getElementById('deviceready').classList.add('ready'); +} diff --git a/www/index.html b/www/index.html new file mode 100644 index 0000000..ba64b6d --- /dev/null +++ b/www/index.html @@ -0,0 +1,124 @@ + + + + + + + + Irwan T-Shirt Design + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Irwan T-Shirt

+

Aplikasi T-Shirt Design by Irwan

+ Mulai Mendesain +
+
+ + +
+
+ +
+ + + + + Designed by Irwan +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/list.html b/www/list.html new file mode 100644 index 0000000..41387f3 --- /dev/null +++ b/www/list.html @@ -0,0 +1,143 @@ + + + + + + + + Irwan T-Shirt Design + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+

List Desain

+
+ +
+ +
+
+
+ +
+ +
+
+ + + +
+
+ +
+ + + + + Designed by Irwan +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file