summaryrefslogtreecommitdiffstats
path: root/tpl/objects
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2023-11-09 15:44:54 +0100
committerVolpeon <git@volpeon.ink>2023-11-09 15:44:54 +0100
commit679b9b108101b67ad56b4fdf35ec2bd0568d8d84 (patch)
tree1b097e9f90627ca401174c738a8d754e8f2cce6b /tpl/objects
parentSimplified bubble arrows (diff)
downloadiro-design-679b9b108101b67ad56b4fdf35ec2bd0568d8d84.tar.gz
iro-design-679b9b108101b67ad56b4fdf35ec2bd0568d8d84.tar.bz2
iro-design-679b9b108101b67ad56b4fdf35ec2bd0568d8d84.zip
Renamed "bubble" to "message", added message group merging
Diffstat (limited to 'tpl/objects')
-rw-r--r--tpl/objects/bubble-group.pug17
-rw-r--r--tpl/objects/message-group.pug19
-rw-r--r--tpl/objects/message.pug (renamed from tpl/objects/bubble.pug)20
3 files changed, 30 insertions, 26 deletions
diff --git a/tpl/objects/bubble-group.pug b/tpl/objects/bubble-group.pug
deleted file mode 100644
index 4fcb1a4..0000000
--- a/tpl/objects/bubble-group.pug
+++ /dev/null
@@ -1,17 +0,0 @@
1mixin bubble-group(user)
2 -
3 let classes = {
4 'l-bubble-group': true,
5 'l-bubble-group--compact': attributes.compact,
6 'l-bubble-group--left': attributes.left,
7 'l-bubble-group--right': attributes.right,
8 'l-bubble-group--arrow': attributes.arrow
9 }
10 if (attributes.class) {
11 classes[attributes.class] = true
12 }
13
14 section(class=classes)
15 .l-bubble-group__avatar.u-p-sticky-top
16 +avatar= user.slice(0, 2)
17 block
diff --git a/tpl/objects/message-group.pug b/tpl/objects/message-group.pug
new file mode 100644
index 0000000..e5e055c
--- /dev/null
+++ b/tpl/objects/message-group.pug
@@ -0,0 +1,19 @@
1mixin message-group(user)
2 -
3 let classes = {
4 'l-message-group': true,
5 'l-message-group--compact': attributes.compact,
6 'l-message-group--left': attributes.left,
7 'l-message-group--right': attributes.right,
8 'l-message-group--arrow': attributes.arrow,
9 'l-message-group--group': attributes.group,
10 'l-message-group--merge': attributes.merge
11 }
12 if (attributes.class) {
13 classes[attributes.class] = true
14 }
15
16 section(class=classes)
17 .l-message-group__avatar.u-p-sticky-top
18 +avatar= user.slice(0, 2)
19 block
diff --git a/tpl/objects/bubble.pug b/tpl/objects/message.pug
index 6a3ea8b..d644347 100644
--- a/tpl/objects/bubble.pug
+++ b/tpl/objects/message.pug
@@ -1,4 +1,4 @@
1mixin bubble(user) 1mixin message(user)
2 - const slots = {} 2 - const slots = {}
3 3
4 mixin slot(key) 4 mixin slot(key)
@@ -8,10 +8,11 @@ mixin bubble(user)
8 block ? block() : undefined 8 block ? block() : undefined
9 9
10 let classes = { 10 let classes = {
11 'o-bubble': true, 11 'o-message': true,
12 'o-bubble--75': attributes.compact, 12 'o-message--bubble': attributes.bubble || !!attributes.theme,
13 'o-bubble--highlight': attributes.highlight, 13 'o-message--75': attributes.compact,
14 't-up': !attributes.theme 14 'o-message--highlight': attributes.highlight,
15 'l-message-group__message': attributes.group
15 } 16 }
16 if (attributes.class) { 17 if (attributes.class) {
17 classes[attributes.class] = true 18 classes[attributes.class] = true
@@ -21,8 +22,9 @@ mixin bubble(user)
21 } 22 }
22 23
23 let headerClasses = { 24 let headerClasses = {
24 'o-bubble__header': true, 25 'o-message__header': true,
25 'u-mb-50': !attributes.compact, 26 'l-message-group__merge-hide': true,
27 'u-mb-50': !attributes.compact,
26 } 28 }
27 29
28 mixin content 30 mixin content
@@ -35,10 +37,10 @@ mixin bubble(user)
35 span.s-links.s-links--colored 37 span.s-links.s-links--colored
36 - slots.body() 38 - slots.body()
37 if slots.time 39 if slots.time
38 small.o-bubble__suffix 40 small.o-message__suffix
39 - slots.time() 41 - slots.time()
40 if slots.footer 42 if slots.footer
41 footer.o-bubble__footer 43 footer.o-message__footer
42 - slots.footer() 44 - slots.footer()
43 45
44 article(class=classes) 46 article(class=classes)