yasirme commited on
Commit
114d59d
·
verified ·
1 Parent(s): df84dbc

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +173 -7
index.html CHANGED
@@ -1,4 +1,3 @@
1
-
2
  <!doctype html>
3
  <html lang="en">
4
  <head>
@@ -46,8 +45,7 @@
46
  })(document);
47
  smartlook('init', 'aa9463be7bcf3461cd111de8ed0dc6ede653881c', { region: 'eu' });
48
  </script>
49
- <!-- Google tag (gtag.js) -->
50
- <script async src="https://www.googletagmanager.com/gtag/js?id=G-3KV5X49N3B"></script>
51
  <script>
52
  window.dataLayer = window.dataLayer || [];
53
  function gtag(){dataLayer.push(arguments);}
@@ -219,16 +217,87 @@
219
  .muted { color:#9b9b9b; font-size:13px; }
220
  .row { display:flex; gap:10px; align-items:center; }
221
  .note { font-size:13px; color:#cfcfcf; margin-top:6px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  </style>
223
  </head>
224
  <body>
225
 
226
  <div class="topbar" role="banner">
227
  <div class="btn-small" onclick="window.open('https://discord.gg/QjyD579HSn') ">Discord</div>
228
- <div class="btn-small" onclick="window.open('https://www.instagram.com/yasir.me2008/')" style="cursor: pointer;">
229
- <img src="https://upload.wikimedia.org/wikipedia/commons/a/a5/Instagram_icon.png" alt="Instagram" style="width: 20px; height: 20px;">Instagram
230
- </div>
231
-
232
 
233
  <a class="btn-small" href="https://buymeacoffee.com/xyaiman" target="_blank" rel="noopener">
234
  <img src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg" alt="coffee">
@@ -314,11 +383,33 @@
314
  </div>
315
  </div>
316
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
 
318
  <script>
319
  const baseUrl = 'https://image.pollinations.ai';
320
  let selectedStyle = null;
321
  let isGenerating = false;
 
 
 
 
 
 
322
  const styleTemplates = {
323
  cinema: " Shot in native IMAX 65mm and ARRI ALEXA LF with anamorphic lenses, color graded in HDR10/Dolby Vision, mastered in 4K DCI, utilizing dynamic lighting, practical effects, deep depth of field, authentic set design, golden hour cinematography, and multi-cam Steadicam, drone, and gimbal setups for immersive wide-to-intimate shots",
324
  realistic: " real life intricate footage scene captured photo",
@@ -561,6 +652,72 @@ GOAL: Generate prompts that produce realistic, natural-looking images by exploit
561
  const imagesContainer = document.getElementById('images');
562
  const generateBtn = document.getElementById('generateBtn');
563
  function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564
  async function generateImage() {
565
  if (isGenerating) return;
566
  const rawPrompt = promptEl.value.trim();
@@ -620,6 +777,15 @@ GOAL: Generate prompts that produce realistic, natural-looking images by exploit
620
  const blob = await res.blob();
621
  const imgUrl = URL.createObjectURL(blob);
622
  card.innerHTML = `<img src="${imgUrl}" alt="generated image">`;
 
 
 
 
 
 
 
 
 
623
  } catch (err) {
624
  console.error(err);
625
  card.innerHTML = `<div class="muted" style="color:#ff6b6b;">Error generating image</div>`;
 
 
1
  <!doctype html>
2
  <html lang="en">
3
  <head>
 
45
  })(document);
46
  smartlook('init', 'aa9463be7bcf3461cd111de8ed0dc6ede653881c', { region: 'eu' });
47
  </script>
48
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-3KV5X49N3B"></script>
 
49
  <script>
50
  window.dataLayer = window.dataLayer || [];
51
  function gtag(){dataLayer.push(arguments);}
 
217
  .muted { color:#9b9b9b; font-size:13px; }
218
  .row { display:flex; gap:10px; align-items:center; }
219
  .note { font-size:13px; color:#cfcfcf; margin-top:6px; }
220
+
221
+ /* New styles for feedback popup */
222
+ #feedbackPopup {
223
+ position: fixed;
224
+ right: -300px;
225
+ top: 50%;
226
+ transform: translateY(-50%);
227
+ width: 280px;
228
+ padding: 20px;
229
+ background: #0f0f0f;
230
+ border-radius: 12px;
231
+ box-shadow: 0 8px 30px rgba(0,0,0,0.4);
232
+ border: 1px solid rgba(255,255,255,0.05);
233
+ z-index: 1500;
234
+ transition: right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
235
+ }
236
+ #feedbackPopup.show {
237
+ right: 20px;
238
+ }
239
+ #feedbackPopup h3 {
240
+ margin: 0 0 10px 0;
241
+ font-size: 18px;
242
+ }
243
+ #feedbackPopup p {
244
+ font-size: 14px;
245
+ color: #b0b0b0;
246
+ margin: 0 0 15px 0;
247
+ }
248
+ .rating-stars {
249
+ display: flex;
250
+ gap: 8px;
251
+ margin-bottom: 15px;
252
+ }
253
+ .rating-stars .fa-star {
254
+ font-size: 24px;
255
+ color: #333;
256
+ cursor: pointer;
257
+ transition: color 0.2s;
258
+ }
259
+ .rating-stars .fa-star.filled {
260
+ color: #ffc107;
261
+ }
262
+ #feedbackMessage {
263
+ width: 100%;
264
+ height: 80px;
265
+ background: #0c0c0c;
266
+ border: 1px solid rgba(255,255,255,0.04);
267
+ color: #fff;
268
+ padding: 10px;
269
+ border-radius: 8px;
270
+ resize: vertical;
271
+ font-family: 'Poppins', sans-serif;
272
+ font-size: 14px;
273
+ outline: none;
274
+ }
275
+ #feedbackActions {
276
+ display: flex;
277
+ justify-content: flex-end;
278
+ gap: 10px;
279
+ margin-top: 15px;
280
+ }
281
+ #feedbackActions button {
282
+ background: #1a1a1a;
283
+ border-radius: 8px;
284
+ padding: 8px 14px;
285
+ font-size: 14px;
286
+ color: #fff;
287
+ border: 1px solid rgba(255,255,255,0.03);
288
+ cursor: pointer;
289
+ }
290
+ #feedbackActions #submitFeedbackBtn {
291
+ background: linear-gradient(90deg,#ff93e9,#9b7cff);
292
+ border: none;
293
+ }
294
  </style>
