|
| 1 | +<!-- Modal structure - defined before the content so it's available immediately --> |
| 2 | +<div id="how-to-join-modal" class="modal modal-how-to-join"> |
| 3 | + <div class="modal-content"> |
| 4 | + <h4><i class="material-icons <%= @accent_color %>-text left" style="margin-right: 10px;">info</i> How to join this showcase</h4> |
| 5 | + <p>Want your content to appear on this page? Follow these steps:</p> |
| 6 | + <ol> |
| 7 | + <li>Add the <span class="highlight">ArtFight2025</span> tag to your content</li> |
| 8 | + <li>Set your content's privacy to <span class="highlight">Public</span> in the privacy toggle</li> |
| 9 | + <li>That's it! Your content will appear here automatically</li> |
| 10 | + </ol> |
| 11 | + <p class="grey-text" style="font-size: 14px;">Note: It may take a few minutes for new content to appear.</p> |
| 12 | + </div> |
| 13 | + <div class="modal-footer"> |
| 14 | + <a href="#!" class="modal-close waves-effect waves-light <%= @accent_color %> btn-flat white-text">Got it</a> |
| 15 | + </div> |
| 16 | +</div> |
| 17 | + |
1 | 18 | <div class="row"> |
2 | 19 | <!-- Privacy text in top right --> |
3 | 20 | <div class="col s12"> |
|
27 | 44 |
|
28 | 45 | <!-- Help button for how to join --> |
29 | 46 | <div class="help-tooltip-container" style="position: absolute; top: 20px; right: 20px; z-index: 10;"> |
30 | | - <a class="btn-floating white z-depth-2 pulse" id="how-to-join-btn" style="height: 42px; width: 42px; display: flex; align-items: center; justify-content: center;"> |
| 47 | + <button class="btn-floating white z-depth-2 pulse" id="how-to-join-btn" style="height: 42px; width: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none;" onclick="showHowToJoinModal()"> |
31 | 48 | <i class="material-icons <%= @accent_color %>-text">help_outline</i> |
32 | | - </a> |
| 49 | + </button> |
33 | 50 | </div> |
34 | 51 |
|
35 | 52 | <!-- Art Fight 2025 header info --> |
|
336 | 353 | filterLinks[0].style.backgroundColor = '<%= @accent_color == "grey" ? "#9e9e9e" : "var(--#{@accent_color}-lighten-4)" %>'; |
337 | 354 | filterLinks[0].style.fontWeight = '500'; |
338 | 355 |
|
339 | | - // How to join modal |
340 | | - document.getElementById('how-to-join-btn').addEventListener('click', function() { |
341 | | - // Show modal |
342 | | - var modalHtml = ` |
343 | | - <div id="how-to-join-modal" class="modal modal-how-to-join"> |
344 | | - <div class="modal-content"> |
345 | | - <h4><i class="material-icons <%= @accent_color %>-text left" style="margin-right: 10px;">info</i> How to join this showcase</h4> |
346 | | - <p>Want your content to appear on this page? Follow these steps:</p> |
347 | | - <ol> |
348 | | - <li>Add the <span class="highlight">ArtFight2025</span> tag to your content</li> |
349 | | - <li>Set your content's privacy to <span class="highlight">Public</span> in the privacy toggle</li> |
350 | | - <li>That's it! Your content will appear here automatically</li> |
351 | | - </ol> |
352 | | - <p class="grey-text" style="font-size: 14px;">Note: It may take a few minutes for new content to appear.</p> |
353 | | - </div> |
354 | | - <div class="modal-footer"> |
355 | | - <a href="#!" class="modal-close waves-effect waves-light <%= @accent_color %> btn-flat white-text">Got it</a> |
356 | | - </div> |
357 | | - </div> |
358 | | - `; |
359 | | - |
360 | | - // Add modal to DOM if it doesn't exist |
361 | | - if (!document.getElementById('how-to-join-modal')) { |
362 | | - document.body.insertAdjacentHTML('beforeend', modalHtml); |
363 | | - } |
364 | | - |
365 | | - // Initialize and open modal |
| 356 | + // Define the showHowToJoinModal function in global scope |
| 357 | + window.showHowToJoinModal = function() { |
| 358 | + // Initialize and open the pre-defined modal |
366 | 359 | var modalElement = document.getElementById('how-to-join-modal'); |
367 | 360 | var modalInstance = M.Modal.init(modalElement, {opacity: 0.6}); |
368 | 361 | modalInstance.open(); |
369 | | - }); |
| 362 | + }; |
| 363 | + |
| 364 | + // Initialize the modal when the page loads |
| 365 | + var howToJoinModal = document.getElementById('how-to-join-modal'); |
| 366 | + M.Modal.init(howToJoinModal, {opacity: 0.6}); |
370 | 367 | }); |
371 | 368 | <% end %> |
372 | 369 |
|
|
0 commit comments