initial commit

This commit is contained in:
2019-06-04 19:35:01 +02:00
commit 9ec32551f6
120 changed files with 12662 additions and 0 deletions

2
js/lib/conditionizr-4.3.0.min.js vendored Normal file
View File

@@ -0,0 +1,2 @@
/*! Conditionizr v4.3.0 | (c) 2014 @toddmotto, @markgdyr | MIT license | conditionizr.com */
!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b:a.conditionizr=b()}(this,function(){"use strict";var a,b={},c=document.head||document.getElementsByTagName("head")[0],d=function(b,d,e){var f=e?b:a+b+("style"===d?".css":".js");switch(d){case"script":var g=document.createElement("script");g.src=f,c.appendChild(g);break;case"style":var h=document.createElement("link");h.href=f,h.rel="stylesheet",c.appendChild(h);break;case"class":document.documentElement.className+=" "+b}};return b.config=function(c){var e=c||{},f=e.tests;a=e.assets||"";for(var g in f){var h=g.toLowerCase();if(b[h])for(var i=f[g],j=i.length;j--;)d(h,i[j])}},b.add=function(a,c,e){var f=a.toLowerCase();if(b[f]=e(),b[f])for(var g=c.length;g--;)d(f,c[g])},b.on=function(a,c){var d=/^\!/;(b[a.toLowerCase()]||d.test(a)&&!b[a.replace(d,"")])&&c()},b.load=b.polyfill=function(a,c){for(var e=/\.js$/.test(a)?"script":"style",f=c.length;f--;)b[c[f].toLowerCase()]&&d(a,e,!0)},b});

2
js/lib/jquery-3.3.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,72 @@
/*global jQuery */
/*!
* Lettering.JS 0.7.0
*
* Copyright 2010, Dave Rupert http://daverupert.com
* Released under the WTFPL license
* http://sam.zoy.org/wtfpl/
*
* Thanks to Paul Irish - http://paulirish.com - for the feedback.
*
* Date: Mon Sep 20 17:14:00 2010 -0600
*/
(function($){
function injector(t, splitter, klass, after) {
var text = t.text()
, a = text.split(splitter)
, inject = '';
if (a.length) {
$(a).each(function(i, item) {
inject += '<span class="'+klass+(i+1)+'" aria-hidden="true">'+item+'</span>'+after;
});
t.attr('aria-label',text)
.empty()
.append(inject)
}
}
var methods = {
init : function() {
return this.each(function() {
injector($(this), '', 'char', '');
});
},
words : function() {
return this.each(function() {
injector($(this), ' ', 'word', ' ');
});
},
lines : function() {
return this.each(function() {
var r = "eefec303079ad17405c889e092e105b0";
// Because it's hard to split a <br/> tag consistently across browsers,
// (*ahem* IE *ahem*), we replace all <br/> instances with an md5 hash
// (of the word "split"). If you're trying to use this plugin on that
// md5 hash string, it will fail because you're being ridiculous.
injector($(this).children("br").replaceWith(r).end(), r, 'line', '');
});
}
};
$.fn.lettering = function( method ) {
// Method calling logic
if ( method && methods[method] ) {
return methods[ method ].apply( this, [].slice.call( arguments, 1 ));
} else if ( method === 'letters' || ! method ) {
return methods.init.apply( this, [].slice.call( arguments, 0 ) ); // always pass an array
}
$.error( 'Method ' + method + ' does not exist on jQuery.lettering' );
return this;
};
})(jQuery);

7
js/lib/jquery.simpler-sidebar.min.js vendored Normal file
View File

