The goal is for anyone to use this code to create a custom social media icon bar without the iframe
s used by social media widgets.
The SVG icon images are produced from Dan Leech's Simple Icons project.
The Font Awesome icons are from Dave Gandy's Font Awesome.
- "Those tiny Tweet, Like, +1 buttons you see on websites are actually brutally large elements to load for (mobile) devices."
- "Services like AddThis and ShareThis will always spy on and tag your audience when you use their widgets"
- "If your image is instead a set of dom nodes, it cuts that extra HTTP request out, making your website faster and more user friendly."
Insert require_once '{where smi is located}/smi/smi.php';
at the top of your PHP page.
Insert <link rel="stylesheet" href="smi/si/smi.css">
in the <head>
section of your HTML code.
Use the smi/si/smi.json
template to create your own data set of links and functionality.
Then embed PHP smi()
calls in your page.
smi()
's optional arguments can be in native PHP array or JSON string format.
Insert require_once '{where smi is located}/smi/smi.php';
at the top of your PHP page.
Insert <link rel="stylesheet" href="smi/si/smi.css">
in the <head>
section of your HTML code.
Use the smi/fa/smi.json
template to create your own data set of links and functionality.
Then embed PHP smi()
calls in your page.
smi()
's optional arguments can be in native PHP array or JSON string format.
<?= smi("si", ["space"=>"3px"]) ?>
<?= smi("si", '{"px": "24", "space": "1rem"}') ?>
<?= smi("si", ["px"=>"32", "icons"=>["Facebook","Google+","Pinterest"], "space"=>"4px"]) ?>
<?= smi("si", '{"all": true, "px": "64"}') ?>
<?= smi("fa", ["space"=>"3px"]) ?>
<?= smi("fa", ["px"=>"24", "space"=>"3px"]) ?>
<?= smi("fa", ["px"=>"32", "space"=>"3px"]) ?>
<?= smi("fa", ["px"=>"64", "icons"=>["fa-facebook-square","fa-twitter-square","fa-at-square"], "space"=>"3px"]) ?>