Skip to content

Commit

Permalink
fix(ui): Improve dropdown styling and functionality; reduce spacing i…
Browse files Browse the repository at this point in the history
…n create list section and add custom dropdown arrow for enhanced usability
  • Loading branch information
CarlKho-Minerva committed Nov 3, 2024
1 parent 64196f0 commit faa6dd8
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 11 deletions.
Binary file modified app/medieval_todos.db
Binary file not shown.
67 changes: 67 additions & 0 deletions app/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -867,4 +867,71 @@ input[type="email"] {
margin-bottom: 1rem;
margin-left: 2.5rem; /* Match the level-1 indentation */
padding-left: 1rem;
}

/* Further reduce create list spacing */
.create-list {
margin-top: 0; /* Remove top margin */
}

.create-list h2 {
margin-top: 0; /* Remove top margin from heading */
margin-bottom: 1rem; /* Add some space before the form */
}

/* Improve dropdown styling */
select {
height: 2.5rem;
padding: 0 1rem;
background: rgba(0, 0, 0, 0.2);
border: 1px solid rgba(192, 160, 128, 0.3);
border-radius: 4px;
color: var(--text-color);
font-family: 'Open Sans', sans-serif;
font-size: 0.9em;
cursor: pointer;
transition: all 0.3s ease;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
min-width: 200px;
position: relative;
}

/* Add custom dropdown arrow */
.select-wrapper {
position: relative;
display: inline-block;
}

.select-wrapper::after {
content: '\f107'; /* FontAwesome chevron-down */
font-family: 'Font Awesome 6 Free';
font-weight: 900;
position: absolute;
right: 1rem;
top: 50%;
transform: translateY(-50%);
color: var(--accent-color);
pointer-events: none;
}

select:hover {
border-color: var(--accent-color);
background: rgba(0, 0, 0, 0.3);
}

select:focus {
outline: none;
border-color: var(--secondary-color);
background: rgba(0, 0, 0, 0.4);
}

/* Style dropdown options */
select option {
background-color: var(--primary-color);
color: var(--text-color);
padding: 0.5rem 1rem;
}
1 change: 0 additions & 1 deletion app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<nav class="navbar">
<div class="navbar-brand">
<a href="{{ url_for('todos.index') }}" class="navbar-logo">
<i class="fas fa-scroll"></i>
<span>Medieval Task List</span>
</a>
</div>
Expand Down
24 changes: 14 additions & 10 deletions app/templates/todos.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ <h3><i class="fas fa-book-open"></i> {{ list.title }}</h3>
<div class="modal-content">
<h3>Move Task to Another List</h3>
<form method="POST" id="moveItemForm" data-ajax="true">
<select name="list_id" required>
{% for list in lists %}
<option value="{{ list.id }}">{{ list.title }}</option>
{% endfor %}
</select>
<div class="select-wrapper">
<select name="list_id" required>
{% for list in lists %}
<option value="{{ list.id }}">{{ list.title }}</option>
{% endfor %}
</select>
</div>
<button type="submit" class="btn btn-primary">Move</button>
<button type="button" class="btn btn-secondary" onclick="closeMoveModal()">Cancel</button>
</form>
Expand All @@ -181,11 +183,13 @@ <h4>Move Item</h4>
<form id="move-item-form">
<input type="hidden" name="item_id" id="move-item-id">
<div class="input-field">
<select name="list_id" id="move-item-list-id">
{% for list in lists %}
<option value="{{ list.id }}">{{ list.title }}</option>
{% endfor %}
</select>
<div class="select-wrapper">
<select name="list_id" id="move-item-list-id">
{% for list in lists %}
<option value="{{ list.id }}">{{ list.title }}</option>
{% endfor %}
</select>
</div>
<label for="move-item-list-id">Select List</label>
</div>
<button type="submit" class="btn">Move</button>
Expand Down

0 comments on commit faa6dd8

Please sign in to comment.