diff options
Diffstat (limited to 'tpl/objects')
-rw-r--r-- | tpl/objects/action-button.pug | 7 | ||||
-rw-r--r-- | tpl/objects/backdrop.pug | 5 | ||||
-rw-r--r-- | tpl/objects/card.pug | 11 | ||||
-rw-r--r-- | tpl/objects/divider.pug | 2 | ||||
-rw-r--r-- | tpl/objects/lightbox.pug | 29 | ||||
-rw-r--r-- | tpl/objects/navbar.pug | 37 |
6 files changed, 77 insertions, 14 deletions
diff --git a/tpl/objects/action-button.pug b/tpl/objects/action-button.pug index c3a9b53..e9b6fe3 100644 --- a/tpl/objects/action-button.pug +++ b/tpl/objects/action-button.pug | |||
@@ -26,4 +26,9 @@ mixin action-button | |||
26 | if attributes.icon | 26 | if attributes.icon |
27 | +icon(attributes.icon) | 27 | +icon(attributes.icon) |
28 | = ' ' | 28 | = ' ' |
29 | block | 29 | if block |
30 | span.o-action-button__label | ||
31 | block | ||
32 | if attributes.postIcon | ||
33 | = ' ' | ||
34 | +icon(attributes.postIcon) | ||
diff --git a/tpl/objects/backdrop.pug b/tpl/objects/backdrop.pug index 227700c..f577961 100644 --- a/tpl/objects/backdrop.pug +++ b/tpl/objects/backdrop.pug | |||
@@ -8,7 +8,10 @@ mixin backdrop | |||
8 | classes[attributes.class] = true; | 8 | classes[attributes.class] = true; |
9 | } | 9 | } |
10 | 10 | ||
11 | let styles = { width: '100%', 'min-height': '5em', 'max-height': '40em' } | 11 | let styles = { width: '100%', 'min-height': '5em' } |
12 | if (attributes.maxHeight) { | ||
13 | styles['max-height'] = '40em'; | ||
14 | } | ||
12 | if (attributes.pad) { | 15 | if (attributes.pad) { |
13 | styles['padding'] = '2em'; | 16 | styles['padding'] = '2em'; |
14 | } | 17 | } |
diff --git a/tpl/objects/card.pug b/tpl/objects/card.pug index 2ab9bef..e0f6a15 100644 --- a/tpl/objects/card.pug +++ b/tpl/objects/card.pug | |||
@@ -26,7 +26,16 @@ mixin card-image | |||
26 | classes[attributes.class] = true; | 26 | classes[attributes.class] = true; |
27 | } | 27 | } |
28 | 28 | ||
29 | img(class=classes src=attributes.src style=attributes.style) | 29 | let imgClasses = { |
30 | 'o-card__image-img': true, | ||
31 | 'l-card-list__card-image': attributes.list | ||
32 | } | ||
33 | |||
34 | div(class=classes) | ||
35 | img(class=imgClasses src=attributes.src style=attributes.style) | ||
36 | if block | ||
37 | .o-card__image-overlay | ||
38 | block | ||
30 | 39 | ||
31 | mixin card-body | 40 | mixin card-body |
32 | .o-card__body(style=attributes.style) | 41 | .o-card__body(style=attributes.style) |
diff --git a/tpl/objects/divider.pug b/tpl/objects/divider.pug index 46425cd..ed4d27a 100644 --- a/tpl/objects/divider.pug +++ b/tpl/objects/divider.pug | |||
@@ -3,6 +3,8 @@ mixin divider(level) | |||
3 | let classes = { | 3 | let classes = { |
4 | 'o-divider': true, | 4 | 'o-divider': true, |
5 | 'o-divider--labelled': !!block, | 5 | 'o-divider--labelled': !!block, |
6 | 'o-divider--vertical': !!attributes.vertical, | ||
7 | 'o-divider--dot': !!attributes.dot, | ||
6 | ['o-divider--' + level]: true, | 8 | ['o-divider--' + level]: true, |
7 | ['o-divider--' + attributes.color]: !!attributes.color | 9 | ['o-divider--' + attributes.color]: !!attributes.color |
8 | } | 10 | } |
diff --git a/tpl/objects/lightbox.pug b/tpl/objects/lightbox.pug index 02a3200..842d44a 100644 --- a/tpl/objects/lightbox.pug +++ b/tpl/objects/lightbox.pug | |||
@@ -4,14 +4,19 @@ mixin lightbox(images) | |||
4 | - | 4 | - |
5 | let classes = { | 5 | let classes = { |
6 | 'o-lightbox': true, | 6 | 'o-lightbox': true, |
7 | 'o-lightbox--interactive': attributes.interactive, | ||
7 | } | 8 | } |
8 | let linksClasses = { | 9 | let linksClasses = { |
9 | 's-links': true, | 10 | 's-links': true, |
10 | } | 11 | } |
12 | let thumbnailClasses = { | ||
13 | 'o-thumbnail': true, | ||
14 | } | ||
11 | 15 | ||
12 | if (attributes.theme) { | 16 | if (attributes.theme) { |
13 | classes[`o-lightbox--${attributes.theme}`] = true; | 17 | classes[`o-lightbox--${attributes.theme}`] = true; |
14 | linksClasses[`s-links--${attributes.theme}`] = true; | 18 | linksClasses[`s-links--${attributes.theme}`] = true; |
19 | thumbnailClasses[`o-thumbnail--${attributes.theme}`] = true; | ||
15 | } | 20 | } |
16 | 21 | ||
17 | div(class=classes) | 22 | div(class=classes) |
@@ -19,21 +24,23 @@ mixin lightbox(images) | |||
19 | div(class=linksClasses) | 24 | div(class=linksClasses) |
20 | block | 25 | block |
21 | +action-button(theme=attributes.theme pill=true quiet=true icon='x' class='o-lightbox__close-btn') | 26 | +action-button(theme=attributes.theme pill=true quiet=true icon='x' class='o-lightbox__close-btn') |
27 | |||
22 | each img, i in images | 28 | each img, i in images |
23 | img.o-lightbox__img(src=images[i] id='image-' + i) | 29 | img(src=images[i] id=('image-' + i) class=`o-lightbox__img ${attributes.interactive && !i ? 'is-visible' : ''}`) |
24 | +action-button(theme=attributes.theme pill=true quiet=true icon='chevron-left' class='o-lightbox__nav-btn o-lightbox__nav-btn--prev') | ||
25 | +action-button(theme=attributes.theme pill=true quiet=true icon='chevron-right' class='o-lightbox__nav-btn o-lightbox__nav-btn--next') | ||
26 | 30 | ||
27 | img.o-lightbox__img.o-lightbox__img--default(src=images[0]) | ||
28 | if images.length > 1 | 31 | if images.length > 1 |
29 | +action-button(theme=attributes.theme pill=true quiet=true icon='chevron-left' class='o-lightbox__nav-btn o-lightbox__nav-btn--prev') | 32 | +action-button(theme=attributes.theme pill=true quiet=true icon='chevron-left' class='o-lightbox__nav-btn o-lightbox__nav-btn--prev') |
30 | +action-button(theme=attributes.theme pill=true quiet=true icon='chevron-right' class='o-lightbox__nav-btn o-lightbox__nav-btn--next') | 33 | +action-button(theme=attributes.theme pill=true quiet=true icon='chevron-right' class='o-lightbox__nav-btn o-lightbox__nav-btn--next') |
34 | |||
31 | .o-lightbox__thumbnails | 35 | .o-lightbox__thumbnails |
32 | each img, i in images | 36 | each img, i in images |
33 | - classes = i === 0 ? 'is-selected' : '' | 37 | - |
34 | a.o-lightbox__thumbnail(class=classes href='#image-' + i) | 38 | let classes = { 'is-selected': i === 0 } |
35 | img.o-lightbox__thumbnail-img(src=img) | 39 | Object.assign(classes, thumbnailClasses) |
36 | button.o-lightbox__thumbnail | 40 | |
37 | +icon('volume-2')(class='o-lightbox__thumbnail-icon') | 41 | a.o-thumbnail(class=classes href='#image-' + i) |
38 | button.o-lightbox__thumbnail | 42 | img.o-thumbnail__image(src=img) |
39 | +icon('video')(class='o-lightbox__thumbnail-icon') | 43 | button(class=thumbnailClasses) |
44 | +icon('volume-2')(class='o-thumbnail__icon') | ||
45 | button(class=thumbnailClasses) | ||
46 | +icon('video')(class='o-thumbnail__icon') | ||
diff --git a/tpl/objects/navbar.pug b/tpl/objects/navbar.pug new file mode 100644 index 0000000..5c7642c --- /dev/null +++ b/tpl/objects/navbar.pug | |||
@@ -0,0 +1,37 @@ | |||
1 | include icon.pug | ||
2 | include status-indicator.pug | ||
3 | include action-button.pug | ||
4 | |||
5 | mixin navbar | ||
6 | - | ||
7 | let classes = { | ||
8 | 'o-navbar': true, | ||
9 | 'o-navbar--quiet': attributes.quiet, | ||
10 | } | ||
11 | if (attributes.class) { | ||
12 | classes[attributes.class] = true; | ||
13 | } | ||
14 | |||
15 | div(class=classes)&attributes(attributes) | ||
16 | block | ||
17 | |||
18 | mixin navbar-item | ||
19 | - | ||
20 | let classes = { | ||
21 | 'o-navbar__item': true, | ||
22 | 'is-selected': attributes.selected, | ||
23 | } | ||
24 | if (attributes.class) { | ||
25 | classes[attributes.class] = true; | ||
26 | } | ||
27 | |||
28 | #{!!attributes.tag ? attributes.tag : 'button'}(class=classes)&attributes(attributes) | ||
29 | .o-navbar__item-content | ||
30 | if attributes.icon | ||
31 | +icon(attributes.icon) | ||
32 | = ' ' | ||
33 | span.o-navbar__item-content-text | ||
34 | block | ||
35 | if attributes.postIcon | ||
36 | = ' ' | ||
37 | +icon(attributes.postIcon) | ||