{"version":3,"sources":["common-post.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"post.min.js","sourcesContent":[" $('.js-triangle').each(function(){\r\n var $wrapper = $(this);\r\n var $triangle = $wrapper.find('.triangle').eq(0);\r\n var $triangleParent = $triangle.parent();\r\n var directionW = $wrapper.data('direction-w');\r\n var directionH = $wrapper.data('direction-h');\r\n var ratio = parseFloat($wrapper.data('ratio'));\r\n\r\n var widthThreashold = 1920;\r\n var minHeight = 100;\r\n var maxHeight = widthThreashold / ratio;\r\n \r\n var cssClassLookup = {\"right\": \"border-right-width\", \"left\": \"border-left-width\", \"top\": \"border-top-width\", \"bottom\": \"border-bottom-width\"};\r\n\r\n $triangle.addClass('triangle--'+directionH+directionW);\r\n\r\n var getTriangleHeight = function() {\r\n var height = $wrapper.width() / ratio;\r\n height = Math.max(height, minHeight);\r\n height = Math.min(height, maxHeight);\r\n return height;\r\n }\r\n\r\n var getPositioningStyle = function() {\r\n return directionH == 'bottom' ? 'top' : 'bottom';\r\n }\r\n\r\n var setupTriangle = function() {\r\n var sw = widthThreashold;\r\n if (matchMediaQuery(\"(min-width: \"+widthThreashold+\"px)\")) {\r\n sw = $triangleParent.width();\r\n }\r\n $triangle.css(cssClassLookup[directionW], sw);\r\n\r\n var sh = getTriangleHeight();\r\n $wrapper.height(sh);\r\n $wrapper.css(getPositioningStyle(), -sh);\r\n $triangle.css(cssClassLookup[directionH], sh);\r\n }\r\n\r\n setupTriangle();\r\n $(window).on('resize', setupTriangle);\r\n $(window).on(\"load\", setupTriangle);\r\n });\r\n"]}