fix up templates

This commit is contained in:
f0x 2021-09-10 22:47:56 +02:00
commit 28d16a9895
7 changed files with 322 additions and 88 deletions

View file

@ -74,8 +74,9 @@ func (m *Module) statusTemplateHandler(c *gin.Context) {
}
c.HTML(http.StatusOK, "status.tmpl", gin.H{
"instance": instance,
"status": status,
"context": context,
"instance": instance,
"status": status,
"context": context,
"stylesheets": []string{"/assets/Fork-Awesome/css/fork-awesome.min.css", "/assets/status.css"},
})
}

View file

@ -1,46 +1,71 @@
html, body {
padding: 0;
margin: 0;
background: #525c66;
background: rgb(70, 79, 88);
color: #fafaff;
font-family: sans-serif;
}
body {
display: grid;
grid-template-columns: 1fr 50% 1fr;
grid-template-columns: 1fr 90ch 1fr;
line-height: 1.5em;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
grid-auto-rows: auto;
grid-auto-flow: dense;
line-height: 1.5em;
}
body > * {
main {
background: #525c66;
display: grid;
padding-top: 2rem;
grid-template-columns: 1fr 50% 1fr;
grid-template-columns: auto min(92%, 90ch) auto;
}
main .left {
grid-column: 1;
}
main .right {
grid-column: 3;
}
main.lightgray {
background: #525c66;
}
main > * {
align-self: start;
grid-column: 2;
}
body header, body footer, body .fullWidth {
grid-column: 1/4;
grid-column: 1/-1;
}
body .left {
grid-column: 1;
}
body .right {
grid-column: 3;
}
header {
background: rgb(70, 79, 88);
padding: 2rem;
margin-bottom: 4rem;
padding: 2rem 0;
padding-bottom: 0;
display: flex;
flex-wrap: wrap;
}
header img {
height: 4rem;
padding-left: 2rem;
padding-bottom: 2rem;
}
header div {
height: 100%;
margin: 0 2rem;
margin-top: -2rem;
flex-grow: 1;
align-self: center;
display: flex;
}
header div h1 {
align-self: center;
}
h1 {
/* color: $acc1; */
margin: 0;
@ -160,26 +185,21 @@ footer a {
}
@media screen and (orientation: portrait) {
body {
main {
grid-template-columns: 1fr 92% 1fr;
}
body footer, body .left, body .right {
grid-column: 2;
}
header {
text-align: center;
}
footer {
padding: 0;
margin-top: 2rem;
grid-template-columns: 1fr;
}
footer div {
margin: 1rem 0;
margin: 0.3rem 0;
}
section.apps .applist {

212
web/assets/status.css Normal file
View file

@ -0,0 +1,212 @@
main {
background: transparent;
grid-auto-rows: auto;
}
.thread {
display: flex;
flex-direction: column;
}
.toot {
position: relative;
background: rgb(75, 84, 93);
padding: 2rem;
/* padding-bottom: 0; */
display: grid;
grid-template-columns: 3.2rem auto 1fr;
column-gap: 0.5rem;
margin-bottom: 0.2rem;
}
.toot a {
position: relative;
z-index: 1;
color: inherit;
text-decoration: none;
}
.toot .avatar {
grid-row: span 2;
}
.toot .avatar img {
height: 3.2rem;
width: 3.2rem;
object-fit: cover;
}
.toot .displayname {
font-weight: bold;
font-size: 1.2rem;
align-self: start;
}
.toot .username {
color: #b0b0b5;
justify-self: start;
}
.toot .text {
margin: 0;
grid-column: span 2;
}
.toot .text a {
color: #de8957;
text-decoration: underline;
}
.toot .media {
margin-top: 0.6rem;
border-radius: 0.2rem;
grid-column: span 3;
display: grid;
grid-template-columns: 50% 50%;
grid-auto-rows: 16rem;
overflow: hidden;
gap: 0.3rem;
}
.toot .media a {
position: relative;
}
.toot .media .no-image-desc {
display: flex;
position: absolute;
bottom: 0.1rem;
right: 0.4rem;
content: "(!)";
color: white;
background: #5897df;
padding: 0.2rem 0.4rem;
border-radius: 100%;
z-index: 3;
}
.toot .media .no-image-desc span {
margin-left: 0.3rem;
display: none;
}
.toot .media .no-image-desc:hover span {
display: block;
}
.toot .media .no-image-desc:hover {
border-radius: 0.2rem;
}
.toot .media img {
width: 100%;
height: 100%;
object-fit: cover;
}
.toot .media.single a {
grid-column: span 2;
}
.toot .media.odd a:first-child {
grid-row: span 2;
}
.toot .info {
display: none;
}
.toot .info div {
position: relative;
padding-right: 1.3rem;
}
.toot .info .stats {
display: flex;
}
.toot .info {
color: #b0b0b5;
grid-column: span 3;
margin-top: 0.5rem;
flex-wrap: wrap;
}
.toot .info div.stats::after {
display: none;
}
.toot .info div::after {
display: block;
background: #b0b0b5;
height: 0.25rem;
width: 0.25rem;
content: "";
position: absolute;
top: calc((1.5rem - 0.25rem) / 2);
right: 0.55rem;
border-radius: 1rem;
}
.toot .info div:last-child::after {
display: none;
}
.toot .info div:last-child {
margin-right: 0;
}
.toot .toot-link {
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
position: absolute;
z-index: 0;
}
.toot {}
.toot:first-child {
/* top left, top right */
border-radius: 0.3rem 0.3rem 0 0;
}
.toot:last-child {
/* bottom left, bottom right */
border-radius: 0 0 0.3rem 0.3rem;
padding-bottom: 1.5rem;
}
.toot.expanded {
background: #525c66;
padding-bottom: 1.5rem;
}
.toot.expanded .displayname {
grid-column: span 2;
}
.toot.expanded .text {
grid-column: span 3;
grid-row: span 1;
margin-top: 0.3rem;
}
.toot.expanded .info {
display: flex;
}
.toot.expanded .media {
grid-auto-rows: 1fr;
max-height: 120rem;
}
footer + div { /* something weird from the devstack.. */
display: none;
}

View file

@ -1,11 +1,9 @@
{{ template "header.tmpl" .}}
<aside class="left logo">
<img src="/assets/sloth.png" alt="Clipart styled sloth logo">
</aside>
<section>
<h1>404: Page Not Found</h1>
If you believe this was an error, you can <a href="{{.instance.ContactAccount.URL}}">contact an admin</a>
</section>
<main>
<section>
<h1>404: Page Not Found</h1>
If you believe this was an error, you can <a href="{{.instance.ContactAccount.URL}}">contact an admin</a>
</section>
</main>
{{ template "footer.tmpl" .}}

View file

@ -8,8 +8,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="og:title" content="GoToSocial Testing Instance">
<meta name="og:description" content="">
<link rel="stylesheet" href="/assets/bundle.css">
<link rel="stylesheet" href="/assets/Fork-Awesome/css/fork-awesome.min.css">
<link rel="stylesheet" href="/assets/base.css">
{{range .stylesheets}}<link rel="stylesheet" href="{{.}}">
{{end}}
<link rel="shortcut icon" href="/assets/logo.png" type="image/png">
<title>{{.instance.Title}} - GoToSocial</title>
</head>

View file

@ -1,40 +1,40 @@
{{ template "header.tmpl" .}}
<div class="left logo">
<img src="/assets/sloth.png" alt="Clipart styled sloth logo">
</div>
<section>
<h1>Home to <span class="count">{{.instance.Stats.user_count}}</span> users
who posted <span class="count">{{.instance.Stats.status_count}}</span> statuses,
federating with <span class="count">{{.instance.Stats.domain_count}}</span> other instances.</h1>
<div className="short-description">
{{.instance.ShortDescription |noescape}}
</div>
</section>
<main class="lightgray">
<section class="apps">
<p>
GoToSocial does not provide its own frontend, but implements the Mastodon client API.
You can use this server through a variety of clients:
</p>
<div class="applist">
<div class="entry">
<svg class="logo redraw" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10000 10000">
<path d="M9212 5993H5987V823c1053 667 2747 2177 3225 5170zM3100 2690A12240 12240 0 01939 6035h2161zm676 7210h2448a3067 3067 0 003067-3067H5052V627a527 527 0 00-1052 0v6206H709a3067 3067 0 003067 3067z"></path>
</svg>
<div>
<h2>Pinafore</h2>
<p>Pinafore is a web client designed for speed and simplicity.</p>
<a class="button" href="https://pinafore.social/settings/instances/add">Use Pinafore</a>
<section>
<h1>Home to <span class="count">{{.instance.Stats.user_count}}</span> users
who posted <span class="count">{{.instance.Stats.status_count}}</span> statuses,
federating with <span class="count">{{.instance.Stats.domain_count}}</span> other instances.</h1>
<div className="short-description">
{{.instance.ShortDescription |noescape}}
</div>
</section>
<section class="apps">
<p>
GoToSocial does not provide its own frontend, but implements the Mastodon client API.
You can use this server through a variety of clients:
</p>
<div class="applist">
<div class="entry">
<svg class="logo redraw" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10000 10000">
<path d="M9212 5993H5987V823c1053 667 2747 2177 3225 5170zM3100 2690A12240 12240 0 01939 6035h2161zm676 7210h2448a3067 3067 0 003067-3067H5052V627a527 527 0 00-1052 0v6206H709a3067 3067 0 003067 3067z"></path>
</svg>
<div>
<h2>Pinafore</h2>
<p>Pinafore is a web client designed for speed and simplicity.</p>
<a class="button" href="https://pinafore.social/settings/instances/add">Use Pinafore</a>
</div>
</div>
<div class="entry">
<img class="logo" src="/assets/tusky.svg" alt="The Tusky mascot, a cartoon elephant tooting happily"/>
<div>
<h2>Tusky</h2>
<p>Tusky is a lightweight mobile client for Android</p>
<a class="button" href="https://tusky.app">Get Tusky</a>
</div>
</div>
</div>
<div class="entry">
<img class="logo" src="/assets/tusky.svg" alt="The Tusky mascot, a cartoon elephant tooting happily"/>
<div>
<h2>Tusky</h2>
<p>Tusky is a lightweight mobile client for Android</p>
<a class="button" href="https://tusky.app">Get Tusky</a>
</div>
</div>
</div>
</section>
</section>
</main>
{{ template "footer.tmpl" .}}

View file

@ -1,13 +1,15 @@
{{ template "header.tmpl" .}}
<section class="login">
<h1>Login</h1>
<form action="/auth/sign_in" method="POST">
<label for="email">Email</label>
<input type="text" class="form-control" name="username" required placeholder="Please enter your email address">
<label for="password">Password</label>
<input type="password" class="form-control" name="password" required placeholder="Please enter your password">
<button type="submit" class="btn btn-success">Login</button>
</form>
</section>
<main>
<section class="login">
<h1>Login</h1>
<form action="/auth/sign_in" method="POST">
<label for="email">Email</label>
<input type="text" class="form-control" name="username" required placeholder="Please enter your email address">
<label for="password">Password</label>
<input type="password" class="form-control" name="password" required placeholder="Please enter your password">
<button type="submit" class="btn btn-success">Login</button>
</form>
</section>
</main>
{{ template "footer.tmpl" .}}