Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webutils css and js, better card css, small fixes, okt
- Loading branch information
1 parent
d65018e
commit e238472
Showing
17 changed files
with
180 additions
and
964 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
{% addScript 'base64' %} | ||
{% addStyle 'webutils' %} | ||
|
||
<textarea id="decoded" class="input"></textarea> | ||
<div id="decoded"> | ||
<textarea class="input" id="decoded-text" placeholder="Plain text"></textarea> | ||
<span class="button" id="decoded-copy">⎘</span> | ||
</div> | ||
<span><=></span> | ||
<textarea id="encoded" class="output"></textarea> | ||
<div id="encoded"> | ||
<textarea class="output" id="encoded-text" placeholder="Encoded text"></textarea> | ||
<span class="button" id="encoded-copy">⎘</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{% addScript 'md5.min' %} {# MD5 function library #} | ||
{% addScript 'md5' %} | ||
{% addStyle 'webutils' %} | ||
|
||
<input id="md5-input" class="input" type="text" placeholder="String to hash using MD5"> | ||
<br> <br> | ||
<span id="md5-output" class="output"></span> | ||
<span class="button" id="md5-copy">copy</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
{% addScript 'tiny' %} | ||
{% addStyle 'webutils' %} | ||
|
||
<div> | ||
<input type="checkbox" id="tiny-ignore"> | ||
<label for="tiny-ignore">Ignore untinifyable content</label> | ||
</div> | ||
<input class="input" id="tiny-input" type="text" placeholder="String to tinify"> | ||
<br> <br> | ||
<span class="output" id="tiny-output"></span> | ||
<span class=button id="tiny-copy">copy</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
// import md5 function from library blueimp-md5 | ||
require('md5.min.js'); | ||
|
||
window.addEventListener("load", function(event) { | ||
const input = document.querySelector('#md5-input'); | ||
const output = document.querySelector('#md5-output'); | ||
const copy = document.querySelector('#md5-copy'); | ||
|
||
input.value = ''; | ||
output.innerHTML = ''; | ||
copy.classList.add('disabled'); | ||
|
||
const update = () => { | ||
if (input.value.length === 0) { | ||
copy.classList.add('disabled'); | ||
output.innerHTML = ''; | ||
return; | ||
} | ||
|
||
copy.classList.remove('disabled'); | ||
output.innerHTML = md5(input.value); | ||
} | ||
|
||
const copyToClipboard = () => { | ||
this.navigator.clipboard.writeText(output.inner); | ||
} | ||
|
||
input.addEventListener('input', update); | ||
copy.addEventListener('click', copyToClipboard); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,40 @@ | ||
window.addEventListener("load", function(event) { | ||
const input = document.querySelector('#tiny-input'); | ||
const output = document.querySelector('#tiny-output'); | ||
const ignore = document.querySelector('#tiny-ignore'); | ||
const copy = document.querySelector('#tiny-copy'); | ||
|
||
input.value = ''; | ||
output.innerHTML = ''; | ||
copy.classList.add('disabled'); | ||
|
||
const update = () => { | ||
output.innerHTML = tinify(input.value); | ||
output.innerHTML = tinify(input.value, ignore.checked); | ||
if (output.innerHTML.length === 0) { | ||
copy.classList.add('disabled'); | ||
return; | ||
} | ||
copy.classList.remove('disabled'); | ||
} | ||
|
||
const copyToClipboard = () => { | ||
this.navigator.clipboard.writeText(output.innerHTML); | ||
} | ||
|
||
input.addEventListener('input', update); | ||
ignore.addEventListener('change', update); | ||
copy.addEventListener('click', copyToClipboard); | ||
}); | ||
|
||
const superscript = { 'a': 'ᵃ', 'b': 'ᵇ', 'c': 'ᶜ', 'd': 'ᵈ', 'e': 'ᵉ', 'f': 'ᶠ', 'g': 'ᵍ', 'h': 'ʰ', 'i': 'ⁱ', 'j': 'ʲ', 'k': 'ᵏ', 'l': 'ˡ', 'm': 'ᵐ', 'n': 'ⁿ', 'o': 'ᵒ', 'p': 'ᵖ', 'q': '𐞥', 'r': 'ʳ', 's': 'ˢ', 't': 'ᵗ', 'u': 'ᵘ', 'v': 'ᵛ', 'w': 'ʷ', 'x': 'ˣ', 'y': 'ʸ', 'z': 'ᶻ', | ||
'A': 'ᴬ', 'B': 'ᴮ', 'C': 'ꟲ', 'D': 'ᴰ', 'E': 'ᴱ', 'F': 'ꟳ', 'G': 'ᴳ', 'H': 'ᴴ', 'I': 'ᴵ', 'J': 'ᴶ', 'K': 'ᴷ', 'L': 'ᴸ', 'M': 'ᴹ', 'N': 'ᴺ', 'O': 'ᴼ', 'P': 'ᴾ', 'Q': 'ꟴ', 'R': 'ᴿ', 'S': 'ˢ', 'T': 'ᵀ', 'U': 'ᵁ', 'V': 'ⱽ', 'W': 'ᵂ', 'X': 'ˣ', 'Y': 'ʸ', 'Z': 'ᶻ', | ||
'1': '¹', '2': '²', '3': '³', '4': '⁴', '5': '⁵', '6': '⁶', '7': '⁷', '8': '⁸', '9': '⁹', '0': '⁰' }; | ||
|
||
|
||
function tinify(str) { | ||
return str.split('').map(c => superscript[c] || c).join(''); | ||
function tinify(str, ignore) { | ||
return str.split('').map( | ||
ignore ? | ||
(c => superscript[c] || '') : | ||
(c => superscript[c] || c) | ||
).join(''); | ||
} |
Oops, something went wrong.