diff --git a/source/_patterns/04-components/facebook/_facebook.scss b/source/_patterns/04-components/facebook/_facebook.scss new file mode 100644 index 0000000000000000000000000000000000000000..6abbf90099e60c34ead532604c6d07e2afb7de08 --- /dev/null +++ b/source/_patterns/04-components/facebook/_facebook.scss @@ -0,0 +1,9 @@ +.uw-facebook { + width: 100%; + + &__wrapper { + margin-left: auto; + margin-right: auto; + text-align: center; + } +} diff --git a/source/_patterns/04-components/facebook/facebook.js b/source/_patterns/04-components/facebook/facebook.js new file mode 100644 index 0000000000000000000000000000000000000000..4f717afe0bb16733a348820a2b733df4cba65c7f --- /dev/null +++ b/source/_patterns/04-components/facebook/facebook.js @@ -0,0 +1,23 @@ +(function ($, Drupal) { + 'use strict'; + + // The styling for this mobile menu is located in source/_patterns/04-components/menus/menu--main/. + + Drupal.behaviors.facebook = { + attach(context, settings) { + $('.uw-facebook__data').each(function () { + + var fbwidth = $(this).parent().width(); + + if (fbwidth == 0) { + fbwidth = 239; + } + + var fburl = encodeURIComponent('/' + $(this).data('username')); + + $(this).before('<iframe src="https://www.facebook.com/plugins/likebox.php?href=' + fburl + '&width=' + fbwidth + '&height=350&colorscheme=light&show_faces=false&border_color&stream=true&header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; max-width: 500px;width:' + fbwidth + 'px; height:350px;" allowTransparency="true"></iframe>'); + $(this).remove(); + }); + }, + }; +})(jQuery, Drupal); diff --git a/source/_patterns/04-components/facebook/facebook.twig b/source/_patterns/04-components/facebook/facebook.twig new file mode 100644 index 0000000000000000000000000000000000000000..74c2957c1f1baa556224e0cc8a35cdb0cd43c33c --- /dev/null +++ b/source/_patterns/04-components/facebook/facebook.twig @@ -0,0 +1,6 @@ +<div class="uw-facebook"> + <div class="uw-facebook__wrapper"> + <div class="uw-facebook__data" data-username="{{ username }}"> + </div> + </div> +</div> diff --git a/source/_patterns/04-components/facebook/facebook.yml b/source/_patterns/04-components/facebook/facebook.yml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391