appscms-tools-theme 2.1.9 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_data/feature/en/theframe.json +29 -1
- data/_data/photo-categories.json +11 -0
- data/_includes/custom-head.html +57 -1
- data/_layouts/frame.html +106 -86
- data/assets/fonts/Calligraphy.ttf +0 -0
- data/assets/images/together_forever.png +0 -0
- data/assets/js/frame.js +168 -88
- data/assets/js/photo-effects.json +56 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8337ee4d86c64f07bcbb01b8f67b2e49920db129fcb73fce0a590d90d8ce89a2
|
4
|
+
data.tar.gz: 81cdabf90a71f3bf587c30278c22af25b034a2ba1343ec3a5cc74358e5a53bfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04b33c08f8681f6fa69d31117fc506fccef84156ef701e9b9ba45dd5747e9e9db32fcf4cfb073153723628188f0b94cb5dc3a9b6c6b28fb2c9ce3830b7001508
|
7
|
+
data.tar.gz: 2d5d3db6f3be79f5970f6b64fe542dbec3cac597673c5abceba86ccfa807199744edd234198916822e582166b34aa3479bacd7b8ce8f410597f94fa7634477bc
|
@@ -27,11 +27,39 @@
|
|
27
27
|
"https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.12/cropper.css",
|
28
28
|
"/assets/css/frame.css"
|
29
29
|
],
|
30
|
+
"mainPreviewImage": "https://cdn.photofunia.com/effects/calendar/icons/medium.jpg",
|
31
|
+
"imageSamples": [
|
32
|
+
"https://cdn.photofunia.com/effects/calendar/examples/1hjpco5_r.jpg",
|
33
|
+
"https://cdn.photofunia.com/effects/calendar/examples/1gzzwn7_r.jpg",
|
34
|
+
"https://cdn.photofunia.com/effects/calendar/examples/eny6h4_r.jpg",
|
35
|
+
"https://cdn.photofunia.com/effects/calendar/examples/1v705mc_r.jpg"
|
36
|
+
],
|
30
37
|
"image": {
|
31
38
|
"src": "/assets/images/gallary.png",
|
32
39
|
"height": 277,
|
33
40
|
"width": 378,
|
34
41
|
"x": 110,
|
35
42
|
"y": 180
|
36
|
-
}
|
43
|
+
},
|
44
|
+
"effectImagePath": "/assets/images/gallary.png",
|
45
|
+
"elements": [
|
46
|
+
{
|
47
|
+
"type": "image",
|
48
|
+
"label": "1."
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"label": "label",
|
52
|
+
"type": "text",
|
53
|
+
"id": "text-1"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"type": "image",
|
57
|
+
"label": "1."
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"label": "label",
|
61
|
+
"type": "text",
|
62
|
+
"id": "text-2"
|
63
|
+
}
|
64
|
+
]
|
37
65
|
}
|
data/_includes/custom-head.html
CHANGED
@@ -71,6 +71,62 @@
|
|
71
71
|
endif -%} />
|
72
72
|
|
73
73
|
{%- include google-analytics.html -%}
|
74
|
-
{
|
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/_layouts/frame.html
CHANGED
@@ -2,108 +2,128 @@
|
|
2
2
|
layout: feature
|
3
3
|
---
|
4
4
|
|
5
|
+
{%- assign fileData = site.data[page.folderName][page.lang][page.fileName] -%}
|
5
6
|
<div class="container">
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<div class="inner-box">
|
11
|
-
<div style="display:none;" id="file-loader"><img src="/spinner.gif" alt="">
|
12
|
-
<p>Please Wait ,Loading Your file </p>
|
7
|
+
<div class="row">
|
8
|
+
<div class="col-md-3">
|
9
|
+
<div class="categories-section">
|
10
|
+
<h3>Categories</h3>
|
13
11
|
</div>
|
14
|
-
<div class="
|
15
|
-
<
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
<
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
<i class="fas fa-angle-down arrow-sign "></i>
|
36
|
-
<div class="file-picker-dropdown" style="display: none;">
|
37
|
-
<button id="dropbox"> <svg viewBox="0 0 24 24" fill="#0061FF"
|
38
|
-
xmlns="http://www.w3.org/2000/svg">
|
39
|
-
<path id="icon"
|
40
|
-
d="M12.0146 6.57367L6.50732 10.1473L12.0146 13.721L6.50732 17.2947L1 13.6912L6.50732 10.1176L1 6.57367L6.50732 3L12.0146 6.57367ZM6.47803 18.4263L11.9854 14.8527L17.4927 18.4263L11.9854 22L6.47803 18.4263ZM12.0146 13.6912L17.522 10.1176L12.0146 6.57367L17.4927 3L23 6.57367L17.4927 10.1473L23 13.721L17.4927 17.2947L12.0146 13.6912Z">
|
41
|
-
</path>
|
42
|
-
</svg> From Dropbox</button>
|
43
|
-
<button id='filepicker'> <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
44
|
-
<path id="Path" d="M8.33331 3H15.6666L23 15H15.6666L8.33331 3Z" fill="#FFC107">
|
45
|
-
</path>
|
46
|
-
<path id="Path_2" d="M4.6012 21L8.30086 15H23L19.3333 21H4.6012Z" fill="#1976D2">
|
47
|
-
</path>
|
48
|
-
<path id="Path_3" d="M1 15.0625L4.60119 21L12 9L8.33333 3L1 15.0625Z"
|
49
|
-
fill="#4CAF50">
|
50
|
-
</path>
|
51
|
-
</svg> From Google Drive</button>
|
12
|
+
<div class="categories-list">
|
13
|
+
<div class="accordion" id="accordionExample">
|
14
|
+
{%- for item in site.data.photo-categories -%}
|
15
|
+
<div class="card">
|
16
|
+
<div class="card-header" id="heading-{{forloop.index}}">
|
17
|
+
<h3 class="mb-0">
|
18
|
+
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse"
|
19
|
+
data-target="#collapse-{{forloop.index}}" aria-expanded="true"
|
20
|
+
aria-controls="collapse-{{forloop.index}}">
|
21
|
+
{{item.category}}
|
22
|
+
</button>
|
23
|
+
</h3>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div id="collapse-{{forloop.index}}" class="collapse show"
|
27
|
+
aria-labelledby="heading-{{forloop.index}}" data-parent="#accordionExample">
|
28
|
+
<div class="card-body">
|
29
|
+
{%- for i in item.features -%}
|
30
|
+
<a href="{{i.link}}">{{i.name}}</a>
|
31
|
+
{%- endfor -%}
|
32
|
+
</div>
|
52
33
|
</div>
|
53
34
|
</div>
|
35
|
+
{%- endfor -%}
|
54
36
|
</div>
|
55
|
-
<p id="dropfile">or drop your file here</p>
|
56
37
|
</div>
|
57
|
-
</div>
|
58
|
-
</div>
|
59
|
-
<div class="crop-image-modal-container">
|
60
|
-
<div class="row w-100">
|
61
|
-
<div class="crop-image-modal col-lg-6 col-md-8 mx-auto">
|
62
|
-
<div class="crop-image-modal-header" style="background-color:{{fileData.color}} ;">
|
63
|
-
<div>Select an area you would like to use</div>
|
64
|
-
<div>
|
65
|
-
<button onclick="closeModal()">
|
66
|
-
<i class="fas fa-times"></i>
|
67
|
-
</button>
|
68
|
-
</div>
|
69
|
-
</div>
|
70
|
-
<div class="crop-image-modal-body">
|
71
38
|
|
72
|
-
</div>
|
73
|
-
<div class="crop-btn-section">
|
74
|
-
<button id="crop" class="mx-auto my-3" style="background-color: {{fileData.color}};">crop</button>
|
75
|
-
</div>
|
76
|
-
</div>
|
77
39
|
</div>
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
<
|
85
|
-
|
40
|
+
<div class="col-md-9">
|
41
|
+
<div class="row">
|
42
|
+
<div class="col-md-8">
|
43
|
+
<form id="effect-form" data-feature-name="{{page.featureName}}">
|
44
|
+
{%- for item in fileData.elements -%}
|
45
|
+
{%- if item.type == "image" -%}
|
46
|
+
<label for="{{item.id}}">{{item.label}}</label>
|
47
|
+
<button type="button" id="{{item.id}}" data-index="{{forloop.index}}"
|
48
|
+
onclick="clickInput(this)">Choose
|
49
|
+
image</button>
|
50
|
+
<input class="d-none" id="file-{{forloop.index}}" type="file" onchange="fileOnChange(this)"
|
51
|
+
data-index="{{forloop.index}}" accept=".webp,.png,.jpg,.jpeg" required />
|
52
|
+
{%- endif -%}
|
53
|
+
{%- if item.type == "text" -%}
|
54
|
+
<label for="{{item.id}}">{{item.label}}</label>
|
55
|
+
<input type="text" id="{{item.id}}">
|
56
|
+
{%- endif -%}
|
57
|
+
{%- endfor -%}
|
58
|
+
<div>
|
59
|
+
<button type="submit">Go</button>
|
60
|
+
</div>
|
61
|
+
</form>
|
62
|
+
</div>
|
63
|
+
<div class="col-md-4">
|
64
|
+
<div class="preview-section">
|
65
|
+
<img src="{{fileData.mainPreviewImage}}" alt="">
|
86
66
|
</div>
|
87
|
-
<
|
67
|
+
<h3>Examples</h3>
|
68
|
+
<div class="image-samples">
|
69
|
+
{%- for item in fileData.imageSamples -%}
|
70
|
+
<img src="{{item}}" alt="sample">
|
71
|
+
{%- endfor -%}
|
88
72
|
</div>
|
89
73
|
</div>
|
90
74
|
</div>
|
91
|
-
<div class="col-md-4">
|
92
|
-
<div class="options-panel">
|
93
|
-
<div class="title">
|
94
75
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
76
|
+
<div class="crop-image-modal-container">
|
77
|
+
<div class="row w-100">
|
78
|
+
<div class="crop-image-modal col-lg-6 col-md-8 mx-auto">
|
79
|
+
<div class="crop-image-modal-header" style="background-color:{{fileData.color}} ;">
|
80
|
+
<div>Select an area you would like to use</div>
|
81
|
+
<div>
|
82
|
+
<button onclick="closeModal()">
|
83
|
+
<i class="fas fa-times"></i>
|
84
|
+
</button>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
<div class="crop-image-modal-body">
|
88
|
+
|
89
|
+
</div>
|
90
|
+
<div class="crop-btn-section">
|
91
|
+
<button id="crop" class="mx-auto my-3"
|
92
|
+
style="background-color: {{fileData.color}};">crop</button>
|
93
|
+
</div>
|
102
94
|
</div>
|
103
95
|
</div>
|
96
|
+
</div>
|
97
|
+
<div id="workspace" data-name="together_forever" style="display: none;">
|
98
|
+
<div class="row">
|
99
|
+
<div class="col-md-8 mx-auto">
|
100
|
+
<div class="select-img-panel">
|
101
|
+
<div id="saving-data" style="display: none;">
|
102
|
+
<img loading="lazy" src="/img/save.gif" alt="saving"> <span class="ml-2">Saving your
|
103
|
+
images...</span>
|
104
|
+
</div>
|
105
|
+
<div id="canvas-panel">
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
<div class="col-md-4">
|
110
|
+
<div class="options-panel">
|
111
|
+
<div class="title">
|
112
|
+
|
113
|
+
</div>
|
114
|
+
<div class="download-wrapper">
|
115
|
+
<button id="download-button" style="background-color: {{fileData.color}};"><svg
|
116
|
+
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
117
|
+
<path
|
118
|
+
d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM382.6 302.6l-103.1 103.1C270.7 414.6 260.9 416 256 416c-4.881 0-14.65-1.391-22.65-9.398L129.4 302.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 306.8V128c0-17.69 14.33-32 32-32s32 14.31 32 32v178.8l49.38-49.38c12.5-12.5 32.75-12.5 45.25 0S395.1 290.1 382.6 302.6z" />
|
119
|
+
</svg>Download</button>
|
120
|
+
</div>
|
121
|
+
</div>
|
104
122
|
|
123
|
+
</div>
|
124
|
+
</div>
|
105
125
|
</div>
|
106
126
|
</div>
|
107
127
|
</div>
|
108
|
-
|
109
|
-
|
128
|
+
|
129
|
+
</div>
|
Binary file
|
Binary file
|
data/assets/js/frame.js
CHANGED
@@ -1,122 +1,207 @@
|
|
1
1
|
const getScript = document.currentScript
|
2
2
|
const pageTool = getScript.dataset.tool
|
3
3
|
const lang = getScript.dataset.lang
|
4
|
-
const gdrive = document.querySelector('#filepicker')
|
5
4
|
const inputBox = document.querySelector('#Inputbox')
|
6
5
|
const fileDropBox = document.querySelector('.custom-box')
|
7
6
|
const cropModal = document.querySelector('.crop-image-modal-container')
|
8
7
|
const workspace = document.getElementById('workspace')
|
9
8
|
const canvasPanel = document.getElementById('canvas-panel')
|
10
9
|
const download = document.querySelector('#download-button')
|
10
|
+
const form = document.querySelector('#effect-form')
|
11
|
+
let files = []
|
12
|
+
let cropWidth = null
|
13
|
+
let cropHeight = null
|
14
|
+
let cropper = null
|
11
15
|
let cropInputWidth = null
|
16
|
+
let index = 0
|
12
17
|
let cropInputHeight = null
|
13
18
|
let image = null
|
14
19
|
const showLoader = () => {
|
15
20
|
showLoading()
|
16
21
|
}
|
17
22
|
const closeLoader = () => {}
|
18
|
-
const
|
19
|
-
|
20
|
-
|
21
|
-
'click',
|
22
|
-
(getFile, mimeTypes, showLoader, closeLoader) => {
|
23
|
-
const data = loadPicker()
|
24
|
-
}
|
25
|
-
)
|
26
|
-
const getDropBoxFile = (file) => {
|
27
|
-
handleFile(file)
|
28
|
-
}
|
29
|
-
const getFile = (file) => {
|
30
|
-
handleFile(file)
|
23
|
+
const clickInput = (e) => {
|
24
|
+
console.log(`#file-${e.dataset.index}`)
|
25
|
+
document.querySelector(`#file-${e.dataset.index}`).click()
|
31
26
|
}
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
27
|
+
let featureData = null
|
28
|
+
|
29
|
+
fetch('/assets/js/photo-effects.json')
|
30
|
+
.then((response) => response.json())
|
31
|
+
.then((data) => {
|
32
|
+
featureData = data.find((i) => i.name === form.dataset.featureName)
|
33
|
+
console.log(featureData)
|
34
|
+
})
|
35
|
+
const fileOnChange = (e) => {
|
36
|
+
index = Number(e.dataset.index)
|
37
|
+
let reader = new FileReader()
|
38
|
+
reader.onload = (event) => {
|
39
|
+
cropModal.style.display = 'flex'
|
40
|
+
if (cropper === null) {
|
41
|
+
cropImage(event.target.result, e.id)
|
42
|
+
} else {
|
43
|
+
updateCropper(event.target.result, e.id)
|
44
|
+
}
|
40
45
|
}
|
41
|
-
)
|
42
|
-
inputBox.onclick = function () {
|
43
|
-
document.querySelector('#file').click()
|
46
|
+
reader.readAsDataURL(e.files[0])
|
44
47
|
}
|
45
|
-
fileDropBox.addEventListener('dragover', (e) => {
|
46
|
-
e.preventDefault()
|
47
|
-
})
|
48
|
-
fileDropBox.addEventListener('drop', (e) => {
|
49
|
-
e.preventDefault()
|
50
|
-
handleFile(e.dataTransfer.files[0])
|
51
|
-
})
|
52
48
|
const closeModal = () => {
|
53
49
|
cropModal.style.display = 'none'
|
54
50
|
}
|
51
|
+
form.addEventListener('submit', (e) => {
|
52
|
+
e.preventDefault()
|
53
|
+
drawImage()
|
54
|
+
})
|
55
|
+
const drawInputImage = (ctx, item, indexValue, canvas, image) => {
|
56
|
+
return new Promise((resolve, reject) => {
|
57
|
+
let image = document.createElement('img')
|
58
|
+
image.src = files[indexValue]
|
59
|
+
image.onload = () => {
|
60
|
+
image.width = Number(item.width)
|
61
|
+
image.height = Number(item.height)
|
62
|
+
if (item.filter) {
|
63
|
+
ctx.filter = item.filter
|
64
|
+
}
|
65
|
+
ctx.drawImage(
|
66
|
+
image,
|
67
|
+
Number(item.x),
|
68
|
+
Number(item.y),
|
69
|
+
image.width,
|
70
|
+
image.height
|
71
|
+
)
|
72
|
+
|
73
|
+
if (item.rotate) {
|
74
|
+
drawRotated(item.rotate, ctx, canvas, image, item)
|
75
|
+
}
|
76
|
+
resolve()
|
77
|
+
}
|
78
|
+
})
|
79
|
+
}
|
80
|
+
const drawRotated = (degrees, ctx, canvas, image, item) => {
|
81
|
+
console.log(image)
|
82
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height)
|
83
|
+
|
84
|
+
// save the unrotatedctx of the canvas so we can restore it later
|
85
|
+
// the alternative is to untranslate & unrotate after drawing
|
86
|
+
ctx.save()
|
87
|
+
|
88
|
+
// move to the center of the canvas
|
89
|
+
ctx.translate(item.x, item.y)
|
90
|
+
|
91
|
+
// rotate the canvas to the specified degrees
|
92
|
+
ctx.rotate((degrees * Math.PI) / 180)
|
93
|
+
|
94
|
+
// draw the image
|
95
|
+
// since thectx is rotated, the image will be rotated also
|
96
|
+
ctx.drawImage(image, -image.width / 2, -image.width / 2)
|
97
|
+
|
98
|
+
// we’re done with the rotating so restore the unrotatedctx
|
99
|
+
ctx.restore()
|
100
|
+
}
|
55
101
|
const drawImage = () => {
|
56
102
|
let img = new Image()
|
57
|
-
img.src =
|
103
|
+
img.src = featureData.effectImagePath
|
58
104
|
var canvas = document.createElement('canvas')
|
59
105
|
var ctx = canvas.getContext('2d')
|
60
106
|
img.onload = () => {
|
61
|
-
image.width = Number(fileDropBox.dataset.width)
|
62
|
-
image.height = Number(fileDropBox.dataset.height)
|
63
107
|
canvas.width = img.width
|
64
108
|
canvas.height = img.height
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
109
|
+
Promise.all(
|
110
|
+
featureData.elements.map((item, indexValue) => {
|
111
|
+
if (item.type === 'image') {
|
112
|
+
return new Promise((resolve, reject) => {
|
113
|
+
drawInputImage(ctx, item, indexValue, canvas).then(() => {
|
114
|
+
resolve()
|
115
|
+
})
|
116
|
+
})
|
117
|
+
}
|
118
|
+
})
|
119
|
+
).then(() => {
|
120
|
+
ctx.filter = 'none'
|
121
|
+
ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
|
122
|
+
featureData.elements.map((item, indexValue) => {
|
123
|
+
if (item.type === 'text') {
|
124
|
+
let myFont = new FontFace(item.font, `url(${item.fontPath})`)
|
125
|
+
myFont.load().then(function (font) {
|
126
|
+
document.fonts.add(font)
|
127
|
+
ctx.font = `${item.fontSize}px ${item.font}`
|
128
|
+
if (item.shadowColor) {
|
129
|
+
ctx.shadowColor = `${item.shadowColor}`
|
130
|
+
}
|
131
|
+
console.log(item)
|
132
|
+
console.log((item.rotate * Math.PI) / 180)
|
133
|
+
if (item.rotate) {
|
134
|
+
ctx.rotate((item.rotate * Math.PI) / 180)
|
135
|
+
}
|
136
|
+
if (item.shadowOffsetX) {
|
137
|
+
ctx.shadowOffsetX = 3
|
138
|
+
}
|
139
|
+
if (item.shadowOffsetY) {
|
140
|
+
ctx.shadowOffsetY = 3
|
141
|
+
}
|
142
|
+
if (item.shadowBlur) {
|
143
|
+
ctx.shadowBlur = 2
|
144
|
+
}
|
145
|
+
ctx.textAlign = 'center'
|
146
|
+
ctx.fillStyle = `${item.color}`
|
147
|
+
ctx.save()
|
148
|
+
ctx.fillText(
|
149
|
+
document.querySelector(`#${item.id}`).value,
|
150
|
+
item.x,
|
151
|
+
item.y
|
152
|
+
)
|
153
|
+
ctx.restore()
|
154
|
+
})
|
155
|
+
}
|
156
|
+
if (item.type === 'rectangle') {
|
157
|
+
}
|
158
|
+
})
|
159
|
+
canvasPanel.innerHTML = ''
|
160
|
+
canvasPanel.appendChild(canvas)
|
161
|
+
workspace.style.display = 'block'
|
162
|
+
})
|
78
163
|
}
|
79
164
|
}
|
80
|
-
const cropImage = (result) => {
|
81
|
-
let
|
82
|
-
|
83
|
-
img.src = fileDropBox.dataset.src
|
84
|
-
img.onload = () => {
|
165
|
+
const cropImage = (result, id) => {
|
166
|
+
let image = new Image()
|
167
|
+
image.onload = () => {
|
85
168
|
let img = document.createElement('img')
|
86
|
-
img.id = 'image'
|
87
169
|
img.src = result
|
88
|
-
|
89
|
-
let cropHeight = null
|
170
|
+
img.id = 'image'
|
90
171
|
document.querySelector('.crop-image-modal-body').appendChild(img)
|
91
172
|
cropper = new Cropper(img, {
|
173
|
+
viewMode: 3,
|
92
174
|
ready() {
|
93
|
-
|
94
|
-
|
95
|
-
)
|
175
|
+
console.log(id)
|
176
|
+
let find = featureData.elements.find((i) => i.id === id)
|
177
|
+
console.log(find)
|
178
|
+
cropper.setAspectRatio(Number(find.width) / Number(find.height))
|
96
179
|
cropModal.style.display = 'flex'
|
97
180
|
this.cropper.crop()
|
98
|
-
document.querySelector('#crop').addEventListener('click', () => {
|
99
|
-
let cropperImg = cropper
|
100
|
-
.getCroppedCanvas({
|
101
|
-
width: cropWidth,
|
102
|
-
height: cropHeight,
|
103
|
-
})
|
104
|
-
.toDataURL()
|
105
|
-
image = new Image()
|
106
|
-
image.onload = () => {
|
107
|
-
drawImage()
|
108
|
-
}
|
109
|
-
image.src = cropperImg
|
110
|
-
})
|
111
181
|
},
|
112
182
|
crop(event) {
|
113
183
|
cropWidth = Math.round(event.detail.width)
|
114
184
|
cropHeight = Math.round(event.detail.height)
|
115
185
|
},
|
116
186
|
})
|
117
|
-
stopLoading()
|
118
187
|
}
|
188
|
+
image.src = result
|
119
189
|
}
|
190
|
+
const updateCropper = (result, id) => {
|
191
|
+
cropper.destroy()
|
192
|
+
document.querySelector('.crop-image-modal-body').innerHTML = ''
|
193
|
+
cropImage(result, id)
|
194
|
+
}
|
195
|
+
document.querySelector('#crop').addEventListener('click', () => {
|
196
|
+
let cropperImg = cropper
|
197
|
+
.getCroppedCanvas({
|
198
|
+
width: cropWidth,
|
199
|
+
height: cropHeight,
|
200
|
+
})
|
201
|
+
.toDataURL()
|
202
|
+
files[index - 1] = cropperImg
|
203
|
+
cropModal.style.display = 'none'
|
204
|
+
})
|
120
205
|
let inputFile = ''
|
121
206
|
const handleFile = (file) => {
|
122
207
|
cropModal.style.display = 'flex'
|
@@ -154,18 +239,13 @@ download.addEventListener('click', () => {
|
|
154
239
|
window.location.href = `/${lang}/download?tool=${pageTool}`
|
155
240
|
}
|
156
241
|
})
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
dropDown.style.display = 'block'
|
168
|
-
icon.classList.remove('fa-angle-down')
|
169
|
-
icon.classList.add('fa-angle-up')
|
170
|
-
}
|
171
|
-
})
|
242
|
+
|
243
|
+
//
|
244
|
+
// fonts
|
245
|
+
// font rotation
|
246
|
+
// font position
|
247
|
+
// font transform
|
248
|
+
|
249
|
+
//images
|
250
|
+
//image rotation
|
251
|
+
// image rectangle with text
|
@@ -0,0 +1,56 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "together_forever",
|
4
|
+
"effectImagePath": "/assets/images/together_forever.png",
|
5
|
+
"elements": [
|
6
|
+
{
|
7
|
+
"type": "image",
|
8
|
+
"filter": "",
|
9
|
+
"perspective": "",
|
10
|
+
"height": 300,
|
11
|
+
"width": 300,
|
12
|
+
"x": 200,
|
13
|
+
"y": 200,
|
14
|
+
"id": "file-1"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"label": "",
|
18
|
+
"id": "text-1",
|
19
|
+
"type": "text",
|
20
|
+
"x": "100",
|
21
|
+
"rotate": 0,
|
22
|
+
"y": "100",
|
23
|
+
"color": "red",
|
24
|
+
"fontFamily": "Calligraphy",
|
25
|
+
"fontPath": "/assets/fonts/Calligraphy.ttf",
|
26
|
+
"fontWeight": "bold",
|
27
|
+
"fontSize": 50
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"type": "image",
|
31
|
+
"imagePath": "",
|
32
|
+
"filter": "grayscale(100%)",
|
33
|
+
"perspective": "",
|
34
|
+
"rotate": 40,
|
35
|
+
"height": 300,
|
36
|
+
"width": 300,
|
37
|
+
"x": 100,
|
38
|
+
"y": 200,
|
39
|
+
"id": "file-3"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"label": "",
|
43
|
+
"id": "text-2",
|
44
|
+
"type": "text",
|
45
|
+
"x": "200",
|
46
|
+
"y": "200",
|
47
|
+
"rotate": 40,
|
48
|
+
"color": "red",
|
49
|
+
"fontFamily": "Calligraphy",
|
50
|
+
"fontPath": "/assets/fonts/Calligraphy.ttf",
|
51
|
+
"fontWeight": "bold",
|
52
|
+
"fontSize": 50
|
53
|
+
}
|
54
|
+
]
|
55
|
+
}
|
56
|
+
]
|
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.
|
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-
|
11
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -2376,6 +2376,7 @@ files:
|
|
2376
2376
|
- _data/home/hi/hi.json
|
2377
2377
|
- _data/languagesupport/compress-pdf-langs.json
|
2378
2378
|
- _data/languagesupport/index-langs.json
|
2379
|
+
- _data/photo-categories.json
|
2379
2380
|
- _data/privacy/en/privacyPolicy.json
|
2380
2381
|
- _data/rating/rating.json
|
2381
2382
|
- _data/termAndCondition/en/termAndCondition.json
|
@@ -2564,6 +2565,7 @@ files:
|
|
2564
2565
|
- assets/fileimg/wcqHWtb.jpeg
|
2565
2566
|
- assets/fileimg/xbfyrdU.jpeg
|
2566
2567
|
- assets/fileimg/xeDZX8x.jpeg
|
2568
|
+
- assets/fonts/Calligraphy.ttf
|
2567
2569
|
- assets/guaranty.svg
|
2568
2570
|
- assets/images/Ankita.webp
|
2569
2571
|
- assets/images/Anushka.webp
|
@@ -2584,6 +2586,7 @@ files:
|
|
2584
2586
|
- assets/images/safevideoconverter.svg
|
2585
2587
|
- assets/images/siddhika.jpeg
|
2586
2588
|
- assets/images/sona.jpeg
|
2589
|
+
- assets/images/together_forever.png
|
2587
2590
|
- assets/images/udit.jpeg
|
2588
2591
|
- assets/images/udit.jpg
|
2589
2592
|
- assets/images/udit.png
|
@@ -2599,6 +2602,7 @@ files:
|
|
2599
2602
|
- assets/js/homeResult.js
|
2600
2603
|
- assets/js/manifest.json
|
2601
2604
|
- assets/js/multiselect.js
|
2605
|
+
- assets/js/photo-effects.json
|
2602
2606
|
- assets/js/redirectResult.js
|
2603
2607
|
- assets/js/theme.js
|
2604
2608
|
- assets/linkdin.svg
|