Доделал под домашнюю страницу catgirls.asia

This commit is contained in:
B4D_US3R 2024-12-10 22:54:02 +05:00
parent 68fbcb15c1
commit 7635437b6e
3 changed files with 61 additions and 1 deletions

18
main.go
View file

@ -7,6 +7,7 @@ import (
"math/rand" "math/rand"
"net/http" "net/http"
"os" "os"
"text/template"
) )
func GetPicsArray() []string { func GetPicsArray() []string {
@ -36,8 +37,23 @@ func ReturnPic(w http.ResponseWriter, req *http.Request) {
log.Println("Картинка отдана") log.Println("Картинка отдана")
} }
func ReturnHTML(w http.ResponseWriter, req *http.Request) {
htmlOpen, err := template.ParseFiles("main.html")
if err != nil {
log.Println(err.Error())
return
}
image := GetRandImg()
fmt.Println(image)
htmlOpen.Execute(w, image)
}
func main() { func main() {
log.Println("Server Start") log.Println("Server Start")
http.HandleFunc("/", ReturnPic) imagesDir := http.FileServer(http.Dir("images"))
staticDir := http.FileServer(http.Dir("static"))
http.Handle("/images/", http.StripPrefix("/images/", imagesDir))
http.Handle("/static/", http.StripPrefix("/static/", staticDir))
http.HandleFunc("/", ReturnHTML)
http.ListenAndServe(":3666", nil) http.ListenAndServe(":3666", nil)
} }

43
main.html Normal file
View file

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title>Тестирование хостинга</title>
<link rel="stylesheet" href="static/picnic.min.css">
<meta charset="utf-8">
</head>
<body>
<div style="overflow: hidden;height: 75px;">
<nav class="demo">
<a href="#" class="brand">
<span>CatGirls.asia</span>
</a>
</nav>
</div>
<section class="flex three">
<div class="flex">
<div class="links flex two">
<div class=""></div>
<div class="flex half-1000">
<h2>Services</h2>
<div class="links half">
<div><a class="pseudo button" href="https://pleroma.catgirls.asia">Pleroma</a></div>
<div><a class="pseudo button" href="https://git.catgirls.asia">Git</a></div>
<div><a class="pseudo button" href="https://cloud.catgirls.asia">Nextcloud</a></div>
</div>
<h2>Contacts</h2>
<div class="links half">
<div><a class="pseudo button" href="https://pleroma.catgirls.asia/users/SiberiaBread">ActivityPub</a></div>
<div><a class="pseudo button" href="xmpp:siberiabread@catgirls.asia">XMPP</a></div>
</div>
</div>
</div>
</div>
<div class="flex ">
<article class="card">
<img src="images/{{ . }}">
</article>
</div>
<div class="flex"></div>
</section>
</body>
</html>

1
static/picnic.min.css vendored Normal file

File diff suppressed because one or more lines are too long