1
0

5 Revīzijas 0eb7f4f70e ... 6dc4328923

Autors SHA1 Ziņojums Datums
  Danilo Gómez Gómez 6dc4328923 Merge branch 'staging' of https://git.o-for.net/marx/alucho into staging 4 gadi atpakaļ
  Danilo Gómez Gómez 01d2244322 Add sort criterion to images 4 gadi atpakaļ
  Danilo Gómez Gómez 844a03984e Preset eye position 4 gadi atpakaļ
  Danilo Gómez Gómez b810bf4e5f Recompile layout on static files modification 5 gadi atpakaļ
  Danilo Gómez Gómez 20c9e9449f Translate page title 5 gadi atpakaļ

+ 1 - 0
languages/es.txt

@@ -12,3 +12,4 @@ branding:marca
 other:otros
 About Alejandro:Acerca de Alejandro
 about & contact:acerca de & contacto
+Alucho Portfolio:Portafolios de Alucho

+ 1 - 1
layout/_base.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-	<title>Alucho Portfolio</title>
+	<title>{{ 'Alucho Portfolio' | lang }}</title>
 	<!-- Global site tag (gtag.js) - Google Analytics -->
 	<script async src="https://www.googletagmanager.com/gtag/js?id=UA-148161067-1"></script>
 	<script>

+ 1 - 1
layout/work.html

@@ -8,7 +8,7 @@
 {% endblock %}
 
 {% block main %}
-{% for image in images(path) %}
+{% for image in (sorted(images(path), reverse=True) if sort_images else images(path)) %}
 	<figure class="{{ 'clickable-fig' if expand_dialog else ''}}">
 		<img class="tile" src="{{ (image.main or image.filenames[0]) | static }}" alt="{{ image.category }}: {{ image.name }} ({{ image.year }})">
 		<figcaption class="hbox">

+ 1 - 0
layout/work/illustration.html

@@ -2,6 +2,7 @@
 
 {% set illustration_selected = True %}
 {% set work_path = "illustration" %}
+{% set sort_images = True %}
 
 {% block style %}
 :root {

+ 1 - 0
layout/work/poster.html

@@ -3,3 +3,4 @@
 {% set poster_selected = True %}
 {% set work_path = "poster" %}
 {% set expand_dialog = True %}
+{% set sort_images = True %}

+ 2 - 1
sitegen.py

@@ -307,9 +307,9 @@ def save_generate(generator, args, msg):
 def run(args):
     print('initial compilation')
     init_gen(args)
-    save_generate(gen_layout, args, 'generating layout')
     save_generate(gen_root, args, 'copying root files')
     save_generate(gen_static, args, 'copying static dir')
+    save_generate(gen_layout, args, 'generating layout')
 
     if not args.watch:
         return
@@ -340,6 +340,7 @@ def run(args):
         if static_mt != new_static_mt:
             static_mt = new_static_mt
             save_generate(gen_static, args, 'copying static files')
+            save_generate(gen_layout, args, 'recompiling layout')
 
 if __name__ == '__main__':
     parser = argparse.ArgumentParser("Site generator")

+ 20 - 0
static/js/eye.js

@@ -16,8 +16,28 @@ window.onload = function () {
     const pend = 17;
     const plength = pend - pstart;
     const oY = logo.getAttribute('height') / 2.;
+    var firstTime = true;
+    var x0 = -1;
+    var y0 = -1;
+
+    // preinitialize eye position (it could be never updated)
+    const r = .9;//(ev.clientX) / (window.innerWidth) / 2 + .5;
+
+    const iX = istart + ilength * r;
+    iris.setAttribute('cx', iX);
+
+    const pX = iX + pstart + plength * r;
+    pupil.setAttribute('cx', pX);
+    pupil.setAttribute('cy', oY);
 
     window.onmousemove = function (ev) {
+        if (firstTime) {
+            x0 = ev.clientX;
+            y0 = ev.clientY;
+            firstTime = false;
+            return;
+        }
+        if (ev.clientX == x0 && ev.clientY == y0) return; // avoid fake mouse data (Safari et all)
         const eyeOffset = body.getBoundingClientRect().x + lang.clientWidth + eye.clientWidth / 2;
         const r = (ev.clientX - eyeOffset) / (window.innerWidth - eyeOffset) / 2 + .5;
         const ry = ev.clientY / window.innerHeight;