appscms-tools-theme 2.5.8 → 2.5.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 235ec4173f520f3409bab1e2c89d1ec65fdd52e824d1f793bf74c029e8452608
4
- data.tar.gz: 60febb002f750dcd0c73e92dfb649e8cb34ced7389c98cad79ef6adaa38dc30e
3
+ metadata.gz: 04e730b88e246c845416e3f40e975c7de1af93e0ac565a1e3a19050721875b11
4
+ data.tar.gz: 2d6a765c327f1deb8b203f85f2f07e7599f2ea05a0f788ad3b0864ef880b643a
5
5
  SHA512:
6
- metadata.gz: e4634aa810117bc3b7fb5e3ff545cd0fb07f0100eabc3403f586af3ea19b95a121ee19d7a3e84073cfd10b80c7002f521632037afb74b11364d96829b08852f3
7
- data.tar.gz: 109912e06964b9289b3490a96eb3c3dd2070c05d949c8400c614ad7f49c88f06a3acb1932298b55890973b91d157ec7794dc2fd5a8173fac8d9b8f08883e9cb3
6
+ metadata.gz: 229f78bc8a881139eeb93281a90051b824674dcd8887c4428dc35f367ebdc341258b55e96cc8e43d10f7a6ad01801b2ade34adfebdeaaf4d247df48b7b587310
7
+ data.tar.gz: f347b2baddbfbb556a4f7300366712381a5caed95c46f86dfe3aaf5d25378f720c65cc6689d82030ee084ee986880fcddf04852272ed99653f0b409623ae79bf
@@ -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
  ],
Binary file
Binary file
Binary file
data/assets/js/frame.js CHANGED
@@ -70,20 +70,31 @@ 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
  }
84
86
  if (item.skew) {
85
87
  ctx.setTransform(1, item.skew.x, item.skew.y, 1, 0, 0)
86
88
  }
89
+ if (perspectiveKey) {
90
+ let p = new Perspective(ctx, image)
91
+ p.draw([
92
+ [item.perspective.topLeft.x, item.perspective.topLeft.y],
93
+ [item.perspective.topRight.x, item.perspective.topRight.y],
94
+ [item.perspective.bottomRight.x, item.perspective.bottomRight.y],
95
+ [item.perspective.bottomLeft.x, item.perspective.bottomLeft.y],
96
+ ])
97
+ }
87
98
  ctx.restore()
88
99
  resolve()
89
100
  }
@@ -247,13 +258,3 @@ download.addEventListener('click', () => {
247
258
  window.location.href = `/${lang}/download?tool=${pageTool}`
248
259
  }
249
260
  })
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
+ })
@@ -6,9 +6,26 @@
6
6
  {
7
7
  "type": "image",
8
8
  "filter": "",
9
- "perspective": "",
10
9
  "height": 300,
11
10
  "width": 300,
11
+ "perspective": {
12
+ "topLeft": {
13
+ "x": 0,
14
+ "y": 0
15
+ },
16
+ "topRight": {
17
+ "x": 0,
18
+ "y": 0
19
+ },
20
+ "bottomLeft": {
21
+ "x": 0,
22
+ "y": 0
23
+ },
24
+ "bottomRight": {
25
+ "x": 0,
26
+ "y": 0
27
+ }
28
+ },
12
29
  "translate": {
13
30
  "x": -5,
14
31
  "y": -10
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.5.9
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