-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathindex.html
119 lines (119 loc) · 5.25 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
<!DOCTYPE html>
<html>
<head>
<title>Pure CSS Font</title>
<meta name="description" content="Pure CSS Font - Scalable and Styleable - Diana Smith aka cyanHarlow" />
<meta property="og:description" content="Pure CSS Font - Scalable and Styleable - Diana Smith aka cyanHarlow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="keywords" content="cyanharlow, diana, css, art" />
<link href="https://fonts.googleapis.com/css?family=Maven+Pro:400,900" rel="stylesheet">
<link rel="stylesheet" href="generator.css" type="text/css">
</head>
<body>
<div class="text-place section">
<h1>Pure CSS Font</h1>
<h2>CSS/HTML Generator</h2>
<div class="medwidth">
<p>
For private, SEO-hidden, CAPTCHA-friendly unselectable text.
<br> Deter plagiarism and spambots!
</p>
</div>
<div class="linksection">
By Diana Smith
<span class="separator">|</span> <a href="https://github.com/cyanharlow" target="_blank">GitHub.com/cyanHarlow</a>
<span class="separator">|</span>
<a href="http://diana-adrianne.com" target="_blank">Website</a>
</div>
</div>
<div class="resultpanel section">
<h3>Try it</h3>
<p>Enter some text:</p>
<div class="maxwidth editorback"> <textarea id="result" class="white"></textarea> </div>
<ul class="buttonsets">
<li>
<input id="bold" type="checkbox" data-dat="bold"></input>
<label for="bold" class="bold">B</label>
</li>
<li>
<input id="ital" type="checkbox" data-dat="italic"></input>
<label for="ital" class="italic">I</label>
</li>
<li>
<input id="unde" type="checkbox" data-dat="underlined"></input>
<label for="unde" class="underline">U</label>
</li>
</ul> <a id="submitbutton" class="runconverter" href="#show-css-font" onClick="runCoder();">See it in HTML/CSS!</a>
</div>
<div id="show-css-font" style="display: none;">
<div class="section displayhere example">
<div class="maxwidth">
<div id="sample0" class="sample exa"></div>
<hr>
<h4>Seamless on any background color</h4>
<div class="exa example1">
<div id="sample1"></div>
</div>
<h4>Inherits color property</h4>
<div class="exa example2">
<div id="sample2"></div>
</div>
<h4>Scales with font-size</h4>
<div class="exa example3">
<div id="sample3"></div>
</div>
</div>
</div>
</div>
<div id="codehtml" class="code-place section">
<div class="maxwidth">
<h3>How to Use</h3>
<a href="text-to-css.min.js" class="download-link" download>Download text-to-css.min.js</a>
<p>Call the text converter with your string of text</p>
<div class="coderesult">
var <em class="nm">yourVariable</em> = <em class="el">textToCSSFont</em>(<em class="cl">yourString</em>);
</div>
<p>Optional: add styles.</p>
<div class="coderesult">
var <em class="nm">yourVariable</em> = <em class="el">textToCSSFont</em>(<em class="cl">yourString</em>, {
<br/> bold: <em class="bo">true</em>,
<br/> italic: <em class="bo">true</em>
<br/> underlined: <em class="bo">true</em>
<br/>});
</div>
<p>Insert on page wherever you'd like.</p>
<div class="coderesult">
<em class="nm">yourElement</em>.innerHTML = <em class="el">yourVariable</em>;
</div>
</div>
</div>
</body>
<script type="text/javascript" src="text-to-css.min.js"></script>
<script>
var styleData = {
bold: false,
italic: false,
underlined: false
};
document.addEventListener('click', function(e) {
if (e.target.type === 'checkbox') {
var styleType = e.target.getAttribute('data-dat');
styleData[styleType] = e.target.checked;
}
});
document.getElementById('submitbutton').onclick = function() {
var textArea = document.getElementById('result').value;
if (textArea !== '') {
document.getElementById('show-css-font').setAttribute('style', '');
var displayedFont = textToCSSFont(textArea, styleData);
document.getElementById('sample0').innerHTML = displayedFont;
document.getElementById('sample1').innerHTML = displayedFont;
document.getElementById('sample2').innerHTML = displayedFont;
document.getElementById('sample3').innerHTML = displayedFont;
} else {
alert('Please enter some text to see an example');
}
}
</script>
</html>