-
Notifications
You must be signed in to change notification settings - Fork 416
/
settings.js.erb
62 lines (53 loc) · 2.9 KB
/
settings.js.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var MEME_SETTINGS = {
creditText: 'Source:', // Default "credits" text.
creditSize: 12, // Font size for credit text.
downloadName: 'share', // The name of the downloaded image file (will have a ".png" extension added).
fontColor: 'white', // Universal font color.
// Universal font family for texts:
// Note that you'll need to included quoted font names as you would in CSS, ie: '"Knockout 28 B"'.
fontFamily: 'Helvetica Neue',
// Font family options: set to empty array to disable font selector.
// These options may also be formatted as {text:'Knockout', value:'"Knockout 28 B"'}.
fontFamilyOpts: ['Arial', 'Helvetica Neue', 'Comic Sans MS'],
// Font size of main headline:
fontSize: 24,
// Font size options: set to empty array to disable font-size selector.
fontSizeOpts: [
{text: 'Small text', value: 14},
{text: 'Medium text', value: 24},
{text: 'Large text', value: 36}
],
headlineText: 'Write your own headline', // Default headline text.
height: 378, // Canvas rendering height.
imageScale: 1, // Background image scale.
imageSrc: '', // Default background image path. MUST reside on host domain, or use base64 data.
overlayAlpha: 0.5, // Opacity of image overlay.
// Image overlay color, or blank ('') for no overlay:
overlayColor: '#000',
// Overlay color options: set to empty array to disable overlay options selector.
overlayColorOpts: ['#000', '#777', '#2980b9'],
paddingRatio: 0.05, // Percentage of canvas width to use as edge padding.
// Text alignment: valid settings are "left", "center", and "right".
textAlign: 'left',
// Text alignment options: set to empty array to disable alignment picker.
textAlignOpts: [
{text: 'Align left', value: 'left'},
{text: 'Align center', value: 'center'},
{text: 'Align right', value: 'right'}
],
textShadow: false, // Text shadow toggle.
textShadowEdit: true, // Toggles text shadow control within the editor.
watermarkAlpha: 1, // Opacity of watermark image.
watermarkMaxWidthRatio: 0.25, // Maximum allowed width of watermark (percentage of total canvas width).
// Path to the watermark image source, or blank for no watermark:
// Alternatively, use '<%= asset_data_uri("vox.png") %>' to populate the watermark with base64 data, avoiding Cross-Origin issues.
watermarkSrc: (localStorage && localStorage.getItem('meme_watermark')) || '<%= image_path("vox.png") %>',
// Watermark image options: set to empty array to disable watermark picker.
// NOTE: only populate the "data" attributes with base64 data when concerned about Cross-Origin requests...
// Otherwise, just leave "data" attributes blank and allow images to load from your server.
watermarkOpts: [
{text: 'Vox', value: '<%= image_path("vox.png") %>', data: '<%= asset_data_uri("vox.png") %>'},
{text: 'The Verge', value: '<%= image_path("theverge.png") %>', data: ''}
],
width: 755 // Canvas rendering width.
};