-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
172 lines (136 loc) · 3.92 KB
/
index.html
File metadata and controls
172 lines (136 loc) · 3.92 KB
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
<html>
<head>
<title>Text ⇔ Binary | A simple Text to Binary Converter</title>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, width=device-width">
<meta name="descritption" content="This is an easy, effective, nice-looking and modern application that converts between binary, base 2, and pure text.">
<meta name="keywords" content="binary, text, ASCII, converter, live">
<meta name="author" content="Tobias Skarhed">
<meta name="robots" content="index">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@DehraX">
<!--Open Graph Meta and Twitter Card tags-->
<meta name="twitter:image:src" property="og:image" content="http://text-to-binary.com/images/logo6.png">
<meta property="og:image:width" conetnt="200">
<meta property="og:image:height" content="200">
<meta name="twitter:title" property="og:title" content="Text - Binary Converter">
<meta property="og:url" content="http://text-to-binary.com/">
<meta property="og:site_name" content="Modern text to binary converter">
<meta name="twitter:description" property="og:description" content="This is an easy, effective, nice-looking and modern application that converts between binary, base 2, pure text.">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<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-40224453-2', 'auto');
ga('send', 'pageview');
</script>
<style type="text/css">
@font-face{
font-family: "Bebas Neue";
src: url('BebasNeue.otf');
}
*::selection{
color: white;
background-color: #123456;
}
body{
font-family: "Bebas Neue";
padding: 0;
margin: 0;
text-align: center;
background-color: #770082;
color: white;
}
a{
color: #AAA;
font-family: "Rockwell", Kameron, serif;
}
h1{
font-size: 6em;
color: #770082;
background-color: white;
}
h2{
font-size: 2em;
color: white;
}
textarea{
font-size: 3em;
font-family: "Bebas Neue";
width: 50%;
height: 30%;
text-align: center;
border: none;
background-color: #8E3096;
color: white;
resize: none;
}
textarea:focus{
outline: none;
}
img{
position: fixed;
top: 0;
left: 0;
width: 120px;
}
@media screen and (max-width: 1100px){
textarea{
width: 80%;
}
img{
position: static;
display: block;
text-align: center;
margin: 10px auto;
}
@media screen and (max-width: 500px){
textarea{
width: 90%;
}
h1{
font-size: 4em;
}
}
}
</style>
</head>
<body>
<h1>Text to Binary Converter</h1>
<h2>Text goes here</h2>
<textarea type="text" id="text"></textarea>
<h2>Binary goes here!</h2>
<textarea type="tel" id="binary"></textarea>
<script type="text/javascript">
var bin = document.getElementById("binary");
var text = document.getElementById("text");
text.oninput = function(){
var string = "";
var c;
for (var i = 0; i < text.value.length; i++) {
c = text.value.charCodeAt(i).toString(2)
while(c.length<8)
c = "0" + c;
string += c;
};
bin.value = string;
};
bin.oninput = function(){
var string = "";
var c;
bin.value = bin.value.replace(/[^0-1]/g, "");
var n = bin.value.length;
for (var i = 0; i < (n/8); i++) {
c = String.fromCharCode(parseInt(bin.value.substring(8*i, 8*(i+1)), 2));
string += c;
};
text.value = string;
};
</script>
<img src="images/logo.svg" title="Alpha Base 2 Logo" alt="Logo">
<p>Site by <a href="http://skarhed.com">Skarhed</a>, <a href="http://text-to-binary.com/humans.txt">humans.txt</a></p>
</body>
</html>