Cleaner main method, fixed img not resizing correctly and a bit more, thats not working as intended
This commit is contained in:
35
go.sum
35
go.sum
@@ -1,35 +0,0 @@
|
|||||||
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
|
|
||||||
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
|
|
||||||
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
|
|
||||||
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
|
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
|
||||||
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
|
||||||
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
|
|
||||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
|
||||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
|
||||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
||||||
|
|||||||
282
main.go
282
main.go
@@ -9,15 +9,25 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type NoMoreError struct {
|
||||||
|
Err error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *NoMoreError) Error() string {
|
||||||
|
return "no more images available"
|
||||||
|
}
|
||||||
|
|
||||||
type Image struct {
|
type Image struct {
|
||||||
Path string
|
Path string
|
||||||
Index int
|
Index int
|
||||||
}
|
}
|
||||||
|
|
||||||
type ImageViewModel struct {
|
type ImageViewModel struct {
|
||||||
|
Title string
|
||||||
Images []Image
|
Images []Image
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +39,14 @@ type Server struct {
|
|||||||
NextSubUrl string
|
NextSubUrl string
|
||||||
CurrSubUrl string
|
CurrSubUrl string
|
||||||
PrevSubUrl string
|
PrevSubUrl string
|
||||||
|
|
||||||
|
IsFirst bool
|
||||||
|
IsLast bool
|
||||||
|
|
||||||
|
// I'm not even sure if this helps
|
||||||
|
// If you press next and then prev too fast you still lock yourself out
|
||||||
|
NextReady chan bool
|
||||||
|
PrevReady chan bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func getImageList(html string) ([]string, error) {
|
func getImageList(html string) ([]string, error) {
|
||||||
@@ -39,7 +57,7 @@ func getImageList(html string) ([]string, error) {
|
|||||||
m := reg.FindStringSubmatch(html)
|
m := reg.FindStringSubmatch(html)
|
||||||
|
|
||||||
if len(m) <= 0 {
|
if len(m) <= 0 {
|
||||||
return nil, errors.New("no new images")
|
return nil, &NoMoreError{Err: errors.New("no more content")}
|
||||||
}
|
}
|
||||||
match := m[1]
|
match := m[1]
|
||||||
|
|
||||||
@@ -125,76 +143,26 @@ func appendImagesToBuf(html string, imageBuffs map[string]*bytes.Buffer) ([]Imag
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
curr := "/title/143267-blooming-love/2636103-ch_20"
|
curr := "/title/143267-blooming-love/2636103-ch_20"
|
||||||
h, err := getHtmlFor(curr)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
n, err := getNext(h)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
p, err := getPrev(h)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
server := Server{
|
server := Server{
|
||||||
PrevViewModel: nil,
|
ImageBuffers: make(map[string]*bytes.Buffer),
|
||||||
CurrViewModel: nil,
|
CurrSubUrl: curr,
|
||||||
NextViewModel: nil,
|
NextReady: make(chan bool),
|
||||||
ImageBuffers: make(map[string]*bytes.Buffer),
|
PrevReady: make(chan bool),
|
||||||
// Weird error IDK why this is, but it works like this, so it is what it is
|
|
||||||
NextSubUrl: n, //"/title/143267-blooming-love/2636103-ch_20",
|
|
||||||
PrevSubUrl: p,
|
|
||||||
CurrSubUrl: curr,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
go func(s *Server) {
|
server.loadCurr()
|
||||||
html, err := getHtmlFor(s.PrevSubUrl)
|
go server.loadPrev()
|
||||||
if err != nil {
|
go server.loadNext()
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
imagesNext, err := appendImagesToBuf(html, s.ImageBuffers)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
s.PrevViewModel = &ImageViewModel{Images: imagesNext}
|
|
||||||
fmt.Println("Finished loading prev")
|
|
||||||
}(&server)
|
|
||||||
|
|
||||||
go func(s *Server) {
|
|
||||||
html, err := getHtmlFor(s.NextSubUrl)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
imagesNext, err := appendImagesToBuf(html, s.ImageBuffers)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
s.NextViewModel = &ImageViewModel{Images: imagesNext}
|
|
||||||
fmt.Println("Finished loading next")
|
|
||||||
}(&server)
|
|
||||||
|
|
||||||
imagesCurr, err := appendImagesToBuf(h, server.ImageBuffers)
|
|
||||||
|
|
||||||
server.CurrViewModel = &ImageViewModel{Images: imagesCurr}
|
|
||||||
|
|
||||||
http.HandleFunc("/", server.HandleCurrent)
|
http.HandleFunc("/", server.HandleCurrent)
|
||||||
http.HandleFunc("/img/{url}/", server.HandleImage)
|
http.HandleFunc("/img/{url}/", server.HandleImage)
|
||||||
http.HandleFunc("POST /next", server.handleNext)
|
http.HandleFunc("POST /next", server.handleNext)
|
||||||
http.HandleFunc("POST /prev", server.handlePrev)
|
http.HandleFunc("POST /prev", server.handlePrev)
|
||||||
|
http.HandleFunc("/new/{title}/{chapter}", server.HandleNew)
|
||||||
|
|
||||||
fmt.Println("Server running")
|
fmt.Println("Server running")
|
||||||
err = http.ListenAndServe(":8000", nil)
|
err := http.ListenAndServe(":8000", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
@@ -234,40 +202,109 @@ func (s *Server) handleNext(w http.ResponseWriter, r *http.Request) {
|
|||||||
s.PrevSubUrl = s.CurrSubUrl
|
s.PrevSubUrl = s.CurrSubUrl
|
||||||
s.CurrSubUrl = s.NextSubUrl
|
s.CurrSubUrl = s.NextSubUrl
|
||||||
|
|
||||||
go func(s *Server) {
|
<-s.NextReady
|
||||||
c, err := getHtmlFor(s.CurrSubUrl)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
next, err := getNext(c)
|
go s.loadNext()
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
html, err := getHtmlFor(next)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
imagesNext, err := appendImagesToBuf(html, s.ImageBuffers)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
s.NextViewModel = &ImageViewModel{Images: imagesNext}
|
|
||||||
|
|
||||||
s.NextSubUrl = next
|
|
||||||
fmt.Println("Loaded next")
|
|
||||||
}(s)
|
|
||||||
|
|
||||||
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Server) loadNext() {
|
||||||
|
c, err := getHtmlFor(s.CurrSubUrl)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
next, err := getNext(c)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
html, err := getHtmlFor(next)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
imagesNext, err := appendImagesToBuf(html, s.ImageBuffers)
|
||||||
|
//if err != nil && errors.Is(err, &NoMoreError{}) {
|
||||||
|
// fmt.Println(err)
|
||||||
|
// return
|
||||||
|
//} else
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
title, chapter, err := getTitleAndChapter(next)
|
||||||
|
if err != nil {
|
||||||
|
title = "Unknown"
|
||||||
|
chapter = "ch_?"
|
||||||
|
}
|
||||||
|
|
||||||
|
full := strings.Replace(title, "-", " ", -1) + " - " + strings.Replace(chapter, "_", " ", -1)
|
||||||
|
|
||||||
|
s.NextViewModel = &ImageViewModel{Images: imagesNext, Title: full}
|
||||||
|
|
||||||
|
s.NextSubUrl = next
|
||||||
|
fmt.Println("Loaded next")
|
||||||
|
s.NextReady <- true
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTitleAndChapter(url string) (title string, chapter string, err error) {
|
||||||
|
reg, err := regexp.Compile(`/title/\d*-(.*?)/\d*-(.*)`)
|
||||||
|
if err != nil {
|
||||||
|
return "", "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
matches := reg.FindAllStringSubmatch(url, -1)
|
||||||
|
if len(matches) <= 0 {
|
||||||
|
return "", "", errors.New("no title or chapter found")
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches[0][1], matches[0][2], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Server) loadPrev() {
|
||||||
|
c, err := getHtmlFor(s.CurrSubUrl)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
prev, err := getPrev(c)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
html, err := getHtmlFor(prev)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
imagesNext, err := appendImagesToBuf(html, s.ImageBuffers)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
title, chapter, err := getTitleAndChapter(prev)
|
||||||
|
if err != nil {
|
||||||
|
title = "Unknown"
|
||||||
|
chapter = "ch_?"
|
||||||
|
}
|
||||||
|
|
||||||
|
full := strings.Replace(title, "-", " ", -1) + " - " + strings.Replace(chapter, "_", " ", -1)
|
||||||
|
|
||||||
|
s.PrevViewModel = &ImageViewModel{Images: imagesNext, Title: full}
|
||||||
|
|
||||||
|
s.PrevSubUrl = prev
|
||||||
|
fmt.Println("Loaded prev")
|
||||||
|
s.PrevReady <- true
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Server) handlePrev(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) handlePrev(w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Println("Received Prev")
|
fmt.Println("Received Prev")
|
||||||
if s.NextViewModel != nil {
|
if s.NextViewModel != nil {
|
||||||
@@ -284,34 +321,9 @@ func (s *Server) handlePrev(w http.ResponseWriter, r *http.Request) {
|
|||||||
s.NextSubUrl = s.CurrSubUrl
|
s.NextSubUrl = s.CurrSubUrl
|
||||||
s.CurrSubUrl = s.PrevSubUrl
|
s.CurrSubUrl = s.PrevSubUrl
|
||||||
|
|
||||||
go func(s *Server) {
|
<-s.PrevReady
|
||||||
c, err := getHtmlFor(s.CurrSubUrl)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
prev, err := getPrev(c)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
html, err := getHtmlFor(prev)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
imagesNext, err := appendImagesToBuf(html, s.ImageBuffers)
|
go s.loadPrev()
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
s.PrevViewModel = &ImageViewModel{Images: imagesNext}
|
|
||||||
|
|
||||||
s.PrevSubUrl = prev
|
|
||||||
fmt.Println("Loaded prev")
|
|
||||||
}(s)
|
|
||||||
|
|
||||||
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
||||||
}
|
}
|
||||||
@@ -324,6 +336,44 @@ func (s *Server) HandleCurrent(w http.ResponseWriter, _ *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Server) HandleNew(w http.ResponseWriter, r *http.Request) {
|
||||||
|
title := r.PathValue("title")
|
||||||
|
chapter := r.PathValue("chapter")
|
||||||
|
|
||||||
|
url := fmt.Sprintf("/title/%s/%s", title, chapter)
|
||||||
|
|
||||||
|
s.ImageBuffers = make(map[string]*bytes.Buffer)
|
||||||
|
s.CurrSubUrl = url
|
||||||
|
s.PrevSubUrl = ""
|
||||||
|
s.NextSubUrl = ""
|
||||||
|
s.loadCurr()
|
||||||
|
|
||||||
|
go s.loadNext()
|
||||||
|
go s.loadPrev()
|
||||||
|
|
||||||
|
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Server) loadCurr() {
|
||||||
|
html, err := getHtmlFor(s.CurrSubUrl)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
imagesCurr, err := appendImagesToBuf(html, s.ImageBuffers)
|
||||||
|
|
||||||
|
title, chapter, err := getTitleAndChapter(s.CurrSubUrl)
|
||||||
|
if err != nil {
|
||||||
|
title = "Unknown"
|
||||||
|
chapter = "ch_?"
|
||||||
|
}
|
||||||
|
|
||||||
|
full := strings.Replace(title, "-", " ", -1) + " - " + strings.Replace(chapter, "_", " ", -1)
|
||||||
|
|
||||||
|
s.CurrViewModel = &ImageViewModel{Images: imagesCurr, Title: full}
|
||||||
|
fmt.Println("Loaded current")
|
||||||
|
}
|
||||||
|
|
||||||
func addFileToRam(url string) (*bytes.Buffer, error) {
|
func addFileToRam(url string) (*bytes.Buffer, error) {
|
||||||
// Get the data
|
// Get the data
|
||||||
resp, err := http.Get(url)
|
resp, err := http.Get(url)
|
||||||
|
|||||||
68
test.gohtml
68
test.gohtml
@@ -2,9 +2,11 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Title</title>
|
<title>{{.Title}}</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
body {background-color: #171717}
|
||||||
|
|
||||||
.scroll-container {
|
.scroll-container {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@@ -23,27 +25,77 @@
|
|||||||
.scroll-container img {
|
.scroll-container img {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: block;
|
display: block;
|
||||||
min-width: 40%;
|
/*min-width: 20%;*/
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* I have no clue what css is, jesus christ ...
|
||||||
|
*/
|
||||||
|
.center {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
width: 50%;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
vertical-align: middle;
|
||||||
|
justify-content: center;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-36 {
|
||||||
|
background-image: linear-gradient(92.88deg, #455EB5 9.16%, #5643CC 43.89%, #673FD7 64.72%);
|
||||||
|
border-radius: 8px;
|
||||||
|
border-style: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #FFFFFF;
|
||||||
|
cursor: pointer;
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-family: "Inter UI","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
height: 4rem;
|
||||||
|
padding: 0 1.6rem;
|
||||||
|
text-align: center;
|
||||||
|
text-shadow: rgba(0, 0, 0, 0.25) 0 3px 8px;
|
||||||
|
transition: all .5s;
|
||||||
|
user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
touch-action: manipulation;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-36:hover {
|
||||||
|
box-shadow: rgba(80, 63, 205, 0.5) 0 1px 30px;
|
||||||
|
transition-duration: .1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.button-36 {
|
||||||
|
padding: 0 2.6rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="center">
|
||||||
|
<form method="post" action="/prev">
|
||||||
|
<input type="submit" name="Prev" value="Prev" class="button-36">
|
||||||
|
<input type="submit" name="Next" value="Next" class="button-36" formaction="/next">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
<div class="scroll-container">
|
<div class="scroll-container">
|
||||||
{{range .Images}}
|
{{range .Images}}
|
||||||
<img src="/img/{{.Path}}" alt="img_{{.Index}}"/>
|
<img src="/img/{{.Path}}" alt="img_{{.Index}}"/>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="center">
|
||||||
<form method="post" action="/prev">
|
<form method="post" action="/prev">
|
||||||
<input type="submit" name="Prev" value="Prev">
|
<input type="submit" name="Prev" value="Prev" class="button-36">
|
||||||
</form>
|
<input type="submit" name="Next" value="Next" class="button-36" formaction="/next">
|
||||||
|
|
||||||
<form method="post" action="/next">
|
|
||||||
<input type="submit" name="Next" value="Next">
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user