appscms-tools-theme 5.1.0 → 5.1.1

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: e9873210ca71d0712ce2ce36640ac409e25eab927e560ddd42a056da45d69a72
4
- data.tar.gz: 36a20adf4282c20753d56640033073d0e4a5fe2071fed18e8da84fd771236b28
3
+ metadata.gz: c389f6235f535079eb7afd16c8476ea2fca847f79cc38c4431a4ce3d622c99c7
4
+ data.tar.gz: ee9c46a3fbcc60369f443a11771ace1ea87ba328d13c4d3ada16b91d248133ce
5
5
  SHA512:
6
- metadata.gz: 378a7ef8db27a52c2e92a9dadcbbe818352ca7dffe4bb18bd82efede2084a96768d782fb24e57a938de73c52f36c798ddd56166026efa897722668ff3a0eb226
7
- data.tar.gz: c9bc54601255293d084b41b3f28dec009769df67a0d5f91940cad5288e74ea6d893ea31b827e95b69e92cad14a658657998706775cc5eee912b27454ce811ac6
6
+ metadata.gz: 97aaf78c90775a8db29ae57a75dbba3cbaf5331307a590d45476a112ca9239226095ce03429d4a20c2cf20a9e46abc60f4c341b95662668b7d3151c41eef42bf
7
+ data.tar.gz: 20c7d3522d57fc5b44521ed01293eacc59a4cc53aab06d1a16c7112df98ebb5380c4c3c921e2824f287e8f272cb9d3dfba03e65e9dc716f8180c5a9497e98210
data/_includes/.DS_Store CHANGED
Binary file
Binary file
@@ -13,7 +13,13 @@ site.data.rating.rating.tools -%} {%- for item in data -%} {%- if item.name
13
13
  src="/assets/images/rating.png"
14
14
  alt="rating-img"
15
15
  />
16
- <div class="rating-text">Rate this tool</div>
16
+
17
+ <div class="rating-header">
18
+ <h2 class="rating-text">Rate this tool</h2>
19
+ <p class="rating-description">
20
+ Your feedback helps us improve our services
21
+ </p>
22
+ </div>
17
23
  <div class="rating-stars">
18
24
  <svg
19
25
  class="rating-star"
@@ -76,25 +82,99 @@ site.data.rating.rating.tools -%} {%- for item in data -%} {%- if item.name
76
82
  />
77
83
  </svg>
78
84
  <!-- <i class="bi bi-star-fill rating-star"></i>
79
- <i class="bi bi-star-fill rating-star"></i>
80
- <i class="bi bi-star-fill rating-star"></i>
81
- <i class="bi bi-star-fill rating-star"></i>
82
- <i class="bi bi-star-fill rating-star"></i> -->
85
+ <i class="bi bi-star-fill rating-star"></i>
86
+ <i class="bi bi-star-fill rating-star"></i>
87
+ <i class="bi bi-star-fill rating-star"></i>
88
+ <i class="bi bi-star-fill rating-star"></i> -->
83
89
  </div>
90
+
84
91
  <div class="rating-value ml-2">
85
92
  <span class="rating">
86
93
  <strong id="rating">{{rating}}</strong><span>/5</span>
87
94
  </span>
88
95
  &nbsp; <span class="total-ratings" id="count">{{votes}} </span> votes
89
96
  </div>
97
+ <button class="feedback-btn" id="openFeedbackBtn">
98
+ Share your feedback
99
+ </button>
90
100
  </div>
91
101
  </div>
92
102
  </div>
103
+
104
+ <div class="modal-overlay" style="display: none">
105
+ <div class="feedbackModal" class="modal" style="display: none">
106
+ <div class="modal-header">
107
+ <h3 class="modal-title">Share Your Feedback</h3>
108
+ <button class="close-button">&times;</button>
109
+ </div>
110
+ <div class="modal-body">
111
+ <form
112
+ id="feedbackForm"
113
+ action="https://script.google.com/macros/s/AKfycbzH82MA88NILpSjARmlwTKTwIYlyYnv44cl-7tLw-Q6_LPuPUTFjZ9z5NmWfSTSPH6z/exec"
114
+ method="POST"
115
+ target="hidden_iframe"
116
+ >
117
+ <div class="form-group">
118
+ <label for="comment" class=".form-label">Your Feedback:</label>
119
+ <textarea
120
+ id="comment"
121
+ name="comment"
122
+ class="form-input"
123
+ rows="4"
124
+ required
125
+ placeholder="Tell us what you liked or how we can improve..."
126
+ ></textarea>
127
+ </div>
128
+ <div class="form-group">
129
+ <label for="email" class=".form-label">Email (optional):</label>
130
+ <input
131
+ type="email"
132
+ id="email"
133
+ name="email"
134
+ placeholder="Your.email@example.com"
135
+ class="form-input"
136
+ />
137
+ </div>
138
+ </form>
139
+
140
+ <!-- Hidden iframe to catch the response -->
141
+ <iframe
142
+ name="hidden_iframe"
143
+ id="hidden_iframe"
144
+ style="display: none"
145
+ class="hidden"
146
+ ></iframe>
147
+ </div>
148
+ <div class="modal-footer">
149
+ <button class="btn btn-secondary">Cancel</button>
150
+ <button class="btn btn-primary">Submit Feedback</button>
151
+ </div>
152
+ </div>
153
+ <div class="thank-you">
154
+ <div class="thank-you-icon">✓</div>
155
+ <h3 class="thank-you-title">Thank You!</h3>
156
+ <p class="thank-you-message">
157
+ We appreciate your feedback and will use it to improve our services.
158
+ </p>
159
+ <button class="btn btn-primary">Close</button>
160
+ </div>
161
+ </div>
93
162
  </div>
94
163
 
95
164
  <script>
96
165
  const ratingValue = document.getElementById("rating");
97
166
  const count = document.getElementById("count");
167
+ const tool = "{{page.tool}}";
168
+ const openBtn = document.getElementById("openFeedbackBtn");
169
+ const modal = document.querySelector(".feedbackModal");
170
+ const modalOverlay = document.querySelector(".modal-overlay");
171
+ const cancelButton = document.querySelector(".btn-secondary");
172
+ const submitButton = document.querySelector(".btn-primary");
173
+ const closeButton = document.querySelector(".close-button");
174
+ const thankYouMsg = document.querySelector(".thank-you");
175
+ const form = document.getElementById("feedbackForm");
176
+ const iframe = document.getElementById("hidden_iframe");
177
+
98
178
  const setRating = async (rating) => {
99
179
  const name = "{{site.name}}";
100
180
  const tool = "{{page.tool}}";
@@ -120,7 +200,13 @@ site.data.rating.rating.tools -%} {%- for item in data -%} {%- if item.name
120
200
  console.error("Error:", error);
121
201
  });
