|
1 | 1 |
|
2 | | - |
3 | | - |
4 | 2 | <!-- CONTENT ENDS HERE --> |
5 | 3 | {{ if hasmath }} |
6 | 4 | {{ insert foot_katex.html }} |
@@ -31,198 +29,3 @@ <h3>PeaceFounder Demo</h3> |
31 | 29 |
|
32 | 30 | </body> |
33 | 31 | </html> |
34 | | - |
35 | | - <script> |
36 | | - // Smooth scrolling for navigation links |
37 | | - document.querySelectorAll('a[href^="#"]').forEach(anchor => { |
38 | | - anchor.addEventListener('click', function (e) { |
39 | | - e.preventDefault(); |
40 | | - const target = document.querySelector(this.getAttribute('href')); |
41 | | - if (target) { |
42 | | - target.scrollIntoView({ |
43 | | - behavior: 'smooth', |
44 | | - block: 'start' |
45 | | - }); |
46 | | - } |
47 | | - }); |
48 | | - }); |
49 | | - |
50 | | - // Add scroll effect to navigation |
51 | | - window.addEventListener('scroll', function() { |
52 | | - const nav = document.querySelector('nav'); |
53 | | - if (window.scrollY > 100) { |
54 | | - nav.style.background = 'rgba(255, 255, 255, 0.98)'; |
55 | | - } else { |
56 | | - nav.style.background = 'rgba(255, 255, 255, 0.95)'; |
57 | | - } |
58 | | - }); |
59 | | - |
60 | | - // Intersection Observer for animation triggers |
61 | | - const observerOptions = { |
62 | | - threshold: 0.1, |
63 | | - rootMargin: '0px 0px -50px 0px' |
64 | | - }; |
65 | | - |
66 | | - const observer = new IntersectionObserver(function(entries) { |
67 | | - entries.forEach(entry => { |
68 | | - if (entry.isIntersecting) { |
69 | | - entry.target.style.opacity = '1'; |
70 | | - entry.target.style.transform = 'translateY(0)'; |
71 | | - } |
72 | | - }); |
73 | | - }, observerOptions); |
74 | | - |
75 | | - // Observe elements for animation |
76 | | - document.querySelectorAll('.innovation-card, .step, .solution-item, .problem-item').forEach(el => { |
77 | | - el.style.opacity = '0'; |
78 | | - el.style.transform = 'translateY(20px)'; |
79 | | - el.style.transition = 'opacity 0.6s ease, transform 0.6s ease'; |
80 | | - observer.observe(el); |
81 | | - }); |
82 | | - |
83 | | - // Demo Modal Functions |
84 | | - function openDemoModal() { |
85 | | - const modal = document.getElementById('demoModal'); |
86 | | - const video = document.getElementById('demoVideo'); |
87 | | - video.src = 'https://www.youtube.com/embed/3asNuNMlHhY?autoplay=1'; |
88 | | - modal.style.display = 'flex'; |
89 | | - document.body.style.overflow = 'hidden'; |
90 | | - } |
91 | | - |
92 | | - function closeDemoModal() { |
93 | | - const modal = document.getElementById('demoModal'); |
94 | | - const video = document.getElementById('demoVideo'); |
95 | | - video.src = ''; |
96 | | - modal.style.display = 'none'; |
97 | | - document.body.style.overflow = 'auto'; |
98 | | - } |
99 | | - |
100 | | - // Close modal when pressing Escape key |
101 | | - document.addEventListener('keydown', function(e) { |
102 | | - if (e.key === 'Escape') { |
103 | | - closeDemoModal(); |
104 | | - } |
105 | | - }); |
106 | | - |
107 | | - // Copy to clipboard functionality |
108 | | - function copyToClipboard(text) { |
109 | | - navigator.clipboard.writeText(text).then(function() { |
110 | | - // Find the clicked icon and add subtle click animation |
111 | | - const icons = document.querySelectorAll('.copy-icon'); |
112 | | - icons.forEach(icon => { |
113 | | - if (icon.onclick.toString().includes(text.substring(0, 20))) { |
114 | | - icon.style.transform = 'scale(0.95)'; |
115 | | - setTimeout(() => { |
116 | | - icon.style.transform = 'scale(1)'; |
117 | | - }, 100); |
118 | | - } |
119 | | - }); |
120 | | - }).catch(function(err) { |
121 | | - console.error('Failed to copy: ', err); |
122 | | - }); |
123 | | - } |
124 | | - |
125 | | -function initializeCopyButtons() { |
126 | | - const codeBlocks = document.querySelectorAll('.code-block'); |
127 | | - |
128 | | - codeBlocks.forEach(block => { |
129 | | - // Skip if copy button already exists |
130 | | - if (block.querySelector('.copy-icon')) return; |
131 | | - |
132 | | - const codeElement = block.querySelector('code'); |
133 | | - if (!codeElement) return; |
134 | | - |
135 | | - const codeText = codeElement.textContent; |
136 | | - |
137 | | - // Create copy span exactly like your current format |
138 | | - const copySpan = document.createElement('span'); |
139 | | - copySpan.className = 'copy-icon'; |
140 | | - copySpan.setAttribute('onclick', `copyToClipboard('${codeText.replace(/'/g, "\\'")}')`); |
141 | | - copySpan.title = 'Copy to clipboard'; |
142 | | - copySpan.textContent = 'Copy'; |
143 | | - |
144 | | - // Insert the span before the code element (same position as your HTML) |
145 | | - block.insertBefore(copySpan, codeElement); |
146 | | - }); |
147 | | -} |
148 | | - // Initialize when page loads |
149 | | - document.addEventListener('DOMContentLoaded', initializeCopyButtons); |
150 | | - |
151 | | - // Also provide a function to reinitialize if you add code blocks dynamically |
152 | | - window.reinitializeCopyButtons = initializeCopyButtons; |
153 | | - |
154 | | - |
155 | | - |
156 | | -let slideIndex = 3; |
157 | | -let slideInterval; |
158 | | -const SLIDE_DURATION = 5000; // 3 seconds |
159 | | - |
160 | | -function showSlides(n) { |
161 | | - const slides = document.getElementsByClassName("screenshot-slide"); |
162 | | - const dots = document.getElementsByClassName("dot"); |
163 | | - |
164 | | - // Bounds checking |
165 | | - if (n > slides.length) { |
166 | | - slideIndex = 1; |
167 | | - } else if (n < 1) { |
168 | | - slideIndex = slides.length; |
169 | | - } else { |
170 | | - slideIndex = n; |
171 | | - } |
172 | | - |
173 | | - // Remove active class from all |
174 | | - for (let i = 0; i < slides.length; i++) { |
175 | | - slides[i].classList.remove("active"); |
176 | | - } |
177 | | - |
178 | | - for (let i = 0; i < dots.length; i++) { |
179 | | - dots[i].classList.remove("active"); |
180 | | - } |
181 | | - |
182 | | - // Add active class to current |
183 | | - if (slides[slideIndex - 1] && dots[slideIndex - 1]) { |
184 | | - slides[slideIndex - 1].classList.add("active"); |
185 | | - dots[slideIndex - 1].classList.add("active"); |
186 | | - } |
187 | | -} |
188 | | - |
189 | | -function currentSlide(n) { |
190 | | - stopAutoSlide(); // Always stop first |
191 | | - showSlides(n); |
192 | | - startAutoSlide(); // Then restart |
193 | | -} |
194 | | - |
195 | | -function nextSlide() { |
196 | | - slideIndex++; |
197 | | - showSlides(slideIndex); |
198 | | -} |
199 | | - |
200 | | -function startAutoSlide() { |
201 | | - stopAutoSlide(); // Prevent multiple intervals |
202 | | - slideInterval = setInterval(nextSlide, SLIDE_DURATION); |
203 | | -} |
204 | | - |
205 | | -function stopAutoSlide() { |
206 | | - if (slideInterval) { |
207 | | - clearInterval(slideInterval); |
208 | | - slideInterval = null; |
209 | | - } |
210 | | -} |
211 | | - |
212 | | -// Initialize slideshow |
213 | | -document.addEventListener('DOMContentLoaded', function() { |
214 | | - showSlides(slideIndex); |
215 | | - startAutoSlide(); |
216 | | - |
217 | | - // Pause on hover |
218 | | - const slideshow = document.querySelector('.screenshot-slideshow'); |
219 | | - if (slideshow) { |
220 | | - slideshow.addEventListener('mouseenter', stopAutoSlide); |
221 | | - slideshow.addEventListener('mouseleave', startAutoSlide); |
222 | | - } |
223 | | -}); |
224 | | - |
225 | | -// Cleanup on page unload |
226 | | -window.addEventListener('beforeunload', stopAutoSlide); |
227 | | - |
228 | | - </script> |
0 commit comments