Skip to content

Commit

Permalink
modal improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
codecalm committed Dec 17, 2020
1 parent 9d4314a commit e737b9b
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 28 deletions.
11 changes: 10 additions & 1 deletion src/pages/_docs/modals.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ menu: docs.components.modals
{% capture code %}
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
{% include parts/modals/small.html %}
{% include parts/modals/danger.html %}
</div>
</div>
{% endcapture %}
{% include example.html code=code modal=true %}

{% capture code %}
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
{% include parts/modals/success.html %}
</div>
</div>
{% endcapture %}
Expand Down
18 changes: 18 additions & 0 deletions src/pages/_includes/parts/modals/danger.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% include ui/modal/close.html %}
<div class="modal-status bg-danger"></div>
<div class="modal-body text-center py-4">

{% include ui/icon.html icon="alert-triangle" color="danger" size="lg" class="mb-2" %}

<h3>Are you sure?</h3>
<div class="text-muted">Do you really want to remove 84 files? What you've done cannot be undone.</div>
</div>

<div class="modal-footer">
<div class="w-100">
<div class="row">
<div class="col">{% include ui/button.html dismiss=true text="Cancel" block=true %}</div>
<div class="col">{% include ui/button.html color="danger" dismiss=true text="Delete 84 items" block=true %}</div>
</div>
</div>
</div>
13 changes: 0 additions & 13 deletions src/pages/_includes/parts/modals/info.html

This file was deleted.

26 changes: 14 additions & 12 deletions src/pages/_includes/parts/modals/success.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<div class="modal-body">
<div class="text-center">
<div class="mb">
{% include ui/avatar.html color="green" icon="check" class="avatar-rounded" %}
</div>
<h3>Payment successful</h3>
<div class="text-muted">Your payment was successful! If you paid via PayPal, you will receive a receipt from both IT Training and PayPal. If you paid via a departmental account, the account you indicated will be charged.</div>
</div>
{% include ui/modal/close.html %}
<div class="modal-status bg-success"></div>
<div class="modal-body text-center py-4">

{% include ui/icon.html icon="circle-check" color="green" size="lg" class="mb-2" %}

<h3>Payment succedeed</h3>
<div class="text-muted">Your payment of $290 has been successfully submitted. Your invoice has been sent to support@tabler.io.</div>
</div>

<div class="mt-5">
<div class="btn-list justify-content-end">
<div class="btn">Cancel payment</div>
<div class="btn btn-success">Go to Application</div>
<div class="modal-footer">
<div class="w-100">
<div class="row">
<div class="col">{% include ui/button.html dismiss=true text="Go to dashboard" block=true %}</div>
<div class="col">{% include ui/button.html color="success" dismiss=true text="View invoice" block=true %}</div>
</div>
</div>
</div>
6 changes: 4 additions & 2 deletions src/pages/modals.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
{% include ui/button.html text="Full width modal" modal-id="full-width" %}
{% include ui/button.html text="Scrollable modal" modal-id="scrollable" %}
{% include ui/button.html text="Modal with form" modal-id="report" %}
{% include ui/button.html text="Info modal" modal-id="info" %}
{% include ui/button.html text="Success modal" modal-id="success" %}
{% include ui/button.html text="Danger modal" modal-id="danger" %}
{% include ui/button.html text="Modal with simple form" modal-id="team" %}
</div>

Expand All @@ -26,5 +27,6 @@
{% include ui/modal.html modal-id="full-width" size="full-width" %}
{% include ui/modal.html modal-id="scrollable" scrollable=true %}
{% include ui/modal.html modal-id="report" size="lg" %}
{% include ui/modal.html modal-id="info" size="sm" %}
{% include ui/modal.html modal-id="success" size="sm" %}
{% include ui/modal.html modal-id="danger" size="sm" %}
{% include ui/modal.html modal-id="team" %}
2 changes: 2 additions & 0 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ $modal-inner-padding: 1.5rem !default;
$modal-footer-border-width: 0 !default;
$modal-footer-margin-between: .75rem !default;

$modal-status-size: $border-width-wide !default;

$modal-xl: 1140px !default;
$modal-lg: 720px !default;
$modal-md: 540px !default;
Expand Down
7 changes: 7 additions & 0 deletions src/scss/ui/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@
.icon-md {
width: 2.5rem;
height: 2.5rem;
stroke-width: 1;
}

.icon-lg {
width: 3.5rem;
height: 3.5rem;
stroke-width: 1;
}
10 changes: 10 additions & 0 deletions src/scss/ui/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
}
}

.modal-status {
position: absolute;
top: 0;
left: 0;
right: 0;
height: $modal-status-size;
background: $text-muted;
border-radius: $modal-content-border-radius $modal-content-border-radius 0 0;
}

.modal-header {
align-items: center;
min-height: $modal-header-height;
Expand Down

0 comments on commit e737b9b

Please sign in to comment.