-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
junsan1
committed
Jul 6, 2024
1 parent
90e033d
commit 531a832
Showing
5 changed files
with
511 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
layout: base | ||
--- | ||
<h1>{{ page.title }}</h1> | ||
|
||
<div id="filters"> | ||
{% assign all_filters = page.software | map: "filters" | flatten | uniq | sort %} | ||
<button class="filter-btn active" data-filter="all">All</button> | ||
{% for filter in all_filters %} | ||
<button class="filter-btn" data-filter="{{ filter }}">{{ filter }}</button> | ||
{% endfor %} | ||
</div> | ||
|
||
<div id="software-list"> | ||
{% for item in page.software %} | ||
<div class="software-item" data-filters="{{ item.filters | join: ' ' }}"> | ||
<img src="{{ item.logo | relative_url }}" alt="{{ item.name }} logo"> | ||
<h2>{{ item.name }}</h2> | ||
<p>{{ item.description }}</p> | ||
<a href="{{ item.website }}" target="_blank" rel="noopener noreferrer">Official Website</a> | ||
<a href="{{ item.pedia_link | relative_url }}">Learn More</a> | ||
{% if item.github %} | ||
<a href="{{ item.github }}" target="_blank" rel="noopener noreferrer">GitHub</a> | ||
{% endif %} | ||
<div class="filters"> | ||
{% for filter in item.filters %} | ||
<span class="filter-tag">{{ filter }}</span> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
<script> | ||
document.addEventListener('DOMContentLoaded', function() { | ||
const filterButtons = document.querySelectorAll('.filter-btn'); | ||
const softwareItems = document.querySelectorAll('.software-item'); | ||
|
||
filterButtons.forEach(button => { | ||
button.addEventListener('click', function() { | ||
const filter = this.dataset.filter; | ||
|
||
filterButtons.forEach(btn => btn.classList.remove('active')); | ||
this.classList.add('active'); | ||
|
||
softwareItems.forEach(item => { | ||
if (filter === 'all' || item.dataset.filters.includes(filter)) { | ||
item.style.display = 'block'; | ||
} else { | ||
item.style.display = 'none'; | ||
} | ||
}); | ||
}); | ||
}); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.