-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
167 lines (158 loc) · 7.17 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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="robots" content="index,follow">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="description" content="Simple, pixel-perfect text stroking for the web">
<title>StrokeText.js</title>
<link rel="stylesheet" type="text/css" href="../inorganik.github.io/assets/css/style.css">
<script src="strokeText.js"></script>
<script src="demo.js"></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-7742845-9', 'inorganik.github.io');
ga('send', 'pageview');
</script>
</head>
<body>
<a class="forkMe" href="https://github.com/inorganik/strokeText.js"><img src="../assets/img/forkme_custom_indigo.png" alt="Fork me on GitHub"></a>
<div id="wrap">
<header>
<div id="github"><a class="block" href="https://github.com/inorganik"></a></div>
<div class="leaderLine">////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</div>
<div id="logo"><a class="block" href="http://inorganik.github.io"></a></div>
</header>
<section>
<h1>StrokeText.js <small id="version" class="lt-gray"></small></h1>
<p id="tagline"></p>
<ul>
<li>Strokes do not overlap your text like they do with <code>-webkit-text-stroke</code></li>
<li>Supports nearly all browsers except IE8 and below</li>
<li>Selectable text</li>
<li>Dependency-free</li>
</ul>
<p>Be sure to checkout the <a href="https://github.com/inorganik/strokeText.js/">README</a> for detailed usage instructions, how it works, and known issues.</p>
<p>🆒 You might also like <a href="https://inorganik.github.io/countUp.js/">countUp.js</a> — Animate a numerical value by counting to it.</p>
<p>Install via npm using the package name <code class="indigo large">stroketext.js</code></p>
<h3 class="marginTop marginBottom"><a class="lime weight700" href="https://github.com/inorganik/strokeText.js">Download on Github</a></h3>
</section>
<!-- STROKE TARGET -->
<section style="background: #8BC53F; min-height: 100px; padding: 15px 15px 0 15px;">
<h1 style="color: #4d63bc; font-weight: 700; line-height: 1.2em;" id="targetId"></h1>
</section>
<!-- TEXTAREA -->
<section>
<form>
<h4 class="weight300">Text:</h4>
<textarea id="textSource" onkeyup="assignText()" style="width: 100%; min-height: 50px"></textarea>
</form>
</section>
<!-- METHODS & PARAMS -->
<section>
<form>
<h4 class="inlineLeft noMargin weight300">Methods & Params:</h4>
<div class="inlineLeft marginLeft marginRight">
<label class="inlineLabel">stroke width:</label>
<input type="number" value="3" step="1" id="strokeWidth" style="width:50px">
</div>
<div class="inlineLeft marginRight">
<label class="inlineLabel">stroke color:</label>
<input type="text" value="white" id="strokeColor" style="width:100px">
</div>
<input type="button" class="inlineLeft marginRight" value="Stroke" onClick="executeStroke()" >
<input type="button" class="inlineLeft marginRight" value="Reset" onClick="resetStrokeText()">
</form>
</section>
<!-- OPTIONS -->
<section>
<form>
<h4 class="inlineLeft noMargin weight300">Options:</h4>
<div class="inlineLeft marginLeft marginRight">
<label class="inlineLabel">line-join:</label>
<select id="lineJoin" onchange="changeLineJoin()">
<option checked="checked" value="round">round (default)</option>
<option value="bevel">bevel</option>
<option value="miter">miter</option>
</select>
</div>
<div class="inlineLeft marginRight">
<label class="inlineLabel">line-cap:</label>
<select id="lineCap" onchange="changeLineCap()">
<option checked="checked" value="round">round (default)</option>
<option value="butt">butt</option>
<option value="square">square</option>
</select>
</div>
<div class="inlineLeft marginRight">
<label class="inlineLabel">line-dash-array:</label>
<input type="number" step="1" id="lineDashArrayLine" onchange="changeLineDashArray()" style="width:60px" placeholder="line">
<input type="number" step="1" id="lineDashArrayGap" onchange="changeLineDashArray()" style="width:60px" placeholder="gap">
</div>
<div class="inlineLeft marginRight">
<label class="inlineLabel">miter limit:</label>
<input type="number" step="1" id="miterLimit" onchange="changeMiterLimit()" value="10" style="width:50px">
</div>
<div class="inlineLeft">
<label class="inlineLabel">debug:</label>
<input type="checkbox" onClick="toggleDebug(this)">
</div>
</form>
</section>
<!-- TEXT STYLES -->
<section>
<form>
<h4 class="inlineLeft noMargin weight300">Text styles (for demo):</h4>
<div class="inlineLeft marginLeft marginRight">
<label class="inlineLabel">text-align:</label>
<select id="alignment" onchange="changeAlignment()">
<option checked="checked" value="left">left</option>
<option value="center">center</option>
<option value="right">right</option>
</select>
</div>
<div class="inlineLeft marginLeft marginRight">
<label class="inlineLabel">font:</label>
<select id="fontStyle" onchange="changeFontStyle()">
<option checked="checked" value="normal">normal</option>
<option value="italic">italic</option>
</select>
<select id="fontWeight" onchange="changeFontWeight()">
<option checked="checked" value="700">700</option>
<option value="600">600</option>
<option value="500">500</option>
<option value="400">400</option>
<option value="300">300</option>
<option value="200">200</option>
</select>
<select id="fontFamily" onchange="changeFont()">
<option checked="checked" value="Source Sans Pro">Source Sans Pro</option>
<option value="SF">SF</option>
<option value="serif">serif</option>
<option value="sans-serif">sans-serif</option>
<option value="cursive">cursive</option>
</select>
</div>
<div class="inlineLeft marginLeft marginRight">
<label class="inlineLabel inlineLeft">font-size: <span class="weight700" id="fontSize"></span></label>
<button type="button" class="inlineLeft emojiButton" onClick="increaseFontSize()">🔼</button>
<button type="button" class="inlineLeft emojiButton" onClick="decreaseFontSize()">🔽</button>
</div>
</form>
</section>
<!-- CODE VISUALIZER -->
<section class="marginBottom">
<div class="col full marginBottom marginTop">
<div class="code-contain indigo">
<code id="codeVisualizer" class="indigo"></code>
</div>
</div>
</section>
<p style="color: white"><em>I'm preloading source sans pro italic!</em></p>
</div>
</body>
</html>