`tw-balloon--${x}`).join(' ') : ''}`;
+ let dir = '';
+ if ( this.dir ) {
+ dir = this.dir.split('-').map(d => {
+ if ( d === 'up' || d === 'down' )
+ return `tw-tooltip--${d}`;
+ if ( d === 'left' || d === 'right' )
+ return `tw-tooltip--align-${d}`;
+ return '';
+ }).join(' ');
+ }
+
+ return `tw-c-${this.color} ${this.size ? `tw-balloon--${this.size}` : ''} ${dir}`;
}
}
}
diff --git a/src/utilities/time.js b/src/utilities/time.js
index ab8e14c0..25d37906 100644
--- a/src/utilities/time.js
+++ b/src/utilities/time.js
@@ -42,6 +42,19 @@ export function print_duration(seconds) {
}
+export function durationForChat(elapsed) {
+ const seconds = elapsed % 60;
+ let minutes = Math.floor(elapsed / 60);
+ let hours = Math.floor(minutes / 60);
+ const days = Math.floor(hours / 24);
+
+ minutes = minutes % 60;
+ hours = hours % 24;
+
+ return `${days > 0 ? `${days}d` : ''}${hours > 0 ? `${hours}h` : ''}${minutes > 0 ? `${minutes}m` : ''}${seconds > 0 ? `${seconds}s` : ''}`;
+}
+
+
export function durationForURL(elapsed) {
const seconds = elapsed % 60;
let minutes = Math.floor(elapsed / 60);
diff --git a/styles/widgets.scss b/styles/widgets.scss
index 6b7a4b74..552f1b75 100644
--- a/styles/widgets.scss
+++ b/styles/widgets.scss
@@ -50,6 +50,15 @@ textarea.tw-input {
}
.ffz--widget {
+ .tw-pill {
+ border-radius: 1000px;
+ padding: 0.3rem 0.8em;
+ font-size: 75%;
+ background-color: var(--color-background-pill);
+ color: var(--color-text-overlay);
+ white-space: nowrap;
+ }
+
input, select {
min-width: 20rem;
}