Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: center modal and gray back #109

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,24 @@
/* The Modal (background) */
.si-terms-of-use-modal-block {
position: absolute; /* Stay in place */
top: 15%;
left: 25%;
display: none; /* Hidden by default */
align-self: center;
overflow: auto; /* Enable scroll if needed */
max-width: 600px;
height: 100%; /* Full height */
z-index: 5; /* Sit on top */

@media (max-width: 767px) {
top: 0;
left: 0;
}
display: flex;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.4);
z-index: 7; /* Sit on top */
}

/* Modal Content/Box */
.si-terms-of-use-modal-group {
margin: 4% auto;
padding: 1.25rem;
width: 92%;
max-width: 600px;
background-color: $white;
border: 1px solid $sinai-primary-dk;
z-index: 5; /* Sit on top */
}

.si-terms-of-use-modal-title {
Expand All @@ -35,10 +31,6 @@
align-self: flex-start;
color: $sinai-primary-dk;
text-transform: uppercase;

@media (max-width: 800px) {
font-size: $text-20;
}
}

.si-terms-of-use-modal-content {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def display_term_of_use?
if term_of_use_cookie?
@term_of_use_modal_option = "none"
else
@term_of_use_modal_option = "block"
@term_of_use_modal_option = "flex"
set_term_of_use_cookie
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/blacklight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<%= render 'catalog/banners/homepage_banner' %>

<!-- TERMS OF USE MODAL -->
<% if @term_of_use_modal_option == "block" %>
<div id="termsOfUseModal" style="display: block" class="si-terms-of-use-modal-block">
<% if @term_of_use_modal_option == "flex" %>
<div id="termsOfUseModal" style="display: flex" class="si-terms-of-use-modal-block">
<!-- Modal content -->
<div class="si-terms-of-use-modal-group">
<div class='si-terms-of-use-modal-title'>Sinai Manuscripts Digital Library</div>
Expand Down