Skip to content

Instantly share code, notes, and snippets.

@stephancom
Created November 4, 2017 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephancom/ab0d1fc381d11baea3ad42fe19e29195 to your computer and use it in GitHub Desktop.
Save stephancom/ab0d1fc381d11baea3ad42fe19e29195 to your computer and use it in GitHub Desktop.
ǝnʌ-ʇxǝʇdıןɟ
// __ _ _ _ _
// / _| (_) | | | |
// | |_| |_ _ __ | |_ _____ _| |_ ________ ___ _ ___
// | _| | | '_ \| __/ _ \ \/ / __|______\ \ / / | | |/ _ \
// | | | | | |_) | || __/> <| |_ \ V /| |_| | __/
// |_| |_|_| .__/ \__\___/_/\_\\__| \_/ \__,_|\___|
// | |
// |_| by stephan@stephan.com
//
// a vue filter for fliptext
// requires lodash
module.exports = {
install: (Vue, options) => {
Vue.filter('fliptext', (string = '') => {
const flipTable = {
a: '\u0250',
b: 'q',
c: '\u0254',
d: 'p',
e: '\u01DD',
f: '\u025F',
g: '\u0183',
h: '\u0265',
i: '\u0131',
j: '\u027E',
k: '\u029E',
l: '\u05DF',
m: '\u026F',
n: 'u',
o: 'o',
p: 'd',
q: 'b',
r: '\u0279',
s: 's',
t: '\u0287',
u: 'n',
v: '\u028C',
w: 'ʍ',
x: 'x',
y: '\u028E',
z: 'z',
A: '\u2200',
B: 'B',
C: '\u0186',
D: '\u15E1',
E: '\u018E',
F: '\u2132',
G: '\u05E4',
H: 'H',
I: 'I',
J: '\u017F',
K: 'K',
L: '\u02E5',
M: 'W',
N: 'N',
O: 'O',
P: '\u0500',
Q: '\u01D1',
R: '\u0223',
S: 'S',
T: '\u2534',
U: '\u2229',
V: '\u039B',
W: 'M',
X: 'X',
Y: '\u2144',
Z: 'Z',
0: '0',
1: '\u0196',
2: '\u1105',
3: '\u0190',
4: '\u3123',
5: '\u03DB',
6: '9',
7: '\u3125',
8: '8',
9: '6',
',': "'",
'.': '\u02D9',
'?': '\u00BF',
'!': '\u00A1',
'"': ',,',
"'": ',',
'`': ',',
'&': '\u214B',
'_': '\u203E',
'(': ')',
')': '(',
'[': ']',
']': '[',
'}': '{',
'{': '}',
'\u00BF': '?',
'\u00A1': '!',
'>': '<',
'<': '>',
';': '\u061B',
'\\': '\\',
'\u203F': '\u2040',
'\u2045': '\u2046',
'\u2234': '\u2235'
};
var buıɹʇs = '';
_.forEachRight(string, (char) => {
var ɹɐɥɔ = flipTable[char];
buıɹʇs += (ɹɐɥɔ === undefined) ? char : ɹɐɥɔ;
});
return buıɹʇs;
});
}
};
@stephancom
Copy link
Author

Needs a better mapping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment