Skip to content

Commit ca99db5

Browse files
drusepthclaude
andcommitted
Add left alignment for cards and how-to-join info for ArtFight2025 page
- Fixed card alignment on incomplete rows to align left instead of right - Added help button in header area with question mark icon - Implemented modal with step-by-step instructions for joining the showcase - Created styles for the how-to-join modal with proper highlighting - Added JavaScript to dynamically create and show the modal - Made help button stand out with pulse effect for visibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6facc8f commit ca99db5

File tree

1 file changed

+67
-1
lines changed

1 file changed

+67
-1
lines changed

app/views/browse/tag.html.erb

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
<!-- Gradient overlay for better text contrast -->
2626
<div style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);"></div>
2727

28+
<!-- Help button for how to join -->
29+
<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;">
31+
<i class="material-icons <%= @accent_color %>-text">help_outline</i>
32+
</a>
33+
</div>
34+
2835
<!-- Art Fight 2025 header info -->
2936
<div style="position: absolute; top: 40px; left: 40px; z-index: 1; max-width: 60%;">
3037
<div>
@@ -328,11 +335,69 @@
328335
// Initialize with "All" selected
329336
filterLinks[0].style.backgroundColor = '<%= @accent_color == "grey" ? "#9e9e9e" : "var(--#{@accent_color}-lighten-4)" %>';
330337
filterLinks[0].style.fontWeight = '500';
338+
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
366+
var modalElement = document.getElementById('how-to-join-modal');
367+
var modalInstance = M.Modal.init(modalElement, {opacity: 0.6});
368+
modalInstance.open();
369+
});
331370
});
332371
<% end %>
333372

334373
<!-- Add CSS variables for colors -->
335374
<style>
375+
/* Help modal for how to join */
376+
.modal-how-to-join {
377+
border-radius: 8px;
378+
max-width: 500px;
379+
}
380+
381+
.modal-how-to-join h4 {
382+
margin-top: 0;
383+
font-size: 20px;
384+
font-weight: 500;
385+
}
386+
387+
.modal-how-to-join ol {
388+
padding-left: 25px;
389+
}
390+
391+
.modal-how-to-join li {
392+
margin-bottom: 10px;
393+
}
394+
395+
.modal-how-to-join .highlight {
396+
background-color: #f3e5f5;
397+
padding: 2px 5px;
398+
border-radius: 3px;
399+
}
400+
336401
:root {
337402
--purple: #9c27b0;
338403
--purple-lighten-1: #ab47bc;
@@ -384,12 +449,13 @@
384449
margin-bottom: 0;
385450
}
386451

387-
/* Make all cards in a row the same height */
452+
/* Make all cards in a row the same height and align left */
388453
.js-content-cards-list {
389454
display: flex;
390455
flex-wrap: wrap;
391456
margin-left: -0.75rem;
392457
margin-right: -0.75rem;
458+
justify-content: flex-start;
393459
}
394460

395461
/* Make sure card containers take their full column width */

0 commit comments

Comments
 (0)