Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(theme/plugin): improve external links behavior and visibility #2054

Merged
merged 5 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion themes/navy/layout/partial/plugin.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<li class="plugin on" id="{{ plugin.name }}">
<a href="{{ plugin.link }}" class="plugin-name" target="_blank">{{ plugin.name }}</a>
<a href="{{ plugin.link }}" class="plugin-name" target="_blank">{{ plugin.name }} <i class="fa fa-external-link"></i></a>
<p class="plugin-desc">{{ plugin.description }}</p>
<div class="plugin-tag-list">
{% for tag in plugin.tags %}
Expand Down
11 changes: 8 additions & 3 deletions themes/navy/layout/partial/theme.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
<noscript>
<img src="{{ url_for('themes/screenshots/' + plugin.name + '.png') }}" class="plugin-screenshot-img" alt="{{ plugin.name }}">
</noscript>
<img data-src="{{ url_for('themes/screenshots/' + plugin.name + '.png') }}" data-sizes="auto" class="plugin-screenshot-img lazyload" alt="{{ plugin.name }}">
<img data-src="{{ url_for('themes/screenshots/' + plugin.name + '.png') }}" data-sizes="auto" class="plugin-screenshot-img lazyload" alt="{{ plugin.name }}" data-zoom-src="{{ url_for('themes/screenshots/' + plugin.name + '.png') }}" data-zoomable>
uiolee marked this conversation as resolved.
Show resolved Hide resolved
{% if plugin.preview %}
<a href="{{ plugin.preview }}" class="plugin-preview-link" target="_blank"><i class="fa fa-eye"></i></a>
<div class='plugin-screenshot-mask'><i class="fa fa-eye"></i></div>
stevenjoezhang marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}
</div>
<a href="{{ plugin.link }}" class="plugin-name" target="_blank">{{ plugin.name }}</a>
<a href="{{ plugin.link }}" class="plugin-name" target="_blank">{{ plugin.name }} <i class="fa fa-external-link"></i></a>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add <i class="fa fa-external-link"></i> to mark it as an external link explicitly.

{% if plugin.preview %}
<div class="plugin-preview-wrap">
<a href="{{ plugin.preview }}" class="plugin-preview-link" target="_blank"> Visit preview site <i class="fa fa-external-link"></i></a>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add preview link site instead of line 8

<div>
{% endif %}
<p class="plugin-desc">{{ plugin.description }}</p>
<div class="plugin-tag-list">
{% for tag in plugin.tags %}
Expand Down
4 changes: 3 additions & 1 deletion themes/navy/layout/plugins.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
</div>
</div>
</div>
<script>window.SEARCH_INDEX = {{ lunr_index(site.data[page.data]) }}</script>
<script>window.SEARCH_INDEX = {{ lunr_index(site.data[page.data]) }}</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/medium-zoom.min.js"></script>
<script defer>mediumZoom('[data-zoomable]',{background:'#171f26'});</script>
36 changes: 29 additions & 7 deletions themes/navy/source/css/_partial/plugins.styl
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,28 @@
font-size: 20px
text-decoration: none
line-height: 1
.fa-external-link
font-size: 12px
opacity: 0.7
&:hover
color: color-link-hover

.plugin-preview-wrap
margin: 10px 0 10px 0

.plugin-preview-link
font-family: font-title
color: color-link
font-size: 14px
text-decoration: none
line-height: 1
.fa-external-link
font-size: 12px
opacity: 0.7
&:hover
color: color-link-hover


.plugin-desc
line-height: line-height
margin: 1em 0
Expand All @@ -84,6 +103,12 @@
padding-top: (10 / 16 * 100)% // 16:10 ratio
height: 0
overflow: hidden
&:hover
.plugin-screenshot-mask
opacity: 1
.fa
opacity: 1
transform: scale(1)

.plugin-screenshot-img
position: absolute
Expand All @@ -98,7 +123,7 @@
&.lazyloaded
opacity: 1

.plugin-preview-link
.plugin-screenshot-mask
position: absolute
top: 0
left: 0
Expand All @@ -109,11 +134,7 @@
text-align: center
opacity: 0
transition: 0.15s
&:hover
opacity: 1
.fa
opacity: 1
transform: scale(1)
pointer-events: none
.fa
position: absolute
top: 0
Expand All @@ -127,4 +148,5 @@
opacity: 0
transform: scale(6)
transition: 0.2s
transition-delay: 0.15s
transition-delay: 0.15s
pointer-events: none