Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ config.xml
salt.bin
thumbnail.ces
/assets/contest
.DS_Store
.DS_Store
assets/marquee
52 changes: 41 additions & 11 deletions assets/output.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
! tailwindcss v3.4.7 | MIT License | https://tailwindcss.com
! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com
*/

/*
Expand Down Expand Up @@ -691,6 +691,10 @@ h1 {
margin: 0.5rem;
}

.mb-10 {
margin-bottom: 2.5rem;
}

.mb-3 {
margin-bottom: 0.75rem;
}
Expand Down Expand Up @@ -763,10 +767,6 @@ h1 {
margin-top: 1.5rem;
}

.mb-10 {
margin-bottom: 2.5rem;
}

.\!block {
display: block !important;
}
Expand Down Expand Up @@ -1016,6 +1016,26 @@ h1 {
border-bottom-right-radius: 0.5rem;
}

.rounded-l-xl {
border-top-left-radius: 0.75rem;
border-bottom-left-radius: 0.75rem;
}

.rounded-r-sm {
border-top-right-radius: 0.125rem;
border-bottom-right-radius: 0.125rem;
}

.rounded-l-sm {
border-top-left-radius: 0.125rem;
border-bottom-left-radius: 0.125rem;
}

.rounded-r-xl {
border-top-right-radius: 0.75rem;
border-bottom-right-radius: 0.75rem;
}

.border {
border-width: 1px;
}
Expand Down Expand Up @@ -1127,6 +1147,11 @@ h1 {
background-color: rgb(248 113 113 / var(--tw-bg-opacity));
}

.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
}

.bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
Expand All @@ -1137,9 +1162,9 @@ h1 {
background-color: rgb(250 204 21 / var(--tw-bg-opacity));
}

.bg-red-500 {
.bg-gray-600 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
}

.bg-\[url\(\'https\:\/\/rc24\.xyz\/goodies\/wallpapers\/CMO_Channel_BG_orange_1600x900\.png\'\)\] {
Expand Down Expand Up @@ -1640,14 +1665,19 @@ h1 {
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
}

.hover\:bg-red-300:hover {
.hover\:bg-red-600:hover {
--tw-bg-opacity: 1;
background-color: rgb(252 165 165 / var(--tw-bg-opacity));
background-color: rgb(220 38 38 / var(--tw-bg-opacity));
}

.hover\:bg-red-600:hover {
.hover\:bg-gray-700:hover {
--tw-bg-opacity: 1;
background-color: rgb(220 38 38 / var(--tw-bg-opacity));
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
}

.hover\:bg-gray-400:hover {
--tw-bg-opacity: 1;
background-color: rgb(156 163 175 / var(--tw-bg-opacity));
}

.hover\:underline:hover {
Expand Down
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ func main() {
}
{
auth.GET("/admin", panel.AdminPage)
auth.GET("/marquee", panel.MarqueePage)
auth.POST("/editmarquee", panel.EditMarquee)
auth.POST("/marquee", func(c *gin.Context) {
c.Redirect(http.StatusMovedPermanently, "/panel/marquee")
})
auth.GET("/contests", panel.ViewContests)
auth.POST("/contests", func(c *gin.Context) {
c.Redirect(http.StatusMovedPermanently, "/panel/contests")
Expand Down
83 changes: 83 additions & 0 deletions templates/marquee.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>

<head>
<title>Edit Marquee | CMOC Control Panel</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap"
rel="stylesheet" />
<link href="/assets/output.css" rel="stylesheet" />
<link rel="apple-touch-icon" sizes="180x180" href="https://www.wiilink24.com/img/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="https://www.wiilink24.com/img/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="https://www.wiilink24.com/img/favicon-16x16.png" />
<link rel="manifest" href="https://www.wiilink24.com/img/site.webmanifest" />
<link rel="mask-icon" href="https://www.wiilink24.com/img/safari-pinned-tab.svg" color="#5bbad5" />
<link rel="shortcut icon" href="https://www.wiilink24.com/img/favicon.ico" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="msapplication-config" content="https://www.wiilink24.com/img/browserconfig.xml" />
<meta name="theme-color" content="#ffffff" />
<script src="https://kit.fontawesome.com/e47ece3e74.js" crossorigin="anonymous"></script>
</head>

<body class="dark:text-white dark:bg-slate-800">
<main class="container py-20 space-y-4">
<div class=" pb-2 flex items-center justify-between">
<div class="flex flex-row gap-3 items-center">
<img src="https://www.wiilink24.com/img/IS-logo.png" class="!h-[60px] dark:invert">
<i class="fa-solid fa-chevron-right text-2xl cursor-pointer" onclick="toggleOpen('toggleOpen');"></i>
<div id="toggleOpen"
class="p-2 flex-row items-center gap-3 rounded-xl bg-gray-50 dark:bg-slate-500 hidden">
<a href="/panel/contests"><button
class="p-2 bg-gray-200 dark:bg-slate-600 hover:bg-gray-300 dark:hover:bg-slate-800 rounded-md transition-all"><i
class="fa-solid fa-flag-checkered"></i> Contests</button></a> |
<a href="/panel/contests/add"><button
class="p-2 hover:bg-gray-200 dark:hover:bg-slate-800 rounded-md transition-all"><i
class="fa-solid fa-circle-plus"></i> Add Contest</button></a> |
<a href="/panel/plaza"><button
class="p-2 hover:bg-gray-200 dark:hover:bg-slate-800 rounded-md transition-all"><i
class="fa-solid fa-users"></i> Plaza</button></a> |
<a href="/panel/artisans"><button
class="p-2 hover:bg-gray-200 dark:hover:bg-slate-800 rounded-md transition-all"><i
class="fa-solid fa-brush"></i> Mii Artisans</button></a>
</div>
</div>
<h2 class="text-right text-lg"><b>CMOC</b><br> Control Panel</h2>
</div>
<hr class="pt-2">
<div class="pb-3 flex items-center justify-end">
<p class="opacity-50">
CMOC <i class="fa-solid fa-caret-right"></i> Edit Marquee
</p>
</div>
<p class="opacity-30">Write down below the text you want to display on the Check Mii Out Channel Marquee.
</p>
<form class="flex flex-row items-center gap-1" action="/panel/editmarquee" enctype="multipart/form-data"
method="post">
<input
class="w-full p-4 rounded-l-xl rounded-r-sm bg-gray-300 dark:bg-slate-600 hover:bg-gray-400 dark:hover:bg-slate-700 transition-all"
type="text" name="marquee_text" id="">
<input
class="p-4 rounded-l-sm rounded-r-xl bg-gray-600 dark:bg-slate-500 hover:bg-gray-700 dark:hover:bg-slate-600 transition-all"
type="submit" value="Update">
</form>
<br />
<hr />
<p>©2020 - 2024 WiiLink Team</p>
</main>
</body>

<script>
function toggleOpen(id) {
const element = document.getElementById(id);
if (element.style.display === 'none') {
element.style.display = 'flex';
localStorage.setItem(id, 'open');
} else {
element.style.display = 'none';
localStorage.setItem(id, 'closed');
}
}
</script>
</html>
27 changes: 27 additions & 0 deletions webpanel/misc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package webpanel

import (
"fmt"
"net/http"
"os"

"github.com/gin-gonic/gin"
)

func (w *WebPanel) MarqueePage(c *gin.Context) {
c.HTML(http.StatusOK, "marquee.html", gin.H{})
}

func (w *WebPanel) EditMarquee(c *gin.Context) {
marquee_text := c.PostForm("marquee_text")

err := os.WriteFile(fmt.Sprintf("%s/marquee/marquee.txt", w.Config.AssetsPath), []byte(marquee_text), 0666)
if err != nil {
c.HTML(http.StatusInternalServerError, "error.html", gin.H{
"error": err,
})
return
}

c.Redirect(http.StatusTemporaryRedirect, "/panel/marquee")
}