HK420
September 20, 2020, 9:48pm
1
Hello all. I am trying to make a good list but I just can’t find a good place to start my code.
I legit have this…
Can anyone send me a suggestion on how to make my list look better.
Heres the code:
<%- include("partials/header", { bot, user, path, title: "Twintails🎀 - Bot Dashboard" }) %>
<link rel="shortcut icon" href="https://i.imgur.com/NgV0KSf.png">
<% user.guilds.forEach(guild => {
const permsOnGuild = new perms(guild.permissions);
if(!permsOnGuild.has("MANAGE_GUILD")) return;
%>
<p><%= guild.name %></p>
<% if (bot.guilds.cache.get(guild.id)) { %>
<a href="/dashboard/<%= guild.id %>">Edit Settings</a>
<% } else { %>
<a
href="<%= `https://discordapp.com/oauth2/authorize?client_id=${bot.user.id}&scope=bot&guild_id=${guild.id}&response_type=code&redirect_uri=${encodeURIComponent(`${bot.config.domain}${bot.config.port == 80 ? "" : `:${bot.config.port}`}/callback`)}` %>">Add
Bot</a>
<% } %>
<% }); %>
<%- include("partials/footer") %>
uwu, thanks!
Daw588
September 20, 2020, 10:14pm
2
How you expect the item to look like?
Like this?
[Server Name] [Edit Settings]
HK420
September 20, 2020, 10:16pm
3
I was thinking more of a clean design like that of mee6
1 Like
Daw588
September 20, 2020, 10:19pm
4
I would suggest you to search on google on how to in css, so you can learn more about styling. I will try to play with css and see if there is nice design that I can suggest you.
Daw588
September 20, 2020, 10:58pm
6
Okay, this is quick design that I made:
test.js
- just for test purposes JavaScript file
["server1", "server2", "server3"].forEach((name) => {
var item = document.createElement("div");
item.classList.add("server");
document.body.appendChild(item);
var div = document.createElement("div");
div.classList.add("name");
div.innerHTML = name;
item.appendChild(div);
var button = document.createElement("button");
button.innerHTML = "Edit";
button.classList.add("edit");
item.appendChild(button);
});
style.css
- actual style file
.server { background: #303030; padding: 10px; margin: 0; display: block; }
.server * { -webkit-appearance: none; box-sizing: border-box; color: #eee; display: inline-block; font-family: Arial; }
.server .name { width: 87.5vw; padding: 5px; }
.server .edit { background: #505050; border: none; outline: none; border-radius: 15px; padding: 5px; padding-left: 25px; padding-right: 25px; }
Keep in mind this may not be responsive and it contains Arial
font, so you may want to remove it from css.
1 Like
HK420
September 20, 2020, 11:04pm
8
What would you call something like this? Just for reference. A list, or what?
Daw588
September 20, 2020, 11:05pm
9
You mean the classname
for those div
’s?
HK420
September 20, 2020, 11:06pm
10
I just mean in general, what would you call something that has a Name and button option.
Daw588
September 20, 2020, 11:08pm
11
A list
, specifically for this list
, an server-list
.
HK420
September 20, 2020, 11:08pm
12
omg, that was at the tip of my tongue for so long, thanks.
1 Like
Lol, why use any framework when you can write it yourself
My advice is add some padding around your list. Then you can round some corners, play with units and colors until you get to something good looking. Tbh i’m not really proud of my open radio selector list either but it’s sufficent
and all I used with padding and some cool selector magic to pick the right colors
HK420
September 22, 2020, 11:44am
16
My creative skills are in the negatives, mind you.