Skip to content

Commit

Permalink
Fix up HTML issues found by w3c validator
Browse files Browse the repository at this point in the history
I'm trying to debug an odd issue, so I ran the major pages of the site
through the w3c validator. It didn't help my issue, but it's still
worth fixing these HTML spec violations up.
  • Loading branch information
Paul DobbinSchmaltz committed Oct 25, 2024
1 parent 6ff4112 commit 1f13ee8
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/application.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
Example Usage:
<dfn
data-tooltip="up-left"
aria-label="..."
data-tooltip-text="..."
class="after:w-80"
>...</dfn>
*/
Expand All @@ -144,7 +144,7 @@
@apply size-3 content-[""] rotate-45 bg-neutral-900;
}
&::after {
@apply content-[attr(aria-label)] my-1.5 p-4 rounded-md
@apply content-[attr(data-tooltip-text)] my-1.5 p-4 rounded-md
bg-neutral-900 font-normal text-gray-200;
}

Expand Down
6 changes: 5 additions & 1 deletion app/views/application/_collapse_container.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
class="space-y-6"
>
<button
id="<%= view.button_id %>"
data-collapse-target="button"
data-action="collapse#toggle"
aria-controls="<%= view.content_id %>"
aria-label="Toggle <%= view.button_text %>"
aria-haspopup="true"
aria-expanded="<%= view.open? %>"
Expand All @@ -30,15 +32,17 @@
</button>

<div
id="<%= view.content_id %>"
data-collapse-target="section"
data-transition-enter="transition ease-out duration-100"
data-transition-enter-start="transform opacity-0 scale-95"
data-transition-enter-end="transform opacity-100 scale-100"
data-transition-leave="transition ease-in duration-75"
data-transition-leave-start="transform opacity-100 scale-100"
data-transition-leave-end="transform opacity-0 scale-95"
role="region"
aria-labelledby="<%= view.button_id %>"
aria-hidden="<%= view.collapsed? %>"
aria-orientation="vertical"
class="<%= class_names(view.section_css_class) %>"
>
<%= yield %>
Expand Down
1 change: 0 additions & 1 deletion app/views/games/_game.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
<time
data-elapsed-time-target="elapsedTime"
datetime="PT<%= view.elapsed_time.to_i %>S"
aria-label="Elapsed Time"
><%= view.elapsed_time %></time>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions app/views/games/_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<th>
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.score") %>"
data-tooltip-text="<%= t("terms.score") %>"
class="after:w-80"
>Score</dfn>
</th>
Expand All @@ -54,7 +54,7 @@
<th>
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.bbbv") %>"
data-tooltip-text="<%= t("terms.bbbv") %>"
class="after:w-80"
>3BV</dfn>
</th>
Expand All @@ -64,7 +64,7 @@
<th>
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.bbbvps") %>"
data-tooltip-text="<%= t("terms.bbbvps") %>"
class="after:w-80"
>3BV/s</dfn>
</th>
Expand All @@ -74,7 +74,7 @@
<th>
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.efficiency") %>"
data-tooltip-text="<%= t("terms.efficiency") %>"
class="after:w-80"
>Efficiency</dfn>
</th>
Expand All @@ -86,7 +86,7 @@
<td><%= stats.clicks_count %></td>
</tr>
<tr>
<td colspan="100%">
<td colspan="2">
<table
class="
border-separate
Expand All @@ -100,7 +100,7 @@
<th class="pl-6">
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.reveals") %>"
data-tooltip-text="<%= t("terms.reveals") %>"
class="after:w-80"
>Reveals</dfn>
</th>
Expand All @@ -110,7 +110,7 @@
<th class="pl-6">
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.chords") %>"
data-tooltip-text="<%= t("terms.chords") %>"
class="after:w-80"
>Chords</dfn>
</th>
Expand Down
3 changes: 3 additions & 0 deletions app/views/games/rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def initialize(context:)

def cookie_name = COOKIE_NAME

def button_id = @button_id ||= "rules_button-#{Time.new.to_i}"
def content_id = @content_id ||= "rules_content-#{Time.new.to_i}"

def button_text = "Rules of Engagement"

def button_css_class
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/_page_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% if nav.previous_game? %>
<div
class="
group-has-[banner]:hidden
group-has-[role='banner']:hidden
absolute -top-8 flex items-center gap-x-3
*:text-gray-500 *:dark:text-neutral-400
*:no-underline
Expand Down
6 changes: 3 additions & 3 deletions app/views/layouts/_banner.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%# locals: (banner:) %>

<banner
role="alert"
<div
role="banner"
data-controller="banner"
<% if banner.permanently_dismissable? %>
data-banner-permanently-dismissable-value="<%= banner.permanently_dismissable? %>"
Expand Down Expand Up @@ -36,4 +36,4 @@
</button>
<% end %>
</div>
</banner>
</div>
16 changes: 8 additions & 8 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<td><%= @view.losing_games_count %></td>
</tr>

<tr><td colspan="100%" class="select-none">&nbsp;</td></tr>
<tr><td colspan="2" class="select-none">&nbsp;</td></tr>

<tr>
<th>Cells Revealed</th>
Expand All @@ -61,7 +61,7 @@
<th>
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.chords") %>"
data-tooltip-text="<%= t("terms.chords") %>"
class="after:w-80"
>Chords</dfn>
</th>
Expand Down Expand Up @@ -96,10 +96,10 @@
>
<tbody>
<tr>
<th>
<th colspan="2">
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.score") %>"
data-tooltip-text="<%= t("terms.score") %>"
class="after:w-80"
>Score</dfn>
</th>
Expand All @@ -117,10 +117,10 @@
<td><%= @view.best_expert_score %></td>
</tr>
<tr>
<th>
<th colspan="2">
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.bbbvps") %>"
data-tooltip-text="<%= t("terms.bbbvps") %>"
class="after:w-80"
>3BV/s</dfn>
</th>
Expand All @@ -138,10 +138,10 @@
<td><%= @view.best_expert_bbbvps %></td>
</tr>
<tr>
<th>
<th colspan="2">
<dfn
data-tooltip="up-left"
aria-label="<%= t("terms.efficiency") %>"
data-tooltip-text="<%= t("terms.efficiency") %>"
class="after:w-80"
>Efficiency</dfn>
</th>
Expand Down

0 comments on commit 1f13ee8

Please sign in to comment.