diff --git a/go.mod b/go.mod index 93833af7..951aacc8 100644 --- a/go.mod +++ b/go.mod @@ -32,6 +32,7 @@ require ( golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/image v0.0.0-20190118043309-183bebdce1b2 // indirect golang.org/x/net v0.0.0-20190110044637-be1c187aa6c6 + google.golang.org/appengine v1.2.0 // indirect google.golang.org/genproto v0.0.0-20190108161440-ae2f86662275 google.golang.org/grpc v1.17.0 ultre.me/kryptos v0.0.0-20181023194748-240fe1a16033 diff --git a/static/components/cornify/cornify.js b/static/components/cornify/cornify.js index 1f851379..7a1fb811 100644 --- a/static/components/cornify/cornify.js +++ b/static/components/cornify/cornify.js @@ -23,8 +23,8 @@ var cornify_add = function(top, left) { // randomly select an image, either a unicorn or a rainbow var cornImage = imageHost + "images/" + ((Math.round(Math.random())) ? - "unicorn_" + Math.floor((Math.random()*unicorn_count)+1) + ".gif" : - "rainbow_" + Math.floor((Math.random()*rainbow_count)+1) + ".gif") + "unicorn/" + Math.floor((Math.random()*unicorn_count)+1) + ".gif" : + "rainbow/" + Math.floor((Math.random()*rainbow_count)+1) + ".gif") img.setAttribute('src', cornImage); // used later as a query selector to find and clear cornified images img.setAttribute('class', 'cornify'); diff --git a/static/js/calc.js b/static/js/calc.js index 3aa36ae7..9b3a3cb7 100644 --- a/static/js/calc.js +++ b/static/js/calc.js @@ -131,7 +131,7 @@ var hexToRgb = function(hex) { easter_egg_callbacks.push(function() { if (!window.cornify) { - $.getScript("/static/components/cornify/cornify.js", + $.getScript("/components/cornify/cornify.js", function(data, textStatus, jqxhr) { window.cornify.pizzazz(); window.setTimeout(function() { @@ -143,7 +143,7 @@ easter_egg_callbacks.push(function() { easter_egg_callbacks.push(function() { if (!$.fn.raptorize) { - $.getScript("/static/js/jquery.raptorize.1.0.js", + $.getScript("/js/jquery.raptorize.1.0.js", function(data, textStatus, jqxhr) { var div = $('
'); $('body').append(div); diff --git a/static/js/jquery.raptorize.1.0.js b/static/js/jquery.raptorize.1.0.js index ca75dd15..68a171a1 100644 --- a/static/js/jquery.raptorize.1.0.js +++ b/static/js/jquery.raptorize.1.0.js @@ -31,8 +31,8 @@ audioSupported = true; //Raptor Vars - var raptorImageMarkup = '' - var raptorAudioMarkup = ''; + var raptorImageMarkup = '' + var raptorAudioMarkup = ''; var locked = false; //Append Raptor and Style diff --git a/templates/hackz.2048.tmpl b/templates/hackz.2048.tmpl new file mode 100644 index 00000000..78116475 --- /dev/null +++ b/templates/hackz.2048.tmpl @@ -0,0 +1,83 @@ +{{define "title"}}Coolz 2048{{end}} +{{define "h1"}}2048 {{mot_cool}}{{end}} +{{define "h1small"}}Ce n'est qu'une translation{{end}} + +{{define "content"}} +
+
+
+
+
0
+
0
+
+ Recommencer +
+ +
+
+

+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ + + + + + + + + + + + +{{end}} + +{{define "secondary_column"}} +

Hackzers les plus {{ mot_cool }} pour l'instant

+LES SCORES SONT CASSÉS! + +{{end}} diff --git a/templates/hackz.3615cryptage.tmpl b/templates/hackz.3615cryptage.tmpl new file mode 100644 index 00000000..889c00dc --- /dev/null +++ b/templates/hackz.3615cryptage.tmpl @@ -0,0 +1,7 @@ +{{define "title"}}3615 CRYPTAGE{{end}} +{{define "h1"}}3615 CRYPTAGE{{end}} +{{define "h1small"}}(James Bond, etc.){{end}} + +{{define "content"}} + +{{end}} diff --git a/templates/hackz.calculatrice.tmpl b/templates/hackz.calculatrice.tmpl new file mode 100644 index 00000000..6f3c2760 --- /dev/null +++ b/templates/hackz.calculatrice.tmpl @@ -0,0 +1,76 @@ +{{define "title"}}Calculatrice.exe{{end}} +{{define "h1"}}Calculatrice.exe{{end}} +{{define "h1small"}}(c'est comme des maths, mais en {{mot_cool}}){{end}} + +{{define "content"}} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +{{end}} diff --git a/templates/hackz.m1ch3l.tmpl b/templates/hackz.m1ch3l.tmpl new file mode 100644 index 00000000..7b3f07ae --- /dev/null +++ b/templates/hackz.m1ch3l.tmpl @@ -0,0 +1,7 @@ +{{define "title"}}Hack cassé{{end}} +{{define "h1"}}Hack {{mot_cool}}, mais cassé{{end}} +{{define "h1small"}}travaux {{mot_cool_pluriel}} en cours{{end}} + +{{define "content"}} + Je reviendrai. +{{end}} diff --git a/templates/hackz.moijaime.tmpl b/templates/hackz.moijaime.tmpl new file mode 100644 index 00000000..7b3f07ae --- /dev/null +++ b/templates/hackz.moijaime.tmpl @@ -0,0 +1,7 @@ +{{define "title"}}Hack cassé{{end}} +{{define "h1"}}Hack {{mot_cool}}, mais cassé{{end}} +{{define "h1small"}}travaux {{mot_cool_pluriel}} en cours{{end}} + +{{define "content"}} + Je reviendrai. +{{end}} diff --git a/templates/hackz.paint.tmpl b/templates/hackz.paint.tmpl new file mode 100644 index 00000000..7b3f07ae --- /dev/null +++ b/templates/hackz.paint.tmpl @@ -0,0 +1,7 @@ +{{define "title"}}Hack cassé{{end}} +{{define "h1"}}Hack {{mot_cool}}, mais cassé{{end}} +{{define "h1small"}}travaux {{mot_cool_pluriel}} en cours{{end}} + +{{define "content"}} + Je reviendrai. +{{end}} diff --git a/templates/hackz.phazms.tmpl b/templates/hackz.phazms.tmpl new file mode 100644 index 00000000..7b3f07ae --- /dev/null +++ b/templates/hackz.phazms.tmpl @@ -0,0 +1,7 @@ +{{define "title"}}Hack cassé{{end}} +{{define "h1"}}Hack {{mot_cool}}, mais cassé{{end}} +{{define "h1small"}}travaux {{mot_cool_pluriel}} en cours{{end}} + +{{define "content"}} + Je reviendrai. +{{end}} diff --git a/templates/hackz.recettator.tmpl b/templates/hackz.recettator.tmpl new file mode 100644 index 00000000..7b3f07ae --- /dev/null +++ b/templates/hackz.recettator.tmpl @@ -0,0 +1,7 @@ +{{define "title"}}Hack cassé{{end}} +{{define "h1"}}Hack {{mot_cool}}, mais cassé{{end}} +{{define "h1small"}}travaux {{mot_cool_pluriel}} en cours{{end}} + +{{define "content"}} + Je reviendrai. +{{end}} diff --git a/templates/hackz.tetris.tmpl b/templates/hackz.tetris.tmpl new file mode 100644 index 00000000..38e822ca --- /dev/null +++ b/templates/hackz.tetris.tmpl @@ -0,0 +1,60 @@ +{{define "title"}}Ultreme Tetris{{end}} +{{define "h1"}}Ultreme Tetris{{end}} +{{define "h1small"}}{{ .niveau }}ème niveau de difficulté{{end}} + +{{define "content"}} +{{/* {% include '../../../hackz/tetris_v2/app.html' %} */}} +
+ + Désolé, ce tetris n'est pas géré par votre navigateur. + +
+{{end}} + +{{define "secondary_column"}} +
+
+

+
+
+

Appuyez sur espace pour commencer.

+

score 00000

+

lignes 0

+ +
+
+
+
+ 1 + 2 + 4.2 + 5 +
+
+
+ 6 + 8 +
+ +
+
+ +
+
+

Hackzers les plus {{ mot_cool }} pour l'instant

+ LES SCORES SONT CASSÉS POUR LE MOMENT +
    + {{/* + {{ for scor in hackzers }} +
  • #{{ loop.index }} {{ scor.login }} avec {{ scor.score }} {{ mot_debile_qui_se_mange() }} le {{ scor.created_at}}
  • + {{ endfor }} + */}} +
+
+
+{{end}} + +{{define "extra_js"}} + + +{{end}} diff --git a/templates/old/hackz/tetris_v2.html b/templates/old/hackz/tetris_v2.html index fcdb5b8c..fb106153 100644 --- a/templates/old/hackz/tetris_v2.html +++ b/templates/old/hackz/tetris_v2.html @@ -4,7 +4,7 @@ {% set layout = 'two_columns' %} {% block title %}Ultreme Tetris{% endblock %} -{% block subtitle %}{{ niveau }}ème niveau de difficulté{% endblock %} +{% block subtitle %}{{ .niveau }}ème niveau de difficulté{% endblock %} {% block main_column %} {# {% include '../../../static/hackz/tetris_v2/app.html' %} #} diff --git a/templates/track.tmpl b/templates/track.tmpl index 26acd1b4..e4d6377d 100644 --- a/templates/track.tmpl +++ b/templates/track.tmpl @@ -4,37 +4,36 @@ {{define "content"}} - - - - - {{ if .track.Description }} -
{{ .track.Description | linkify }}
- {{end}} + + + + +{{ if .track.Description }} +
{{ .track.Description | linkify }}
+{{end}} {{end}} {{define "secondary_column"}} - - {{ .track.Title }} - - -
- {{ .track.CreatedAt }} -
- - - -
- {{ range $tag := .track.Tags }} - #{{ $tag }} - {{ end }} -
+ + {{ .track.Title }} + + +
+ {{ .track.CreatedAt }} +
+ + + +
+ {{ range $tag := .track.Tags }} + #{{ $tag }} + {{ end }} +
{{end}} diff --git a/views/views.go b/views/views.go index f332502e..314a9747 100644 --- a/views/views.go +++ b/views/views.go @@ -51,20 +51,20 @@ func Setup(opts *Options) error { // hackz opts.Router.HandleFunc("/hackz", handlers.hackzHandler) - opts.Router.HandleFunc("/hackz/recettator", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/convertisseur", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/miroir", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/demineur", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/calculatrice.exe", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/terminul", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/steak-hache-shake", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/3615cryptage", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/paint", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/2048", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/ultreme-tetris", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/moijaime", handlers.hackzTravaux) - opts.Router.HandleFunc("/hackz/phazms", handlers.hackzTravaux) // GET POST ? - opts.Router.HandleFunc("/hackz/m1ch3l", handlers.hackzTravaux) // GET POST ? + opts.Router.HandleFunc("/hackz/recettator", handlers.hackzRecettator) + opts.Router.HandleFunc("/hackz/convertisseur", handlers.hackzConvertisseur) + opts.Router.HandleFunc("/hackz/miroir", handlers.hackzMiroir) + opts.Router.HandleFunc("/hackz/demineur", handlers.hackzDemineur) + opts.Router.HandleFunc("/hackz/calculatrice.exe", handlers.hackzCalculatrice) + opts.Router.HandleFunc("/hackz/terminul", handlers.hackzTerminul) + opts.Router.HandleFunc("/hackz/steak-hache-shake", handlers.hackzSteakHacheShake) + opts.Router.HandleFunc("/hackz/3615cryptage", handlers.hackz3615cryptage) + opts.Router.HandleFunc("/hackz/paint", handlers.hackzPaint) + opts.Router.HandleFunc("/hackz/2048", handlers.hackz2048) + opts.Router.Path("/hackz/ultreme-tetris").HandlerFunc(handlers.hackzTetris).Name("hackz.tetris") + opts.Router.HandleFunc("/hackz/moijaime", handlers.hackzMoiJaime) + opts.Router.HandleFunc("/hackz/phazms", handlers.hackzPhazms) // GET POST ? + opts.Router.HandleFunc("/hackz/m1ch3l", handlers.hackzM1ch3l) // GET POST ? // copaings opts.Router.HandleFunc("/copaings", handlers.copaingsHandler) @@ -171,6 +171,88 @@ func (h *handlers) hackzTravaux(w http.ResponseWriter, r *http.Request) { h.render(w, r, "hackz.travaux.tmpl", nil) } +func (h *handlers) hackzCalculatrice(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.calculatrice.tmpl", nil) +} + +func (h *handlers) hackz2048(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + data := renderData{ + "layout_mode": "two_columns", + } + h.render(w, r, "hackz.2048.tmpl", data) +} + +func (h *handlers) hackzSteakHacheShake(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.steakhacheshake.tmpl", nil) +} + +func (h *handlers) hackzConvertisseur(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.convertisseur.tmpl", nil) +} + +func (h *handlers) hackzMiroir(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.miroir.tmpl", nil) +} + +func (h *handlers) hackzTerminul(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.terminul.tmpl", nil) +} + +func (h *handlers) hackzDemineur(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.demineur.tmpl", nil) +} + +func (h *handlers) hackzTetris(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + niveau := r.FormValue("niveau") + if niveau == "" { + niveau = "5" + } + data := renderData{ + "layout_mode": "two_columns", + "niveau": niveau, + } + + h.render(w, r, "hackz.tetris.tmpl", data) +} + +func (h *handlers) hackzMoiJaime(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.moijaime.tmpl", nil) +} + +func (h *handlers) hackzPaint(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.paint.tmpl", nil) +} + +func (h *handlers) hackzRecettator(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.recettator.tmpl", nil) +} + +func (h *handlers) hackzPhazms(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.phazms.tmpl", nil) +} + +func (h *handlers) hackzM1ch3l(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.m1ch3l.tmpl", nil) +} + +func (h *handlers) hackz3615cryptage(w http.ResponseWriter, r *http.Request) { + h.setDefaultHeaders(w) + h.render(w, r, "hackz.3615cryptage.tmpl", nil) +} + func (h *handlers) hackzHandler(w http.ResponseWriter, r *http.Request) { h.setDefaultHeaders(w) hackz, err := h.opts.Svc.Hackz(nil, &api.Void{})