122
202
  };
123
- const tool = "{{page.tool}}";
203
+ closeButton.addEventListener("click", () => {
204
+ modalOverlay.style.display = "none";
205
+ });
206
+
207
+ cancelButton.addEventListener("click", () => {
208
+ modalOverlay.style.display = "none";
209
+ });
124
210
  const fetchRating = async () => {
125
211
  const data = await fetch(
126
212
  `https://ratingapi-main.netlify.app/.netlify/functions/api/v1/${tool}/rating`
@@ -150,28 +236,114 @@ site.data.rating.rating.tools -%} {%- for item in data -%} {%- if item.name
150
236
  Array.from(ratingNode).map((item) =>
151
237
  item.addEventListener("click", () => {
152
238
  const tool = "{{page.tool}}";
153
- if (!localStorage.getItem(`${tool}rating`)) {
154
- function indexInClass(node) {
155
- var className = node.className;
156
- var num = 0;
157
- for (var i = 0; i < ratingNode.length; i++) {
158
- if (ratingNode[i] === node) {
159
- return num;
160
- }
161
- num++;
239
+ function indexInClass(node) {
240
+ var className = node.className;
241
+ var num = 0;
242
+ for (var i = 0; i < ratingNode.length; i++) {
243
+ if (ratingNode[i] === node) {
244
+ return num;
162
245
  }
163
- return -1;
246
+ num++;
164
247
  }
165
- const index = indexInClass(item);
166
- Array.from(ratingNode)
167
- .slice(0, index + 1)
168
- .map((item) => {
169
- item.style.fill = "#FFB21D";
170
- });
171
- setRating(index + 1);
172
- localStorage.setItem(`${tool}rating`, index + 1);
248
+ return -1;
173
249
  }
250
+
251
+ // Reset all stars to gray first
252
+ Array.from(ratingNode).map((star) => {
253
+ star.style.fill = "gray";
254
+ });
255
+
256
+ const index = indexInClass(item);
257
+ // Color the selected stars
258
+ Array.from(ratingNode)
259
+ .slice(0, index + 1)
260
+ .map((star) => {
261
+ star.style.fill = "#FFB21D";
262
+ });
263
+
264
+ setRating(index + 1);
265
+ localStorage.setItem(`${tool}rating`, index + 1);
266
+ modal.style.display = "block";
267
+ modalOverlay.style.display = "flex";
268
+ thankYouMsg.style.display = "none";
269
+ document.getElementById("comment").placeholder = `Tell us why you gave ${
270
+ index + 1
271
+ } stars...`;
174
272
  })
175
273
  );
274
+
275
+ openBtn.addEventListener("click", () => {
276
+ modal.style.display = "block";
277
+ modalOverlay.style.display = "flex";
278
+ thankYouMsg.style.display = "none";
279
+ form.reset();
280
+ });
281
+
282
+ document
283
+ .querySelector(".thank-you .btn-primary")
284
+ .addEventListener("click", () => {
285
+ modalOverlay.style.display = "none";
286
+ });
287
+
288
+ window.addEventListener("click", (event) => {
289
+ if (event.target === modal) {
290
+ modal.style.display = "none";
291
+ }
292
+ });
293
+
294
+ // Set up iframe onload handler
295
+ iframe.onload = function () {
296
+ // This function runs when the form submission completes
297
+ if (form.classList.contains("submitted")) {
298
+ // Reset the form
299
+ form.reset();
300
+ // Hide modal and show thank you message
301
+ modal.style.display = "none";
302
+ thankYouMsg.style.display = "block";
303
+ form.classList.remove("submitted");
304
+ }
305
+ };
306
+
307
+ // Handle submit button click
308
+ submitButton.addEventListener("click", function () {
309
+ // Mark the form as submitted
310
+ form.classList.add("submitted");
311
+
312
+ // Get the current domain, URL and rating
313
+ const domain = window.location.hostname;
314
+ const url = window.location.href;
315
+ const rating = localStorage.getItem(`${tool}rating`) || "0";
316
+
317
+ // Create or update hidden fields
318
+ createHiddenElement("domain", "domain").value = domain;
319
+ createHiddenElement("url", "url").value = url;
320
+ createHiddenElement("user-rating", "rating").value = rating;
321
+
322
+ // Disable the submit button
323
+ submitButton.disabled = true;
324
+ submitButton.textContent = "Submitting...";
325
+
326
+ // Submit the form
327
+ form.submit();
328
+
329
+ // Enable the button after 5 seconds (in case of errors)
330
+ setTimeout(function () {
331
+ submitButton.disabled = false;
332
+ submitButton.textContent = "Submit Feedback";
333
+ }, 5000);
334
+ });
335
+
336
+ // Helper function to create hidden form elements
337
+ function createHiddenElement(elementId, elementName) {
338
+ let field = document.getElementById(elementId);
339
+ if (!field) {
340
+ field = document.createElement("input");
341
+ field.type = "hidden";
342
+ field.name = elementName;
343
+ field.id = elementId;
344
+ form.appendChild(field);
345
+ }
346
+ return field;
347
+ }
176
348
  </script>
177
349
  {%- endif -%}
@@ -151,6 +151,5 @@ if page.layout == "appscms-feature" -%}
151
151
  {%- endif -%} {%- endif -%} {%- if site.authentication -%}
152
152
  <script src="https://www.gstatic.com/firebasejs/9.22.0/firebase-app-compat.js"></script>
153
153
  <script src="https://www.gstatic.com/firebasejs/9.22.0/firebase-auth-compat.js"></script>
154
- <script src="/assets/js/appscms-auth.js"></script>
155
154
  <script src="/assets/js/appscms-login.js"></script>
156
155
  {%- endif -%}
data/assets/.DS_Store CHANGED
Binary file
@@ -650,12 +650,12 @@ body {
650
650
  /* Rating tool css */
651
651
  .rating-tool {
652
652
  display: flex;
653
+ flex-direction: column;
653
654
  justify-content: center;
654
655
  align-items: center;
655
656
  box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
656
657
  background-color: #fcfcfc;
657
658
  border-radius: 50px;
658
- height: 70px;
659
659
  margin: 40px 0;
660
660
  }
661
661
 
@@ -671,7 +671,7 @@ body {
671
671
  }
672
672
 
673
673
  .rating-tool .rating-text {
674
- font-size: 16px;
674
+ font-size: 22px;
675
675
  font-weight: 700;
676
676
  color: rgb(33, 33, 33);
677
677
  padding: 6px;
@@ -2953,7 +2953,7 @@ select:focus {
2953
2953
  font-size: 14px;
2954
2954
  padding: 0px 0px 0px 25px;
2955
2955
  }
2956
- <style > .side-modal-overlay {
2956
+ .side-modal-overlay {
2957
2957
  position: fixed;
2958
2958
  top: 0;
2959
2959
  left: 0;
@@ -3457,3 +3457,267 @@ a:hover {
3457
3457
  .auth-container a {
3458
3458
  justify-content: center;
3459
3459
  }
3460
+ .review {
3461
+ width: 300px; /* Set each review card width to match the `.reviews` container */
3462
+ flex-shrink: 0;
3463
+ }
3464
+
3465
+ .feedback-btn {
3466
+ background-color: #4361ee;
3467
+ color: white;
3468
+ border: none;
3469
+ padding: 12px 32px;
3470
+ border-radius: 8px;
3471
+ font-size: 16px;
3472
+ font-weight: 500;
3473
+ cursor: pointer;
3474
+ transition: all 0.2s ease;
3475
+ margin-bottom: 12px;
3476
+ margin-top: 10px;
3477
+ }
3478
+
3479
+ .modal {
3480
+ display: none;
3481
+ position: fixed;
3482
+ z-index: 1;
3483
+ left: 0;
3484
+ top: 0;
3485
+ width: 100%;
3486
+ height: 100%;
3487
+ background-color: rgba(0, 0, 0, 0.5);
3488
+ }
3489
+
3490
+ .modal-body {
3491
+ padding: 25px;
3492
+ }
3493
+
3494
+ @keyframes modalopen {
3495
+ from {
3496
+ opacity: 0;
3497
+ transform: translateY(-60px);
3498
+ }
3499
+ to {
3500
+ opacity: 1;
3501
+ transform: translateY(0);
3502
+ }
3503
+ }
3504
+
3505
+ .close {
3506
+ color: #aaa;
3507
+ float: right;
3508
+ font-size: 28px;
3509
+ font-weight: bold;
3510
+ cursor: pointer;
3511
+ }
3512
+
3513
+ .close:hover {
3514
+ color: black;
3515
+ }
3516
+
3517
+ h2 {
3518
+ margin-top: 0;
3519
+ color: #333;
3520
+ }
3521
+
3522
+ .form-group {
3523
+ margin-botton: 15px;
3524
+ }
3525
+
3526
+ label {
3527
+ display: block;
3528
+ margin-bottom: 5px;
3529
+ font-weight: bold;
3530
+ }
3531
+
3532
+ textarea,
3533
+ input {
3534
+ width: 100%;
3535
+ padding: 10px;
3536
+ border: 1px solid #ddd;
3537
+ border-radius: 4px;
3538
+ box-sizing: border-box;
3539
+ }
3540
+
3541
+ textarea {
3542
+ height: 120px;
3543
+ resize: vertical;
3544
+ }
3545
+ .submit-btn {
3546
+ background-color: #4caf50;
3547
+ color: white;
3548
+ padding: 10px 20px;
3549
+ border: none;
3550
+ border-radius: 4px;
3551
+ cursor: pointer;
3552
+ font-size: 16px;
3553
+ }
3554
+
3555
+ .rating-header {
3556
+ margin-top: 10px;
3557
+ }
3558
+
3559
+ .feedbackModal {
3560
+ background-color: var(--white);
3561
+ border-radius: 12px;
3562
+ box-shadow: var(--shadow-feedback);
3563
+ width: 100%;
3564
+ max-width: 500px;
3565
+ overflow: hidden;
3566
+ animation: slideIn 0.3s ease-out;
3567
+ }
3568
+
3569
+ .modal-overlay {
3570
+ position: fixed;
3571
+ top: 0;
3572
+ left: 0;
3573
+ right: 0;
3574
+ bottom: 0;
3575
+ background-color: rgba(0, 0, 0, 0.5);
3576
+ display: flex;
3577
+ align-items: center;
3578
+ justify-content: center;
3579
+ z-index: 1000;
3580
+ backdrop-filter: blur(5px);
3581
+ animation: fadeIn 0.3s ease-out;
3582
+ }
3583
+
3584
+ .close {
3585
+ position: absolute;
3586
+ top: 10px;
3587
+ right: 15px;
3588
+ font-size: 24px;
3589
+ font-weight: bold;
3590
+ cursor: pointer;
3591
+ }
3592
+
3593
+ .form-group {
3594
+ margin-bottom: 15px;
3595
+ }
3596
+
3597
+ .form-group label {
3598
+ display: block;
3599
+ margin-bottom: 5px;
3600
+ font-weight: bold;
3601
+ }
3602
+
3603
+ .form-control {
3604
+ width: 100%;
3605
+ padding: 8px;
3606
+ border: 1px solid #ccc;
3607
+ border-radius: 4px;
3608
+ box-sizing: border-box;
3609
+ }
3610
+
3611
+ .btn-primary {
3612
+ background-color: #007bff;
3613
+ color: #fff;
3614
+ border: none;
3615
+ padding: 8px 16px;
3616
+ border-radius: 4px;
3617
+ cursor: pointer;
3618
+ }
3619
+
3620
+ .close-button {
3621
+ background: none;
3622
+ border: none;
3623
+ font-size: 22px;
3624
+ color: var(--text-light);
3625
+ cursor: pointer;
3626
+ padding: 0;
3627
+ display: flex;
3628
+ align-items: center;
3629
+ justify-content: center;
3630
+ width: 32px;
3631
+ height: 32px;
3632
+ border-radius: 50%;
3633
+ transition: all 0.2s;
3634
+ }
3635
+
3636
+ .close-button:hover {
3637
+ background-color: var(--gray-200);
3638
+ color: var(--text);
3639
+ }
3640
+
3641
+ .thank-you {
3642
+ text-align: center;
3643
+ }
3644
+
3645
+ .form-group {
3646
+ margin-bottom: 20px;
3647
+ }
3648
+
3649
+ .modal-footer {
3650
+ padding: 15px 25px 20px;
3651
+ text-align: right;
3652
+ }
3653
+
3654
+ .form-label {
3655
+ display: block;
3656
+ margin-bottom: 8px;
3657
+ font-weight: 500;
3658
+ color: #2d3748;
3659
+ }
3660
+
3661
+ .form-input {
3662
+ width: 100%;
3663
+ padding: 12px 15px;
3664
+ border: 1px solid #e2e8f0;
3665
+ border-radius: 8px;
3666
+ font-size: 15px;
3667
+ color: #2d3748;
3668
+ transition: all 0.2s;
3669
+ box-sizing: border-box;
3670
+ }
3671
+
3672
+ .form-input:focus {
3673
+ outline: none;
3674
+ border-color: #4353ff;
3675
+ box-shadow: 0 0 0 3px rgba(67, 83, 255, 0.2);
3676
+ }
3677
+
3678
+ .modal-title {
3679
+ font-size: 18px;
3680
+ font-weight: 600;
3681
+ margin: 0;
3682
+ color: var(--text);
3683
+ }
3684
+
3685
+ .modal-header {
3686
+ padding: 20px 25px;
3687
+ border-bottom: 1px solid var(--gray-200);
3688
+ display: flex;
3689
+ justify-content: space-between;
3690
+ align-items: center;
3691
+ }
3692
+
3693
+ /* Thank you message */
3694
+ .thank-you {
3695
+ text-align: center;
3696
+ padding: 30px 20px;
3697
+ background-color: #fff;
3698
+ border-radius: 22px;
3699
+ }
3700
+
3701
+ .thank-you-icon {
3702
+ width: 60px;
3703
+ height: 60px;
3704
+ background-color: #48bb78;
3705
+ color: white;
3706
+ border-radius: 50%;
3707
+ display: flex;
3708
+ align-items: center;
3709
+ justify-content: center;
3710
+ margin: 0 auto 20px;
3711
+ font-size: 30px;
3712
+ }
3713
+
3714
+ .thank-you-title {
3715
+ font-weight: 600;
3716
+ font-size: 20px;
3717
+ margin-bottom: 10px;
3718
+ }
3719
+
3720
+ .thank-you-message {
3721
+ color: var(--text-light);
3722
+ margin-bottom: 25px;
3723
+ }