@@ -0,0 +1,7 @@
/*! simpler-sidebar - A simple side nav in jQuery
* @version 2.2.5
* @link https://github.com/simple-sidebar/simpler-sidebar
* @copyright 2015 - 2018 Davide Di Criscito (https://github.com/dcdeiv)
* @license MIT AND GPL-2.0
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(n,o){return void 0===o&&(o="undefined"!=typeof window?require("jquery"):require("jquery")(n)),e(o),o}:e(jQuery)}(function(q){q.fn.simplerSidebar=function(n){var I=q.extend(!0,{attr:"simplersidebar",top:0,gap:64,zIndex:3e3,sidebar:{width:300},animation:{duration:500,easing:"swing"},events:{on:{animation:{open:function(){},close:function(){},both:function(){}}},callbacks:{animation:{open:function(){},close:function(){},both:function(){},freezePage:!0}}},mask:{display:!0,css:{backgroundColor:"black",opacity:.5,filter:"Alpha(opacity=50)"}}},n);return this.each(function(){var n,o,e,t="data-"+I.attr,i="opened"===I.init?"opened":"closed",a=I.overflow?I.overflow:q("html").css("overflow"),s=I.overflow?I.overflow:q("body").css("overflow"),c="left"===I.align?"left":"right",d=I.animation.duration,r=I.animation.easing,l={},f=!0===I.events.callbacks.animation.freezePage,u=function(){q("body, html").css("overflow","hidden")},p=q(this),m=function(n){return n<I.sidebar.width+I.gap?n-I.gap:I.sidebar.width},b=function(){return p.attr(t)},h=function(n){p.attr(t,n)},w=q("<div>").attr(t,"mask"),v=q(I.selectors.trigger),y=I.selectors.quitter?I.selectors.quitter:"a",k=q(window).width(),g={animation:{open:function(){w.fadeIn(d),h("opened"),I.events.on.animation.open()},close:function(){w.fadeOut(d),h("closed"),I.events.on.animation.close()},both:function(){I.events.on.animation.both()}}},x={animation:{open:function(){f&&u(),I.events.callbacks.animation.open()},close:function(){f&&(q("html").css("overflow",a),q("body").css("overflow",s)),I.events.callbacks.animation.close()},both:function(){I.events.callbacks.animation.both()}}},z=function(){l[c]=-p.width(),p.animate(l,d,r,function(){x.animation.close(),x.animation.both()}),g.animation.close(),g.animation.both()};(n={position:"fixed",top:parseInt(I.top),bottom:0,width:m(k),zIndex:I.zIndex})[c]="closed"===i?-m(k):0,f&&"opened"===i&&u(),p.css(n).attr(t,i),(o={position:"fixed",top:parseInt(I.top),right:0,bottom:0,left:0,zIndex:I.zIndex-1,display:"none"}).display="opened"===i?"block":"none",e=q.extend(!0,o,I.mask.css),I.mask.display&&w.appendTo("body").css(e),v.click(function(){switch(b()){case"opened":z();break;case"closed":l[c]=0,p.animate(l,d,r,function(){x.animation.open(),x.animation.both()}),g.animation.open(),g.animation.both()}}),w.click(z),p.on("click",y,z),q(window).resize(function(){var n=q(window).width();p.css("width",m(n)),"closed"===b()&&p.css(c,-p.width())})})}});

1
js/lib/modernizr-2.7.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

6
js/lib/snap-scroll.min.js vendored Normal file

File diff suppressed because one or more lines are too long

39
js/myloadmore.js Normal file
View File

@@ -0,0 +1,39 @@
jQuery(function($){ // use jQuery code inside this to avoid "$ is not defined" error
$('.misha_loadmore').click(function(){
var button = $(this),
data = {
'action': 'loadmore',
'query': misha_loadmore_params.posts, // that's how we get params from wp_localize_script() function
'page' : misha_loadmore_params.current_page
};
button.trigger("moreload-start")
$.ajax({ // you can also use $.post here
url : misha_loadmore_params.ajaxurl, // AJAX handler
data : data,
type : 'POST',
beforeSend : function ( xhr ) {
button.html('<p>Betöltés...</p>'); // change the button text, you can also add a preloader image
},
success : function( data ){
if( data ) {
button.html( '<a>Tovább</a>' ).before(data); // insert new posts
misha_loadmore_params.current_page++;
button.trigger("moreload-finish")
if ( misha_loadmore_params.current_page == misha_loadmore_params.max_page )
button.remove(); // if last page, remove the button
// you can also fire the "post-load" event here if you use a plugin that requires it
// $( document.body ).trigger( 'post-load' );
} else {
button.remove(); // if no data, remove the button as well
}
}
});
});
});

281
js/scripts.js Normal file
View File

@@ -0,0 +1,281 @@
(function ($, root, undefined) {
$(function () {
'use strict';
// DOM ready, take it away
/* ========================================================================== */
/* VARIABLES */
/* ========================================================================== */
const vw = $(window).width()
const wow = window.outerWidth
console.log(vw, wow)
var isMobile
var isHome = false
if (wow < 769) {
isMobile = true
//mobile settings
$('.social-link').addClass('hidden')
} else {
isMobile = false
}
if ($('body').hasClass("home")) {
isHome = true
}
var desktophomemargin = $(".header-1")[0].getBoundingClientRect().width
/* ========================================================================== */
/* FUNCTIONS */
/* ========================================================================== */
var focusSearch = function () {
$(".search-bar input").focus()
}
var rotateMenuButton = function () {
if ($(".menubutton button").hasClass("rotated")) {
$(".menubutton button").removeClass("rotated");
} else {
$(".menubutton button").addClass("rotated");
}
}
var showHideSocial = function () {
if (isMobile && $('.social-link').hasClass('hidden')) {
$('.social-link').removeClass('hidden')
} else if (isMobile) {
$('.social-link').addClass('hidden')
}
}
function convertRemToPixels(rem) {
return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
}
/* ========================================================================== */
/* SEARCH */
/* ========================================================================== */
if (isMobile) {
$(".search-bar").prependTo("#sidebar-wrapper")
}
/* ========================================================================== */
/* MENU */
/* ========================================================================== */
var menuWidth = wow
if (!isMobile) {
menuWidth = 420
}
$("#sidebar").simplerSidebar({
selectors: {
trigger: "#toggle-sidebar",
quitter: "#toggle-sidebar"
},
sidebar: {
width: menuWidth
},
mask: {
display: false,
css: {
backgroundColor: "black",
opacity: 1,
filter: "Alpha(opacity=100)" // IE opacity fix
}
},
gap: 0,
events: {
on: {
animation: {
both: rotateMenuButton
}
},
callbacks: {
animation: {
both: showHideSocial,
freezePage: false
}
}
}
});
/* --------------------------------- Search --------------------------------- */
if (!isMobile) {
$(".search-box button").click(function (e) {
e.preventDefault()
var bar = $(this).next(".search-bar")
if (bar.hasClass("opensearch")) {
bar.stop().animate({ width: "0" }, 400, function () {
bar.hide().removeClass("opensearch")
})
} else {
bar.show().stop().animate({ width: "20rem" }, 400, function () {
bar.addClass("opensearch")
})
}
})
}
/* -------------------------------------------------------------------------- */
/* HOME */
/* -------------------------------------------------------------------------- */
/* ----------------------------------- css ---------------------------------- */
if (isHome & !isMobile) {
$('html').css({ overflowY: "hidden" })
}
/* ----------------------------- Snap on mobile ----------------------------- */
if (isHome & isMobile) {
$("article.post").SnapScroll({
animateDuration: 400
});
}
/* --------------------------------- To top --------------------------------- */
$(".totop>a").click(function (e) {
e.preventDefault()
$('html, body').stop().animate({ scrollTop: 0 }, 800);
})
/* ---------------------------- Scroll on desktop --------------------------- */
//scroll to the next or prev article
function homeScroll(target, direction) {
var nextelem;
if (direction == "next") {
nextelem = target.next()
} else {
nextelem = target.prev()
}
if (nextelem.length == 0) {
nextelem = target
}
// var offset = ($(nextelem).offset().left) - desktophomemargin
var offset = ($(nextelem).position().left) - desktophomemargin
console.log("scrolling to: " + nextelem.attr("id") + " - offset: " + offset)
$('html, body').stop().animate({ scrollLeft: offset }, 800);
return nextelem;
}
//extractDelta(e): extract the scroll length from an event
function extractDelta(e) {
if (e.wheelDelta) {
return e.wheelDelta;
}
if (e.originalEvent.detail) {
return e.originalEvent.detail;
}
if (e.originalEvent.deltaY) {
return e.originalEvent.deltaY * -1;
}
if (e.originalEvent && e.originalEvent.wheelDelta) {
return e.originalEvent.wheelDelta;
}
}
var currElem = $('article:first-child')
//checking the current scroll location for refresh:
if (isHome & !isMobile) {
var articleWidth = $('article:first-child')[0].getBoundingClientRect().width
var currscroll = $('html').scrollLeft()
var scrollnr = Math.floor(currscroll / articleWidth) + 1
currElem = $('article:nth-child(' + scrollnr + ')')
console.log(currElem.attr("id"))
}
var scrolltimer = false;
$(window).on('wheel DOMMouseScroll', function (e) {
//e.preventDefault();
if (isHome & !isMobile) {
if (scrolltimer) {
return false;
}
scrolltimer = true;
setTimeout(() => {
scrolltimer = false;
}, 500);
var wd = extractDelta(e)
if (wd > 0) {
currElem = homeScroll(currElem, "prev")
}
else {
currElem = homeScroll(currElem, "next")
}
}
});
/* -------------------------- scroll click on home -------------------------- */
$(".header-scroll-left button").click(() => {
currElem = homeScroll(currElem, "prev")
})
$(".header-scroll-right button").click(() => {
currElem = homeScroll(currElem, "next")
})
/* -------------------------- loadmore: ajax loads -------------------------- */
$('.misha_loadmore').on("moreload-start", function () {
currElem = $(this).prev()
})
$('.misha_loadmore').on("moreload-finish", function () {
currElem = homeScroll(currElem, "next")
})
/* -------------------------------------------------------------------------- */
/* CIRCULAR TEXT */
/* -------------------------------------------------------------------------- */
var charnum = 0
$(".wrapper .header #tag-nav ul li a").each(function () {
let chars = $(this).html().length + 1
$(this).lettering()
$(this).children("span").each(function () {
let origClass = $(this).attr("class")
let origClassNum = parseInt(origClass.split("r")[1])
let newClassNum = origClassNum + charnum
$(this).removeClass(origClass).addClass("char" + newClassNum)
})
charnum += chars
})
});
})(jQuery, this);