yeiayel commited on
Commit
5bcbb30
·
verified ·
1 Parent(s): 08cbe4b

Add 1 files

Browse files
Files changed (1) hide show
  1. index.html +221 -53
index.html CHANGED
@@ -6,6 +6,8 @@
6
  <title>SEO AutoBlog AI - Create SEO-Optimized Content in Minutes</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
 
 
9
  <style>
10
  .gradient-bg {
11
  background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
@@ -43,6 +45,29 @@
43
  .sidebar-open {
44
  transform: translateX(0);
45
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  </style>
47
  </head>
48
  <body class="bg-gray-50 font-sans">
@@ -285,7 +310,7 @@
285
  <span>Generate Titles & Outline</span>
286
  <i class="fas fa-arrow-right"></i>
287
  </button>
288
- </div>
289
  </div>
290
  </div>
291
  </div>
@@ -301,7 +326,7 @@
301
  <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
302
  <div class="flex items-start">
303
  <div class="mr-3 mt-1">
304
- <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500">
305
  </div>
306
  <div>
307
  <h3 class="font-medium text-gray-800">The Ultimate Guide to Starting a Blog in 2024: Step-by-Step for Beginners</h3>
@@ -312,7 +337,7 @@
312
  <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
313
  <div class="flex items-start">
314
  <div class="mr-3 mt-1">
315
- <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500">
316
  </div>
317
  <div>
318
  <h3 class="font-medium text-gray-800">How to Start a Successful Blog: A Complete Beginner's Guide</h3>
@@ -323,7 +348,7 @@
323
  <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
324
  <div class="flex items-start">
325
  <div class="mr-3 mt-1">
326
- <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500">
327
  </div>
328
  <div>
329
  <h3 class="font-medium text-gray-800">Blogging 101: Everything You Need to Know to Start Your First Blog</h3>
@@ -334,7 +359,7 @@
334
  <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
335
  <div class="flex items-start">
336
  <div class="mr-3 mt-1">
337
- <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500">
338
  </div>
339
  <div>
340
  <h3 class="font-medium text-gray-800">From Idea to Launch: The Step-by-Step Process to Start a Blog That Grows</h3>
@@ -426,18 +451,30 @@
426
  <div class="flex justify-between items-center mb-6">
427
  <h2 class="text-xl font-bold text-gray-800">Generated Article</h2>
428
  <div class="flex space-x-3">
429
- <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-2 rounded-lg text-sm font-medium flex items-center">
430
- <i class="fas fa-download mr-2"></i>
431
- Export
432
- </button>
433
- <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-2 rounded-lg text-sm font-medium flex items-center">
 
 
 
 
 
 
 
 
434
  <i class="fas fa-edit mr-2"></i>
435
  Edit
436
  </button>
 
 
 
 
437
  </div>
438
  </div>
439
 
440
- <div class="mb-6">
441
  <h1 class="text-3xl font-bold text-gray-900 mb-4">The Ultimate Guide to Starting a Blog in 2024: Step-by-Step for Beginners</h1>
442
  <div class="flex items-center text-sm text-gray-500 space-x-4 mb-6">
443
  <span><i class="fas fa-clock mr-1"></i> 12 min read</span>
@@ -544,17 +581,70 @@
544
  </div>
545
  </div>
546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  <div class="flex justify-between">
548
  <button id="backToStep3" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-medium">
549
  <i class="fas fa-arrow-left mr-2"></i>
550
  Back
551
  </button>
552
  <div class="flex space-x-3">
553
- <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-medium">
554
  <i class="fas fa-redo mr-2"></i>
555
  Regenerate
556
  </button>
557
- <button class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-3 rounded-lg font-medium">
558
  <i class="fas fa-save mr-2"></i>
559
  Save & Publish
560
  </button>
@@ -572,8 +662,8 @@
572
  <div class="w-16 h-16 mx-auto mb-4 rounded-full bg-purple-100 flex items-center justify-center">
573
  <i class="fas fa-spinner fa-spin text-purple-600 text-2xl"></i>
574
  </div>
575
- <h3 class="text-xl font-medium text-gray-800 mb-2">Generating Content</h3>
576
- <p class="text-gray-600 mb-4">Our AI is crafting your perfect article. This may take a minute...</p>
577
  <div class="w-full bg-gray-200 rounded-full h-1.5">
578
  <div id="progressBar" class="bg-purple-600 h-1.5 rounded-full" style="width: 0%"></div>
579
  </div>
@@ -581,6 +671,20 @@
581
  </div>
582
  </div>
583
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
584
  <script>
585
  // DOM Elements
586
  const sidebar = document.getElementById('sidebar');
@@ -597,9 +701,29 @@
597
  const step3 = document.getElementById('step3');
598
  const step4 = document.getElementById('step4');
599
  const loadingModal = document.getElementById('loadingModal');
 
 
600
  const progressBar = document.getElementById('progressBar');
601
  const progressText = document.getElementById('progressText');
 
 
 
602
  const titleOptions = document.querySelectorAll('.title-option');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
603
 
604
  // Toggle sidebar on mobile
605
  sidebarToggle.addEventListener('click', () => {
@@ -612,9 +736,28 @@
612
  sidebar.classList.remove('sidebar-open');
613
  });
614
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  // Navigation between steps
616
  generateKeywordsBtn.addEventListener('click', () => {
617
- showLoadingModal();
 
 
 
 
 
 
618
  setTimeout(() => {
619
  hideLoadingModal();
620
  step1.classList.add('hidden');
@@ -629,7 +772,7 @@
629
  });
630
 
631
  generateTitlesBtn.addEventListener('click', () => {
632
- showLoadingModal();
633
  setTimeout(() => {
634
  hideLoadingModal();
635
  step2.classList.add('hidden');
@@ -644,7 +787,13 @@
644
  });
645
 
646
  generateContentBtn.addEventListener('click', () => {
647
- showLoadingModal();
 
 
 
 
 
 
648
  simulateProgress();
649
  setTimeout(() => {
650
  hideLoadingModal();
@@ -656,6 +805,11 @@
656
  document.querySelectorAll('.flex-1.text-center div')[3].classList.add('bg-purple-600', 'text-white');
657
  document.querySelectorAll('.flex-1.text-center p')[3].classList.remove('text-gray-600');
658
  document.querySelectorAll('.flex-1.text-center p')[3].classList.add('text-purple-600');
 
 
 
 
 
659
  }, 8000);
660
  });
661
 
@@ -720,40 +874,54 @@
720
  });
721
  });
722
 
723
- // Loading modal functions
724
- function showLoadingModal() {
725
- loadingModal.classList.remove('hidden');
726
- progressBar.style.width = '0%';
727
- progressText.textContent = 'Initializing AI models...';
728
- }
729
-
730
- function hideLoadingModal() {
731
- loadingModal.classList.add('hidden');
732
- }
733
 
734
- function simulateProgress() {
735
- let progress = 0;
736
- const interval = setInterval(() => {
737
- progress += 5;
738
- progressBar.style.width = `${progress}%`;
739
-
740
- if (progress <= 20) {
741
- progressText.textContent = 'Analyzing keywords...';
742
- } else if (progress <= 40) {
743
- progressText.textContent = 'Researching topic...';
744
- } else if (progress <= 60) {
745
- progressText.textContent = 'Generating outline...';
746
- } else if (progress <= 80) {
747
- progressText.textContent = 'Writing content...';
748
- } else {
749
- progressText.textContent = 'Finalizing article...';
750
- }
751
 
752
- if (progress >= 100) {
753
- clearInterval(interval);
754
- }
755
- }, 300);
756
- }
757
- </script>
758
- <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=yeiayel/contentforge" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
759
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  <title>SEO AutoBlog AI - Create SEO-Optimized Content in Minutes</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
10
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/mammoth/1.4.0/mammoth.browser.min.js"></script>
11
  <style>
12
  .gradient-bg {
13
  background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
 
45
  .sidebar-open {
46
  transform: translateX(0);
47
  }
48
+ .social-share-btn {
49
+ transition: all 0.3s ease;
50
+ }
51
+ .social-share-btn:hover {
52
+ transform: scale(1.05);
53
+ }
54
+ .copy-btn {
55
+ transition: all 0.2s ease;
56
+ }
57
+ .copy-btn:active {
58
+ transform: scale(0.95);
59
+ }
60
+ .export-dropdown {
61
+ opacity: 0;
62
+ visibility: hidden;
63
+ transform: translateY(10px);
64
+ transition: all 0.2s ease;
65
+ }
66
+ .export-dropdown.show {
67
+ opacity: 1;
68
+ visibility: visible;
69
+ transform: translateY(0);
70
+ }
71
  </style>
72
  </head>
73
  <body class="bg-gray-50 font-sans">
 
310
  <span>Generate Titles & Outline</span>
311
  <i class="fas fa-arrow-right"></i>
312
  </button>
313
+ </div>
314
  </div>
315
  </div>
316
  </div>
 
326
  <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
327
  <div class="flex items-start">
328
  <div class="mr-3 mt-1">
329
+ <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500" value="The Ultimate Guide to Starting a Blog in 2024: Step-by-Step for Beginners">
330
  </div>
331
  <div>
332
  <h3 class="font-medium text-gray-800">The Ultimate Guide to Starting a Blog in 2024: Step-by-Step for Beginners</h3>
 
337
  <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
338
  <div class="flex items-start">
339
  <div class="mr-3 mt-1">
340
+ <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500" value="How to Start a Successful Blog: A Complete Beginner's Guide">
341
  </div>
342
  <div>
343
  <h3 class="font-medium text-gray-800">How to Start a Successful Blog: A Complete Beginner's Guide</h3>
 
348
  <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
349
  <div class="flex items-start">
350
  <div class="mr-3 mt-1">
351
+ <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500" value="Blogging 101: Everything You Need to Know to Start Your First Blog">
352
  </div>
353
  <div>
354
  <h3 class="font-medium text-gray-800">Blogging 101: Everything You Need to Know to Start Your First Blog</h3>
 
359
  <div class="title-option p-4 border-2 border-gray-200 rounded-lg cursor-pointer hover:border-purple-400 transition-all">
360
  <div class="flex items-start">
361
  <div class="mr-3 mt-1">
362
+ <input type="radio" name="titleOption" class="h-4 w-4 text-purple-600 focus:ring-purple-500" value="From Idea to Launch: The Step-by-Step Process to Start a Blog That Grows">
363
  </div>
364
  <div>
365
  <h3 class="font-medium text-gray-800">From Idea to Launch: The Step-by-Step Process to Start a Blog That Grows</h3>
 
451
  <div class="flex justify-between items-center mb-6">
452
  <h2 class="text-xl font-bold text-gray-800">Generated Article</h2>
453
  <div class="flex space-x-3">
454
+ <div class="relative">
455
+ <button id="exportBtn" class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-2 rounded-lg text-sm font-medium flex items-center">
456
+ <i class="fas fa-download mr-2"></i>
457
+ Export
458
+ </button>
459
+ <div id="exportDropdown" class="export-dropdown absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-10 py-1">
460
+ <a href="#" class="export-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-type="pdf"><i class="fas fa-file-pdf mr-2 text-red-500"></i> PDF</a>
461
+ <a href="#" class="export-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-type="docx"><i class="fas fa-file-word mr-2 text-blue-500"></i> Word</a>
462
+ <a href="#" class="export-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-type="txt"><i class="fas fa-file-alt mr-2 text-gray-500"></i> Text</a>
463
+ <a href="#" class="export-option block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-type="md"><i class="fab fa-markdown mr-2 text-purple-500"></i> Markdown</a>
464
+ </div>
465
+ </div>
466
+ <button id="editBtn" class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-2 rounded-lg text-sm font-medium flex items-center">
467
  <i class="fas fa-edit mr-2"></i>
468
  Edit
469
  </button>
470
+ <button id="copyBtn" class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-2 rounded-lg text-sm font-medium flex items-center copy-btn">
471
+ <i class="fas fa-copy mr-2"></i>
472
+ Copy
473
+ </button>
474
  </div>
475
  </div>
476
 
477
+ <div id="articleContent" class="mb-6">
478
  <h1 class="text-3xl font-bold text-gray-900 mb-4">The Ultimate Guide to Starting a Blog in 2024: Step-by-Step for Beginners</h1>
479
  <div class="flex items-center text-sm text-gray-500 space-x-4 mb-6">
480
  <span><i class="fas fa-clock mr-1"></i> 12 min read</span>
 
581
  </div>
582
  </div>
583
 
584
+ <!-- Social Media Sharing -->
585
+ <div class="bg-gray-50 p-6 rounded-lg mb-6">
586
+ <h3 class="text-lg font-medium text-gray-800 mb-4">Share Your Article</h3>
587
+ <p class="text-gray-600 mb-4">Generate social media posts for your article with one click:</p>
588
+
589
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
590
+ <button class="social-share-btn bg-blue-500 hover:bg-blue-600 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="twitter">
591
+ <i class="fab fa-twitter mr-2"></i>
592
+ Generate Twitter Post
593
+ </button>
594
+ <button class="social-share-btn bg-blue-700 hover:bg-blue-800 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="facebook">
595
+ <i class="fab fa-facebook-f mr-2"></i>
596
+ Generate Facebook Post
597
+ </button>
598
+ <button class="social-share-btn bg-pink-600 hover:bg-pink-700 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="instagram">
599
+ <i class="fab fa-instagram mr-2"></i>
600
+ Generate Instagram Post
601
+ </button>
602
+ </div>
603
+
604
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
605
+ <button class="social-share-btn bg-blue-400 hover:bg-blue-500 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="linkedin">
606
+ <i class="fab fa-linkedin-in mr-2"></i>
607
+ Generate LinkedIn Post
608
+ </button>
609
+ <button class="social-share-btn bg-red-500 hover:bg-red-600 text-white px-4 py-3 rounded-lg flex items-center justify-center" data-platform="pinterest">
610
+ <i class="fab fa-pinterest-p mr-2"></i>
611
+ Generate Pinterest Post
612
+ </button>
613
+ </div>
614
+ </div>
615
+
616
+ <!-- Generated Social Media Posts (Hidden Initially) -->
617
+ <div id="socialPostsContainer" class="hidden">
618
+ <div class="bg-white border border-gray-200 rounded-lg p-6 mb-6">
619
+ <div class="flex justify-between items-center mb-4">
620
+ <h3 class="text-lg font-medium text-gray-800" id="socialPlatformName">Twitter Post</h3>
621
+ <div class="flex space-x-2">
622
+ <button class="copy-social-btn bg-gray-100 hover:bg-gray-200 text-gray-800 px-3 py-1 rounded text-sm">
623
+ <i class="fas fa-copy mr-1"></i> Copy
624
+ </button>
625
+ <button class="close-social-btn bg-gray-100 hover:bg-gray-200 text-gray-800 px-3 py-1 rounded text-sm">
626
+ <i class="fas fa-times mr-1"></i> Close
627
+ </button>
628
+ </div>
629
+ </div>
630
+ <div id="socialPostContent" class="bg-gray-50 p-4 rounded">
631
+ <p class="text-gray-800" id="socialPostText"></p>
632
+ <div id="socialPostMedia" class="mt-3"></div>
633
+ </div>
634
+ </div>
635
+ </div>
636
+
637
  <div class="flex justify-between">
638
  <button id="backToStep3" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-medium">
639
  <i class="fas fa-arrow-left mr-2"></i>
640
  Back
641
  </button>
642
  <div class="flex space-x-3">
643
+ <button id="regenerateBtn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-medium">
644
  <i class="fas fa-redo mr-2"></i>
645
  Regenerate
646
  </button>
647
+ <button id="publishBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-3 rounded-lg font-medium">
648
  <i class="fas fa-save mr-2"></i>
649
  Save & Publish
650
  </button>
 
662
  <div class="w-16 h-16 mx-auto mb-4 rounded-full bg-purple-100 flex items-center justify-center">
663
  <i class="fas fa-spinner fa-spin text-purple-600 text-2xl"></i>
664
  </div>
665
+ <h3 class="text-xl font-medium text-gray-800 mb-2" id="loadingTitle">Generating Content</h3>
666
+ <p class="text-gray-600 mb-4" id="loadingMessage">Our AI is crafting your perfect article. This may take a minute...</p>
667
  <div class="w-full bg-gray-200 rounded-full h-1.5">
668
  <div id="progressBar" class="bg-purple-600 h-1.5 rounded-full" style="width: 0%"></div>
669
  </div>
 
671
  </div>
672
  </div>
673
 
674
+ <!-- Success Modal -->
675
+ <div id="successModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
676
+ <div class="bg-white rounded-xl p-8 max-w-md w-full text-center">
677
+ <div class="w-16 h-16 mx-auto mb-4 rounded-full bg-green-100 flex items-center justify-center">
678
+ <i class="fas fa-check text-green-600 text-2xl"></i>
679
+ </div>
680
+ <h3 class="text-xl font-medium text-gray-800 mb-2">Success!</h3>
681
+ <p class="text-gray-600 mb-6" id="successMessage">Your article has been generated successfully.</p>
682
+ <button id="successModalClose" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-2 rounded-lg font-medium">
683
+ Continue
684
+ </button>
685
+ </div>
686
+ </div>
687
+
688
  <script>
689
  // DOM Elements
690
  const sidebar = document.getElementById('sidebar');
 
701
  const step3 = document.getElementById('step3');
702
  const step4 = document.getElementById('step4');
703
  const loadingModal = document.getElementById('loadingModal');
704
+ const loadingTitle = document.getElementById('loadingTitle');
705
+ const loadingMessage = document.getElementById('loadingMessage');
706
  const progressBar = document.getElementById('progressBar');
707
  const progressText = document.getElementById('progressText');
708
+ const successModal = document.getElementById('successModal');
709
+ const successMessage = document.getElementById('successMessage');
710
+ const successModalClose = document.getElementById('successModalClose');
711
  const titleOptions = document.querySelectorAll('.title-option');
712
+ const exportBtn = document.getElementById('exportBtn');
713
+ const exportDropdown = document.getElementById('exportDropdown');
714
+ const exportOptions = document.querySelectorAll('.export-option');
715
+ const articleContent = document.getElementById('articleContent');
716
+ const editBtn = document.getElementById('editBtn');
717
+ const copyBtn = document.getElementById('copyBtn');
718
+ const regenerateBtn = document.getElementById('regenerateBtn');
719
+ const publishBtn = document.getElementById('publishBtn');
720
+ const socialShareBtns = document.querySelectorAll('.social-share-btn');
721
+ const socialPostsContainer = document.getElementById('socialPostsContainer');
722
+ const socialPlatformName = document.getElementById('socialPlatformName');
723
+ const socialPostText = document.getElementById('socialPostText');
724
+ const socialPostMedia = document.getElementById('socialPostMedia');
725
+ const copySocialBtn = document.querySelector('.copy-social-btn');
726
+ const closeSocialBtn = document.querySelector('.close-social-btn');
727
 
728
  // Toggle sidebar on mobile
729
  sidebarToggle.addEventListener('click', () => {
 
736
  sidebar.classList.remove('sidebar-open');
737
  });
738
 
739
+ // Export dropdown toggle
740
+ exportBtn.addEventListener('click', (e) => {
741
+ e.stopPropagation();
742
+ exportDropdown.classList.toggle('show');
743
+ });
744
+
745
+ // Close export dropdown when clicking outside
746
+ document.addEventListener('click', (e) => {
747
+ if (!exportBtn.contains(e.target) && !exportDropdown.contains(e.target)) {
748
+ exportDropdown.classList.remove('show');
749
+ }
750
+ });
751
+
752
  // Navigation between steps
753
  generateKeywordsBtn.addEventListener('click', () => {
754
+ const topic = document.getElementById('topic').value.trim();
755
+ if (!topic) {
756
+ alert('Please enter a topic for your article');
757
+ return;
758
+ }
759
+
760
+ showLoadingModal('Analyzing Topic', 'Our AI is analyzing your topic and finding the best keywords...');
761
  setTimeout(() => {
762
  hideLoadingModal();
763
  step1.classList.add('hidden');
 
772
  });
773
 
774
  generateTitlesBtn.addEventListener('click', () => {
775
+ showLoadingModal('Generating Titles', 'Our AI is creating compelling title options for your article...');
776
  setTimeout(() => {
777
  hideLoadingModal();
778
  step2.classList.add('hidden');
 
787
  });
788
 
789
  generateContentBtn.addEventListener('click', () => {
790
+ const selectedTitle = document.querySelector('input[name="titleOption"]:checked');
791
+ if (!selectedTitle) {
792
+ alert('Please select a title for your article');
793
+ return;
794
+ }
795
+
796
+ showLoadingModal('Writing Article', 'Our AI is writing your complete article based on your selected title and outline...');
797
  simulateProgress();
798
  setTimeout(() => {
799
  hideLoadingModal();
 
805
  document.querySelectorAll('.flex-1.text-center div')[3].classList.add('bg-purple-600', 'text-white');
806
  document.querySelectorAll('.flex-1.text-center p')[3].classList.remove('text-gray-600');
807
  document.querySelectorAll('.flex-1.text-center p')[3].classList.add('text-purple-600');
808
+
809
+ // Update article title with selected title
810
+ document.querySelector('#articleContent h1').textContent = selectedTitle.value;
811
+
812
+ showSuccessModal('Your article has been generated successfully! You can now export, share, or publish it.');
813
  }, 8000);
814
  });
815
 
 
874
  });
875
  });
876
 
877
+ // Export functionality
878
+ exportOptions.forEach(option => {
879
+ option.addEventListener('click', function(e) {
880
+ e.preventDefault();
881
+ const type = this.getAttribute('data-type');
882
+ exportArticle(type);
883
+ exportDropdown.classList.remove('show');
884
+ });
885
+ });
 
886
 
887
+ function exportArticle(type) {
888
+ showLoadingModal('Exporting Article', `Preparing your article for export as ${type.toUpperCase()}...`);
889
+
890
+ setTimeout(() => {
891
+ const element = document.getElementById('articleContent');
892
+ const articleTitle = document.querySelector('#articleContent h1').textContent;
 
 
 
 
 
 
 
 
 
 
 
893
 
894
+ switch(type) {
895
+ case 'pdf':
896
+ const pdfOpts = {
897
+ margin: 10,
898
+ filename: `${articleTitle}.pdf`,
899
+ image: { type: 'jpeg', quality: 0.98 },
900
+ html2canvas: { scale: 2 },
901
+ jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
902
+ };
903
+
904
+ html2pdf().set(pdfOpts).from(element).save();
905
+ break;
906
+
907
+ case 'docx':
908
+ // For DOCX export, we'll create a simple HTML version that can be saved as Word
909
+ const htmlContent = `
910
+ <!DOCTYPE html>
911
+ <html>
912
+ <head>
913
+ <meta charset="UTF-8">
914
+ <title>${articleTitle}</title>
915
+ <style>
916
+ body { font-family: Arial, sans-serif; line-height: 1.6; }
917
+ h1 { color: #2d3748; }
918
+ h2 { color: #4a5568; margin-top: 24px; }
919
+ p { margin-bottom: 16px; }
920
+ ul, ol { margin-left: 24px; }
921
+ .pro-tip { background: #ebf8ff; padding: 12px; border-left: 4px solid #4299e1; margin: 16px 0; }
922
+ </style>
923
+ </head>
924
+ <body>
925
+ ${element.innerHTML}
926
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=yeiayel/contentforge" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
927
+ </html>