“use strict”;
var positionImage = function positionImage(imageEl) {
var imageDimensions = imageEl.dataset.imageDimensions.split(‘x’);
var originalWidth = imageDimensions[0];
var originalHeight = imageDimensions[1];
var focalPoint = imageEl.dataset.imageFocalPoint.split(‘,’);
var focalPointX = focalPoint[0];
var focalPointY = focalPoint[1];
var parentNode = imageEl.parentNode;
var scale = function () {
var imageRatio = originalWidth / originalHeight;
var parentClientSize = {
height: parentNode.clientHeight,
width: parentNode.clientWidth
};
var parentRatio = parentClientSize.width / parentClientSize.height;
if (imageRatio > parentRatio) {
return parentClientSize.height / originalHeight;
}
return parentClientSize.width / originalWidth;
}();
var getRelativeOffset = function getRelativeOffset() {
var targetWidth = Math.ceil(originalWidth * scale);
var targetHeight = Math.ceil(originalHeight * scale);
var parentDimensionWidth = parentNode.offsetWidth;
var parentDimensionHeight = parentNode.offsetHeight;
var overflowWidth = targetWidth – parentDimensionWidth;
var overflowHeight = targetHeight – parentDimensionHeight;
var valueX;
if (overflowWidth === 0) {
valueX = focalPointX;
} else {
valueX = Math.max(Math.min(targetWidth * focalPointX – parentDimensionWidth * 0.5, overflowWidth), 0) / overflowWidth;
}
var valueY;
if (overflowHeight === 0) {
valueY = focalPointY;
} else {
valueY = Math.max(Math.min(targetHeight * focalPointY – parentDimensionHeight * 0.5, overflowHeight), 0) / overflowHeight;
}
return {
valueX: valueX,
valueY: valueY
};
};
var relativeOffset = getRelativeOffset();
var valueX = relativeOffset.valueX;
var valueY = relativeOffset.valueY;
imageEl.style.objectPosition = “”.concat(valueX * 100, “% “).concat(valueY * 100, “%”);
};
services
Live
Events
Sign up to attend my live webinars, which explore different strategies for better connecting the mind & body.
Gluten-free baking
June 20 · 1-3 pm
Setting up a meditation practice
June 27 · 1-3 pm
Strategies for stressful situations
July 4 · 1-3 pm
Unlimited events
for $50/month
Online
Courses
Get unlimited access to multi-class courses that ladder up to specific focuses and goals.
Detox and Restore
If you’re looking to begin your wellness journey with a clean slate, following this holistic detox plan is a great place to start.
Week 1 — Mind detox
Week 2 — Body detox
Week 3 — Relationship detox
Week 4 — Reintroduction
Essential Oils 101
Interested in aromatherapy but don’t know where to start? You’ll learn all the basics in this introductory course.
Week 1 — Introduction to essential oils
Week 2 — Combining oils with carrier oils
Week 3 — Oils for the home
Week 4 — Oils for the body
Unlimited courses
for $750/year
1:1 Coaching
Get a personalized plan and regular check-ins to help you reach your goals.
Weekly Sessions
If you’re looking for something completely integrated and tailored to your specific needs, 1:1 wellness coaching might be the right step for you. Learn what you can expect in a session or book a free consultation today.