Skip to content

Commit

Permalink
Merge pull request #70 from algolia/slider
Browse files Browse the repository at this point in the history
Slider + jQuery 3.x update
  • Loading branch information
eranchetz authored Feb 12, 2023
2 parents 5c388a3 + 361c4db commit e84823b
Show file tree
Hide file tree
Showing 7 changed files with 498 additions and 420 deletions.
26 changes: 5 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
module github.com/algolia/sup3rS3cretMes5age

go 1.12
go 1.15

require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/go-ldap/ldap v3.0.2+incompatible // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.6.8 // indirect
github.com/hashicorp/vault/api v1.1.0
github.com/hashicorp/vault/sdk v0.2.0 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/hashicorp/vault/api v1.3.1
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/ory/dockertest/v3 v3.6.3
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc
golang.org/x/net v0.0.0-20210420072503-d25e30425868 // indirect
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
github.com/labstack/gommon v0.3.1 // indirect
github.com/ory/dockertest/v3 v3.9.1
golang.org/x/crypto v0.0.0-20220208050332-20e1d8d225ab
)
397 changes: 212 additions & 185 deletions go.sum

Large diffs are not rendered by default.

27 changes: 22 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package main

import (
"net/http"
"crypto/tls"

"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
"golang.org/x/crypto/acme/autocert"
"golang.org/x/crypto/acme"
)

func main() {
Expand Down Expand Up @@ -44,9 +48,22 @@ func main() {
}
}

if conf.TLSAutoDomain != "" {
e.Logger.Fatal(e.StartAutoTLS(conf.HttpsBindingAddress))
} else if conf.TLSCertFilepath != "" {
e.Logger.Fatal(e.StartTLS(conf.HttpsBindingAddress, conf.TLSCertFilepath, conf.TLSCertKeyFilepath))
autoTLSManager := autocert.Manager{
Prompt: autocert.AcceptTOS,
// Cache certificates to avoid issues with rate limits (https://letsencrypt.org/docs/rate-limits)
Cache: autocert.DirCache("/var/www/.cache"),
//HostPolicy: autocert.HostWhitelist("<DOMAIN>"),
}
s := http.Server{
Addr: ":443",
Handler: e, // set Echo as handler
TLSConfig: &tls.Config{
//Certificates: nil, // <-- s.ListenAndServeTLS will populate this field
GetCertificate: autoTLSManager.GetCertificate,
NextProtos: []string{acme.ALPNProto},
},
//ReadTimeout: 30 * time.Second, // use custom timeouts
}
}
if err := s.ListenAndServeTLS("", ""); err != http.ErrServerClosed {
e.Logger.Fatal(err)
}}
56 changes: 55 additions & 1 deletion static/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ html,body {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
color: transparent;
text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

h1{
Expand Down Expand Up @@ -86,3 +87,56 @@ button {
text-align: center;
color: white;
}

div.footer {
position: absolute;
height: 24px;
right: 10px;
bottom: 10px;
}

div.footer img {
position: absolute;
right: 0;
bottom: 0;
width: 32px;
height: auto;
}

.slidecontainer {
width: 100%;
}

.slider {
-webkit-appearance: none;
width: 100%;
height: 25px;
border-radius: 5px;
background: #d3d3d3;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}

.slider:hover {
opacity: 1;
}

.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 35px;
height: 35px;
border-radius: 5px;
background: #4CAF50;
cursor: pointer;
}

.slider::-moz-range-thumb {
width: 35px;
height: 35px;
border-radius: 5px;
background: #4CAF50;
cursor: pointer;
}
Loading

0 comments on commit e84823b

Please sign in to comment.