commit d7e3a984d806e449e7a322b23d114b17c9d519ad
parent 6d9a68ccc142ccb1982adcd6936c91d5ad0c7a35
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sun, 11 Jun 2023 16:58:51 -0700
cleanup
Diffstat:
1 file changed, 4 insertions(+), 54 deletions(-)
diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go
@@ -4860,10 +4860,6 @@ var cssReset = `<style>
border-collapse: collapse;
border-spacing: 0;
}
-
-html, body {
- background-color: #222;
-}
</style>`
func chessGamefoolMate(g *interceptors.ChessGame) {
@@ -4924,55 +4920,8 @@ func chessGameQueenSideCastle(g *interceptors.ChessGame) {
func ChessGameFormHandler(c echo.Context) error {
key := c.Param("key")
- out := `<style>
-/* http://meyerweb.com/eric/tools/css/reset/
- v2.0 | 20110126
- License: none (public domain)
-*/
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, embed,
-figure, figcaption, footer, header, hgroup,
-menu, nav, output, ruby, section, summary,
-time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-/* HTML5 display-role reset for older browsers */
-article, aside, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section {
- display: block;
-}
-body {
- line-height: 1;
-}
-ol, ul {
- list-style: none;
-}
-blockquote, q {
- quotes: none;
-}
-blockquote:before, blockquote:after,
-q:before, q:after {
- content: '';
- content: none;
-}
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-/* --- end --- */
+ out := cssReset
+ out += `<style>
.newBoard {
position: relative;
aspect-ratio: 1 / 1;
@@ -5011,7 +4960,6 @@ input[type=checkbox]:checked + label {
border: 3px solid red;
}
</style>`
-
authUser := c.Get("authUser").(*database.User)
g := interceptors.ChessInstance.GetGame(key)
isFlipped := authUser.ID == g.Player2.ID
@@ -5125,6 +5073,7 @@ func ChessGameHandler(c echo.Context) error {
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTMLCharsetUTF8)
c.Response().WriteHeader(http.StatusOK)
_, _ = c.Response().Write([]byte(cssReset))
+ _, _ = c.Response().Write([]byte(`<style>html, body { background-color: #222; }</style>`))
card1 := g.DrawPlayerCard(key, isFlipped, false)
_, _ = c.Response().Write([]byte(fmt.Sprintf(`<div id="div_0">%s</div>`, card1)))
return nil
@@ -5147,6 +5096,7 @@ func ChessGameHandler(c echo.Context) error {
c.Response().Header().Set("Connection", "keep-alive")
send(cssReset)
+ send(`<style>html, body { background-color: #222; }</style>`)
authorizedChannels := make([]string, 0)
authorizedChannels = append(authorizedChannels, key)