diff options
author | Volpeon <git@volpeon.ink> | 2022-02-06 20:23:11 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2022-02-06 20:23:11 +0100 |
commit | 9691ccf48f64dd0fac669ae51943907cc8da9b78 (patch) | |
tree | 01fa18eee29ec1266bbe3d276a8dac6f54390f16 /tpl/objects | |
parent | Fixes (diff) | |
download | iro-design-9691ccf48f64dd0fac669ae51943907cc8da9b78.tar.gz iro-design-9691ccf48f64dd0fac669ae51943907cc8da9b78.tar.bz2 iro-design-9691ccf48f64dd0fac669ae51943907cc8da9b78.zip |
Added status indicator and avatar
Diffstat (limited to 'tpl/objects')
-rw-r--r-- | tpl/objects/avatar.pug | 26 | ||||
-rw-r--r-- | tpl/objects/status-indicator.pug | 8 |
2 files changed, 34 insertions, 0 deletions
diff --git a/tpl/objects/avatar.pug b/tpl/objects/avatar.pug new file mode 100644 index 0000000..83c0f7c --- /dev/null +++ b/tpl/objects/avatar.pug | |||
@@ -0,0 +1,26 @@ | |||
1 | include ../objects/status-indicator.pug | ||
2 | |||
3 | mixin avatar | ||
4 | - | ||
5 | let classes = { | ||
6 | 'o-avatar': true, | ||
7 | 'o-avatar--circle': attributes.circle | ||
8 | } | ||
9 | |||
10 | if (attributes.size) { | ||
11 | classes['o-avatar--' + attributes.size] = true; | ||
12 | } | ||
13 | |||
14 | let styles = {} | ||
15 | if (attributes.hue) { | ||
16 | styles['--avatar--colors--h'] = attributes.hue; | ||
17 | } | ||
18 | |||
19 | div(class=classes style=styles) | ||
20 | if attributes.status | ||
21 | +status-indicator(attributes.status)(class='o-avatar__status') | ||
22 | if attributes.src | ||
23 | img.o-avatar__content(src=attributes.src) | ||
24 | else | ||
25 | .o-avatar__content | ||
26 | block | ||
diff --git a/tpl/objects/status-indicator.pug b/tpl/objects/status-indicator.pug new file mode 100644 index 0000000..9b240e1 --- /dev/null +++ b/tpl/objects/status-indicator.pug | |||
@@ -0,0 +1,8 @@ | |||
1 | mixin status-indicator(status) | ||
2 | - | ||
3 | let classes = { | ||
4 | 'o-status-indicator': true, | ||
5 | } | ||
6 | classes['is-' + status] = true | ||
7 | |||
8 | div(class=classes)&attributes(attributes) | ||