few minor changes - and offpage modal filter

master
David Kebler 2017-04-20 13:11:36 -07:00
parent d43791bfdd
commit 0c20def9e6
6 changed files with 16 additions and 14 deletions

View File

@ -21,7 +21,7 @@
<link href="//fonts.googleapis.com/css?family={{ . }}" rel="stylesheet" type="text/css">
{{ end }}
{{ with .hero.headline_font }}
{{ with .hero.headlines_font }}
<link href="//fonts.googleapis.com/css?family={{ . }}" rel="stylesheet" type="text/css">
{{ end }}

View File

@ -1,4 +1,4 @@
{{ range where .Site.RegularPages "Section" "modal" }}
{{ range where .Site.RegularPages "Section" "modals" }}
<div id="modal-{{ .File.BaseFileName }}" class="section section--modal">
<div class="section__container section__container--modal">
<div class="section__headline section__headline--modal">

View File

@ -157,11 +157,12 @@ figcaption {
hr {
width: 50%;
height: 0;
margin: 4px auto;
border-top-color: white;
border-bottom-color: rgba(0, 0, 0, 0.2);
border-width: 2px;
border-style: solid;
margin-top: 0.5em;
margin-bottom: 1em;
}
.flex-col-center {

View File

@ -217,7 +217,8 @@
}
.box--btn {
padding: 0.5rem;
padding: 0.5em;
margin-bottom: 0.5em;
}
.box--btn-bar > .box--btn {

View File

@ -7,14 +7,14 @@
$.fn.fitToWindow = function (maxWidth, wPad) {
console.log("in fit to Window")
// console.log("in fit to Window")
// if more than one element
this.each(function () {
let $el = $(this);
console.log(`element ${$el.prop("tagName")} ${$el.attr("class")} parent ${$el.parent().attr('class')}`)
console.log(`before ${maxWidth} ${wPad} ${$el.data('maxWidth')} ${$el.data('wPad')}`)
// console.log(`element ${$el.prop("tagName")} ${$el.attr("class")} parent ${$el.parent().attr('class')}`)
// console.log(`before ${maxWidth} ${wPad} ${$el.data('maxWidth')} ${$el.data('wPad')}`)
var mw = $el.parent().attr('maxWidth');
maxWidth = mw ? mw : maxWidth
maxWidth = (maxWidth || $el.data('maxWidth')) || 450
@ -25,7 +25,7 @@
let windowWidth = $(window).width()
let newWidth = (windowWidth > maxWidth) ? maxWidth : windowWidth - 2 * wPad
console.log(`after ${maxWidth} ${wPad} ${newWidth}`)
// console.log(`after ${maxWidth} ${wPad} ${newWidth}`)
// Initial Aspect given in attributes by element itself
let setWidth = $el.attr('width');
@ -41,11 +41,11 @@
if (!aspect) {
aspect = setWidth / setHeight;
$el.data('aspect', aspect);
console.log(`aspect set ${aspect} = ${$el.data('aspect')}`)
// console.log(`aspect set ${aspect} = ${$el.data('aspect')}`)
$el.data('maxWidth', maxWidth)
$el.data('wPad', wPad)
console.log(`values set ${maxWidth} = ${$el.data('maxWidth')} ${wPad} = ${$el.data('wPad')}`)
console.log("REGISTERING RESIZE")
// console.log(`values set ${maxWidth} = ${$el.data('maxWidth')} ${wPad} = ${$el.data('wPad')}`)
// console.log("REGISTERING RESIZE")
$(window).resize({ el: $el }, function (event) {
event.data.el.fitToWindow()
})
@ -70,7 +70,7 @@
// newWidth = (newHeight * aspect);
// }
console.log(`new width and height before setting ${newWidth} ${newHeight}`)
// console.log(`new width and height before setting ${newWidth} ${newHeight}`)
// Set new size of element
$el.width(newWidth);

View File

@ -1,6 +1,6 @@
// Smooth Scroll Init - Register click handler for ID anchors
$('a[href*="#"]:not(a[modal])').click(function () {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
if (location.pathname.replace(/\/$/, "") == this.pathname.replace(/\/$/, "") && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
@ -147,7 +147,7 @@ function lightgallery(id) {
// Register click event for all modal links on page
$("a[modal]").click(function () {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
if (location.pathname.replace(/\/$/, "") == this.pathname.replace(/\/$/, "") && location.hostname == this.hostname) {
var target = this.hash;
modalShow(target);
} else {