<|start_filename|>src/helpers/viewbox-helpers.js<|end_filename|>
export const isElementBelowViewBox = (viewBoxHeight, top) => viewBoxHeight - top < 0;
export const isElementAboveViewBox = (bottom) => bottom < 0;
export const shouldPositionLeft = (viewBoxWidth, left) => (viewBoxWidth - left) < (viewBoxWidth /2);
export const shouldPositionAbove = (viewBoxHeight, bottom) => (viewBoxHeight - bottom) < 100;
export const shouldPositionBelow = (top) => top < 50;


<|start_filename|>src/tour-button.js<|end_filename|>
import React from "react";

const TourButton = (props) => {
	return (
		<div style={props.style} onClick={props.onClick} {...props}>
			{props.children}
		</div>
	);
};

TourButton.defaultProps = {
	style: {
		"width": 50,
		"height": 30,
		"backgroundColor": "#cbd1d4",
		"color": "#494949",
		"fontWeight": 700,
		"display": "inline-block",
		"textAlign": "center",
		"paddingTop": "5px",
		"cursor": "pointer",
		"float": "right",
		"marginRight": 10
	},
	onClick: () => {}
};

export default TourButton;


<|start_filename|>src/helpers/position-helpers.js<|end_filename|>
const positions = {
	right: ({position, margin}) => {
		return {
			left: Math.floor(position.right + margin),
			top: Math.floor(position.top + window.pageYOffset),
			positioned: "right"
		};
	},
	left: ({position, tourElWidth, margin}) => {
		return {
			left: Math.floor((position.left - margin) - tourElWidth),
			top: Math.floor(position.top + window.pageYOffset),
			positioned: "left"
		};
	},
	top: ({position, tourElHeight, arrowSize, margin}) => {
		return {
			left: Math.floor(position.left),
			top: Math.floor((position.top + window.pageYOffset) - tourElHeight - arrowSize),
			positioned: "top"
		};
	},
	topLeft: ({position, tourElWidth, tourElHeight, arrowSize, margin}) => {
		return {
			left: Math.floor((position.left + margin) - tourElWidth),
			top: Math.floor((position.top + window.pageYOffset) - tourElHeight - arrowSize),
			positioned: "topLeft"
		};
	},
	bottom: ({position, arrowSize, offsetHeight, margin}) => {
		return {
			left: Math.floor(position.left),
			top: Math.floor((position.top + window.pageYOffset) + offsetHeight + arrowSize),
			positioned: "bottom"
		};
	},
	bottomLeft: ({position, tourElWidth, arrowSize, offsetHeight, margin}) => {
		return {
			left: Math.floor((position.left + margin) - tourElWidth),
			top: Math.floor((position.top + window.pageYOffset) + offsetHeight + arrowSize),
			positioned: "bottomLeft"
		};
	}
}

export default positions;
