This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import loadImage from 'blueimp-load-image' | |
/** | |
* Fix jpg image orientation on client-side by reading exif data - inspired by: https://stackoverflow.com/a/56268674/10280454 | |
* @param {file} file - Files to upload | |
* @return {file} - The file with the right orientation without exif data | |
*/ | |
const fixExifOrientation = async file => { | |
const jpegTypes = ['image/jpg', 'image/jpeg'] | |
if (jpegTypes.includes(file.type)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIX INVALID DATE STRING | |
// Purpose: convert invalid date string to a valid one | |
// Issue: This date string is not valid, so e.g. Safari can't interpret it. | |
const invalidDateString = '2011-04-12 00:00' | |
const validDateString = invalidDateString.replace(/-/g, "/") | |
const date = new Date(validDateString) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findAncestor(el = null, selector) { | |
if (el.closest) { | |
return el.closest(selector); | |
} | |
// IE9+ polyfill | |
if (!Element.prototype.matches) { | |
Element.prototype.matches = Element.prototype.msMatchesSelector || | |
Element.prototype.webkitMatchesSelector; | |
} | |
var matches = el.matches || el.matchesSelector; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A SCSS function for creating scrim gradients | |
Inspired by Andreas Larson - https://github.com/larsenwork | |
https://css-tricks.com/easing-linear-gradients/ | |
*/ | |
@function scrim-gradient($startColor: $color-black, $direction: 'to bottom', $startAlpha: 1) { | |
$scrimCoordinates: ( | |
0: 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>StringsTable</key> | |
<string>Root</string> | |
<key>PreferenceSpecifiers</key> | |
<array> | |
<dict> | |
<key>Type</key> |