@jlengstorf/get-share-image
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -15,2 +15,4 @@ interface Config { | ||
textLeftOffset?: number; | ||
titleGravity?: string; | ||
taglineGravity?: string; | ||
titleLeftOffset?: number; | ||
@@ -32,3 +34,3 @@ taglineLeftOffset?: number; | ||
*/ | ||
export default function generateSocialImage({ title, tagline, cloudName, imagePublicID, cloudinaryUrlBase, titleFont, titleExtraConfig, taglineExtraConfig, taglineFont, imageWidth, imageHeight, textAreaWidth, textLeftOffset, titleLeftOffset, taglineLeftOffset, titleBottomOffset, taglineTopOffset, textColor, titleColor, taglineColor, titleFontSize, taglineFontSize, version, }: Config): string; | ||
export default function generateSocialImage({ title, tagline, cloudName, imagePublicID, cloudinaryUrlBase, titleFont, titleExtraConfig, taglineExtraConfig, taglineFont, imageWidth, imageHeight, textAreaWidth, textLeftOffset, titleGravity, taglineGravity, titleLeftOffset, taglineLeftOffset, titleBottomOffset, taglineTopOffset, textColor, titleColor, taglineColor, titleFontSize, taglineFontSize, version, }: Config): string; | ||
export {}; |
@@ -18,3 +18,3 @@ "use strict"; | ||
function generateSocialImage(_a) { | ||
var title = _a.title, tagline = _a.tagline, cloudName = _a.cloudName, imagePublicID = _a.imagePublicID, _b = _a.cloudinaryUrlBase, cloudinaryUrlBase = _b === void 0 ? 'https://res.cloudinary.com' : _b, _c = _a.titleFont, titleFont = _c === void 0 ? 'arial' : _c, _d = _a.titleExtraConfig, titleExtraConfig = _d === void 0 ? '' : _d, _e = _a.taglineExtraConfig, taglineExtraConfig = _e === void 0 ? '' : _e, _f = _a.taglineFont, taglineFont = _f === void 0 ? 'arial' : _f, _g = _a.imageWidth, imageWidth = _g === void 0 ? 1280 : _g, _h = _a.imageHeight, imageHeight = _h === void 0 ? 669 : _h, _j = _a.textAreaWidth, textAreaWidth = _j === void 0 ? 760 : _j, _k = _a.textLeftOffset, textLeftOffset = _k === void 0 ? 480 : _k, _l = _a.titleLeftOffset, titleLeftOffset = _l === void 0 ? null : _l, _m = _a.taglineLeftOffset, taglineLeftOffset = _m === void 0 ? null : _m, _o = _a.titleBottomOffset, titleBottomOffset = _o === void 0 ? 254 : _o, _p = _a.taglineTopOffset, taglineTopOffset = _p === void 0 ? 445 : _p, _q = _a.textColor, textColor = _q === void 0 ? '000000' : _q, titleColor = _a.titleColor, taglineColor = _a.taglineColor, _r = _a.titleFontSize, titleFontSize = _r === void 0 ? 64 : _r, _s = _a.taglineFontSize, taglineFontSize = _s === void 0 ? 48 : _s, _t = _a.version, version = _t === void 0 ? null : _t; | ||
var title = _a.title, tagline = _a.tagline, cloudName = _a.cloudName, imagePublicID = _a.imagePublicID, _b = _a.cloudinaryUrlBase, cloudinaryUrlBase = _b === void 0 ? 'https://res.cloudinary.com' : _b, _c = _a.titleFont, titleFont = _c === void 0 ? 'arial' : _c, _d = _a.titleExtraConfig, titleExtraConfig = _d === void 0 ? '' : _d, _e = _a.taglineExtraConfig, taglineExtraConfig = _e === void 0 ? '' : _e, _f = _a.taglineFont, taglineFont = _f === void 0 ? 'arial' : _f, _g = _a.imageWidth, imageWidth = _g === void 0 ? 1280 : _g, _h = _a.imageHeight, imageHeight = _h === void 0 ? 669 : _h, _j = _a.textAreaWidth, textAreaWidth = _j === void 0 ? 760 : _j, _k = _a.textLeftOffset, textLeftOffset = _k === void 0 ? 480 : _k, _l = _a.titleGravity, titleGravity = _l === void 0 ? 'south_west' : _l, _m = _a.taglineGravity, taglineGravity = _m === void 0 ? 'north_west' : _m, _o = _a.titleLeftOffset, titleLeftOffset = _o === void 0 ? null : _o, _p = _a.taglineLeftOffset, taglineLeftOffset = _p === void 0 ? null : _p, _q = _a.titleBottomOffset, titleBottomOffset = _q === void 0 ? 254 : _q, _r = _a.taglineTopOffset, taglineTopOffset = _r === void 0 ? 445 : _r, _s = _a.textColor, textColor = _s === void 0 ? '000000' : _s, titleColor = _a.titleColor, taglineColor = _a.taglineColor, _t = _a.titleFontSize, titleFontSize = _t === void 0 ? 64 : _t, _u = _a.taglineFontSize, taglineFontSize = _u === void 0 ? 48 : _u, _v = _a.version, version = _v === void 0 ? null : _v; | ||
// configure social media image dimensions, quality, and format | ||
@@ -33,3 +33,3 @@ var imageConfig = [ | ||
"co_rgb:" + (titleColor || textColor), | ||
'g_south_west', | ||
"g_" + titleGravity, | ||
"x_" + (titleLeftOffset || textLeftOffset), | ||
@@ -45,3 +45,3 @@ "y_" + titleBottomOffset, | ||
"co_rgb:" + (taglineColor || textColor), | ||
'g_north_west', | ||
"g_" + taglineGravity, | ||
"x_" + (taglineLeftOffset || textLeftOffset), | ||
@@ -48,0 +48,0 @@ "y_" + taglineTopOffset, |
{ | ||
"name": "@jlengstorf/get-share-image", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "author": "Jason Lengstorf <jason@lengstorf.com> (https://lengstorf.com)", |
@@ -68,2 +68,4 @@ # Generate Social Media Images Using Cloudinary | ||
| textLeftOffset | | (number, default `480`) distance from left edge to start text boxes | | ||
| titleGravity | | (string, default `south_west`) location the title is anchored from | | ||
| taglineGravity | | (string, default `north_west`) location the tagline is anchored from | | ||
| titleLeftOffset | | (number, `null`) distance from left edge to start text boxes | | ||
@@ -70,0 +72,0 @@ | taglineLeftOffset | | (number, default `null`) distance from left edge to start text boxes | |
12855
105
102