-
Notifications
You must be signed in to change notification settings - Fork 52
/
themes.html
127 lines (124 loc) · 4.03 KB
/
themes.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
title: Discord themes & plugins!
description: A list of free and paid high quality themes made by our community. For the past 3 years we have been the #1 go to website for all Discord themes!
hero: Discord Themes
subtitle: Custom CSS themes made by our commuity!
layout: default
search: true
---
<div class="content" id="themes">
<section style="padding: 40px 0;">
<div class="container">
<h2>Themes ({{ site.themes | size }})</h2>
<p class="editor-link" style="text-align: center;"><a href="cloudcannon:collections/_products" class="btn"><strong>✎</strong> Manage products</a></p>
<ul class="product-list" id="product-list">
<!-- Third Ad Responsive -->
<li><div class="styles"><ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1998206533560539"
data-ad-slot="9689023387"
data-ad-format="auto"
data-full-width-responsive="true">
</ins></div></li>
{% assign sortedThemes = site.themes | sort: 'title' %}
{% for theme in sortedThemes %}
<li>
<div class="styles">
{% include product-styles.html product=theme %}
<div class="product-details">
<h4><a href="{{ theme.url }}">{{ theme.title }}</a></h4>
<h5>by <b>{{ theme.author }}</b></h5>
<div class="product-description">
{{ theme.description_markdown | truncate: 100 | markdownify }}
</div>
{% if theme.price == nil %}
{% else %}
<p>${{ theme.price }}</p>
{% endif %}
<div class="button-wrapper flex-row">
<div class="button flex-button">
<a href="{{ theme.download }}" target="blank">Download</a>
<a href="{{ site.url }}/demo/{{ theme.style }}/?theme={{ theme.demo }}" target="blank">Demo</a>
</div>
</div>
</div>
</div>
</li>
{% endfor %}
<!-- Rectangle Ad 336x280 -->
<li><div class="styles">
<ins class="adsbygoogle"
style="display:inline-block;width:336px;height:280px"
data-ad-client="ca-pub-1998206533560539"
data-ad-slot="8585740998"></ins></div></li>
<!-- Third Ad Responsive -->
<li><div class="styles"><ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1998206533560539"
data-ad-slot="9689023387"
data-ad-format="auto"
data-full-width-responsive="true">
</ins></div></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</section>
</div>
<a href="https://github.com/MrRobotjs/BetterDocs/tree/gh-pages/_themes#uploading-a-theme">
<div class="upload-button-container">
<div class="upload-btn">
<span>+</span> Upload Theme
</div>
</div>
</a>
<script>
$(function() {
$("#search-input").keyup(function() {
console.log("searching for: " + $(this).val());
var search = $(this).val().toLowerCase();
$("#product-list").find("li").each(function() {
if ($(this).text().toLowerCase().includes(search)) {
$(this).show();
} else {
$(this).hide();
}
});
});
});
/*
$(function() {
$.fn.sortList = function() {
var mylist = $(this);
var listitems = $('li', mylist).get();
listitems.sort(function(a, b) {
var compA = $(a).text().toUpperCase();
var compB = $(b).text().toUpperCase();
return (compA < compB) ? -1 : 1;
});
$.each(listitems, function(i, itm) {
mylist.append(itm);
});
}
$("ul#product-list").sortList();
});
selector to parent element (best approach by id)
var parent = document.querySelector("ul#product-list"),
take items (parent.children) into array
itemsArray = Array.prototype.slice.call(parent.children);
sort items in array by custom criteria
itemsArray.sort(function(a, b) {
inner text suits best (even when formated somehow)
if (a.innerText < b.innerText) return -1;
if (a.innerText > b.innerText) return 1;
return 0;
});
reorder items in the DOM
itemsArray.forEach(function(item) {
one by one move to the end in correct order
parent.appendChild(item);
});*/
var count = $('ul#product-list').children().length;
$('#result').text(count);
</script>