Skip to content

Commit

Permalink
Add some emoji spinners (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
nnmrts and sindresorhus authored Mar 18, 2021
1 parent d324478 commit 1e1d532
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"devDependencies": {
"ava": "^1.4.1",
"log-update": "^3.2.0",
"string-length": "^4.0.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
Expand Down
126 changes: 123 additions & 3 deletions spinners.json
Original file line number Diff line number Diff line change
Expand Up @@ -1233,10 +1233,10 @@
"grenade": {
"interval": 80,
"frames": [
"، ",
" ",
"، ",
"",
" ´ ",
"",
"",
"",
"",
" |",
Expand Down Expand Up @@ -1279,6 +1279,126 @@
"ββββββρ"
]
},
"fingerDance": {
"interval": 160,
"frames": [
"🤘 ",
"🤟 ",
"🖖 ",
"",
"🤚 ",
"👆 "
]
},
"fistBump": {
"interval": 80,
"frames": [
"🤜\u3000\u3000\u3000\u3000🤛 ",
"🤜\u3000\u3000\u3000\u3000🤛 ",
"🤜\u3000\u3000\u3000\u3000🤛 ",
"\u3000🤜\u3000\u3000🤛\u3000 ",
"\u3000\u3000🤜🤛\u3000\u3000 ",
"\u3000🤜✨🤛\u3000\u3000 ",
"🤜\u3000\u3000🤛\u3000 "
]
},
"soccerHeader": {
"interval": 80,
"frames": [
" 🧑⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 "
]
},
"mindblown": {
"interval": 160,
"frames": [
"😐 ",
"😐 ",
"😮 ",
"😮 ",
"😦 ",
"😦 ",
"😧 ",
"😧 ",
"🤯 ",
"💥 ",
"",
"\u3000 ",
"\u3000 ",
"\u3000 "
]
},
"speaker": {
"interval": 160,
"frames": [
"🔈 ",
"🔉 ",
"🔊 ",
"🔉 "
]
},
"orangePulse": {
"interval": 100,
"frames": [
"🔸 ",
"🔶 ",
"🟠 ",
"🟠 ",
"🔶 "
]
},
"bluePulse": {
"interval": 100,
"frames": [
"🔹 ",
"🔷 ",
"🔵 ",
"🔵 ",
"🔷 "
]
},
"orangeBluePulse": {
"interval": 100,
"frames": [
"🔸 ",
"🔶 ",
"🟠 ",
"🟠 ",
"🔶 ",
"🔹 ",
"🔷 ",
"🔵 ",
"🔵 ",
"🔷 "
]
},
"timeTravel": {
"interval": 100,
"frames": [
"🕛 ",
"🕚 ",
"🕙 ",
"🕘 ",
"🕗 ",
"🕖 ",
"🕕 ",
"🕔 ",
"🕓 ",
"🕒 ",
"🕑 ",
"🕐 "
]
},
"aesthetic": {
"interval": 80,
"frames": [
Expand Down
24 changes: 24 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import test from 'ava';
import stringLength from 'string-length';

import cliSpinners from '.';

function mockMathRandom(fixedResult) {
Expand All @@ -22,6 +24,28 @@ test('main', t => {
t.true(Array.isArray(cliSpinners.dots.frames));
});

test('constant width', t => {
for (const key of Object.keys(cliSpinners)) {
// TODO: Remove this if statement when "module.exports.default = spinners" is removed from index.js.
if (key === 'default') {
continue;
}

const {
[key]: {
frames,
frames: [
firstFrame
]
}
} = cliSpinners;

const firstFrameLength = stringLength(firstFrame);

t.true(frames.every(frame => stringLength(frame) === firstFrameLength));
}
});

test('random getter', t => {
const spinnersList = Object.keys(cliSpinners)
// TODO: Remove this filter when "module.exports.default = spinners" is removed from index.js.
Expand Down

0 comments on commit 1e1d532

Please sign in to comment.