forked from vgs-samples/vgs-collect-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
masked-examples.html
195 lines (181 loc) · 7.02 KB
/
masked-examples.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Quicksand" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Varela" rel="stylesheet">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="https://www.verygoodsecurity.com/theme/css/main.css"/>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/color-brewer.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<script src="https://js.verygoodvault.com/vgs-collect/1/vgs-collect-examples.js"></script>
</head>
<body>
<main>
<div class="alert alert-success alert-dismissible hidden show fade copy-success" role="alert">
<strong>Copied to clipboard!</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<section class="container pt-5 pb-5">
<div class="text-center ">
<h4 class="mb-5">VGS COLLECT.JS MASKED INPUT EXAMPLES</h4>
<p class="mb-4">VGS Collect.js is a javascript library that allows you to integrate secure fields with non-secure
fields in your page.
<br>The secure fields behave like traditional input fields while preventing access to the unsecured data.</p>
<div class="flex justify-content-center navigation-links">
<a target="_blank" href="https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it" class="btn btn-outline-primary">
Documentation
</a>
<a target="_blank" href="./style-examples.html" class="btn btn-outline-primary">
Style Examples
</a>
<a target="_blank" href="./masked-examples.html" class="btn btn-get">
Input masking
</a>
</div>
</div>
</section>
<section class="container">
<a href="https://codesandbox.io/s/static-o8njh?fontsize=14&module=%2Fscript.js"
target="_blank"
class="source-link">
<i class="fas fa-code"></i>
Codesandbox playground
</a>
<form id="masked-inputs-form" class="masked-inputs-form">
<div id="cc-holder" class="inner-container">
<div class="mb-5">
<label for="cc-holder" class="flex justify-content-between">
Card Holder <b>Alphabetic only</b>
</label>
<span class="field-space"></span>
</div>
<pre>
<code class="javascript">f.field('#cc-holder', {...})
.replacePattern('/[^a-zA-Z\s]+/g');
</code>
</pre>
</div>
<div id="zip-code" class="inner-container">
<div class="mb-5">
<label for="zip-code" class="flex justify-content-between">
Zip code <b>Numeric only</b>
</label>
<span class="field-space"></span>
</div>
<pre>
<code class="javascript">f.field('#zip-code', {...})
.replacePattern('/[^\\d]+/g');
</code>
</pre>
</div>
<div id="phone-number" class="inner-container">
<div class="mb-5">
<label for="phone-number" class="flex justify-content-between">
Phone number <b>+1 (XXX) XXX-XX-XX</b>
</label>
<span class="field-space"></span>
</div>
<pre>
<code class="javascript">f.field('#phone-number', {...})
.mask('+1 (999) 999-99-99');
</code>
</pre>
</div>
<div id="ssn" class="inner-container">
<div class="mb-5">
<label for="ssn" class="flex justify-content-between">
SSN <b>XXX-XX-XXXX</b>
</label>
<span class="field-space"></span>
</div>
<pre>
<code class="javascript">f.field('#ssn', {...})
.mask('999-99-9999', '*');
</code>
</pre>
</div>
<div id="birth-date" class="inner-container">
<div class="mb-5">
<label for="birth-date" class="flex justify-content-between">
Birth date <b>(MM/DD/YYYY)</b>
</label>
<span class="field-space"></span>
</div>
<pre>
<code class="javascript">f.field('#password', {...})
.mask('MM/DD/YYYY', '_');
</code>
</pre>
</div>
<div id="cc-exp-short" class="inner-container">
<div class="mb-5">
<label for="cc-exp-short" class="flex justify-content-between">
Expiration date <b>MM/YY</b>
</label>
<span class="field-space"></span>
</div>
<pre>
<code class="javascript">f.field('#cc-exp-short',
{yearLength: '2'});
</code>
</pre>
</div>
<div id="cc-exp-full" class="inner-container">
<div class="mb-5">
<label for="cc-exp-full" class="flex justify-content-between"> Expiration date <b>MM/YYYY</b></label>
<span class="field-space"></span>
</div>
<pre>
<code class="javascript">f.field('#cc-exp-full .field-space',
{yearLength: '4'});
</code>
</pre>
</div>
</form>
</section>
</main>
<footer class="page-footer font-small cyan darken-3">
<div class="container">
<div class="row">
<div class="col-md-12 py-2">
<div class="d-flex justify-content-center">
<a href="https://github.com/verygoodsecurity/" class="p-2" target="_blank">
<i class="fab fa-github-square"></i>
</a>
<a href="https://www.linkedin.com/company/18142614/" class="p-2" target="_blank">
<i class="fab fa-linkedin"></i>
</a>
<a href="https://www.instagram.com/verygoodsecurity/" class="p-2" target="_blank">
<i class="fab fa-instagram"></i>
</a>
<a href="https://twitter.com/getvgs" class="p-2" target="_blank">
<i class="fab fa-twitter-square"></i>
</a>
<a href="https://www.facebook.com/getvgs/" class="p-2" target="_blank">
<i class="fab fa-facebook-square"></i>
</a>
</div>
</div>
</div>
</div>
<div class="footer-copyright text-center pb-3">© 2019 VERY GOOD SECURITY, Inc.</div>
</footer>
<script src="vendor/jquery-3.3.1.min.js"></script>
<script src="vendor/bootstrap/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
$('.alert').alert();
</script>
<script src="js/script.js"></script>
<script src="masked-examples/masked-examples.js"></script>
</body>
</html>