aboutsummaryrefslogtreecommitdiffstats
path: root/templates/js
diff options
context:
space:
mode:
Diffstat (limited to 'templates/js')
-rw-r--r--templates/js/efectos.js47
-rw-r--r--templates/js/efectos.min.js3
-rw-r--r--templates/js/formulario.js64
-rw-r--r--templates/js/formulario.min.js3
4 files changed, 117 insertions, 0 deletions
diff --git a/templates/js/efectos.js b/templates/js/efectos.js
new file mode 100644
index 0000000..9d76511
--- /dev/null
+++ b/templates/js/efectos.js
@@ -0,0 +1,47 @@
+/*
+@licstart The following is the entire license notice for the
+JavaScript code in this page.
+
+Copyleft 2017 | Heckyel
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+@licend The above is the entire license notice
+for the JavaScript code in this page.
+*/
+$(document).ready(function(){
+ // scroll elementos Menu
+ var acercade = $('#acerca-de').offset().top,
+ proyecto = $('#trabajos').offset().top,
+ contactar = $('#contacto').offset().top;
+
+ $('#btn-acerca-de').on('click', function(e){
+ e.preventDefault();
+ $('html, body').animate({
+ scrollTop: 240
+ }, 500);
+ });
+
+ $('#btn-trabajos').on('click', function(e){
+ e.preventDefault();
+ $('html, body').animate({
+ scrollTop: proyecto
+ }, 500);
+ });
+
+ $('#btn-contacto').on('click', function(e){
+ e.preventDefault();
+ $('html, body').animate({
+ scrollTop: contactar
+ }, 500);
+ });
+
+});
diff --git a/templates/js/efectos.min.js b/templates/js/efectos.min.js
new file mode 100644
index 0000000..021b50d
--- /dev/null
+++ b/templates/js/efectos.min.js
@@ -0,0 +1,3 @@
+// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
+$(document).ready(function(){$("#acerca-de").offset().top;var t=$("#trabajos").offset().top,o=$("#contacto").offset().top;$("#btn-acerca-de").on("click",function(t){t.preventDefault(),$("html, body").animate({scrollTop:240},500)}),$("#btn-trabajos").on("click",function(o){o.preventDefault(),$("html, body").animate({scrollTop:t},500)}),$("#btn-contacto").on("click",function(t){t.preventDefault(),$("html, body").animate({scrollTop:o},500)})});
+// @license-end
diff --git a/templates/js/formulario.js b/templates/js/formulario.js
new file mode 100644
index 0000000..fae85ec
--- /dev/null
+++ b/templates/js/formulario.js
@@ -0,0 +1,64 @@
+/*
+@licstart The following is the entire license notice for the
+JavaScript code in this page.
+
+Copyleft 2017 | Heckyel
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License for more details.
+
+@licend The above is the entire license notice
+for the JavaScript code in this page.
+*/
+
+(function(){
+ var formulario = document.getElementById('formulario'),
+ nombre = formulario.nombre,
+ correo = formulario.correo,
+ mensaje = formulario.mensaje,
+ error = document.getElementById('error');
+
+ function validarNombre(e){
+ if(nombre.value == '' || nombre.value == null){
+ console.info('Por favor completa el nombre');
+ error.style.display = 'block';
+ error.innerHTML = error.innerHTML + '<li>Por favor completa el nombre</li>';
+ e.preventDefault();
+ }
+ }
+
+ function validarCorreo(e){
+ if(correo.value == '' || correo.value == null){
+ console.info('Por favor completa el correo');
+ error.style.display = 'block';
+ error.innerHTML = error.innerHTML + '<li>Por favor completa el correo</li>';
+ e.preventDefault();
+ }
+ }
+
+ function validarMensaje(e){
+ if(mensaje.value == '' || mensaje.value == null){
+ console.info('Por favor completa el mensaje');
+ error.style.display = 'block';
+ error.innerHTML = error.innerHTML + '<li>Por favor completa el mensaje</li>';
+ e.preventDefault();
+ }
+ }
+
+ function validarFormulario(e){
+ error.innerHTML = '';
+ error.style.display = 'none';
+ validarNombre(e);
+ validarCorreo(e);
+ validarMensaje(e);
+ }
+
+ formulario.addEventListener('submit', validarFormulario);
+}());
diff --git a/templates/js/formulario.min.js b/templates/js/formulario.min.js
new file mode 100644
index 0000000..d58b9d2
--- /dev/null
+++ b/templates/js/formulario.min.js
@@ -0,0 +1,3 @@
+// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
+!function(){function e(e){""!=a.value&&null!=a.value||(console.info("Por favor completa el nombre"),c.style.display="block",c.innerHTML=c.innerHTML+"<li>Por favor completa el nombre</li>",e.preventDefault())}function l(e){""!=t.value&&null!=t.value||(console.info("Por favor completa el correo"),c.style.display="block",c.innerHTML=c.innerHTML+"<li>Por favor completa el correo</li>",e.preventDefault())}function n(e){""!=i.value&&null!=i.value||(console.info("Por favor completa el mensaje"),c.style.display="block",c.innerHTML=c.innerHTML+"<li>Por favor completa el mensaje</li>",e.preventDefault())}function o(o){c.innerHTML="",c.style.display="none",e(o),l(o),n(o)}var r=document.getElementById("formulario"),a=r.nombre,t=r.correo,i=r.mensaje,c=document.getElementById("error");r.addEventListener("submit",o)}();
+// @license-end