appscms-tools-theme 2.2.1 → 2.2.2

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: a214d95b3e1cd03e4f5b23f10e7dfdab5c037a8954a8d5384a464ba85f14567c
4
- data.tar.gz: 1c87ad2ef5e1748d734910383417fb3cc189874b3935b4a84b69913dbec2dec4
3
+ metadata.gz: 8337ee4d86c64f07bcbb01b8f67b2e49920db129fcb73fce0a590d90d8ce89a2
4
+ data.tar.gz: 81cdabf90a71f3bf587c30278c22af25b034a2ba1343ec3a5cc74358e5a53bfb
5
5
  SHA512:
6
- metadata.gz: c8f4e52b5ef4e4368ff273c1476e8a6d923fffdad6fa5b3c521088e6d5d9c455a527a3d4068ea5413014437895971fbf33d7aa9dd1e0b544d0e459cd8753e2c4
7
- data.tar.gz: c6068ad6242f047d7525f88f28086986ef2214965d232aa17695c0fb4d9e1c42a94c87c746528de3fca96f22be54fe59ab030c5ede1e8671b7140b561d7a7904
6
+ metadata.gz: 04b33c08f8681f6fa69d31117fc506fccef84156ef701e9b9ba45dd5747e9e9db32fcf4cfb073153723628188f0b94cb5dc3a9b6c6b28fb2c9ce3830b7001508
7
+ data.tar.gz: 2d5d3db6f3be79f5970f6b64fe542dbec3cac597673c5abceba86ccfa807199744edd234198916822e582166b34aa3479bacd7b8ce8f410597f94fa7634477bc
@@ -71,6 +71,62 @@
71
71
  endif -%} />
72
72
 
73
73
  {%- include google-analytics.html -%}
74
- {%- include monumetric/monumetric.html -%}
74
+ {% if jekyll.environment == 'production' and site.monumetricId %}
75
+ <script>
76
+ const autoLoadDuration = 5; //In Seconds
77
+ const eventList = ["keydown", "mousemove", "wheel", "touchmove", "touchstart", "touchend"];
78
+
79
+ const autoLoadTimeout = setTimeout(runScripts, autoLoadDuration * 1000);
80
+
81
+ eventList.forEach(function (event) {
82
+ window.addEventListener(event, triggerScripts, { passive: true })
83
+ });
84
+
85
+ function triggerScripts() {
86
+ runScripts();
87
+ clearTimeout(autoLoadTimeout);
88
+ eventList.forEach(function (event) {
89
+ window.removeEventListener(event, triggerScripts, { passive: true });
90
+ });
91
+ }
92
+
93
+ function runScripts() {
94
+ document.querySelectorAll("script[delay]").forEach(function (scriptTag) {
95
+ scriptTag.setAttribute("src", scriptTag.getAttribute("delay"));
96
+ });
97
+ }
98
+ </script>
99
+ <script type="text/javascript" defer delay="{{site.monumetricId}}" crossorigin="anonymous"
100
+ data-cfasync="false"></script>
101
+ {% endif %}
102
+
103
+ {% if jekyll.environment == 'development' and site.monumetricId %}
104
+ <script>
105
+ const autoLoadDuration = 5; //In Seconds
106
+ const eventList = ["keydown", "mousemove", "wheel", "touchmove", "touchstart", "touchend"];
107
+
108
+ const autoLoadTimeout = setTimeout(runScripts, autoLoadDuration * 1000);
109
+
110
+ eventList.forEach(function (event) {
111
+ window.addEventListener(event, triggerScripts, { passive: true })
112
+ });
113
+
114
+ function triggerScripts() {
115
+ runScripts();
116
+ clearTimeout(autoLoadTimeout);
117
+ eventList.forEach(function (event) {
118
+ window.removeEventListener(event, triggerScripts, { passive: true });
119
+ });
120
+ }
121
+
122
+ function runScripts() {
123
+ document.querySelectorAll("script[delay]").forEach(function (scriptTag) {
124
+ scriptTag.setAttribute("src", scriptTag.getAttribute("delay"));
125
+ });
126
+ }
127
+ </script>
128
+ <script type="text/javascript" delay="{{site.monumetricId}}" crossorigin="anonymous"></script>
129
+
130
+ {% endif %}
75
131
  </head>
