pixflow-upgrade-planning 0.0.9 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -64
- package/package.json +2 -7
- package/styles/pixflow.css +28 -60
- package/template.html +3 -7
package/index.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
const parse = new DOMParser();
|
|
2
2
|
const fs = require("fs");
|
|
3
3
|
const path = require("path");
|
|
4
|
-
const price_details = require("pixflow-price-details");
|
|
5
|
-
const PurchaseCodeActivate = require("pixflow-purchase-code-activate");
|
|
6
|
-
const PixflowCEPManifest = require("pixflow-cep-manifest");
|
|
7
4
|
|
|
8
5
|
class PixflowUpgradePlanning extends HTMLElement {
|
|
9
6
|
|
|
10
7
|
constructor(){
|
|
11
8
|
super();
|
|
12
|
-
self = this;
|
|
13
9
|
this.port = localStorage.getItem("port");
|
|
14
10
|
}
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
self = this;
|
|
18
|
-
this.cep_manifest = new PixflowCEPManifest();
|
|
12
|
+
connectedCallback(){
|
|
19
13
|
const style = document.createElement("style");
|
|
20
14
|
style.textContent = fs.readFileSync(path.join(__dirname, "styles", `${this.port}.css`));
|
|
21
15
|
this.appendChild(style);
|
|
@@ -23,70 +17,19 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
23
17
|
this.template = parse.parseFromString(fs.readFileSync(path.join(__dirname, "template.html")).toString("utf8"), "text/html");
|
|
24
18
|
this.appendChild(this.template.querySelector(`div.${this.port}`));
|
|
25
19
|
|
|
20
|
+
this.querySelector(`img.close`).addEventListener("click", this.close_click);
|
|
21
|
+
|
|
26
22
|
if(this.port == "pixflow"){
|
|
27
|
-
const p = await price_details(this.cep_manifest.get_post_id());
|
|
28
|
-
this.querySelector("div.pixflow > div.plan > div.single > div > div").innerHTML = p.single;
|
|
29
|
-
this.querySelector("div.pixflow > div.plan > div.team > div > div").innerHTML = p.team;
|
|
30
23
|
this.appendChild(this.template.querySelector("div.purchase-code"));
|
|
31
|
-
this.querySelector("div.
|
|
32
|
-
|
|
33
|
-
this.querySelector("div.purchase-code > div.form > div.back-upgrade-plan").addEventListener("click", this.back_upgrade_plan_click);
|
|
34
|
-
this.querySelector("div.purchase-code > div > button").addEventListener("click", this.purchase_code_click);
|
|
35
|
-
this.querySelectorAll("div.plan > div > div").forEach(function(element){
|
|
36
|
-
element.addEventListener("click", function(){
|
|
37
|
-
element.parentNode.parentNode.querySelector("div.plan > div > div.active").classList.remove("active");
|
|
38
|
-
this.classList.add("active");
|
|
39
|
-
})
|
|
24
|
+
this.querySelector("div.purchase-code > img.close").addEventListener("click", function(){
|
|
25
|
+
this.parentNode.classList.remove("active");
|
|
40
26
|
})
|
|
27
|
+
this.querySelector("div.activate-code").addEventListener("click", this.activate_code_click);
|
|
41
28
|
}
|
|
42
29
|
|
|
43
|
-
this.querySelectorAll(`img.close`).forEach(function(element){
|
|
44
|
-
element.addEventListener("click", element.parentNode.parentNode.close_click)
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async purchase_code_click(e){
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
const purchase_code_activate = new PurchaseCodeActivate(e.target.parentNode.parentNode.querySelector("input[type='text']").value);
|
|
52
|
-
const result = await purchase_code_activate.check_user_license_type();
|
|
53
|
-
var index = 3;
|
|
54
|
-
if(result.license_type == "single" || result.license_type == "team"){
|
|
55
|
-
const check_device_query = await purchase_code_activate.check_device_query(result.license_type);
|
|
56
|
-
if(check_device_query.error == 0){
|
|
57
|
-
index = 1;
|
|
58
|
-
localStorage.setItem("active", result.license_type);
|
|
59
|
-
} else if(check_device_query.error == -2){
|
|
60
|
-
index = 2;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
e.target.parentNode.querySelector(`div.message > p:nth-child(${index})`).classList.add("active");
|
|
64
|
-
if(index == 1){
|
|
65
|
-
setTimeout(() => {
|
|
66
|
-
window.location.href = "./index.html";
|
|
67
|
-
}, 1200);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
activate_code_block_click(e){
|
|
72
|
-
const cep_manifest = new PixflowCEPManifest();
|
|
73
|
-
const item_name = cep_manifest.get_item_name();
|
|
74
|
-
const license = this.parentNode.parentNode.querySelector("div.plan > div > div.active").parentNode.className.split(" ")[0];
|
|
75
|
-
var link = `https://pixflow.net/product/px-${item_name}/?active-license=free`;
|
|
76
|
-
if(license != "free")
|
|
77
|
-
link = `https://pixflow.net/aff/${item_name}-plugin-${license}/`;
|
|
78
|
-
window.cep.util.openURLInDefaultBrowser(link);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
back_upgrade_plan_click(e){
|
|
82
|
-
const purchase_code_panel = e.target.parentNode.parentNode;
|
|
83
|
-
purchase_code_panel.classList.remove("active");
|
|
84
|
-
const upgrade_planning_panel = purchase_code_panel.parentNode.querySelector("div.pixflow");
|
|
85
|
-
upgrade_planning_panel.classList.add("active");
|
|
86
30
|
}
|
|
87
31
|
|
|
88
32
|
activate_code_click(e){
|
|
89
|
-
e.target.parentNode.parentNode.classList.remove("active");
|
|
90
33
|
e.target.parentNode.parentNode.parentNode.querySelector("div.purchase-code").classList.add("active");
|
|
91
34
|
}
|
|
92
35
|
|
|
@@ -94,8 +37,12 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
94
37
|
this.querySelector(`div.${this.port}`).classList.add("active");
|
|
95
38
|
}
|
|
96
39
|
|
|
40
|
+
close(){
|
|
41
|
+
this.querySelector(`div.${this.port}`).classList.remove("active");
|
|
42
|
+
}
|
|
43
|
+
|
|
97
44
|
close_click(e){
|
|
98
|
-
e.target.parentNode.
|
|
45
|
+
e.target.parentNode.parentNode.close();
|
|
99
46
|
}
|
|
100
47
|
|
|
101
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixflow-upgrade-planning",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,10 +8,5 @@
|
|
|
8
8
|
},
|
|
9
9
|
"keywords": [],
|
|
10
10
|
"author": "",
|
|
11
|
-
"license": "ISC"
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"pixflow-price-details": "^1.0.0",
|
|
14
|
-
"pixflow-purchase-code-activate": "^1.0.0",
|
|
15
|
-
"pixflow-cep-manifest": "^1.0.0"
|
|
16
|
-
}
|
|
11
|
+
"license": "ISC"
|
|
17
12
|
}
|
package/styles/pixflow.css
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
pixflow-upgrade-planning > div.pixflow > div.plan > div, pixflow-upgrade-planning
|
|
10
|
+
pixflow-upgrade-planning > div.pixflow > div.plan > div, pixflow-upgrade-planning div.purchase-code button {
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -121,13 +121,14 @@ div.activate-code-block {
|
|
|
121
121
|
background: linear-gradient(180deg, rgba(12,12,12,0) 0%, rgba(12,12,12,1) 34%, rgba(12,12,12,1) 100%);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
pixflow-upgrade-planning > div.pixflow button {
|
|
124
|
+
pixflow-upgrade-planning > div.pixflow button, pixflow-upgrade-planning > div.purchase-code > form > button {
|
|
125
125
|
width: 147px;
|
|
126
126
|
height: 34px;
|
|
127
127
|
border-radius: 17px;
|
|
128
128
|
background-color: #005dff;
|
|
129
129
|
color: #fff;
|
|
130
130
|
transition: filter 200ms;
|
|
131
|
+
border: 0;
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
pixflow-upgrade-planning > div.pixflow > div:nth-child(5) {
|
|
@@ -246,8 +247,8 @@ pixflow-upgrade-planning div.close {
|
|
|
246
247
|
height: 27px;
|
|
247
248
|
}
|
|
248
249
|
|
|
249
|
-
pixflow-upgrade-planning
|
|
250
|
-
display:
|
|
250
|
+
pixflow-upgrade-planning div.purchase-code {
|
|
251
|
+
display: flex;
|
|
251
252
|
flex-direction: column;
|
|
252
253
|
position: fixed;
|
|
253
254
|
top: calc(100vh + 10px);
|
|
@@ -260,55 +261,46 @@ pixflow-upgrade-planning > div.purchase-code {
|
|
|
260
261
|
border-radius: 17px 17px 0px 0px;
|
|
261
262
|
z-index: 1001;
|
|
262
263
|
align-items: center;
|
|
263
|
-
justify-content: space-between;
|
|
264
264
|
font-family: 'Inter';
|
|
265
265
|
font-style: normal;
|
|
266
266
|
font-weight: 700;
|
|
267
267
|
font-size: 12px;
|
|
268
268
|
transition: top 400ms;
|
|
269
269
|
background: linear-gradient(180deg, #005DFF -86.53%, #2273FF -13.89%, #0C0C0C 47.55%, rgb(221 0 27) 47.56%, #0C0C0C 47.57%);
|
|
270
|
+
justify-content: space-between;
|
|
270
271
|
}
|
|
271
272
|
|
|
272
|
-
pixflow-upgrade-planning
|
|
273
|
+
pixflow-upgrade-planning div.purchase-code.active {
|
|
273
274
|
top: calc(100vh - 95%);
|
|
274
275
|
}
|
|
275
276
|
|
|
276
|
-
pixflow-upgrade-planning
|
|
277
|
-
margin-top: 39px;
|
|
277
|
+
pixflow-upgrade-planning div.purchase-code > form > input[type=text]:nth-child(1) {
|
|
278
278
|
background: rgb(185 210 255 / 10%);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
pixflow-upgrade-planning
|
|
281
|
+
pixflow-upgrade-planning div.purchase-code > form > div {
|
|
282
282
|
color: #7C879A;
|
|
283
283
|
margin: 15px 0;
|
|
284
284
|
cursor: pointer;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
pixflow-upgrade-planning
|
|
287
|
+
pixflow-upgrade-planning div.purchase-code > img:nth-child(1) {
|
|
288
288
|
position: absolute;
|
|
289
289
|
z-index: -1;
|
|
290
290
|
top: -8px;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
pixflow-upgrade-planning
|
|
294
|
-
margin-top: 8px;
|
|
293
|
+
pixflow-upgrade-planning div.purchase-code > img:nth-child(2) {
|
|
295
294
|
position: absolute;
|
|
295
|
+
top: 0;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
pixflow-upgrade-planning
|
|
299
|
-
margin-top:
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
pixflow-upgrade-planning > div.purchase-code.active, div#block.active, div#logout.active, div#revoke-access.active, div#store.active, #font-selector.active {
|
|
303
|
-
opacity: 1;
|
|
304
|
-
display: flex!important;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
pixflow-upgrade-planning > div.purchase-code > div {
|
|
298
|
+
pixflow-upgrade-planning div.purchase-code > div {
|
|
299
|
+
margin-top: 0px;
|
|
308
300
|
color: #7C879A;
|
|
309
301
|
}
|
|
310
302
|
|
|
311
|
-
pixflow-upgrade-planning
|
|
303
|
+
pixflow-upgrade-planning div.purchase-code > p.describe {
|
|
312
304
|
font-family: Inter;
|
|
313
305
|
font-style: normal;
|
|
314
306
|
font-weight: bold;
|
|
@@ -320,18 +312,18 @@ pixflow-upgrade-planning > div.purchase-code > p.describe {
|
|
|
320
312
|
margin-top: 69px;
|
|
321
313
|
}
|
|
322
314
|
|
|
323
|
-
pixflow-upgrade-planning
|
|
315
|
+
pixflow-upgrade-planning div.purchase-code > p {
|
|
324
316
|
width: fit-content;
|
|
325
317
|
}
|
|
326
318
|
|
|
327
|
-
pixflow-upgrade-planning
|
|
319
|
+
pixflow-upgrade-planning div.purchase-code > form {
|
|
328
320
|
display: flex;
|
|
329
321
|
justify-content: space-between;
|
|
330
322
|
align-items: center;
|
|
331
323
|
flex-direction: column;
|
|
332
324
|
}
|
|
333
325
|
|
|
334
|
-
pixflow-upgrade-planning
|
|
326
|
+
pixflow-upgrade-planning div.purchase-code > form > input[type="text"] {
|
|
335
327
|
background-color: rgba(226, 226, 226, 0.6);
|
|
336
328
|
border: 0;
|
|
337
329
|
color: #8D8D8D;
|
|
@@ -348,21 +340,21 @@ pixflow-upgrade-planning > div.purchase-code > div.form > input[type="text"] {
|
|
|
348
340
|
margin: 0;
|
|
349
341
|
}
|
|
350
342
|
|
|
351
|
-
pixflow-upgrade-planning
|
|
343
|
+
pixflow-upgrade-planning div.purchase-code > form > input[type="text"]::selection {
|
|
352
344
|
filter: invert(1);
|
|
353
345
|
}
|
|
354
346
|
|
|
355
|
-
pixflow-upgrade-planning
|
|
347
|
+
pixflow-upgrade-planning div.purchase-code > form > p {
|
|
356
348
|
color: #fff;
|
|
357
349
|
height: 15px;
|
|
358
350
|
}
|
|
359
351
|
|
|
360
|
-
pixflow-upgrade-planning
|
|
352
|
+
pixflow-upgrade-planning div.purchase-code > p {
|
|
361
353
|
width: fit-content;
|
|
362
354
|
text-align: center;
|
|
363
355
|
}
|
|
364
356
|
|
|
365
|
-
pixflow-upgrade-planning
|
|
357
|
+
pixflow-upgrade-planning div.purchase-code > p.buy {
|
|
366
358
|
font-family: Inter;
|
|
367
359
|
font-style: normal;
|
|
368
360
|
font-weight: 500;
|
|
@@ -373,50 +365,26 @@ pixflow-upgrade-planning > div.purchase-code > p.buy {
|
|
|
373
365
|
color: #FFFFFF;
|
|
374
366
|
}
|
|
375
367
|
|
|
376
|
-
pixflow-upgrade-planning
|
|
368
|
+
pixflow-upgrade-planning div.purchase-code > p.buy > a {
|
|
377
369
|
color: #5c92ff;
|
|
378
370
|
text-decoration: underline;
|
|
379
371
|
transition: color 0.2s;
|
|
380
372
|
}
|
|
381
373
|
|
|
382
|
-
pixflow-upgrade-planning
|
|
374
|
+
pixflow-upgrade-planning div.purchase-code > p.buy > a:hover {
|
|
383
375
|
color: #0A48C4;
|
|
384
376
|
}
|
|
385
377
|
|
|
386
|
-
pixflow-upgrade-planning
|
|
378
|
+
pixflow-upgrade-planning div.purchase-code > p.help > a {
|
|
387
379
|
text-decoration: underline;
|
|
388
380
|
}
|
|
389
381
|
|
|
390
|
-
pixflow-upgrade-planning
|
|
382
|
+
pixflow-upgrade-planning div.purchase-code > p.buy > a {
|
|
391
383
|
color: #5c92ff;
|
|
392
384
|
text-decoration: underline;
|
|
393
385
|
display: contents;
|
|
394
386
|
}
|
|
395
387
|
|
|
396
|
-
pixflow-upgrade-planning
|
|
397
|
-
color: #FFFFFF;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
pixflow-upgrade-planning > div.purchase-code > div.form > div.message > p {
|
|
401
|
-
display: none;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
pixflow-upgrade-planning > div.purchase-code > div.form > div.message > p.active {
|
|
405
|
-
display: block;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
pixflow-upgrade-planning > div.purchase-code button {
|
|
388
|
+
pixflow-upgrade-planning div.purchase-code div.result {
|
|
409
389
|
color: #FFFFFF;
|
|
410
|
-
|
|
411
|
-
font-style: normal;
|
|
412
|
-
font-weight: 500;
|
|
413
|
-
font-size: 14px;
|
|
414
|
-
border: 0;
|
|
415
|
-
outline: none;
|
|
416
|
-
transition: background-color 0.2s;
|
|
417
|
-
cursor: pointer;
|
|
418
|
-
padding: 9px;
|
|
419
|
-
margin: 9px;
|
|
420
|
-
border-radius: 7px;
|
|
421
|
-
background-color: #005dff;
|
|
422
|
-
}
|
|
390
|
+
}
|
package/template.html
CHANGED
|
@@ -60,14 +60,10 @@
|
|
|
60
60
|
<img src="./node_modules/pixflow-upgrade-planning/images/drawer.svg" class="close">
|
|
61
61
|
<img src="./node_modules/pixflow-upgrade-planning/images/pixflow/purchase-code.svg">
|
|
62
62
|
<p class="describe">Use the code you received after the purchase process to activate the plugin</p>
|
|
63
|
-
<
|
|
63
|
+
<form>
|
|
64
64
|
<input type="text" spellcheck="false" placeholder="Purchase code">
|
|
65
|
-
<
|
|
66
|
-
<p>Activation was successful</p>
|
|
67
|
-
<p>Your code has been activated on 1 machines. Revoke them and try again.</p>
|
|
68
|
-
<p>Invalid purchase code!</p>
|
|
69
|
-
</div>
|
|
65
|
+
<p class="message"></p>
|
|
70
66
|
<button>ACTIVATE</button>
|
|
71
67
|
<div class="back-upgrade-plan">Purchase Pro Membership</div>
|
|
72
|
-
</
|
|
68
|
+
</form>
|
|
73
69
|
</div>
|