added search + solved icon

This commit is contained in:
CorwinDev committed 2022-08-11 21:27:14 +02:00
1 parent d91ebbfa25
commit b8d67d588c
17 files changed
+290 -159

No files matched your search

+27 -99
View File
@@ -1,12 +1,12 @@
<%- include("./includes/header.ejs") %>
<div class="promotedbots">
<% var nbots=bots.filter(a=> a.promoted == true)
nbots.forEach((val, key) => {
randomIndex = Math.ceil(Math.random()*(key + 1));
nbots[key] = nbots[randomIndex];
nbots[randomIndex] = val;
});
if(nbots.length > 0) { %>
nbots.forEach((val, key) => {
randomIndex = Math.ceil(Math.random()*(key + 1));
nbots[key] = nbots[randomIndex];
nbots[randomIndex] = val;
});
if(nbots.length > 0) { %>
<div class="mx-auto text-center">
<br>
<h2 class="text-xl text-white text-center"><i class="fa fa-bullhorn" aria-hidden="true"></i> Promoted Bots
@@ -16,12 +16,10 @@
<div class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
<% } %>
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
<img class="w-full rounded-full" src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp" alt="<%= bot.name %>">
<div class="px-6 py-4 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %>
<%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %>
<% } %>
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color " onclick="location.href='/bot/<%=bot.id%> ';" style="cursor: pointer;">
<img class="w-full rounded-full" src="<%= global.bsl.users.cache.get(bot.id).user.displayAvatarURL() %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
<div class="px-6 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %><% } %>
</p>
</div>
<div class="px-6 py-4">
@@ -32,19 +30,10 @@
<%= bot.description %>
</p>
</div>
<div class="px-6 pt-4 pb-2">
<a href="/bot/<%= bot.id %>" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
<i class="fa fa-eye" aria-hidden="true"></i> View
</a>
<a href="/bot/<%= bot.id %>/invite" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
<i class="fa fa-link" aria-hidden="true"></i> Invite
</a>
</div>
<% if(bot.tags) {%>
<div class="px-6 pt-4 pb-2">
<% bot.tags.forEach(tag=>{ %>
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
<%= tag %>
<% bot.tags.slice(-3).forEach(tag=>{ %>
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %>
</a>
<% }) %>
</div>
@@ -56,12 +45,12 @@
</div>
<div class="randombots">
<% var nbots=bots.filter(a=> a.verified == true)
nbots.forEach((val, key) => {
randomIndex = Math.ceil(Math.random()*(key + 1));
nbots[key] = nbots[randomIndex];
nbots[randomIndex] = val;
});
if(nbots.length > 0) { %>
nbots.forEach((val, key) => {
randomIndex = Math.ceil(Math.random()*(key + 1));
nbots[key] = nbots[randomIndex];
nbots[randomIndex] = val;
});
if(nbots.length > 0) { %>
<div class="mx-auto text-center">
<br>
<h2 class="text-xl text-white text-center"><i class="fa fa-shuffle" aria-hidden="true"></i> Random Bots
@@ -71,86 +60,25 @@
<div class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
<% } %>
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
<img class="w-full rounded-full" src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp" alt="<%= bot.name %>">
<div class="px-6 py-4 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %><% } %></p>
<% getBot = global.bsl.users.cache.get(bot.id); %>
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color " onclick="location.href='/bot/<%=bot.id%> ';" style="cursor: pointer;">
<img class="w-full rounded-full" src="<%= "https://cdn.discordapp.com/avatars/" + bot.id + "/" + getBot?.avatar +".png" %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
<div class="px-6 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %><% } %>
</p>
</div>
<div class="px-6 py-4">
<div class="font-bold text-xl mb-2 text-white">
<%= bot.name %>
<%= getBot.username %>
</div>
<p class="text-white text-base">
<%= bot.description %>
</p>
</div>
<div class="px-6 pt-4 pb-2">
<a href="/bot/<%= bot.id %>" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
<i class="fa fa-eye" aria-hidden="true"></i> View
</a>
<a href="/bot/<%= bot.id %>/invite" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
<i class="fa fa-link" aria-hidden="true"></i> Invite
</a>
</div>
<% if(bot.tags) {%>
<div class="px-6 pt-4 pb-2">
<% bot.tags.forEach(tag=>{ %>
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
<%= tag %>
</a>
<% }) %>
</div>
<% } %>
</div>
<% } } %>
</div>
</div>
<div class="randombots">
<% var nbots=bots.filter(a=> a.verified == true)
nbots.forEach((val, key) => {
randomIndex = Math.ceil(Math.random()*(key + 1));
nbots[key] = nbots[randomIndex];
nbots[randomIndex] = val;
});
if(nbots.length > 0) { %>
<div class="mx-auto text-center">
<br>
<h2 class="text-xl text-white text-center"><i class="fa fa-check-to-slot" aria-hidden="true"></i> Best bots
</h2>
<p class="content text-white text-center" style="opacity:.6">Bots with highest votes!</p>
</div>
<div class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
<% } %>
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
<img class="w-full rounded-full" src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp" alt="<%= bot.name %>">
<div class="px-6 py-4 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %>
<%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %>
<% } %>
</p>
</div>
<div class="px-6 py-4">
<div class="font-bold text-xl mb-2 text-white">
<%= bot.name %>
</div>
<p class="text-white text-base">
<%= bot.description %>
</p>
</div>
<div class="px-6 pt-4 pb-2">
<a href="/bot/<%= bot.id %>" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
<i class="fa fa-eye" aria-hidden="true"></i> View
</a>
<a href="/bot/<%= bot.id %>/invite" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
<i class="fa fa-link" aria-hidden="true"></i> Invite
</a>
</div>
<% if(bot.tags) {%>
<div class="px-6 pt-4 pb-2">
<% bot.tags.forEach(tag=>{ %>
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
<%= tag %>
<% bot.tags.slice(-3).forEach(tag=>{ %>
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %>
</a>
<% }) %>
</div>