appscms-tools-theme 2.5.8 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 235ec4173f520f3409bab1e2c89d1ec65fdd52e824d1f793bf74c029e8452608
4
- data.tar.gz: 60febb002f750dcd0c73e92dfb649e8cb34ced7389c98cad79ef6adaa38dc30e
3
+ metadata.gz: 30d957c8873b6d2852b0a3632235ac8d76ea4c90a4c3f69416bdd0cd644170c3
4
+ data.tar.gz: 8628a9dcb87e275ac8ed515f6f47a2f8d8d90ead50cf0bbf335c48dc68d6d1d7
5
5
  SHA512:
6
- metadata.gz: e4634aa810117bc3b7fb5e3ff545cd0fb07f0100eabc3403f586af3ea19b95a121ee19d7a3e84073cfd10b80c7002f521632037afb74b11364d96829b08852f3
7
- data.tar.gz: 109912e06964b9289b3490a96eb3c3dd2070c05d949c8400c614ad7f49c88f06a3acb1932298b55890973b91d157ec7794dc2fd5a8173fac8d9b8f08883e9cb3
6
+ metadata.gz: f50252598fd44fbfd95ec94a682cf7d654ccdb464c23bb275c89d60a66a2773cfd69866da42913f9b6729ff0f08cbca4b4f5322af1af87b8483120daca466151
7
+ data.tar.gz: 4f74b60d77819c9767bea36f2476b2951d7e64a45a26746cc4c523bbcb8bbac2db601f2fea16730af0c58a8065a8a7d3777707aae8d1e95cf378b3c193d126a6
@@ -20,6 +20,7 @@
20
20
  ],
21
21
  "jsfilepaths": [
22
22
  "/assets/js/googledrive.js",
23
+ "/assets/js/perspective.min.js",
23
24
  "https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.12/cropper.min.js",
24
25
  "/assets/js/frame.js"
25
26
  ],
@@ -255,7 +255,6 @@
255
255
  {%- endif -%}
256
256
  {% include footer/index.html %}
257
257
  {% include script.html %}
258
- <script defer src="/app.js"></script>
259
258
  </body>
260
259
 
261
260
  </html>
Binary file
Binary file
Binary file
data/assets/js/frame.js CHANGED
@@ -70,20 +70,33 @@ const drawInputImage = (ctx, item, indexValue) => {
70
70
  if (item.rotate) {
71
71
  ctx.rotate((item.rotate * Math.PI) / 180)
72
72
  }
73
-
74
- ctx.drawImage(
75
- image,
76
- Number(item.x),
77
- Number(item.y),
78
- image.width,
79
- image.height
80
- )
73
+ let perspectiveKey = 'perspective' in item
74
+ if (!perspectiveKey) {
75
+ ctx.drawImage(
76
+ image,
77
+ Number(item.x),
78
+ Number(item.y),
79
+ image.width,
80
+ image.height
81
+ )
82
+ }
81
83
  if (item.translate) {
82
84
  ctx.translate(item.translate.x, item.translate.y)
83
85
  }
86
+ if (perspectiveKey) {
87
+ let p = new Perspective(ctx, image)
88
+ p.draw([
89
+ [item.perspective.topLeft.x, item.perspective.topLeft.y],
90
+ [item.perspective.topRight.x, item.perspective.topRight.y],
91
+ [item.perspective.bottomRight.x, item.perspective.bottomRight.y],
92
+ [item.perspective.bottomLeft.x, item.perspective.bottomLeft.y],
93
+ ])
94
+ }
95
+
84
96
  if (item.skew) {
85
97
  ctx.setTransform(1, item.skew.x, item.skew.y, 1, 0, 0)
86
98
  }
99
+
87
100
  ctx.restore()
88
101
  resolve()
89
102
  }
@@ -247,13 +260,3 @@ download.addEventListener('click', () => {
247
260
  window.location.href = `/${lang}/download?tool=${pageTool}`
248
261
  }
249
262
  })