295
  </head>
296
  <body>
297
 
298
  <div class="topbar" role="banner">
299
  <div class="btn-small" onclick="window.open('https://discord.gg/QjyD579HSn') ">Discord</div>
300
+
 
 
 
301
 
302
  <a class="btn-small" href="https://buymeacoffee.com/xyaiman" target="_blank" rel="noopener">
303
  <img src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg" alt="coffee">
 
383
  </div>
384
  </div>
385
  </div>
386
+
387
+ <div id="feedbackPopup" class="popup">
388
+ <h3 style="color:#ff93e9;">Rate XimgGen</h3>
389
+ <p>How would you rate the quality of the generated images?</p>
390
+ <div class="rating-stars" id="ratingStars">
391
+ <i class="fa-solid fa-star" data-rating="1"></i>
392
+ <i class="fa-solid fa-star" data-rating="2"></i>
393
+ <i class="fa-solid fa-star" data-rating="3"></i>
394
+ <i class="fa-solid fa-star" data-rating="4"></i>
395
+ <i class="fa-solid fa-star" data-rating="5"></i>
396
+ </div>
397
+ <textarea id="feedbackMessage" placeholder="Optional message..."></textarea>
398
+ <div id="feedbackActions">
399
+ <button id="submitFeedbackBtn">Submit</button>
400
+ </div>
401
+ </div>
402
 
403
  <script>
404
  const baseUrl = 'https://image.pollinations.ai';
405
  let selectedStyle = null;
