diff --git a/assets/style.css b/assets/style.css index 826ad0c..e78f8c3 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1,485 +1,308 @@ - - -@import url('https://fonts.googleapis.com/css2?family=Share:wght@700&family=Ubuntu+Mono&family=Ubuntu:wght@300;700&display=swap'); - -/* @import url('https://fonts.googleapis.com/css2?family=Sen&family=Work+Sans:wght@700&display=swap'); */ +/* TODO: Don't use CDN and serve as assets */ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap'); :root { - --font-title: 'Share', cursive; - --font-text: 'Ubuntu', sans-serif; - --font-mono: 'Ubuntu Mono', monospace; -} - -* { - box-sizing: border-box; -} + --bg: #f0f0f0; + --fg: #333; -html, -body { - position: relative; - - margin: 0; - min-height: 100%; + /* --bg-dark: #e0e0d6; + --bg-darker: #d6d6cc; */ - width: 100vw; - overflow-x: hidden; + --bg-dark: hsl(220, 5%, 93%); + --bg-darker: hsl(220, 5%, 90%); - font-family: var(--font-text); - font-weight: 300; - font-size: 17px; - line-height: 1.25; -} + --accent-1: #278542; + --accent-1-fg: #154d24; -html { - background: white; + --font-sf: 'Inter', sans-serif; + --font-weight-light: 300; + --font-weight-normal: 400; + --font-weight-medium: 500; + --font-weight-bold: 700; - height: 100%; - min-height: 100%; + --shadow-1: 0 0 16px 0 #00000018; } -body { - margin: 0 auto; - padding-bottom: 5rem; - - max-width: 850px; - text-align: justify; - - background: white; +* { + box-sizing: border-box; } -/* Typography */ - -h1, h2, h3, h4 { +html, body { margin: 0; - - font-family: var(--font-title); - font-weight: 700; -} - -p { - margin: 0.75rem 0; -} - -p:last-child { - margin-bottom: 0; -} - -/* Elements */ - -nav { - margin-bottom: 1rem; - - display: flex; - flex-wrap: wrap; - - border: 4px solid; - border-top: none; - - gap: 2px; - /* border-bottom: 1rem solid black; */ + width: 100%; + height: fit-content; } -.nav-item { - flex-grow: 1; - +body { display: flex; + flex-direction: column; align-items: center; - justify-content: center; - - height: 2.5rem; - padding: 0 0.75rem; - margin: -2px; + background: var(--bg); + color: var(--fg); - font-size: 130%; - font-weight: bold; + font-family: var(--font-sf); + font-size: 17px; + font-weight: var(--font-weight-normal); - border: 2px solid black; + position: relative; } -.nav-dropdown { - flex-grow: 1; - margin: -2px; - - max-width: 100%; +.main { + max-width: 70ch; + margin: 0 auto 8rem; display: flex; flex-direction: column; - position: relative; - z-index: 1; + gap: 3rem; } -.nav-dropdown .label { - display: flex; - align-items: center; - justify-content: center; - - width: 100%; - - height: 2.5rem; - - padding: 0 0.75rem; +nav { + margin: 1rem 0; - font-size: 130%; - font-weight: bold; + display: grid; + grid-template-columns: auto 1fr; + gap: 1rem; - border: 2px solid black; -} + align-items: center; + font-weight: var(--font-weight-medium); -.nav-dropdown .label .icons8 { - width: 16px; - height: 16px; + color: var(--accent-1-fg); - margin-left: 0.5rem; - transform: translate(0, 0.1rem); + z-index: 0; } -.nav-dropdown .dropdown { - position: absolute; - - top: 100%; - width: 100%; - /* margin-bottom: 0.5rem; */ - +/* Tutti i link dentro la navbar sono speciali e non sembrano link */ +nav a { display: flex; - flex-direction: column; - - gap: 2px; - - border: 2px solid black; - - background: white; -} + width: 100%; + height: 100%; -.nav-dropdown:not(:hover) .dropdown { - display: none; -} + align-items: center; + justify-content: center; -nav a { text-decoration: none; + color: inherit; } -section { - border: 4px solid; - - padding: 1rem; - margin-bottom: 1rem; +nav a:hover { + color: var(--accent-1-fg); + text-decoration: none; } -header { +nav .nav-logo { + /* height: 3.5rem; */ + display: flex; - width: 100%; + align-items: center; justify-content: center; - - margin: 2.5rem 0; -} - -header .logo { - flex-grow: 1; + padding: 0.5rem; - margin-right: 1rem; - object-fit: contain; - object-position: right; + background: var(--bg-dark); + border-radius: 4px; + border: 1px solid #dadada; + box-shadow: var(--shadow-1); } -header .title { - flex-grow: 1; - - display: flex; - flex-direction: column; - justify-content: space-around; -} +nav .nav-main { + display: grid; + grid-template-columns: repeat(5, 1fr) 2fr 1fr; -header .title h1 { - font-size: 56px; - display: inline-block; - transform: translate(-0.125rem); -} + background: var(--bg-dark); + border-radius: 4px; + border: 1px solid #dadada; + box-shadow: var(--shadow-1); -.service-list { - display: flex; - flex-wrap: wrap; - gap: 0.5rem; + z-index: -1; } -.service { - flex: 1 1 calc(50% - 1rem); - min-width: 300px; - - padding: 1rem 0.75rem; - - /* Brutal */ - border: 2px solid black; +nav .nav-main a { + padding: 0.75rem 1rem; } -.user-list { +nav .nav-main .nav-item { display: flex; - flex-direction: row; - flex-wrap: wrap; - + align-items: center; justify-content: center; - - gap: 0.25rem; -} - -.user { - display: flex; - flex-grow: 1; - - width: calc(50% - 0.25rem / 2); - min-width: 250px; - align-items: center; - justify-content: space-between; + background: var(--bg-dark); - padding: 0.125rem 0.25rem; + user-select: none; + cursor: pointer; - border: 2px solid black; + z-index: 2; } -.user h4 { - font-size: 90%; - line-height: 1; - font-family: var(--font-mono); +nav .nav-main .nav-item:hover { + background: var(--bg-darker); } -.user a { - text-decoration: none; +nav .nav-main .nav-item:last-child { + grid-column: 7 / 8; } -.user a:hover img { - opacity: 0.6; -} +nav .nav-main .nav-item.dropdown { + position: relative; -.user img { - margin: 0.5rem; + z-index: 1; } -footer { - position: absolute; - bottom: 0; - left: 0; - right: 0; +nav .nav-main .nav-item.dropdown .name { + width: 100%; + height: 100%; display: flex; - flex-wrap: wrap; - align-items: center; justify-content: center; - background: black; - color: white; - - border-bottom: none; + background: var(--bg-dark); + + z-index: 10; } -footer a, footer a:visited { - color: white; +nav .nav-main .nav-item.dropdown .name:hover { + background: var(--bg-darker); } -.footer-item { - padding: 0.5rem; - font-size: 90%; -} +nav .nav-main .nav-item.dropdown .nav-items { + position: absolute; + top: 100%; + width: 100%; -.search { - display: flex; - align-items: center; + display: none; - max-width: 27rem; - margin: 1.5rem auto; - border: 2px solid black; -} - -#search-field { - width: 100%; - flex-grow: 1; - - height: 1.75rem; - padding: 0 0.5rem; + background: var(--bg-dark); + border-radius: 4px; + border: 1px solid #dadada; + box-shadow: var(--shadow-1); - border: none; - border-right: 2px solid black; } +/* +nav .nav-main .nav-item.dropdown .nav-items::before { + position: absolute; + content: ''; + top: -2px; + height: 2px; + left: 0; + right: 0; + width: 100%; -.search img { - display: block; - transform: scale(0.8); - - width: 1.75rem; - height: 1.75rem; + background: var(--bg-darker); +} */ - cursor: pointer; +nav .nav-main .nav-item.dropdown .name:hover + .nav-items, nav .nav-main .nav-item.dropdown .name + .nav-items:hover { + display: flex; + flex-direction: column; } -/* Common */ - -img { - display: block; +/* .nav-main borders */ +.nav-main > .nav-item:first-child { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; } - -a, a:visited { - color: black; +.nav-main > .nav-item:last-child { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; } -a:hover { - color: gray; -} +footer { + position: absolute; + bottom: 0; + left: 50%; + height: 3rem; -hr { - width: 100%; - height: 1rem; - - margin: 1rem 0; - padding: 0; - - background: black; - border: none; -} + width: 80ch; -ul { - list-style: square; -} + transform: translate(-50%, 0); -li { - margin: 0.25rem 0; -} + background: var(--bg-dark); + border-radius: 4px; + border: 1px solid #dadada; + border-bottom: none; + box-shadow: var(--shadow-1); -form { - margin: 3rem auto; - padding: 0.75rem; + display: flex; + align-items: center; + justify-content: center; - max-width: 30rem; - border: 4px solid black; + border-top-left-radius: 4px; + border-top-right-radius: 4px; } -form .row { +/* Components */ + +section { display: flex; - width: 100%; + flex-direction: column; + align-items: center; } -form .row:not(:last-child) { - margin-bottom: 0.5rem; -} +.card-list { + display: flex; + flex-direction: column; + align-items: center; -form label { - width: 30%; -} + gap: 1rem; -form input[type=text], form input[type=password] { - flex-grow: 1; + margin-top: 1rem; } -form button, form input[type=submit] { - margin-top: 0.5rem; -} +.card { + background: var(--bg-dark); + border-radius: 4px; + border: 1px solid #dadada; + box-shadow: var(--shadow-1); -input[type=text], input[type=password] { - font-size: 15px; + max-width: 60ch; - padding: 0 0.2rem; - height: 1.5rem; - - appearance: none; - outline: none; + padding: 1rem; - border: 2px solid black; + display: flex; + flex-direction: column; } -input[type=text]:focus, input[type=password]:focus { - background: #e0e0e0; +.card .title { + font-size: 22px; + font-weight: var(--font-weight-bold); } -button, input[type=submit] { - outline: none; - - font-size: 17px; - font-family: var(--font-title); - - padding: 0 4rem; - height: 1.6rem; - - background: black; - color: white; - - border: none; - /* border: 2px solid black; */ +.card .date { + font-size: 15px; + color: #666; - cursor: pointer; + margin-bottom: 0.75rem; } -button:hover, input[type=submit]:hover { - background: #444; +.card .description { + font-weight: var(--font-weight-light); + color: #222; } -/* Utils */ - -.icons8 { - width: 25px; - height: 25px; - - display: inline-block; - vertical-align: middle; -} +/* Typography */ -h2 .icons8 { - transform: translateY(-0.125rem); -} +h1, h2, h3, h4 { + margin: 0; + margin-top: 1rem; + margin-bottom: 0.5rem; -.hfill { - /* min-height: 0.5rem; */ - flex-grow: 1000; + font-weight: var(--font-weight-light); } -@media screen and (max-width: 850px) { - section, nav { - border-left: none; - border-right: none; - } +p { + margin: 0.5rem 0; } -@media screen and (max-width: 30rem) { - form { - border-left: none; - border-right: none; - } -} +/* Controls */ -/* Large screen */ -@media screen and (min-width: 421px) { - .nav-dropdown .dropdown { - margin-top: -2px; - } +a { + color: var(--accent-1-fg); + text-decoration: none; } -/* Mobile screen */ -@media screen and (max-width: 420px) and (orientation: portrait) { - nav { - flex-direction: column; - } - - .nav-dropdown:hover { - padding: 0 0.25rem 0.25rem; - } - - .nav-dropdown, .nav-dropdown .nav-item { - margin: -2px 0; - } - - .nav-item, .nav-dropdown .label { - max-width: 100%; - - border-left: none; - border-right: none; - } - - .nav-dropdown .dropdown { - position: relative; - - border: 4px solid black; - border-top-width: 2px; - } +a:hover { + color: var(--accent-1); + text-decoration: underline; } \ No newline at end of file diff --git a/config/config.go b/config/config.go index e304a76..ba69b02 100644 --- a/config/config.go +++ b/config/config.go @@ -34,10 +34,10 @@ func Load() { Host = stringOrDefault(os.Getenv("HOST"), "localhost:8080") log.Printf("HOST = %v", Host) - GitUrl = stringOrDefault(os.Getenv("GIT_URL"), "git.phc.dm.unipi.it") + GitUrl = stringOrDefault(os.Getenv("GIT_URL"), "https://git.phc.dm.unipi.it") log.Printf("GIT_URL = %v", GitUrl) - ForumUrl = stringOrDefault(os.Getenv("FORUM_URL"), "forum.phc.dm.unipi.it") + ForumUrl = stringOrDefault(os.Getenv("FORUM_URL"), "https://forum.phc.dm.unipi.it") log.Printf("FORUM_URL = %v", ForumUrl) } diff --git a/views/base.html b/views/base.html index c6249ff..fc7982f 100644 --- a/views/base.html +++ b/views/base.html @@ -7,15 +7,18 @@