-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
293 lines (229 loc) · 12.4 KB
/
index.html
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SocialShareJS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="social-share.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/js/all.min.js"></script>
<script src="social-share.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<style>
*{
font-family: 'Roboto', sans-serif;
}
</style>
</head>
<body>
<div class="container py-4">
<h1>SocialShareJS</h1>
<p>This is a simple library to make your web page shareable fast and easy.</p>
<p>Its allow to include the social share link of the major social network to your page.</p>
<br>
<p>Github repository: <a href="https://github.com/assisfery/SocialShareJS" target="_blank">https://github.com/assisfery/SocialShareJS</a></p>
<br>
<p>CDN repository: <a href="https://www.jsdelivr.com/package/gh/assisfery/SocialShareJS" target="_blank">https://www.jsdelivr.com/package/gh/assisfery/SocialShareJS</a></p>
<iframe src="https://data.jsdelivr.com/v1/package/gh/assisfery/SocialShareJS/badge" frameborder="0" height="30" width="160">
</iframe>
<br><br>
<h3>Install</h3>
<p>Just include the <b>social-share.css</b> and <b>social-share.js</b> files.</p>
<pre class="alert alert-secondary"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/assisfery/[email protected]/social-share.min.css">
<script src="https://cdn.jsdelivr.net/gh/assisfery/[email protected]/social-share.min.js"></script></pre>
<br><br>
<h3>Dependences</h3>
<p>The <b>SocialShareJS</b> don't dependents of none library, but its uses the <b>FontAwesome 5</b> Fonts, so make sure you have included it in your web page.</p>
<pre class="alert alert-secondary"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/js/all.min.js"></script></pre>
<br><br>
<h3>Get Started</h3>
<p>
To have the social share buttons just put the class <b>ss-box</b> in one or more of you <b>containers</b>
</p>
<pre class="alert alert-secondary"><div class="ss-box"></div></pre>
<br>
<div class="ss-box" data-ss-link="https://github.com/assisfery/SocialShareJS">
</div>
<br><br>
<h3>Select Social Network</h3>
<p>If you want to select specifics social share network just add the <b>data-ss-social</b> attribute in your
container.</p>
<pre class="alert alert-secondary"><div class="ss-box" data-ss-social="facebook, pinterest"></div></pre>
<br>
<div class="ss-box" data-ss-social="facebook, pinterest">
</div>
<br><br>
<h3>Change Link</h3>
<p>For defaults the SocialShareJs put the current page location as share link but you can change it just including the
<b>data-ss-link</b> attribute in your container.</p>
<pre class="alert alert-secondary"><div class="ss-box" data-ss-link="https://www.google.com/"></div></pre>
<br>
<div class="ss-box" data-ss-link="https://www.google.com/">
</div>
<br><br>
<h3>Custom Query String</h3>
<p>
In some of social network shares you could want to put a query string available just to specific social network,
so to do that just include <br><b>data-ss-<i>NAME_OF_SOCIAL_MEDIA</i> = "key1:value1, key2:value2"</b> attribute,
<br><br>for example<br><br>
include <b>data-ss-messenger = "app_id:123456"</b>, so it will include the query string <b>&app_id=123456</b> in
messenger share link, or <br>
include <b>data-ss-email = "subject:SocialShareJS is amazing"</b>, it will include the query string
<b>&subject=Email Subject</b> in <br>
email share link.
</p>
<pre class="alert alert-secondary"><div class="ss-box" data-ss-social="messenger, pinterest, email" data-ss-messenger="app_id: 123456" data-ss-email="subject:SocialShareJS is amazing"></div></pre>
<br>
<div class="ss-box" data-ss-social="messenger, pinterest, email" data-ss-messenger="app_id: 123456" data-ss-email="subject:SocialShareJS is amazing">
</div>
<br><br>
<h3>Responsive check</h3>
<p>
Some of buttons (like: <b>share native</b> ,<b>messenger</b>, <b>viber</b> and <b>sms</b>) perhaps
not work on desktop OS, but its works in mobile OS like Android and IOS, so may be necessary
to show that buttons only in mobile screen.
<br><br>
To solve that problem you could include the class <b>ss-responsive</b> on
your container.
</p>
<pre class="alert alert-secondary"><div class="ss-box ss-responsive"></div></pre>
<div class="ss-box ss-responsive"></div>
<br><br>
<h3>Customizations</h3>
<br>
<h5>Hide Social Network Name</h5>
<p>If you want to show just the icons without the name of Social Network just include <b>data-ss-content</b> attribute with value <b>false</b>.</p>
<pre class="alert alert-secondary"><div class="ss-box" data-ss-content="false"></div></pre>
<br>
<div class="ss-box" data-ss-content="false"></div>
<br><br>
<h5>Rounded buttons</h5>
<p>If you want to make button with circle shape just include the class <b>ss-circle</b> in <b>ss-box</b> container.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-circle" data-ss-content="false"></div></pre>
<br>
<div class="ss-box ss-circle" data-ss-content="false"></div>
<br><br>
<h5>Flat buttons</h5>
<p>If you want to make button without rounded border just include the class <b>ss-flat</b> in <b>ss-box</b> container.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-flat"></div></pre>
<br>
<div class="ss-box ss-flat"></div>
<br><br>
<h5>Pill buttons</h5>
<p>If you want to make button with pill shape effect just include the class <b>ss-pill</b> in <b>ss-box</b> container.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-pill"></div></pre>
<br>
<div class="ss-box ss-pill"></div>
<br><br>
<h5>Button with Shadows</h5>
<p>If you want to put shadow in button just include the class <b>ss-shadow</b> in <b>ss-box</b> container.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-shadow"></div></pre>
<br>
<div class="ss-box ss-shadow"></div>
<br><br>
<h5>Unicolor</h5>
<p>If you want to all your buttons have the same color just use the class <b>ss-black</b> (or ss-dark, ss-gray, ss-light, ss-outline) in <b>ss-box</b> container.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-black"></div></pre>
<br>
<div class="ss-box ss-black"></div>
<div class="ss-box ss-dark"></div>
<div class="ss-box ss-gray"></div>
<div class="ss-box ss-light"></div>
<div class="ss-box ss-outline"></div>
<br><br>
<h5>Strait</h5>
<p>If you want to all your buttons have the same color just use the class <b>ss-strait</b> in <b>ss-box</b> container.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-strait ss-dark" data-ss-content="false"></div></pre>
<br>
<div class="ss-box ss-strait ss-dark" data-ss-content="false"></div>
<br><br>
<h5>Position fixed</h5>
<p>To create the buttons in a fixed position combine the class <b>ss-fixed</b> with <b>ss-bottom, ss-top, ss-left</b> or <b>ss-right</b> in <b>ss-box</b> container.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-fixed ss-bottom" data-ss-content="false"></div></pre>
<br>
<!--<div class="ss-box ss-fixed ss-bottom" data-ss-content="false"></div>-->
<br><br>
<h5>Hide Icons</h5>
<p>If you dont want to show the icons of Social Network just include <b>data-ss-icon</b> attribute with value <b>false</b>.</p>
<pre class="alert alert-secondary"><div class="ss-box" data-ss-icon="false"></div></pre>
<br>
<div class="ss-box" data-ss-icon="false"></div>
<br><br>
<h5>Change Icons</h5>
<p>
If you want to change the icon class of any Social Network to another icon of you
preference or icon of others packages just include the <b>data-ss-icon-class</b>
with value <b>social_name1: icon_class1, social_name2: iconclass2</b>
<br><br>
for example:
<br><br>
include <b>data-ss-icon-class="facebook:fab fa-facebook-messenger,email:fas fa-sms"</b> so
it will put the icon <b>fab fa-facebook-messenger</b> instead the facebook default icon and it will
put the icon <b>fas fa-sms</b> instead the email default icon.
</p>
<pre class="alert alert-secondary"><div class="ss-box" data-ss-social="facebook, email" data-ss-icon-class="facebook:fab fa-facebook-messenger,email:fas fa-sms"></div></pre>
<br>
<div class="ss-box" data-ss-social="facebook, email" data-ss-icon-class="facebook:fab fa-facebook-messenger,email:fas fa-sms">
</div>
<br><br>
<h3>Hover Effects</h3>
<br>
<h5>Grow</h5>
<p>Include <b>ss-grow</b> in your container to make button grow when the mouse is hover.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-grow" data-ss-social="facebook"></div></pre>
<div class="ss-box ss-grow" data-ss-social="facebook"></div>
<br><br>
<h5>Shrink</h5>
<p>Include <b>ss-shrink</b> in your container to make button shrink when the mouse is hover.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-shrink" data-ss-social="facebook"></div></pre>
<div class="ss-box ss-shrink" data-ss-social="facebook"></div>
<br><br>
<h5>Rotate</h5>
<p>Include <b>ss-rotate</b> in your container to make button rotate when the mouse is hover.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-rotate" data-ss-social="facebook"></div></pre>
<div class="ss-box ss-rotate" data-ss-social="facebook"></div>
<br><br>
<h5>Float</h5>
<p>Include <b>ss-float</b> in your container to make button float when the mouse is hover.</p>
<pre class="alert alert-secondary"><div class="ss-box ss-float" data-ss-social="facebook"></div></pre>
<div class="ss-box ss-float" data-ss-social="facebook"></div>
<br><br>
<h5>JavaScript Utils</h5>
<p>If you want to create a share box in JavaScript you can use the follow function.</p>
<pre class="alert alert-secondary">SocialShare.createShareBox(_elements, _link = null, _socials = null, _showIcon = true, _showContent = true, _clearContainer = true);</pre>
<ul>
<li><b>_elements</b> - the dom elements where the socials buttons will be created</li>
<li><b>_link</b> - the link/content will be shared, by default will be the current window location</li>
<li><b>_showIcon</b> - the social button icon will be presented or not</li>
<li><b>_showContent</b> - the social button name/label will be presented or not</li>
<li><b>_clearContainer</b> - clear or not the elements before create the buttons</li>
</ul>
<p>For example</p>
<pre class="alert alert-secondary">SocialShare.createShareBox("#newShareBox", "https://github.com/assisfery/SocialShareJS", "facebook, twitter, email, sms, viber");</pre>
<button type="button" class="btn btn-primary" onclick="createNewShareBox()">Create Share Box</button>
<div id="newShareBox"></div>
<br><br>
<h5>Just Move On...</h5>
<p>If you want to customize the share buttons like you want just do it adding css effect in your code.</p>
<pre class="alert alert-secondary">.ss-btn{
/*your code*/
}</pre>
<br>
<div class="text-right text-muted">
<span>Made with ♥ by <a href="https://github.com/assisfery/" target="_blank">Assis Ferreira</a></span>
</div>
<script>
function createNewShareBox(){
// SocialShare.createShareBox("#newShareBox", _link = null, _socials = null, _showIcon = true, _showContent = true, _clearContainer = true);
// SocialShare.createShareBox("#newShareBox", null, null, true, true, true);
SocialShare.createShareBox("#newShareBox", "https://github.com/assisfery/SocialShareJS", "facebook, twitter, email, sms, viber");
}
</script>
</div>
</body>
</html>