406
  let isGenerating = false;
407
+ let generationCount = 0;
408
+ let selectedRating = 0;
409
+ let feedbackSubmitted = false;
410
+
411
+ const FORM_SPREE_ENDPOINT = 'https://formspree.io/f/xgvzqeed';
412
+
413
  const styleTemplates = {
414
  cinema: " Shot in native IMAX 65mm and ARRI ALEXA LF with anamorphic lenses, color graded in HDR10/Dolby Vision, mastered in 4K DCI, utilizing dynamic lighting, practical effects, deep depth of field, authentic set design, golden hour cinematography, and multi-cam Steadicam, drone, and gimbal setups for immersive wide-to-intimate shots",
415
  realistic: " real life intricate footage scene captured photo",
 
652
  const imagesContainer = document.getElementById('images');
653
  const generateBtn = document.getElementById('generateBtn');
654
  function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }
655
+
656
+ // New functions for feedback popup
657
+ const feedbackPopup = document.getElementById('feedbackPopup');
658
+ const ratingStars = document.getElementById('ratingStars');
659
+ const feedbackMessage = document.getElementById('feedbackMessage');
660
+
661
+ function showFeedbackPopup() {
662
+ feedbackPopup.classList.add('show');
663
+ }
664
+
665
+ function resetRating() {
666
+ selectedRating = 0;
667
+ document.querySelectorAll('.rating-stars .fa-star').forEach(star => {
668
+ star.classList.remove('filled');
669
+ });
670
+ }
671
+
672
+ async function submitFeedback() {
673
+ if (selectedRating === 0) {
674
+ alert("Please select a rating from 1 to 5.");
675
+ return;
676
+ }
677
+
678
+ const formData = {
679
+ rating: selectedRating,
680
+ message: feedbackMessage.value.trim() || 'No message provided.'
681
+ };
682
+
683
+ try {
684
+ await fetch(FORM_SPREE_ENDPOINT, {
685
+ method: 'POST',
686
+ headers: {
687
+ 'Content-Type': 'application/json',
688
+ 'Accept': 'application/json'
689
+ },
690
+ body: JSON.stringify(formData)
691
+ });
692
+
693
+ alert('Thank you for your feedback!');
694
+ feedbackPopup.classList.remove('show');
695
+ feedbackSubmitted = true;
696
+ feedbackMessage.value = '';
697
+ resetRating();
698
+
699
+ } catch (error) {
700
+ console.error('Error submitting feedback:', error);
701
+ alert('Failed to submit feedback. Please try again later.');
702
+ }
703
+ }
704
+
705
+ ratingStars.addEventListener('click', (e) => {
706
+ const clickedStar = e.target.closest('.fa-star');
707
+ if (clickedStar) {
708
+ selectedRating = parseInt(clickedStar.dataset.rating, 10);
709
+ document.querySelectorAll('.rating-stars .fa-star').forEach(star => {
710
+ if (parseInt(star.dataset.rating, 10) <= selectedRating) {
711
+ star.classList.add('filled');
712
+ } else {
713
+ star.classList.remove('filled');
714
+ }
715
+ });
716
+ }
717
+ });
718
+
719
+ document.getElementById('submitFeedbackBtn').addEventListener('click', submitFeedback);
720
+
721
  async function generateImage() {
722
  if (isGenerating) return;
723
  const rawPrompt = promptEl.value.trim();
 
777
  const blob = await res.blob();
778
  const imgUrl = URL.createObjectURL(blob);
779
  card.innerHTML = `<img src="${imgUrl}" alt="generated image">`;
780
+
781
+ // Increment generation count and show popup if threshold is met
782
+ if (!feedbackSubmitted) {
783
+ generationCount++;
784
+ if (generationCount >= 3) {
785
+ showFeedbackPopup();
786
+ }
787
+ }
788
+
789
  } catch (err) {
790
  console.error(err);
791
  card.innerHTML = `<div class="muted" style="color:#ff6b6b;">Error generating image</div>`;