-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsocial-share-svg.js
47 lines (44 loc) · 7.73 KB
/
social-share-svg.js
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
/**
Inline SVGs
## Usage:
1. Optimize SVG with SVGO
1. https://jakearchibald.github.io/svgomg/
1. https://github.com/svg/svgo
2. Copy SVG code inline below
1. find and replace regex `\n` with `` to remove new lines
2. REMOVE any height & width attributes on the svg and instead use / add `width="100%"`
3. Use by calling the template with the `name` attribute matching they key in the `svgs` object, e.g. `{{>svg name='logo'}}
1. the SVG will be responsive and resize based on the element dimensions; use CSS as normal to set width/height (since the image default width/height are NOT set, you'll have to set for inline elements. Use the svg `viewBox` attribute to see the default dimensions.)
## References:
http://css-tricks.com/using-svg/
http://stackoverflow.com/questions/19484707/how-can-i-make-an-svg-scale-with-its-parent-container
*/
lmSocialSharePrivate.svgs ={
'email': {
html: '<svg viewbox="0 0 512 512"><path d="M256.4,72.5L65.8,214.8v226.4H447V214.8L256.4,72.5z M203.7,174.1c5.6-10.2,13.3-17.9,23.1-23 c9.8-5.2,20.9-7.7,33.5-7.7c10.6,0,20.1,2.1,28.4,6.2c8.3,4.2,14.6,10,19,17.7c4.3,7.6,6.6,16,6.6,25c0,10.8-3.3,20.5-10,29.2 c-8.3,11-19,16.5-32,16.5c-3.5,0-6.1-0.6-7.9-1.8c-1.8-1.2-3-3-3.6-5.4c-5,4.8-10.7,7.2-17.2,7.2c-7,0-12.8-2.4-17.5-7.2 c-4.6-4.9-7-11.3-7-19.3c0-10,2.8-19,8.4-27.2c6.8-10,15.4-15,26-15c7.5,0,13.1,2.9,16.7,8.6l1.6-7.1h16.8l-9.6,45.5 c-0.6,2.9-0.9,4.7-0.9,5.6c0,1.1,0.2,1.8,0.7,2.4c0.5,0.5,1.1,0.8,1.7,0.8c2.1,0,4.7-1.2,7.9-3.7c4.3-3.2,7.8-7.5,10.5-12.9 c2.7-5.4,4-11,4-16.8c0-10.4-3.7-19.1-11.3-26.1c-7.5-7-18.1-10.5-31.5-10.5c-11.5,0-21.2,2.3-29.1,7c-7.9,4.6-13.9,11.2-18,19.7 c-4,8.4-6,17.3-6,26.5c0,8.9,2.3,17,6.8,24.3c4.5,7.3,10.8,12.7,19,16c8.1,3.3,17.5,5,27.9,5c10.1,0,18.8-1.4,26.1-4.2 c7.3-2.8,13.1-7,17.6-12.7h13.5c-4.2,8.6-10.7,15.3-19.4,20.2c-10,5.6-22.3,8.3-36.6,8.3c-14,0-26-2.3-36.1-7.1 c-10.2-4.7-17.7-11.7-22.7-20.8c-4.9-9.2-7.4-19.2-7.4-30C195.3,195.4,198,184.4,203.7,174.1z M79.2,219.4l140.7,94.3L79.2,422.6 V219.4z M89.9,429.8l166.5-128.9l166.5,128.9H89.9z M433.6,422.6L292.9,313.7l140.7-94.3V422.6z M263.3,184.5 c2.2,2.5,3.4,6.2,3.4,11c0,4.3-0.8,8.9-2.5,13.8c-1.6,5-3.5,8.7-5.8,11.3c-1.6,1.8-3.2,3.1-4.8,4c-2.1,1.2-4.3,1.8-6.8,1.8 c-3.2,0-5.9-1.3-8.1-3.8c-2.2-2.5-3.2-6.5-3.2-11.8c0-4,0.8-8.6,2.3-13.9c1.6-5.2,3.9-9.2,7-12c3.1-2.8,6.5-4.2,10.1-4.2 C258.3,180.6,261.1,181.9,263.3,184.5z"/></svg>'
},
'facebook': {
html: '<svg viewbox="0 0 512 512"><path d="M211.9 197.4h-36.7v59.9h36.7V433.1h70.5V256.5h49.2l5.2-59.1h-54.4c0 0 0-22.1 0-33.7 0-13.9 2.8-19.5 16.3-19.5 10.9 0 38.2 0 38.2 0V82.9c0 0-40.2 0-48.8 0 -52.5 0-76.1 23.1-76.1 67.3C211.9 188.8 211.9 197.4 211.9 197.4z"/></svg>'
},
'facebookMessage': {
html: '<svg viewbox="0 0 512 512"><path d="M255,68.8C152.8,68.8,69.9,146,69.9,241.2c0,54.3,26.9,102.7,69,134.3v65.7l63-34.8c16.8,4.7,34.6,7.2,53.1,7.2 c102.2,0,185.1-77.2,185.1-172.4S357.2,68.8,255,68.8z M273.4,301l-47.1-50.6l-92,50.6l101.2-108.1l48.3,50.6l90.8-50.6L273.4,301z"/></svg>'
},
'gmail': {
html: '<svg viewbox="0 0 512 512"><path d="M451.2,365.2l-0.1-209l0,0l0,0v-9.3c0-17.4-14.1-31.7-31.4-31.9l0,0H93.2l0,0c-17.6,0-31.9,14.4-31.9,31.9 v218.2c0,17.5,14.2,31.8,31.7,31.9l0,0h0.2h11.4h314.9v-0.6C443,394.1,450.6,385.2,451.2,365.2z M404.7,125.6l-149,109.8l-148-109.8 H404.7z M104.6,186.8L255.7,292l151.1-104.1l0,0l0.1,198.5H104.6L104.6,186.8L104.6,186.8z"/></svg>'
},
'googlePlus': {
html: '<svg viewbox="0 0 512 512"><path d="M306.4,245.9c1.1,6.7,2.1,13.4,2.1,22.2c0,76.5-51.3,130.9-128.6,130.9c-74.1,0-134-59.9-134-134 s59.9-134,134-134c36.2,0,66.4,13.2,89.7,35l-36.4,35c-10-9.6-27.4-20.7-53.4-20.7c-45.7,0-83.1,37.9-83.1,84.6 c0,46.7,37.3,84.6,83.1,84.6c53,0,72.9-38.1,76-57.8h-76v-45.9H306.4z M428.7,245.9v-38.3h-38.3v38.3h-38.3v38.3h38.3v38.3h38.3 v-38.3H467v-38.3H428.7z"/></svg>'
},
'linkedIn': {
html: '<svg viewbox="0 0 512 512"><path d="M186.4 142.4c0 19-15.3 34.5-34.2 34.5 -18.9 0-34.2-15.4-34.2-34.5 0-19 15.3-34.5 34.2-34.5C171.1 107.9 186.4 123.4 186.4 142.4zM181.4 201.3h-57.8V388.1h57.8V201.3zM273.8 201.3h-55.4V388.1h55.4c0 0 0-69.3 0-98 0-26.3 12.1-41.9 35.2-41.9 21.3 0 31.5 15 31.5 41.9 0 26.9 0 98 0 98h57.5c0 0 0-68.2 0-118.3 0-50-28.3-74.2-68-74.2 -39.6 0-56.3 30.9-56.3 30.9v-25.2H273.8z"/></svg>'
},
'pinterest': {
html: '<svg viewbox="0 0 512 512"><path d="M266.6 76.5c-100.2 0-150.7 71.8-150.7 131.7 0 36.3 13.7 68.5 43.2 80.6 4.8 2 9.2 0.1 10.6-5.3 1-3.7 3.3-13 4.3-16.9 1.4-5.3 0.9-7.1-3-11.8 -8.5-10-13.9-23-13.9-41.3 0-53.3 39.9-101 103.8-101 56.6 0 87.7 34.6 87.7 80.8 0 60.8-26.9 112.1-66.8 112.1 -22.1 0-38.6-18.2-33.3-40.6 6.3-26.7 18.6-55.5 18.6-74.8 0-17.3-9.3-31.7-28.4-31.7 -22.5 0-40.7 23.3-40.7 54.6 0 19.9 6.7 33.4 6.7 33.4s-23.1 97.8-27.1 114.9c-8.1 34.1-1.2 75.9-0.6 80.1 0.3 2.5 3.6 3.1 5 1.2 2.1-2.7 28.9-35.9 38.1-69 2.6-9.4 14.8-58 14.8-58 7.3 14 28.7 26.3 51.5 26.3 67.8 0 113.8-61.8 113.8-144.5C400.1 134.7 347.1 76.5 266.6 76.5z"/></svg>'
},
'sms': {
html: '<svg viewbox="0 0 512 512"><path d="M427.2,189.5L427.2,189.5C386,95.5,276.2,52.1,182.1,93.4C87.6,134.1,44.7,243.9,85.5,338 c8.3,19.9,19.9,37.1,33.4,51.7c-3.1,18.8-21.4,38.7-53.8,59.1c34,2.1,62.2-8.9,84.7-32.4c51.2,36.1,119.2,45,180.8,18.3 C425.2,393.9,468,284.1,427.2,189.5z M179.5,286.6c-3.1,4.2-6.8,7.8-12,9.9c-5.2,2.1-11.5,3.2-17.8,3.2c-11,0-19.3-2.1-25.1-6.8 c-5.8-4.2-9.4-11-11-19.9l0,0l0,0c0,0,0,0,0,0l14.1-2.1c1.1,5.8,3.2,9.9,6.8,13.1c3.7,2.6,8.4,4.2,15.1,4.2c6.3,0,11-1,14.1-3.6 c3.7-3.1,5.2-6.3,5.2-9.4c0-3.6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8-12,9.9c-5.2,2.1-11,3.2-17.8,3.2 c-11,0-19.3-2.1-25.1-6.8c-5.2-4.2-8.9-11-10.4-19.9l0,0l0,0c0,0,0,0,0,0l13.6-2.1c1,5.8,3.1,9.9,6.8,13.1c3.6,2.6,8.9,4.2,15.2,4.2 c6.3,0,11.5-1,14.6-3.6c3.2-3.1,4.7-6.3,4.7-9.4c0-3.6-1.6-5.7-4.2-7.8c-2.1-1-6.8-2.6-14.6-4.7c-10.4-2.6-17.8-4.7-21.4-6.8 c-4.2-2.1-7.3-4.7-9.4-7.8c-2.1-3.6-3.1-7.3-3.1-11.5c0-3.7,1.1-7.3,2.6-10.5c1.6-3.1,4.2-5.7,6.8-7.8c2.6-1.6,5.2-3.1,9.4-4.2 c3.7-1,7.8-1.6,12-1.6c6.8,0,12.6,1.1,17.2,2.6c5.2,2.1,8.9,4.7,11,7.8c2.6,3.1,4.2,7.3,5.2,13.1l-14.1,2.1 c-0.5-4.7-2.6-7.9-5.2-10.5c-3.1-2.1-7.3-3.6-13-3.6c-6.3,0-11,1.1-14.1,3.1c-2.6,2.6-4.2,4.7-4.2,7.9c0,1.6,0.5,3.6,2.1,4.7 c1.1,1.5,2.6,3.1,5.2,4.2c1.6,0.5,5.7,1.6,12.5,3.7c9.9,2.6,17.2,4.7,20.9,6.3c4.2,1.6,7.3,4.2,9.4,7.8c2.6,3.2,3.7,6.8,3.7,12 C399,278.3,397.5,282.4,394.8,286.6z"/></svg>'
},
'twitter': {
html: '<svg viewbox="0 0 512 512"><path d="M419.6 168.6c-11.7 5.2-24.2 8.7-37.4 10.2 13.4-8.1 23.8-20.8 28.6-36 -12.6 7.5-26.5 12.9-41.3 15.8 -11.9-12.6-28.8-20.6-47.5-20.6 -42 0-72.9 39.2-63.4 79.9 -54.1-2.7-102.1-28.6-134.2-68 -17 29.2-8.8 67.5 20.1 86.9 -10.7-0.3-20.7-3.3-29.5-8.1 -0.7 30.2 20.9 58.4 52.2 64.6 -9.2 2.5-19.2 3.1-29.4 1.1 8.3 25.9 32.3 44.7 60.8 45.2 -27.4 21.4-61.8 31-96.4 27 28.8 18.5 63 29.2 99.8 29.2 120.8 0 189.1-102.1 185-193.6C399.9 193.1 410.9 181.7 419.6 168.6z"/></svg>'
}
};