From 98e0282821578303551e15a3d283c33e2ee04510 Mon Sep 17 00:00:00 2001 From: infeeeee Date: Mon, 1 Jul 2019 03:31:24 +0200 Subject: [PATCH] small fixes --- _jegyzet.md | 5 + category-esemeny.php | 13 +- css/base.css | 336 ++++++++++++++++++----------------------- functions.php | 53 +++---- header.php | 9 +- js/scripts.js | 92 ++++++----- loop.php | 9 +- sass/_font-mixins.scss | 42 +++--- sass/base.scss | 201 +++++++++++++----------- 9 files changed, 388 insertions(+), 372 deletions(-) diff --git a/_jegyzet.md b/_jegyzet.md index 61ef9e5..d804550 100644 --- a/_jegyzet.md +++ b/_jegyzet.md @@ -98,3 +98,8 @@ Kereső: ## single: képen ne legyen cím + + +## bedo magasság: + margin: $v-unit-1 => 4rem + top: calc(#{$v-unit-1}/ 2); => 2rem \ No newline at end of file diff --git a/category-esemeny.php b/category-esemeny.php index 44a709a..5a28d78 100644 --- a/category-esemeny.php +++ b/category-esemeny.php @@ -4,8 +4,6 @@
-

Események

- @@ -14,19 +12,12 @@ - + - @@ -128,11 +129,11 @@
-
-
+
diff --git a/js/scripts.js b/js/scripts.js index e5453c5..da6e319 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -14,12 +14,26 @@ const vw = $(window).width() const wow = window.outerWidth - // console.log(vw, wow) + const wiw = window.innerWidth + const bw = $('body').width() + + const wih = window.innerHeight + const vh = $(window).height() + - const bottomScrollHeight = window.innerHeight - $(window).height() const desktophomemargin = $(".header-1")[0].getBoundingClientRect().width + const cssWidths = { + vw: vw, + wow: wow, + wiw: wiw, + bw: bw, + desktophomemargin: desktophomemargin + } + console.log(cssWidths) + + /* --------------------------- css values to vars --------------------------- */ //isMobile const isMobile = (_ => { @@ -61,15 +75,21 @@ } })() + const bottomScrollHeight = (_ => { + if (wih / vh > 1.5) { + return 0 + } else { + let bs = wih - vh + return bs + } + })() + + /* ========================================================================== */ /* FUNCTIONS */ /* ========================================================================== */ - var focusSearch = function () { - - $(".search-bar input").focus() - } var rotateMenuButton = function () { if ($(".menubutton button").hasClass("rotated")) { @@ -95,10 +115,33 @@ /* SEARCH */ /* ========================================================================== */ + // on mobile add to sidebar: if (isMobile) { $(".search-bar").prependTo("#sidebar-wrapper") } + //clicking on desktop + if (!isMobile) { + $(".search-box button").click(function (e) { + // e.preventDefault() + var bar = $(this).next(".search-bar") + if (bar.hasClass("opensearch")) { + //if search is opened close: + bar.stop().animate({ width: "0" }, 400, function () { + bar.hide().removeClass("opensearch") + }) + } else { + //if it's closed open: + bar.show().stop().animate({ width: wiw - (desktophomemargin * 3) }, 400, function () { + bar.addClass("opensearch") + $(".search-input").focus() + }) + // console.log("calc(100% - " + (desktophomemargin * 2) + "px)") + } + + }) + } + /* ========================================================================== */ /* MENU */ /* ========================================================================== */ @@ -143,28 +186,6 @@ }); - /* --------------------------------- Search --------------------------------- */ - - if (!isMobile) { - $(".search-box button").click(function (e) { - // e.preventDefault() - var bar = $(this).next(".search-bar") - if (bar.hasClass("opensearch")) { - //if search is opened close: - bar.stop().animate({ width: "0" }, 400, function () { - bar.hide().removeClass("opensearch") - }) - } else { - //if it's closed open: - bar.show().stop().animate({ width: "50vw" }, 400, function () { - bar.addClass("opensearch") - $(".search-input").focus() - }) - } - - }) - } - /* -------------------------------------------------------------------------- */ /* HOME & ARCHIVES */ @@ -229,8 +250,9 @@ } //add bottom scrollbar to div on bottom: - $(".home-wrapper-big .metadata").css({ bottom: bottomScrollHeight }) - + if (bottomScrollHeight > 0) { + $(".home-wrapper-big .metadata").css({ bottom: bottomScrollHeight }) + } }//isHome || isArchive end }// !isMobile end @@ -485,7 +507,7 @@ /* ------------------------------ hover on home ----------------------------- */ //hover on big articles - $(".home-big h2, .home-big .thumbnailwrapper").hover(function () { + $(".home-big h2 a").hover(function () { let cc = $(this) let cArticle = cc.parents("article") let cMetadata = cArticle.children(".metadata") @@ -603,16 +625,16 @@ let itemClass = findClassByStart(tagClass, 'tag') // add wrapper div - $(".sub-wrapper").append('
') + // $(".sub-wrapper").append('
') // add tag title - $(this).children("a").clone().appendTo(".sub-wrapper #" + itemId) + // $(this).children("a").clone().appendTo(".sub-wrapper #" + itemId) //add sub text - $(this).children("span").appendTo(".sub-wrapper #" + itemId) + // $(this).children("span").appendTo(".sub-wrapper #" + itemId) //add circle - $(".sub-wrapper #" + itemId + " span").append('
') + // $(".sub-wrapper #" + itemId + " span").append('
') }) //wrap each letter to spans diff --git a/loop.php b/loop.php index 8127eca..1d30928 100644 --- a/loop.php +++ b/loop.php @@ -20,7 +20,12 @@