250
-
251
- //
252
- // fonts
253
- // font rotation
254
- // font position
255
- // font transform
256
-
257
- //images
258
- //image rotation
259
- // image rectangle with text
@@ -0,0 +1,182 @@
1
+ !(function (t) {
2
+ 'object' == typeof exports && 'undefined' != typeof module
3
+ ? (module.exports = t())
4
+ : 'function' == typeof define && define.amd
5
+ ? define([], t)
6
+ : (('undefined' != typeof window
7
+ ? window
8
+ : 'undefined' != typeof global
9
+ ? global
10
+ : 'undefined' != typeof self
11
+ ? self
12
+ : this
13
+ ).Perspective = t())
14
+ })(function () {
15
+ return (function o(n, r, i) {
16
+ function s(e, t) {
17
+ if (!r[e]) {
18
+ if (!n[e]) {
19
+ var a = 'function' == typeof require && require
20
+ if (!t && a) return a(e, !0)
21
+ if (c) return c(e, !0)
22
+ throw (
23
+ (((a = new Error("Cannot find module '" + e + "'")).code =
24
+ 'MODULE_NOT_FOUND'),
25
+ a)
26
+ )
27
+ }
28
+ ;(a = r[e] = { exports: {} }),
29
+ n[e][0].call(
30
+ a.exports,
31
+ function (t) {
32
+ return s(n[e][1][t] || t)
33
+ },
34
+ a,
35
+ a.exports,
36
+ o,
37
+ n,
38
+ r,
39
+ i
40
+ )
41
+ }
42
+ return r[e].exports
43
+ }
44
+ for (
45
+ var c = 'function' == typeof require && require, t = 0;
46
+ t < i.length;
47
+ t++
48
+ )
49
+ s(i[t])
50
+ return s
51
+ })(
52
+ {
53
+ 1: [
54
+ function (t, e, a) {
55
+ var o = window.html5jp || {}
56
+ !(function () {
57
+ o.perspective = function (t, e) {
58
+ var a, o
59
+ t &&
60
+ t.strokeStyle &&
61
+ e &&
62
+ e.width &&
63
+ e.height &&
64
+ (((a = document.createElement('canvas')).width = parseInt(
65
+ e.width
66
+ )),
67
+ (a.height = parseInt(e.height)),
68
+ (o = a.getContext('2d')).drawImage(e, 0, 0, a.width, a.height),
69
+ ((e = document.createElement('canvas')).width = t.canvas.width),
70
+ (e.height = t.canvas.height),
71
+ (e = e.getContext('2d')),
72
+ (this.p = { ctxd: t, cvso: a, ctxo: o, ctxt: e }))
73
+ }
74
+ var t = o.perspective.prototype
75
+ ;(t.draw = function (t) {
76
+ for (
77
+ var e = t[0][0],
78
+ a = t[0][1],
79
+ o = t[1][0],
80
+ n = t[1][1],
81
+ r = t[2][0],
82
+ i = t[2][1],
83
+ s = t[3][0],
84
+ c = t[3][1],
85
+ h = [
86
+ Math.sqrt(Math.pow(e - o, 2) + Math.pow(a - n, 2)),
87
+ Math.sqrt(Math.pow(o - r, 2) + Math.pow(n - i, 2)),
88
+ Math.sqrt(Math.pow(r - s, 2) + Math.pow(i - c, 2)),
89
+ Math.sqrt(Math.pow(s - e, 2) + Math.pow(c - a, 2)),
90
+ ],
91
+ p = this.p.cvso.width,
92
+ f = this.p.cvso.height,
93
+ d = 0,
94
+ v = 0,
95
+ w = 0,
96
+ l = 0;
97
+ l < 4;
98
+ l++
99
+ ) {
100
+ var u = 0
101
+ v < (u = l % 2 ? h[l] / p : h[l] / f) && ((d = l), (v = u)),
102
+ 0 == h[l] && w++
103
+ }
104
+ if (!(1 < w)) {
105
+ var g,
106
+ m = this.p.ctxo,
107
+ x = this.p.ctxt
108
+ if (
109
+ (x.clearRect(0, 0, x.canvas.width, x.canvas.height),
110
+ d % 2 == 0)
111
+ ) {
112
+ ;(g = this.create_canvas_context(
113
+ p,
114
+ 10
115
+ )).globalCompositeOperation = 'copy'
116
+ for (var M = g.canvas, y = 0; y < f; y += 2) {
117
+ var q = e + (s - e) * (O = y / f),
118
+ _ = a + (c - a) * O,
119
+ C = o + (r - o) * O,
120
+ I = n + (i - n) * O,
121
+ T = Math.atan((I - _) / (C - q)),
122
+ b = Math.sqrt(Math.pow(C - q, 2) + Math.pow(I - _, 2)) / p
123
+ g.setTransform(1, 0, 0, 1, 0, -y),
124
+ g.drawImage(m.canvas, 0, 0),
125
+ x.translate(q, _),
126
+ x.rotate(T),
127
+ x.scale(b, b),
128
+ x.drawImage(M, 0, 0),
129
+ x.setTransform(1, 0, 0, 1, 0, 0)
130
+ }
131
+ } else if (d % 2 == 1) {
132
+ ;(g = this.create_canvas_context(
133
+ 10,
134
+ f
135
+ )).globalCompositeOperation = 'copy'
136
+ for (var M = g.canvas, E = 0; E < p; E += 2) {
137
+ var O,
138
+ q = e + (o - e) * (O = E / p),
139
+ _ = a + (n - a) * O,
140
+ C = s + (r - s) * O,
141
+ I = c + (i - c) * O,
142
+ T = Math.atan((q - C) / (I - _)),
143
+ b = Math.sqrt(Math.pow(C - q, 2) + Math.pow(I - _, 2)) / f
144
+ g.setTransform(1, 0, 0, 1, -E, 0),
145
+ g.drawImage(m.canvas, 0, 0),
146
+ x.translate(q, _),
147
+ x.rotate(T),
148
+ x.scale(b, b),
149
+ x.drawImage(M, 0, 0),
150
+ x.setTransform(1, 0, 0, 1, 0, 0)
151
+ }
152
+ }
153
+ this.p.ctxd.save(),
154
+ this._applyClipPath(this.p.ctxd, [
155
+ [e, a],
156
+ [o, n],
157
+ [r, i],
158
+ [s, c],
159
+ ]),
160
+ this.p.ctxd.drawImage(x.canvas, 0, 0),
161
+ this.p.ctxd.restore()
162
+ }
163
+ }),
164
+ (t.create_canvas_context = function (t, e) {
165
+ var a = document.createElement('canvas')
166
+ return (a.width = t), (a.height = e), a.getContext('2d')
167
+ }),
168
+ (t._applyClipPath = function (t, e) {
169
+ t.beginPath(), t.moveTo(e[0][0], e[0][1])
170
+ for (var a = 1; a < e.length; a++) t.lineTo(e[a][0], e[a][1])
171
+ t.closePath(), t.clip()
172
+ })
173
+ })(),
174
+ (e.exports = o.perspective)
175
+ },
176
+ {},
177
+ ],
178
+ },
179
+ {},
180
+ [1]
181
+ )(1)
182
+ })
@@ -5,13 +5,29 @@
5
5
  "elements": [
6
6
  {
7
7
  "type": "image",
8
- "filter": "",
9
- "perspective": "",
10
- "height": 300,
11
- "width": 300,
8
+ "height": 308,
9
+ "width": 210,
10
+ "perspective": {
11
+ "topLeft": {
12
+ "x": 0,
13
+ "y": 0
14
+ },
15
+ "topRight": {
16
+ "x": 210,
17
+ "y": 0
18
+ },
19
+ "bottomLeft": {
20
+ "x": 0,
21
+ "y": 308
22
+ },
23
+ "bottomRight": {
24
+ "x": 210,
25
+ "y": 308
26
+ }
27
+ },
12
28
  "translate": {
13
- "x": -5,
14
- "y": -10
29
+ "x": 150,
30
+ "y": 250
15
31
  },
16
32
  "x": 100,
17
33
  "y": 100,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscms-tools-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.8
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-19 00:00:00.000000000 Z
11
+ date: 2022-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -2599,6 +2599,7 @@ files:
2599
2599
  - assets/images/balark.jpeg
2600
2600
  - assets/images/bulb.png
2601
2601
  - assets/images/bulb.svg
2602
+ - assets/images/bunnies.png
2602
2603
  - assets/images/cloud-computing.png
2603
2604
  - assets/images/cloud_new.svg
2604
2605
  - assets/images/convert.png
@@ -2626,6 +2627,7 @@ files:
2626
2627
  - assets/images/sona.jpeg
2627
2628
  - assets/images/spinner.gif
2628
2629
  - assets/images/target.svg
2630
+ - assets/images/together_foreve.png
2629
2631
  - assets/images/together_forever.png
2630
2632
  - assets/images/trust.svg
2631
2633
  - assets/images/udit.jpeg
@@ -2645,6 +2647,7 @@ files:
2645
2647
  - assets/js/homeResult.js
2646
2648
  - assets/js/manifest.json
2647
2649
  - assets/js/multiselect.js
2650
+ - assets/js/perspective.min.js
2648
2651
  - assets/js/photo-effects.json
2649
2652
  - assets/js/redirectResult.js
2650
2653
  - assets/js/testing-batch.js