Skip to content

Commit cc716de

Browse files
committed
Add modals
1 parent df6ec61 commit cc716de

4 files changed

Lines changed: 65 additions & 22 deletions

File tree

landing/templates/components.jade

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919

2020
+playground('footer')
2121
include ../../lib/footer/demo
22+
23+
section
24+
25+
h2#modals Modals
26+
p Donec ullamcorper nulla non metus auctor fringilla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean lacinia bibendum nulla sed consectetur. Donec ullamcorper nulla non metus auctor fringilla.
27+
28+
+playground('modal')
29+
include ../../lib/modal/demo
2230

2331
br
2432
br

landing/templates/utils/mixins.jade

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ mixin header(title, img, description)
55
p= description || 'Lorem ipsum dolor sit amet, consectetur adipiscing elit quis risus eget urna mollis.'
66

77

8-
mixin playground(name)
8+
mixin playground(name, noAlternate)
99
- var path = 'lib/' + name + '/demo'
10+
- var darkVersion = (!darkVersion) ? true : false
1011

1112
.playground.js-playground(data-src!=path)
12-
.playground-options
13-
ul.nav.nav-pills
14-
li.active
15-
a(href="#", data-set-mode="light") Light
16-
li
17-
a(href="#", data-set-mode="dark") Dark
13+
if !noAlternate
14+
.playground-options
15+
ul.nav.nav-pills
16+
li.active
17+
a(href="#", data-set-mode="light") Light
18+
li
19+
a(href="#", data-set-mode="dark") Dark
1820

1921
.tab-content
2022
.tab-pane.playground-canvas.active(id!=name + '-component')

lib/modal/demo.jade

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
.modal-container
3-
button.btn.btn-primary.btn-lg(type='button', data-toggle='modal', data-target='#myModal')
3+
button.btn.btn-primary.btn-lg(type='button', data-toggle='modal', data-target='#modal-sample')
44
| Launch demo modal
55
Modal
66

7-
#myModal.modal(tabindex='-1', role='dialog', aria-labelledby='myModalLabel', aria-hidden='true')
7+
#modal-sample.modal(tabindex='-1', role='dialog', aria-labelledby='myModalLabel', aria-hidden='true')
8+
.modal-backdrop
89
.modal-dialog
910
.modal-content
1011
.modal-header
@@ -16,4 +17,4 @@
1617
| ...
1718
.modal-footer
1819
//- button.btn.btn-default(type='button', data-dismiss='modal') Close
19-
button.btn.btn-primary(type='button') Save changes
20+
button.btn.btn-primary(type='button') Save changes

lib/modal/index.styl

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
/*========== Modal ==========*/
2-
.modal
3-
background: rgba(26,53,71,.85);
2+
.modal
3+
background: none;
44
opacity: 0;
55
transition: .5s;
66

7-
&.in
7+
.modal-backdrop
8+
background: rgba(244, 241, 241, 0.95);
9+
opacity: 1;
10+
z-index: 0;
11+
12+
.theme-dark &
13+
background: rgba(black, 0.75);
14+
15+
&.in
816
opacity: 1;
917
pointer-events: auto;
1018

@@ -21,13 +29,27 @@
2129
transition-delay: .2s;
2230
opacity: 0;
2331
transition: .4s;
24-
overflow: hidden
32+
overflow: hidden;
33+
34+
.alert button.close
35+
font-size: 20px;
2536

2637
.modal-content
27-
box-shadow: 0 5px 12px rgba(15,27,39,.4);
28-
38+
overflow: hidden;
39+
-webkit-box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
40+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
41+
border: 0;
42+
2943
.modal-header
3044
border-bottom: 0;
45+
padding-left: 0;
46+
padding-right: 0;
47+
position: relative;
48+
49+
.nav-tabs
50+
margin-bottom: 0;
51+
margin-top: 20px;
52+
3153

3254
.modal-title
3355
font-weight: font-weight-bold
@@ -40,21 +62,31 @@
4062
opacity: .8;
4163
background-size: 100%;
4264
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAFNUlEQVRYCa1XSU8cRxSuelXdTAaGMROwPRiMcJATQ3xISLwkccQhOUS28Sm/kkMEtqVEygHJdkgikYsFUQg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JCGojwGWIBTzYy9TxpYDC0k6KvFUshFrhaIDthlHFzrNrh2mRpwtGUlhIQFAHttxeWN25ELDA9PS3SCh8yeoI3tZm4FwaDSe+0lADspAyUYz/EgFj8HOTkO5pqlCWyoySNzt4vxj+26ygYu58EauDb+4ONuui2dHGjxRC8Ovpujw8R1cjHEeOLwXR4F43Zt83DTONrJK0c2DLD2/S2ENLQc0NP14lW8c0duLXlmalF1B1k6VKhGPQ7UVDYHphHIb7Juk4Dg7zWUuII6XmJgjpIBGPow7oDC6Gg/q/He7VoJJvWPPr8qp3xAWCMk+OcmUY0wTJGZzR6mwDhk2Tgzr1B5aW3pwj+LD5w2EHlyaOl8Cs2cBkqwIOb5XzlbXN+FiqTZaAO1BUGg9TBM8iyzs/P6+9vfbazWpN5rbRr989yRMvc6O1YmpiYOFElmlwWVoruu/zNg3LqnQozZJzjnfnv6WQ1ahnL3uQyu4kjMmB2LhV7XhATluGzd5obGSgLZSaB8fVmFX7lux+LXu2g2zyw2rPy+ApMBsak9/LXid0sfIkuS2IeGxvjL0V7gRMoeEo4THNHUuU3a0yDwBbCAe4Jovav8MN9LAdJsuL2/we/urKeUsCFcAAAAABJRU5ErkJggg==');
43-
44-
&:hover
65+
margin-top: 0;
66+
position: absolute
67+
margin-right: 15px;
68+
right: 0;
69+
top: 15px;
70+
71+
&:hover
4572
opacity: 1;
4673
&:focus
4774
outline: none;
4875

4976
.modal-body
50-
max-height: 540px;
5177
overflow-y: auto;
5278
border: 0;
79+
max-height: none;
80+
min-height: 70px;
81+
padding: 20px 35px;
5382

54-
.modal-footer
83+
.modal-title
84+
line-height: 1;
85+
font-size: 16px;
86+
87+
.modal-footer
5588
text-align: center
56-
// border-color: #f1f1f1;
57-
// border: 0;
89+
5890
.btn
5991
font-size: 11px;
6092

0 commit comments

Comments
 (0)