0:04
[Music]
0:10
so in this video we're going to be
0:11
looking at the share it Swatch stack now
0:15
this is a useful stack when you want to
0:17
turn anything you want into a share
0:21
action so here I have a demo where I
0:23
have a picture it's just a picture stack
0:26
I have a header stack and then a button
0:28
stack all three of these Stacks are from
0:30
my starter pack so um it is free go
0:33
ahead and download that now the Sher it
0:35
Swatch can be accessed from the
0:37
components drop down inside site Styles
0:40
or you can access it directly from the
0:43
swatches stack as well in this big huge
0:46
ginormous list it's towards the
0:48
bottom so let's look at some
0:50
implementations here so here in this
0:52
picture stack I have a class of share
0:56
sheet let's look at the share sheet
1:00
Swatch here so here I have a shareit uh
1:03
Swatch and I've added a class of share
1:06
sheet and what I've done is I then
1:08
configured that to work with the share
1:11
sheet service so all I did is I set the
1:14
service to share sheet I said it's going
1:16
to automatically get the metadata from
1:18
the web page if you want you can
1:19
actually manually Define that data as
1:21
well but I'm fine with automatic and
1:24
just by just this one simple thing
1:28
allows me to trigger a Shar sheet action
1:31
just by clicking on this photo let's
1:33
have a
1:35
look so clicking on this gives us access
1:39
to the share sheet super easy we've done
1:43
the same thing here inside Mastadon so
1:45
um in this this is just a header um
1:48
where I've created a class called masto
1:52
sh okay and I have a share it Swatch set
1:57
to that class it's set to the share
2:00
service of Mastadon I've configured my
2:02
pop-up window size and my share data is
2:05
automatic it's going to get acquired
2:07
from The Meta tags on this page let's go
2:09
ahead and in order to use this we need
2:12
to preview in the browser so we'll go
2:14
ahead and click on that so we get our
2:16
pop-up
2:17
window and then it will share to
2:21
Mastadon now last but definitely not
2:24
least this is a common use case for this
2:26
is actually just integrating it into a
2:28
button okay okay now this button stack
2:31
is from my starter pack um if you're
2:33
using like a foundation 6 button there
2:34
would be a class setting here um but the
2:37
starter pack button Works a little bit
2:38
differently so we go ahead in here we
2:40
can click edit link and uh this works
2:43
with any link as well this is how you
2:45
would do it with any sort of Link within
2:47
Stacks um so we go ahead and add a class
2:50
attribute to our link and set that to be
2:52
copy
2:53
link okay again if you're using a
2:56
foundation 6 button it's a little bit
2:57
easier you just have a class setting
2:59
Direct ly here and you can put that
3:01
class on that button and then here I
3:04
have my share it Swatch set to the copy
3:07
link
3:08
class and that simply ties to the copy
3:12
link
3:14
service at that point all I need to do
3:16
is I can click on this and the link is
3:18
magically copied to my
3:21
clipboard now before we go I want to
3:23
show you one small caveat and that is to
3:26
get around content blockers okay since
3:30
we are in control using the Swatch of
3:32
the classes you have to be careful of
3:35
what classes you might want to use let
3:38
me show you an example let's go ahead
3:40
and create a Shar Swatch um for Facebook
3:44
and um what I'm going to do is I'm going
3:46
to create a a class seems logical it's
3:49
going to be
3:50
share- um
3:52
Facebook okay and that's going to
3:55
configure to the Facebook service okay
3:58
and let's go and add this to a button so
4:01
um I talked about Foundation six buttons
4:02
let's just go ahead and use that so I'm
4:04
can use the normal button stack okay and
4:08
um let's just give it a text of um share
4:11
to um Facebook okay and I'm going to
4:15
give it the class of
4:17
share
4:19
share- Facebook okay and uh just for fun
4:23
let's go ahead and uh let's add a little
4:26
bit of radius or roundness and let's
4:28
make it Center L okay right so now I
4:31
have my button share on Facebook and if
4:34
I were to click on that it should open
4:36
up a Facebook share and uh let's test it
4:39
out so here I've previewed my
4:43
page and if you notice the button is
4:46
nowhere to be seen why is that that is
4:49
because I use a Content blocker let's go
4:52
ahead and I'm going to turn off the
4:53
content blocker I use one called one
4:55
blocker I'm going to go ahead and turn
4:56
that off I'm going to pause blocking and
4:59
it's going to refresh my page and
5:01
magically when I turned off content
5:02
blocking my share button is there now it
5:06
wasn't there a second ago it's there
5:08
just because I turned off my content
5:10
blocker now why was that that's because
5:14
of the class name that we chose we chose
5:17
something very explicit that a Content
5:20
blocker thinks it needs to block share
5:24
Facebook
5:26
so what we need to do is be a little bit
5:28
cryptic here so instead of a class share
5:32
Facebook I'm just going to do um FB sh
5:37
okay Facebook
5:39
share okay so now um I have a a class
5:42
called
5:43
FB um and I'm going to go ahead and
5:45
let's go ahead and change this to
5:49
FB here so now my button nothing else
5:52
about my button is everything else is
5:53
the same it just changes the class
5:55
that's all I did let's preview and have
5:58
a look so now my content blockers are
6:01
back
6:02
on and we see our button and if you see
6:05
if we click on this button now it will
6:08
launch our Facebook
6:14
[Music]
6:18
share