diff --git a/README.md b/README.md index 1d791a3..6e7151b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # Nuovo Sito Poisson Servizio del nuovo sito del PHC + +## Development + +Esegui `go run main.go` per farlo girare su `localhost:8000` e vedere le modifiche in diretta, amico. \ No newline at end of file diff --git a/assets/images/scritta.jpg b/assets/images/scritta.jpg new file mode 100644 index 0000000..335260e Binary files /dev/null and b/assets/images/scritta.jpg differ diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 0000000..2282db8 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,84 @@ + +@import url('https://fonts.googleapis.com/css2?family=Sen&family=Work+Sans:wght@700&display=swap'); + +* { + box-sizing: border-box; +} + +html, +body { + margin: 0; + min-height: 100vh; + display: flex; + flex-direction: column; + position: relative; + + font-family: 'Sen'; +} + +h1, h2, h3, h4 { + font-family: 'Work Sans'; + font-weight: 700; +} + +body { + max-width: 50rem; + margin: 0 auto; + padding: 0 0.5em; +} + +nav { + display: flex; + align-items: center; + border-bottom: 1px solid #ddd; + flex-wrap: wrap; +} + +.hfill { + flex-grow: 1; +} + +.vfill { + flex-grow: 1; +} + +.news-list { + display: flex; +} + +.news-list > article { + margin: 1em; + /* padding: 1em; */ + /* background: greenyellow; */ +} + +.nav-item { + margin: 1em 0.75em; +} + +body > div:last-of-type { + margin-bottom: 20em; +} + +footer { + position: absolute; + bottom: 0; + width: 100%; + height: 3em; + display: flex; + align-items: center; + justify-content: center; + border-top: 1px solid #ddd; +} + +@media screen and (max-width: 600px) { + + body { + width: 100%; + overflow-x: hidden; + } + + .news-list { + flex-direction: column; + } +} \ No newline at end of file diff --git a/main.go b/main.go index 0300322..66bc39c 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,11 @@ func serveHome(w http.ResponseWriter, r *http.Request) { func main() { + // Serve assets files + fs := http.FileServer(http.Dir("./assets")) + http.Handle("/assets/", http.StripPrefix("/assets/", fs)) + + // Serve homepage http.HandleFunc("/", serveHome) log.Println("Listening on :8000...") diff --git a/views/home.html b/views/home.html index 241dd4c..c5423b9 100644 --- a/views/home.html +++ b/views/home.html @@ -1,13 +1,84 @@ +