-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (87 loc) · 7.53 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
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-L91L00VLR6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-L91L00VLR6');
</script>
<script data-ad-client="ca-pub-1398250278993052" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<title>Clipboard.js</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.5/styles/github-gist.min.css">
<link href = "style.css" rel = "stylesheet">
<link href = "mobile.css" rel = "stylesheet">
<link href = "clipboard/clipboard.css" rel = "stylesheet">
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADlklEQVRYCcVXSyhtURj+kcfJ45CBlJLHvTOTO5MRJZSBgYE7oZQZKWbMSKTjNaKOQ0phwggTDCgZnCJOioGUGLhXSbnpOny3b7X3bj8WHZzbWbXb6/E/vr3W/3//2iKxN7+I/BSRoIiEReS3iESNh33OcY0ylI1b+y4iIRH5IyKI8aEsdaj76eYTkYCI/I3RqQ4cdWmDtj7UvolI5AuO3WBoizZjaj9E5FccnZtgaJO2321E+T+c20G8uRM8p3huu+nU/aYPbUwwWNzC/2tMX47GdPlKtH8UKH05UpQ56zGSk5ODrq4uLC4uYm1tDTMzM2hubkZKSopHlvqVlZWYnJzE6uoqFhYW0N7ejvT0dK2swRNqF8haHpIpKirC5eUlTk9PMTIygr6+PszNzeHh4QF7e3vIyspyGB4eHsbz8zNWVlbQ39+P8fFxXF9f4/j4GAUFBQ5Z42PpUzEmqdMjMD09jXA4jLS0NMdaaWkpbm9vMTQ0ZM3X1tbi5eUFDQ0N1hxt5uXlIRKJYHl52TFv80ffir89AvxKfrlN2OpPTU1hf3/fGodCIWxvb1tju05bWxuenp6QmpqqW2ftUEXEs7i0tITd3V3teVdVVaG1tdXS2djYwOzsrDW2A6ioqMD6+rrnyAwZFjBV1TzKVLy/v8fOzg7o0G7U3d/c3EQwGHxXxq1jjFlFVUnVKpeVlanzi0ajODo6QkdHBzIyMjyybgCUKSkpcTxJSUkePcP32wBM1MXFxWCU393d4erqCk1NTQ5jbgAMSnfLz8936Bi2eZ/QH4Hp3P7Ozs7G2NiYinjygbnmBsCv5S7wqa+vV1jeAKCOgIFgGWOfETs6Oqq20L3G8fz8PA4PDy2d94KwpqZGAWBKamypIGQqOBaZ+6+vr2hsbHTMm3Ld3d2KZMwxAW1tbWllW1pa8Pj4iOTkZN26SkMtER0cHCij7qDj7jA9SbcmABIQiaiurs6a45rP5wPtMKVNWddbEZGWipmGNzc3uLi4QCAQQE9PDwYGBnBycqICsby83GF0YmJCUTHrRm9vLwYHB3F+fo6zszMUFhY6ZA0QFhUzELXFKDc3F9xufgEDjZTKsd/v1xlEdXW1KliMCdaEzs5OZGZmamXtxYgAEl6OCSKhFxICSPiVjCASeiklALaEXssNDGon4nlD/tCPiQmCMcHA/Mpl9dO/ZiYIvpmiCfk5tYNgn4xJ6iR/s4jE5ff8HzYLHs0NdS0xAAAAAElFTkSuQmCC" rel="icon" type="image/x-icon" />
<link href = "cube/cube.css" rel = "stylesheet">
</head>
<body>
<script src = "cube/settings.js"></script>
<script src = "cube/cube.js"></script>
<div class = "nav flexcenterboth">
<div class = "flexcentervert innernav">
<div style = "" class = "logocontainer">
<h1 class = "logo">clipboard.js</h1>
<span>By: Sooraj Gupta</span>
</div>
<div style = "" class = "githubcontainer">
<a class = "btn" style = "margin-right: 40px;" href = "https://github.com/sooraj-gupta/clipboardjs"><svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="github" class="svg-inline--fa fa-github fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 480"><path fill="#fff" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> GitHub</a>
</div>
</div>
</div>
<section class = "" style = "width: 100%;">
<center>
<div class = "content">
<h1>Easily add a "Copy to Clipboard" button using clipboard.js</h1>
<h4 class = "description">Sooraj Gupta <span class = "date">December 5, 2020</span></h4>
<img src ="https://image.freepik.com/free-photo/minimalist-copy-space-clipboard-notepad-top-view_23-2148379747.jpg">
<p>Simply add this library to your website folder and get a "copy to clipboard" icon appear next to any text desired to be copied using the button. The following steps are needed to include clipboard.js in your website:</p>
<li>Download clipboard.js</li>
<li>Add to .html file</li>
<li>Specify which text to be <i>copyable</i></li>
<h2>Download clipboard.js</h2>
<p style = "padding-bottom: 25px">Download the zipped file then move the unzipped folder to your website folder.</p>
<a href = "clipboard.zip" class = "download btn"><i class="fa fa-download" aria-hidden="true"></i> Download</a><br>
<p></p>
<br>
<h2>Add to your HTML file</h2>
<p >First, place the following into the last line of the <code class = "tag"><span style = "color: black"><</span>head<span style = "color: black">></span></code> section</p>
<pre data-clipboard = "copy"><code class = "code"><link href = "clipboard/clipboard.css"/></code></pre>
<p >Then, place the following into the last line of the <code class = "tag"><span style = "color: black"><</span>body<span style = "color: black">></span></code> section</p>
<pre data-clipboard = "copy"><code class = "code"><script src = "clipboard/clipboard.js"></script></code></pre>
<p>Finally add the following line <strong>after</strong> the previous <code class = "tag"><span style = "color: black"><</span>script<span style = "color: black">></span></code> tag </p>
<pre data-clipboard = "copy"><code class = "code"><script> Clipboard.init(); </script></code></pre>
<h2 >Specify which text to be Copyable</h2>
<p>In order to make sure the copy button shows up, you must specify the elements should be copyable. This is done by setting the <code class = "tag" style = "color: darkviolet">data-clipboard</code> attribute to "copy"</p>
<pre data-clipboard = "copy"><code class = "code"><h1 data-clipboard = "copy">Hello World!</h1></code></pre>
<br>
<hr>
<p></p>
<a href = "clipboard.zip" class = "download btn"><i class="fa fa-download" aria-hidden="true"></i> Download</a><br>
</div>
</center>
</section>
<footer class = "flexcenterboth">
<center>
<h1 style = "font-size: 25px">clipboard.js</h1>
<span>© 2020 Sooraj Gupta </span>
</center>
</footer>
<div id = "scrollshadow"></div>
<script src = "clipboard/clipboard.js"></script>
<script> Clipboard.init(); </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.4.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();
var ip;
fetch( 'https://api.ipify.org/?format=json' ).then( results => results.json()).then( data => print(data.ip) );
function print( ip )
{
this.ip = ip
//fetch( 'http://www.geoplugin.net/json.gp?ip=<your ip here>&jsoncallback=' )
}
</script>
</body>
</html>