Skip to content

Commit

Permalink
improve navigation link style
Browse files Browse the repository at this point in the history
  • Loading branch information
alphatownsman committed May 31, 2024
1 parent 20ca5fa commit 1879aa7
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 25 deletions.
4 changes: 2 additions & 2 deletions catalog/templates/discover.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load mastodon %}
{% load thumb %}
<!DOCTYPE html>
<html lang="zh" class="classic-page">
<html lang="zh" class="classic-page nav-page-discover">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -23,7 +23,7 @@
<script src="{% static 'js/podcast.js' %}"></script>
</head>
<body>
{% include "_header.html" with current="discover" %}
{% include "_header.html" %}
<script>
function _scroll_left(el){
el.scrollBy(0-el.offsetWidth, 0);
Expand Down
2 changes: 1 addition & 1 deletion catalog/templates/search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% load duration %}
{% load thumb %}
<!DOCTYPE html>
<html lang="zh" class="classic-page">
<html lang="zh" class="classic-page nav-page-search">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down
24 changes: 21 additions & 3 deletions common/static/scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ body {
min-width: -moz-max-content;
}

ul li a.current {
font-weight: bold;
color: var(--pico-primary);
.nav-links a {
color: var(--pico-secondary);
}

font-weight: bold;

.nav-search,
.nav-search li {
Expand Down Expand Up @@ -171,3 +171,21 @@ body {
*/
}
}

.nav-page-discover .nav-links a.nav-link-discover {
color: var(--pico-primary) !important;
font-weight: bold;
}

.nav-page-feed .nav-links a.nav-link-feed {
color: var(--pico-primary) !important;
font-weight: bold;
}
.nav-page-home .nav-links a.nav-link-home {
color: var(--pico-primary) !important;
font-weight: bold;
}
.nav-page-search .nav-links a.nav-link-search {
color: var(--pico-primary) !important;
font-weight: bold;
}
18 changes: 8 additions & 10 deletions common/templates/_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,27 @@
</ul>
<ul class="nav-links">
<li class="small-only">
<a _="on click toggle .unhide on .nav-search then call #q.focus()"
<a class="nav-link-search"
_="on click toggle .unhide on .nav-search then call #q.focus()"
href="#"><i class="fa-solid fa-magnifying-glass"></i></a>
</li>
<li class="small-only">
<a href="{% url 'catalog:discover' %}"><i class="fa-solid fa-globe"></i></a>
<a class="nav-link-discover" href="{% url 'catalog:discover' %}"><i class="fa-solid fa-globe"></i></a>
</li>
<li class="small-only">
<a href="{% url 'social:feed' %}"><i class="fa-solid fa-users"></i></a>
<a class="nav-link-feed" href="{% url 'social:feed' %}"><i class="fa-solid fa-users"></i></a>
</li>
<li class="small-only">
<a href="{% url 'common:me' %}"><i class="fa-solid fa-house-user"></i></a>
<a class="nav-link-home" href="{% url 'common:me' %}"><i class="fa-solid fa-house-user"></i></a>
</li>
<li class="large-only">
<a class="{% if current == 'discover' %}secondary{% endif %}"
href="{% url 'catalog:discover' %}">{% trans 'Explore' %}</a>
<a class="nav-link-discover" href="{% url 'catalog:discover' %}">{% trans 'Explore' %}</a>
</li>
<li class="large-only">
<a class="{% if current == 'timeline' %}secondary{% endif %}"
href="{% url 'social:feed' %}">{% trans 'Feed' %}</a>
<a class="nav-link-feed" href="{% url 'social:feed' %}">{% trans 'Feed' %}</a>
</li>
<li class="large-only">
<a class="{% if current == 'home' %}secondary{% endif %}"
href="{% url 'common:me' %}">{% trans 'Home' %}</a>
<a class="nav-link-home" href="{% url 'common:me' %}">{% trans 'Home' %}</a>
</li>
</ul>
<ul class="nav-dropdown">
Expand Down
4 changes: 3 additions & 1 deletion journal/templates/collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ <h3>
<section>
<div class="entity-list"
hx-get="{% url 'journal:collection_retrieve_items' collection.uuid %}"
hx-trigger="load"></div>
hx-trigger="load">
<i class="fa-solid fa-compact-disc fa-spin loading"></i>
</div>
</section>
<section>
{% if request.user.is_authenticated %}
Expand Down
4 changes: 2 additions & 2 deletions journal/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load mastodon %}
{% load thumb %}
<!DOCTYPE html>
<html lang="zh" class="classic-page">
<html lang="zh" class="classic-page{% if me %} nav-page-home{% endif %}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -30,7 +30,7 @@
</head>
<body>
{% if request.user == identity.user %}
{% include "_header.html" with current="home" %}
{% include "_header.html" %}
{% else %}
{% include "_header.html" %}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions social/templates/feed.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% load mastodon %}
{% load thumb %}
<!DOCTYPE html>
<html lang="zh" class="feed-page">
<html lang="zh" class="feed-page nav-page-feed">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -16,7 +16,7 @@
<script src="{% static 'js/podcast.js' %}"></script>
</head>
<body>
{% include "_header.html" with current="timeline" %}
{% include "_header.html" %}
<main>
<div class="grid__main">
<h5>{% trans 'Activities from those you follow' %}</h5>
Expand Down
2 changes: 1 addition & 1 deletion social/templates/notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% load mastodon %}
{% load thumb %}
<!DOCTYPE html>
<html lang="zh" class="feed-page">
<html lang="zh" class="feed-page nav-page-feed">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down
2 changes: 1 addition & 1 deletion users/templates/users/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% include "common_libs.html" %}
</head>
<body>
{% include "_header.html" with current="data" %}
{% include "_header.html" %}
<main>
<div class="grid__main">
{% if allow_any_site %}
Expand Down
2 changes: 1 addition & 1 deletion users/templates/users/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% include "common_libs.html" %}
</head>
<body>
{% include "_header.html" with current="data" %}
{% include "_header.html" %}
<main>
<div class="grid__main">
<article>
Expand Down
2 changes: 1 addition & 1 deletion users/templates/users/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include "common_libs.html" %}
</head>
<body>
{% include "_header.html" with current="data" %}
{% include "_header.html" %}
<main>
<div class="grid__main">
<article>
Expand Down

0 comments on commit 1879aa7

Please sign in to comment.