Skip to content

Commit

Permalink
feat(ui): redesign the sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed May 12, 2023
1 parent 6d99f5c commit 83bbe4a
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 313 deletions.
2 changes: 1 addition & 1 deletion _data/assets/cross_origin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cdns:

# fonts

webfonts: https://fonts.googleapis.com/css2?family=Lato&family=Source+Sans+Pro:wght@400;600;700;900&display=swap
webfonts: https://fonts.googleapis.com/css2?family=Lato&family=Source+Sans+Pro:wght@400;600;900&display=swap

# Libraries

Expand Down
24 changes: 11 additions & 13 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<!-- The Side Bar -->

<div id="sidebar" class="d-flex flex-column align-items-end">
<div class="profile-wrapper text-center">
<div id="avatar">
<a href="{{ '/' | relative_url }}" class="mx-auto">
{% if site.avatar != empty and site.avatar %}
{% capture avatar_url %}
<div class="profile-wrapper">
<a href="{{ '/' | relative_url }}" id="avatar" class="rounded-circle">
{% if site.avatar != empty and site.avatar %}
{% capture avatar_url %}
{% if site.avatar contains '://' %}
{{ site.avatar }}
{% elsif site.img_cdn != empty and site.img_cdn %}
Expand All @@ -14,10 +13,9 @@
{{ site.avatar | relative_url }}
{% endif %}
{% endcapture %}
<img src="{{ avatar_url | strip }}" alt="avatar" onerror="this.style.display='none'">
{% endif %}
</a>
</div>
<img src="{{ avatar_url | strip }}" width="112" height="112" alt="avatar" onerror="this.style.display='none'">
{% endif %}
</a>

<div class="site-title">
<a href="{{ '/' | relative_url }}">{{ site.title }}</a>
Expand All @@ -26,19 +24,19 @@
</div>
<!-- .profile-wrapper -->

<ul class="w-100">
<ul class="flex-grow-1 w-100 pl-0">
<!-- home -->
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
<a href="{{ '/' | relative_url }}" class="nav-link">
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
<i class="fa-fw fas fa-home"></i>
<span>{{ site.data.locales[include.lang].tabs.home | upcase }}</span>
</a>
</li>
<!-- the real tabs -->
{% for tab in site.tabs %}
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
<a href="{{ tab.url | relative_url }}" class="nav-link">
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
<i class="fa-fw {{ tab.icon }}"></i>
{% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}

<span>{{ site.data.locales[include.lang].tabs.[tab_name] | default: tab.title | upcase }}</span>
Expand All @@ -49,7 +47,7 @@
</ul>
<!-- ul.nav.flex-column -->

<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
<div class="sidebar-bottom d-flex flex-wrap align-items-center w-100">
{% unless site.theme_mode %}
<button class="mode-toggle btn" aria-label="Switch Mode">
<i class="fas fa-adjust"></i>
Expand Down
Loading

0 comments on commit 83bbe4a

Please sign in to comment.