Improve accessibility rating

This commit is contained in:
Robin 2021-01-17 23:49:36 +01:00
parent 090ca1a140
commit 162e00b243
6 changed files with 18 additions and 15 deletions

View File

@ -49,7 +49,7 @@ nav {
nav * { color: var(--text); }
nav #reddit { color: var(--accent); }
nav #version { opacity: 25%; }
nav #version { opacity: 50%; }
#settings_link {
font-size: 18px;

View File

@ -62,7 +62,7 @@
<!-- POST MEDIA -->
{% if post.post_type == "image" %}
<img class="post_media" width="{{ post.media_width }}px" height="{{ post.media_height}}px" src="{{ post.media }}"/>
<img class="post_media" alt="Post image" width="{{ post.media_width }}px" height="{{ post.media_height}}px" src="{{ post.media }}"/>
{% else if post.post_type == "video" || post.post_type == "gif" %}
<video class="post_media" src="{{ post.media }}" controls autoplay loop></video>
{% else if post.post_type == "link" %}
@ -85,7 +85,7 @@
<!-- SORT FORM -->
<form id="sort">
<select name="sort">
<select name="sort" title="Sort comments by">
{% call utils::options(sort, ["confidence", "top", "new", "controversial", "old"], "confidence") %}
</select><input id="sort_submit" type="submit" value="&rarr;">
</form>

View File

@ -6,16 +6,16 @@
{% block content %}
<div id="column_one">
<form id="search_sort">
<input id="search" type="text" name="q" placeholder="Search" value="{{ params.q }}">
<input id="search" type="text" name="q" placeholder="Search" value="{{ params.q }}" title="Search libreddit">
{% if sub != "" %}
<div id="inside">
<input type="checkbox" name="restrict_sr" id="restrict_sr" {% if params.restrict_sr != "" %}checked{% endif %}>
<label for="restrict_sr" class="search_label">in r/{{ sub }}</label>
</div>
{% endif %}
<select id="sort_options" name="sort">
<select id="sort_options" name="sort" title="Sort results by">
{% call utils::options(params.sort, ["relevance", "hot", "top", "new", "comments"], "") %}
</select>{% if params.sort != "new" %}<select id="timeframe" name="t">
</select>{% if params.sort != "new" %}<select id="timeframe" name="t" title="Timeframe">
{% call utils::options(params.t, ["hour", "day", "week", "month", "year", "all"], "all") %}
</select>{% endif %}<input id="sort_submit" type="submit" value="&rarr;">
</form>
@ -54,15 +54,16 @@
</p>
<!-- POST MEDIA/THUMBNAIL -->
{% if (prefs.layout == "" || prefs.layout == "card") && post.post_type == "image" %}
<img class="post_media" width="{{ post.media_width }}px" height="{{ post.media_height}}px" src="{{ post.media }}"/>
<img class="post_media" alt="Post image" width="{{ post.media_width }}px" height="{{ post.media_height}}px" src="{{ post.media }}"/>
{% else if post.post_type != "self" %}
<a class="post_thumbnail {% if post.thumbnail == "" %}no_thumbnail{% endif %}" href="{% if post.post_type == "link" %}{{ post.media }}{% else %}{{ post.permalink }}{% endif %}">
{% if post.thumbnail == "" %}
<svg viewBox="0 0 100 106" width="140" height="53" xmlns="http://www.w3.org/2000/svg">
<title>Thumbnail</title>
<path d="M35,15h-15a10,10 0,0,0 0,20h25a10,10 0,0,0 10,-10m-12.5,0a10, 10 0,0,1 10, -10h25a10,10 0,0,1 0,20h-15" fill="none" stroke-width="5" stroke-linecap="round"/>
</svg>
{% else %}
<img src="{{ post.thumbnail }}" width="{{ post.thumbnail_width }}px" height="{{ post.thumbnail_height }}px">
<img src="{{ post.thumbnail }}" alt="Thumbnail" width="{{ post.thumbnail_width }}px" height="{{ post.thumbnail_height }}px">
{% endif %}
<span>{% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %}</span>
</a>

View File

@ -22,7 +22,7 @@
{% call utils::sort(["/r/", sub.name.as_str()].concat(), ["hot", "new", "top", "rising", "controversial"], sort.0) %}
{% endif %}
</div>
{% if sort.0 == "top" || sort.0 == "controversial" %}<select id="timeframe" name="t">
{% if sort.0 == "top" || sort.0 == "controversial" %}<select id="timeframe" name="t" title="Timeframe">
{% call utils::options(sort.1, ["hour", "day", "week", "month", "year", "all"], "day") %}
<input id="sort_submit" type="submit" value="&rarr;">
</select>{% endif %}
@ -48,15 +48,16 @@
</p>
<!-- POST MEDIA/THUMBNAIL -->
{% if (prefs.layout == "" || prefs.layout == "card") && post.post_type == "image" %}
<img class="post_media" width="{{ post.media_width }}px" height="{{ post.media_height}}px" src="{{ post.media }}"/>
<img class="post_media" alt="Post image" width="{{ post.media_width }}px" height="{{ post.media_height}}px" src="{{ post.media }}"/>
{% else if post.post_type != "self" %}
<a class="post_thumbnail {% if post.thumbnail == "" %}no_thumbnail{% endif %}" href="{% if post.post_type == "link" %}{{ post.media }}{% else %}{{ post.permalink }}{% endif %}">
{% if post.thumbnail == "" %}
<svg viewBox="0 0 100 106" width="140" height="53" xmlns="http://www.w3.org/2000/svg">
<title>Thumbnail</title>
<path d="M35,15h-15a10,10 0,0,0 0,20h25a10,10 0,0,0 10,-10m-12.5,0a10, 10 0,0,1 10, -10h25a10,10 0,0,1 0,20h-15" fill="none" stroke-width="5" stroke-linecap="round"/>
</svg>
{% else %}
<img src="{{ post.thumbnail }}" width="{{ post.thumbnail_width }}px" height="{{ post.thumbnail_height }}px">
<img src="{{ post.thumbnail }}" alt="Thumbnail" width="{{ post.thumbnail_width }}px" height="{{ post.thumbnail_height }}px">
{% endif %}
<span>{% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %}</span>
</a>
@ -91,7 +92,7 @@
</div>
{% endif %}
<div id="sub_meta">
<img id="sub_icon" src="{{ sub.icon }}">
<img id="sub_icon" src="{{ sub.icon }}" alt="Icon for r/{{ sub.name }}">
<p id="sub_title">{{ sub.title }}</p>
<p id="sub_name">r/{{ sub.name }}</p>
<p id="sub_description">{{ sub.description }}</p>

View File

@ -39,15 +39,16 @@
</p>
<!-- POST MEDIA/THUMBNAIL -->
{% if (prefs.layout == "" || prefs.layout == "card") && post.post_type == "image" %}
<img class="post_media" width="{{ post.media_width }}px" height="{{ post.media_height}}px" src="{{ post.media }}"/>
<img class="post_media" alt="Post image" width="{{ post.media_width }}px" height="{{ post.media_height}}px" src="{{ post.media }}"/>
{% else if post.post_type != "self" %}
<a class="post_thumbnail {% if post.thumbnail == "" %}no_thumbnail{% endif %}" href="{% if post.post_type == "link" %}{{ post.media }}{% else %}{{ post.permalink }}{% endif %}">
{% if post.thumbnail == "" %}
<svg viewBox="0 0 100 106" width="140" height="53" xmlns="http://www.w3.org/2000/svg">
<title>Thumbnail</title>
<path d="M35,15h-15a10,10 0,0,0 0,20h25a10,10 0,0,0 10,-10m-12.5,0a10, 10 0,0,1 10, -10h25a10,10 0,0,1 0,20h-15" fill="none" stroke-width="5" stroke-linecap="round"/>
</svg>
{% else %}
<img src="{{ post.thumbnail }}" width="{{ post.thumbnail_width }}px" height="{{ post.thumbnail_height }}px">
<img src="{{ post.thumbnail }}" alt="Thumbnail" width="{{ post.thumbnail_width }}px" height="{{ post.thumbnail_height }}px">
{% endif %}
<span>{% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %}</span>
</a>

View File

@ -16,7 +16,7 @@
{% macro search(root, search) -%}
<form action="{% if root != "/r/" && !root.is_empty() %}{{ root }}{% endif %}/search/" id="searchbox">
<input id="search" type="text" name="q" placeholder="Search" value="{{ search }}">
<input id="search" type="text" name="q" placeholder="Search" title="Search libreddit" value="{{ search }}">
{% if root != "/r/" && !root.is_empty() %}
<div id="inside">
<input type="checkbox" name="restrict_sr" id="restrict_sr">