Skip to content

Commit f6525d0

Browse files
committed
17.0 alpha 3: md5, fixes, better css
1 parent 9aa8c5e commit f6525d0

8 files changed

Lines changed: 37 additions & 18 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% addScript 'base64' %}
2+
{% addStyle 'webutils' %}
23

3-
<textarea id="decoded"></textarea>
4+
<textarea id="decoded" class="input"></textarea>
45
<span><=></span>
5-
<textarea id="encoded"></textarea>
6+
<textarea id="encoded" class="output"></textarea>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% addScript 'md5' %}
2+
{% addStyle 'webutils' %}
3+
4+
<input id="md5-input" class="input" type="text" placeholder="String to hash using MD5">
5+
<br> <br>
6+
<span id="md5-output" class="output"></span>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% addScript 'tiny' %}
2-
{% addStyle 'tiny' %}
2+
{% addStyle 'webutils' %}
33

4-
<input id="input">
4+
<input class="input" id="tiny-input" type="text" placeholder="String to tinify">
55
<br> <br>
6-
<span id="output"></span>
6+
<span class="output" id="tiny-output"></span>
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@use '../base'
22

3-
#output
3+
span.output
44
$padding: 10px
55

66
border-radius: base.$radius
77
border: 3px solid base.$light
8-
padding: $padding $padding 0 $padding
8+
padding: $padding
99
margin: 25em 0

src/static/js/app/md5.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// import md5 function from library blueimp-md5
2+
require('md5.min.js');
3+
4+
window.addEventListener("load", function(event) {
5+
const input = document.querySelector('#md5-input');
6+
const output = document.querySelector('#md5-output');
7+
8+
input.value = '';
9+
output.innerHTML = '';
10+
11+
const update = () => {
12+
output.innerHTML = md5(input.value);
13+
}
14+
15+
input.addEventListener('input', update);
16+
});

src/static/js/app/tiny.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
window.addEventListener("load", function(event) {
2-
const input = document.querySelector('#input');
3-
const output = document.querySelector('#output');
2+
const input = document.querySelector('#tiny-input');
3+
const output = document.querySelector('#tiny-output');
44

5-
clear(input);
5+
input.value = '';
6+
output.innerHTML = '';
67

78
const update = () => {
89
output.innerHTML = tinify(input.value);
@@ -19,8 +20,3 @@ const superscript = { 'a': 'ᵃ', 'b': 'ᵇ', 'c': 'ᶜ', 'd': 'ᵈ', 'e': 'ᵉ'
1920
function tinify(str) {
2021
return str.split('').map(c => superscript[c] || c).join('');
2122
}
22-
23-
function clear(dom) {
24-
dom.innerHTML = '';
25-
dom.value = '';
26-
}

0 commit comments

Comments
 (0)