-
Notifications
You must be signed in to change notification settings - Fork 49
/
index.html
81 lines (76 loc) · 3.87 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Placeholdem // Placeholder Caret Animation</title>
<meta name="description" content="Placeholdem is a JavaScript plugin that animates placeholder carets on inputs and textareas. The placeholder value will incrementally delete on focus, and restore on blur.">
<link href="assets/css/style.min.css" rel="stylesheet">
<link href="assets/images/favicon.ico" rel="shortcut icon" type="image/x-icon">
</head>
<body>
<div class="container">
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=jackrugilecom" id="_carbonads_js"></script>
<header>
<h1 class="fade">Placeholdem</h1>
<h2 class="fade">Placeholder Caret Animation</h2>
<p class="fade">Placeholdem is a JavaScript plugin that animates placeholder carets on inputs and textareas. The placeholder value will incrementally delete on focus, and restore on blur.</p>
</header>
<h3 class="fade">Try It</h3>
<form>
<label class="fade">
<input name="field1" placeholder="Triggered on Focus/Blur" />
<div class="arrow"></div>
</label>
<label class="fade">
<textarea name="field2" placeholder="Inputs or Textareas"></textarea>
<div class="arrow"></div>
</label>
</form>
<h3 class="fade">Get It</h3>
<div class="buttons fade clearfix">
<a href="placeholdem.min.js" class="button">placeholdem.min.js</a>
<a href="https://github.com/jackrugile/placeholdem" class="button">GitHub Repository</a>
</div>
<h3 class="fade">Use It</h3>
<div class="code-wrap">
<pre class="fade"><code><span><!-- add placeholder to input or textarea --/></span>
<input name="fieldname" placeholder="Placeholder Value" /></code></pre>
<pre class="fade"><code><span>// run Placeholdem on all elements with placeholders</span>
Placeholdem( document.querySelectorAll( '[placeholder]' ) );
</code></pre>
</div>
<h3 class="fade">2016-11-04 Update</h3>
<p><a href="https://www.repostatus.org/#inactive"><img src="https://www.repostatus.org/badges/latest/inactive.svg" alt="Project Status: Inactive - The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows." ></a></p>
<p>This project is no longer being developed or maintained. The effect this plugin gives is visually appealing, but it's a bad practice in terms of usability and accessibility. On top of that, manipulating the values of different HTML5 input types directly has a lot of issues (text, email, number, search, etc.). I suggest using an alternative styling for labels and placeholders, such as <a href="https://css-tricks.com/float-labels-css/">Floating Labels</a>.</p>
<footer class="fade">
<p>By <a href="https://jackrugile.com" title="Jack Rugile">Jack Rugile</a></p>
</footer>
</div>
<script src="placeholdem.min.js"></script>
<script>
Placeholdem( document.querySelectorAll( '[placeholder]' ) );
var fadeElems = document.body.querySelectorAll( '.fade' ),
fadeElemsLength = fadeElems.length,
i = 0,
interval = 50;
function incFade() {
if( i < fadeElemsLength ) {
fadeElems[ i ].className += ' fade-load';
i++;
setTimeout( incFade, interval );
}
}
setTimeout( incFade, interval );
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5693606-7', 'jackrugile.com');
ga('send', 'pageview');
</script>
</body>
</html>