76
132
  {{ seo_description }}
data/assets/js/frame.js CHANGED
@@ -53,7 +53,6 @@ form.addEventListener('submit', (e) => {
53
53
  drawImage()
54
54
  })
55
55
  const drawInputImage = (ctx, item, indexValue, canvas, image) => {
56
- console.log(ctx)
57
56
  return new Promise((resolve, reject) => {
58
57
  let image = document.createElement('img')
59
58
  image.src = files[indexValue]
@@ -72,13 +71,13 @@ const drawInputImage = (ctx, item, indexValue, canvas, image) => {
72
71
  )
73
72
 
74
73
  if (item.rotate) {
75
- drawRotated(item.rotate, ctx, canvas, image)
74
+ drawRotated(item.rotate, ctx, canvas, image, item)
76
75
  }
77
76
  resolve()
78
77
  }
79
78
  })
80
79
  }
81
- const drawRotated = (degrees, ctx, canvas, image) => {
80
+ const drawRotated = (degrees, ctx, canvas, image, item) => {
82
81
  console.log(image)
83
82
  ctx.clearRect(0, 0, canvas.width, canvas.height)
84
83
 
@@ -87,7 +86,7 @@ const drawRotated = (degrees, ctx, canvas, image) => {
87
86
  ctx.save()
88
87
 
89
88
  // move to the center of the canvas
90
- // ctx.translate(canvas.width / 2, canvas.height / 2)
89
+ ctx.translate(item.x, item.y)
91
90
 
92
91
  // rotate the canvas to the specified degrees
93
92
  ctx.rotate((degrees * Math.PI) / 180)
@@ -129,6 +128,8 @@ const drawImage = () => {
129
128
  if (item.shadowColor) {
130
129
  ctx.shadowColor = `${item.shadowColor}`
131
130
  }
131
+ console.log(item)
132
+ console.log((item.rotate * Math.PI) / 180)
132
133
  if (item.rotate) {
133
134
  ctx.rotate((item.rotate * Math.PI) / 180)
134
135
  }
@@ -141,12 +142,15 @@ const drawImage = () => {
141
142
  if (item.shadowBlur) {
142
143
  ctx.shadowBlur = 2
143
144
  }
145
+ ctx.textAlign = 'center'
144
146
  ctx.fillStyle = `${item.color}`
147
+ ctx.save()
145
148
  ctx.fillText(
146
149
  document.querySelector(`#${item.id}`).value,
147
150
  item.x,
148
151
  item.y
149
152
  )
153
+ ctx.restore()
150
154
  })
151
155
  }
152
156
  if (item.type === 'rectangle') {
@@ -235,3 +239,13 @@ download.addEventListener('click', () => {
235
239
  window.location.href = `/${lang}/download?tool=${pageTool}`
236
240
  }
237
241
  })
242
+
243
+ //
244
+ // fonts
245
+ // font rotation
246
+ // font position
247
+ // font transform
248
+
249
+ //images
250
+ //image rotation
251
+ // image rectangle with text
@@ -18,8 +18,8 @@
18
18
  "id": "text-1",
19
19
  "type": "text",
20
20
  "x": "100",
21
+ "rotate": 0,
21
22
  "y": "100",
22
- "rotate": 10,
23
23
  "color": "red",
24
24
  "fontFamily": "Calligraphy",
25
25
  "fontPath": "/assets/fonts/Calligraphy.ttf",
@@ -39,16 +39,17 @@
39
39
  "id": "file-3"
40
40
  },
41
41
  {
42
- "id": "text-2",
43
42
  "label": "",
43
+ "id": "text-2",
44
44
  "type": "text",
45
- "x": 100,
46
- "y": 100,
45
+ "x": "200",
46
+ "y": "200",
47
+ "rotate": 40,
47
48
  "color": "red",
48
49
  "fontFamily": "Calligraphy",
49
50
  "fontPath": "/assets/fonts/Calligraphy.ttf",
50
51
  "fontWeight": "bold",
51
- "fontSize": 0
52
+ "fontSize": 50
52
53
  }
53
54
  ]
54
55
  }
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.2.1
4
+ version: 2.2.2
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-08-13 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll