Skip to content

Commit 9ff0ab9

Browse files
authored
Commands Page Done (#2)
* Commands Page Done CSS File updated and fixed Footer and Nav Bar Changed to Flex-Style Removed Main -1 * Commands Page Done CSS File updated and fixed Footer and Nav Bar Changed to Flex-Style Removed Main -1
1 parent 5f8ceee commit 9ff0ab9

4 files changed

Lines changed: 287 additions & 117 deletions

File tree

src/main/java/org/mangorage/mangobotsite/website/WebsiteConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public final class WebsiteConstants {
99
new HeaderData("/home", "Home", true),
1010
new HeaderData("/home#plugins", "Plugins", true),
1111
new HeaderData("/tricks", "Tricks", true),
12-
new HeaderData("/home#contact", "Contact", true)
12+
new HeaderData("/home#contact", "Contact", true),
13+
new HeaderData("/commands", "Commands", true)
1314
);
1415
}

src/main/java/org/mangorage/mangobotsite/website/servlet/CommandsServlet.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.mangorage.mangobotcore.api.command.v1.AbstractCommand;
77
import org.mangorage.mangobotcore.api.plugin.v1.PluginManager;
88
import org.mangorage.mangobotplugin.entrypoint.MangoBot;
9+
import org.mangorage.mangobotsite.website.WebsiteConstants;
910
import org.mangorage.mangobotsite.website.servlet.impl.StandardHttpServlet;
1011
import org.mangorage.mangobotsite.website.util.MapBuilder;
1112
import org.mangorage.mangobotsite.website.util.WebUtil;
@@ -20,6 +21,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
2021

2122
WebUtil.processTemplate(
2223
MapBuilder.of()
24+
.put("headers", WebsiteConstants.headers)
2325
.put("commandDataList",
2426
dispatcher.getAllRegisteredCommands()
2527
.stream()
Lines changed: 97 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,118 @@
11
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Commands</title>
5-
<style>
6-
body {
7-
font-family: monospace;
8-
background: #0f0f0f;
9-
color: #eee;
10-
padding: 20px;
11-
}
12-
13-
.command-block {
14-
margin-bottom: 24px;
15-
border-bottom: 1px solid #333;
16-
padding-bottom: 12px;
17-
}
18-
19-
.command {
20-
margin: 4px 0;
21-
}
22-
23-
/* Command name tooltip */
24-
.cmd {
25-
cursor: help;
26-
position: relative;
27-
color: #ffd37f;
28-
}
29-
30-
.cmd .tooltip {
31-
display: none;
32-
position: absolute;
33-
background: #222;
34-
border: 1px solid #555;
35-
padding: 6px;
36-
border-radius: 4px;
37-
top: 1.5em;
38-
left: 0;
39-
white-space: nowrap;
40-
z-index: 100;
41-
}
42-
43-
.cmd:hover .tooltip {
44-
display: block;
45-
}
46-
47-
/* Parameter tooltip */
48-
.param {
49-
cursor: help;
50-
position: relative;
51-
color: #7fd7ff;
52-
}
53-
54-
.param.required {
55-
color: #ff7f7f;
56-
}
57-
58-
.param .tooltip {
59-
display: none;
60-
position: absolute;
61-
background: #222;
62-
border: 1px solid #555;
63-
padding: 6px;
64-
border-radius: 4px;
65-
top: 1.5em;
66-
left: 0;
67-
white-space: nowrap;
68-
z-index: 100;
69-
}
70-
71-
.param:hover .tooltip {
72-
display: block;
73-
}
74-
75-
</style>
76-
</head>
77-
<body>
78-
79-
<h1>Command List</h1>
80-
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Commands - MangoBot</title>
7+
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
8+
<link rel="stylesheet" href="css/main.css">
9+
<link rel="preconnect" href="https://fonts.googleapis.com">
10+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
12+
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
13+
</head>
14+
<body>
15+
<!-- Navbar -->
16+
<nav class="navbar">
17+
<div class="nav-container">
18+
<a href="/home" class="nav-logo">
19+
<span class="logo-icon">
20+
<img src="images/favicon.ico" alt="Logo" width="48">
21+
</span>
22+
<span class="logo-text">MangoBot</span>
23+
</a>
24+
<ul class="nav-menu">
25+
<#list headers as header>
26+
<li><a href="${header.page()}" class="nav-link<#if header.active()!false> active</#if>">${header.text()}</a></li>
27+
</#list>
28+
</ul>
29+
<a href="https://discord.mangorage.org/" target="_blank" class="nav-cta">
30+
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
31+
<path d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/>
32+
</svg>
33+
Join Discord
34+
</a>
35+
</div>
36+
</nav>
37+
38+
<!-- Page Header -->
39+
<div class="page-header">
40+
<div class="container">
41+
<div class="header-content">
42+
<span class="section-badge">Documentation</span>
43+
<h1>Command List</h1>
44+
<p class="header-subtitle">
45+
Complete reference of all available commands and their parameters
46+
</p>
47+
</div>
48+
</div>
49+
</div>
50+
51+
<!-- Commands Content -->
52+
<div class="commands-content">
53+
<div class="container">
8154
<#list commandDataList as data>
8255
<div class="command-block">
83-
84-
<!-- Show CommandData.cmd -->
8556
<h2>${data.cmd()}</h2>
8657

8758
<#list data.commandParts() as cmd>
8859
<div class="command">
89-
90-
<!-- Command name with tooltip -->
9160
<#if cmd.getCommandNotes()?has_content>
9261
<span class="cmd">
93-
${cmd.getName()}
94-
<span class="tooltip">
95-
<#list cmd.getCommandNotes() as note>
96-
<div>• ${note}</div>
97-
</#list>
62+
${cmd.getName()}
63+
<span class="tooltip">
64+
<#list cmd.getCommandNotes() as note>
65+
<div>${note}</div>
66+
</#list>
67+
</span>
9868
</span>
99-
</span>
10069
<#else>
101-
<span>${cmd.getName()}</span>
70+
<span class="cmd">${cmd.getName()}</span>
10271
</#if>
10372

104-
<!-- Parameters -->
10573
<#list cmd.getParameters() as p>
10674
<span class="param <#if p.isRequired()>required</#if>">
107-
<#if p.isRequired()>
108-
&lt;${p.getName()}&gt;
109-
<#else>
110-
[${p.getName()}]
111-
</#if>
112-
113-
<span class="tooltip">
114-
<div><b>Name:</b> ${p.getName()}</div>
115-
<div><b>Type:</b> ${p.getType()}</div>
116-
<div><b>Argument Type:</b> ${p.getArgumentType()}</div>
117-
<div><b>Description:</b> ${p.getDescription()}</div>
118-
<div><b>Suggestions:</b> ${p.getSuggestions()}</div>
119-
<div><b>Required:</b> ${p.isRequired()?string("yes","no")}</div>
75+
<#if p.isRequired()>
76+
&lt;${p.getName()}&gt;
77+
<#else>
78+
[${p.getName()}]
79+
</#if>
80+
81+
<span class="tooltip">
82+
<div><b>Name:</b> ${p.getName()}</div>
83+
<div><b>Type:</b> ${p.getType()}</div>
84+
<div><b>Argument Type:</b> ${p.getArgumentType()}</div>
85+
<div><b>Description:</b> ${p.getDescription()}</div>
86+
<div><b>Suggestions:</b> ${p.getSuggestions()}</div>
87+
<div><b>Required:</b> ${p.isRequired()?string("yes","no")}</div>
88+
</span>
12089
</span>
121-
</span>
12290
</#list>
123-
12491
</div>
12592
</#list>
126-
12793
</div>
12894
</#list>
129-
130-
</body>
131-
</html>
95+
</div>
96+
</div>
97+
98+
<!-- Footer -->
99+
<footer class="footer">
100+
<div class="container">
101+
<div class="footer-content">
102+
<div class="footer-brand">
103+
<span class="logo-icon">
104+
<img src="images/favicon.ico" alt="Logo" width="48">
105+
</span>
106+
<span class="logo-text">MangoBot</span>
107+
</div>
108+
<p class="footer-text">Developed with passion by MangoRage</p>
109+
<div class="footer-links">
110+
<#list headers as header>
111+
<a href="${header.page()}">${header.text()}</a>
112+
</#list>
113+
</div>
114+
</div>
115+
</div>
116+
</footer>
117+
</body>
118+
</html>

0 commit comments

Comments
 (0)