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

Create Confirm Delete Modal #96

Merged
merged 6 commits into from
Mar 9, 2024
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
56 changes: 53 additions & 3 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ p a{



.icon-top-left {
.icon-top-right {
position: absolute;
top: -7%;
left: -7%;
right: -7%;
}

.add-deck h3 {
Expand Down Expand Up @@ -284,4 +284,54 @@ p a{
position: absolute;
width: 80%;
bottom: 7%;
}
}

/* Confirm Delete Modal */

.modal-container {
padding: 16px;
text-align: center;
padding-bottom: 10%;
}

.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.5);
padding-top: 35%;
}

.modal-content {
background-color: #fafafa;
margin: 5% auto 15% auto;
border: 1px solid #888;
width: 80%;
border-radius: 7rem;
}

.close {
position: absolute;
right: 35px;
top: 15px;
font-size: 40px;
font-weight: bold;
color: #f1f1f1;
}

.frog-image {
height: 500px;
}

.deck-link {
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
Binary file added static/images/are_you_shore_frog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/images/otter2 copy.gif
Binary file not shown.
2 changes: 1 addition & 1 deletion templates/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3 id="next-question"> START </h3>
<form method="post" id="card-form" style="display: none">
<div class="question-box">
<div class="card-question">
<div id="close-icon" class="icon-top-left">
<div id="close-icon" class="icon-top-right">
<span class="fa-stack fa-4x">
<i class="fa-solid fa-circle fa-stack-2x " style="color:#eae1df"></i>
<i class="fa-solid fa-xmark fa-stack-1x" style="color:#382c2b"></i>
Expand Down
52 changes: 40 additions & 12 deletions templates/decks.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,48 @@ <h3>{{ deck.title }}</h3>
{% endfor %}

{% for deck in personalDecks %}
<a href="{{ url_for('displayDeck', username=username, deckTitle=deck.title) }}" style="text-decoration:none" class="deck-link">
<div class="personal-deck" >
<object>
<a href="{{ url_for('deleteDeck', username=username, deckTitle=deck.title) }}" class="icon-top-left">
<span class="fa-stack fa-4x">
<i class="fa-solid fa-circle fa-stack-2x " style="color:#eae1df"></i>
<i class="fa-regular fa-trash-can fa-stack-1x fa-inverse " style="color:#382c2b"></i>
</span>
</a>
</object>
<div class="personal-deck" >
<a href="{{ url_for('displayDeck', username=username, deckTitle=deck.title) }}" style="text-decoration:none" class="deck-link">
<h3>{{ deck.title }}</h3>
</a>
<div onclick="document.getElementById('modal-{{ deck.title }}').style.display='block'" class="icon-top-right">
<span class="fa-stack fa-4x">
<i class="fa-solid fa-circle fa-stack-2x " style="color:#eae1df"></i>
<i class="fa-regular fa-trash-can fa-stack-1x fa-inverse " style="color:#382c2b"></i>
</span>
</div>
</a>
</div>

<div id="modal-{{ deck.title }}" class="modal">
<form class="modal-content">
<div class="modal-container">
<h3>Delete Deck</h3>
<img class="frog-image" src="/static/images/are_you_shore_frog.png" alt="are_you_shore_frog.png">
<div class="button-container">
<button type="button" class="button" onclick="document.getElementById('modal-{{ deck.title }}').style.display='none'">Cancel</button>
<a href="{{ url_for('deleteDeck', username=username, deckTitle=deck.title) }}">
<button type="button" class="button2">Delete</button>
</a>
</div>
</div>
</form>
</div>

<!-- script to have modal close upon click outside -->
<script>
// get modal
var modal = document.getElementById('modal-{{ deck.title }}');

// when user clicks outside modal, close
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
{% endfor %}



<script>
const searchBar = document.getElementById("searchBar");
Expand All @@ -50,7 +78,7 @@ <h3>{{ deck.title }}</h3>
{% if isAuth %}

<form action="{{ url_for('createDeck', username=username) }}" class="personal-deck" method="post" id="add-deck-form" style="display: none">
<div id="close-icon" class="icon-top-left">
<div id="close-icon" class="icon-top-right">
<span class="fa-stack fa-4x">
<i class="fa-solid fa-circle fa-stack-2x " style="color:#eae1df"></i>
<i class="fa-solid fa-xmark fa-stack-1x" style="color:#382c2b"></i>
Expand Down
Loading