This commit is contained in:
Aodhan
2025-06-20 22:27:24 +01:00
parent c09461f58f
commit 324a21800a
10 changed files with 1022 additions and 1866 deletions

View File

@@ -1,21 +1,33 @@
:root {
--primary-color: #1e90ff;
--success-color: #2ed573;
--danger-color: #ff4757;
--warning-color: #ffa502;
--light-color: #f5f5f5;
--dark-color: #333;
--background-color: #f0f2f5;
--card-background: #ffffff;
--text-color: #333;
--border-radius: 12px;
--shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Arial', sans-serif;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
html, body {
background-color: #f5f5f5;
color: #333;
background-color: var(--background-color);
color: var(--text-color);
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
}
.container {
max-width: 500px;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
display: flex;
@@ -25,94 +37,77 @@ html, body {
.header {
text-align: center;
margin-bottom: 10px;
margin-bottom: 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.subtitle {
color: #666;
margin-top: -10px;
margin-bottom: 10px;
.app-title {
font-size: 2rem;
font-weight: 700;
display: inline-flex;
align-items: center;
gap: 10px;
color: var(--dark-color);
}
.app-title i {
color: var(--primary-color);
}
.history-link {
display: inline-block;
margin-bottom: 10px;
padding: 5px 12px;
background-color: #333;
padding: 8px 16px;
background-color: var(--primary-color);
color: white;
text-decoration: none;
border-radius: 5px;
border-radius: var(--border-radius);
font-size: 0.9rem;
transition: background-color 0.3s;
transition: background-color 0.3s, transform 0.2s;
}
.history-link:hover {
background-color: #555;
background-color: #1c86e3;
transform: translateY(-2px);
}
.main-section {
display: flex;
gap: 24px;
flex: 1;
align-items: flex-start;
}
.swipe-container {
position: relative;
flex: 1;
min-height: 400px;
margin-bottom: 20px;
flex: 3;
min-height: 70vh;
perspective: 1000px;
border-radius: var(--border-radius);
background: var(--card-background);
box-shadow: var(--shadow);
border-style: solid;
border-width: 8px;
border-left-color: #ff4757; /* Red - Left (Discard) */
border-right-color: #2ed573; /* Green - Right (Keep) */
border-top-color: #1e90ff; /* Blue - Top (Favorite) */
border-bottom-color: #ffa502; /* Yellow - Bottom (Review Later) */
border-radius: 15px;
border-width: 6px;
border-left-color: var(--danger-color);
border-right-color: var(--success-color);
border-top-color: var(--primary-color);
border-bottom-color: var(--warning-color);
}
.image-card {
position: absolute;
width: 100%;
height: 100%;
border-radius: 10px;
border-radius: var(--border-radius);
overflow: hidden;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
transition: transform 0.3s ease-out;
transition: transform 0.5s ease-out, opacity 0.5s ease-out;
transform-origin: center center;
background-color: white;
touch-action: none; /* Prevents default touch actions like scrolling */
cursor: grab; /* Indicates the card is draggable */
}
/* Animation for new card sliding in from left (desktop) */
@keyframes slideInFromLeft {
0% {
transform: translateX(-100%) rotate(-5deg);
opacity: 0;
}
100% {
transform: translateX(0) rotate(0deg);
opacity: 1;
}
}
.image-card.new-card {
animation: slideInFromLeft 0.25s ease-out forwards;
will-change: transform, opacity;
}
/* Simple fade-in animation for mobile */
@keyframes fadeIn {
0% {
opacity: 0.4;
}
100% {
opacity: 1;
}
}
.image-card.new-card-mobile {
animation: fadeIn 0.2s ease-out forwards;
will-change: opacity;
}
.image-card:active {
cursor: grabbing; /* Changes cursor when actively dragging */
background-color: var(--card-background);
touch-action: none;
cursor: grab;
display: flex;
align-items: center;
justify-content: center;
}
.image-card img {
@@ -120,17 +115,19 @@ html, body {
height: 100%;
object-fit: contain;
transition: opacity 0.3s ease;
pointer-events: none;
}
.loading-indicator {
.loading-indicator, .no-images-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #999;
font-weight: bold;
opacity: 0;
transition: opacity 0.3s;
font-size: 1.2rem;
text-align: center;
padding: 20px;
}
.image-card.loading .loading-indicator {
@@ -138,126 +135,111 @@ html, body {
}
.image-card.swiping {
transition: none; /* Remove transition during active swiping */
}
.image-card.swipe-left {
transform: translateX(-350%) rotate(-15deg);
opacity: 0;
transition: transform 0.5s ease-out, opacity 0.25s ease-out;
}
.image-card.swipe-right {
transform: translateX(350%) rotate(15deg);
opacity: 0;
transition: transform 0.5s ease-out, opacity 0.25s ease-out;
}
.image-card.swipe-up {
transform: translateY(-350%) rotate(5deg);
opacity: 0;
transition: transform 0.5s ease-out, opacity 0.25s ease-out;
}
.image-card.swipe-down {
transform: translateY(350%) rotate(-5deg);
opacity: 0;
transition: transform 0.5s ease-out, opacity 0.25s ease-out;
transition: none;
}
.action-hint {
position: absolute;
background-color: rgba(255, 255, 255, 0.8);
background-color: rgba(0, 0, 0, 0.7);
color: white;
padding: 8px 15px;
border-radius: 20px;
font-weight: bold;
opacity: 0;
transition: opacity 0.3s;
z-index: 10;
}
.left-hint {
left: 10px;
top: 50%;
transform: translateY(-50%);
color: #ff4757;
.left-hint { left: 20px; top: 50%; transform: translateY(-50%); }
.right-hint { right: 20px; top: 50%; transform: translateY(-50%); }
.up-hint { top: 20px; left: 50%; transform: translateX(-50%); }
.down-hint { bottom: 20px; left: 50%; transform: translateX(-50%); }
.side-panel {
flex: 1;
display: flex;
flex-direction: column;
gap: 20px;
position: sticky;
top: 20px;
min-width: 300px;
}
.right-hint {
right: 10px;
top: 50%;
transform: translateY(-50%);
color: #2ed573;
.filter-controls, .action-buttons, .status-area {
background-color: var(--card-background);
padding: 20px;
border-radius: var(--border-radius);
box-shadow: var(--shadow);
}
.up-hint {
top: 10px;
left: 50%;
transform: translateX(-50%);
color: #1e90ff;
.filter-controls h4, .action-buttons h4, .status-area h4 {
margin-top: 0;
margin-bottom: 15px;
color: var(--dark-color);
font-size: 1.1rem;
}
.down-hint {
bottom: 10px;
left: 50%;
transform: translateX(-50%);
color: #ffa502;
.filter-buttons {
display: flex;
gap: 10px;
}
.filter-btn {
flex: 1;
padding: 10px;
border: 1px solid #ddd;
border-radius: var(--border-radius);
background-color: var(--light-color);
color: var(--dark-color);
cursor: pointer;
font-weight: 500;
transition: all 0.2s;
}
.filter-btn:hover {
background-color: #e0e0e0;
border-color: #ccc;
}
.filter-btn.active {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.action-buttons {
display: flex;
justify-content: space-between;
margin: 15px 0 20px;
width: 100%;
flex-direction: column;
gap: 10px;
}
.action-btn {
flex: 1;
padding: 12px 5px;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
padding: 15px;
border: none;
border-radius: 5px;
border-radius: var(--border-radius);
cursor: pointer;
font-weight: bold;
transition: all 0.2s;
margin: 0 5px;
text-align: center;
font-size: 0.9rem;
white-space: nowrap;
}
#btn-left {
background-color: #ff4757;
font-size: 1rem;
color: white;
}
#btn-right {
background-color: #2ed573;
color: white;
}
#btn-up {
background-color: #1e90ff;
color: white;
}
#btn-down {
background-color: #ffa502;
color: white;
}
#btn-left { background-color: var(--danger-color); }
#btn-right { background-color: var(--success-color); }
#btn-up { background-color: var(--primary-color); }
#btn-down { background-color: var(--warning-color); }
.action-btn:hover {
transform: scale(1.05);
}
.action-btn:active {
transform: scale(0.95);
filter: brightness(1.1);
}
.status-area {
text-align: center;
padding: 15px;
background-color: white;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
text-align: left;
}
#last-action {
@@ -267,9 +249,8 @@ html, body {
}
.swipe-legend {
display: flex;
flex-wrap: wrap;
justify-content: center;
display: grid;
grid-template-columns: 1fr;
gap: 10px;
margin-top: 10px;
}
@@ -285,82 +266,34 @@ html, body {
width: 15px;
height: 15px;
border-radius: 50%;
margin-right: 5px;
margin-right: 8px;
}
.left-color {
background-color: #ff4757;
.left-color { background-color: var(--danger-color); }
.right-color { background-color: var(--success-color); }
.up-color { background-color: var(--primary-color); }
.down-color { background-color: var(--warning-color); }
.toast {
position: fixed;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
background-color: rgba(0, 0, 0, 0.85);
color: #fff;
padding: 12px 24px;
border-radius: var(--border-radius);
opacity: 0;
transition: opacity 0.3s ease, transform 0.3s ease;
z-index: 2000;
pointer-events: none;
}
.right-color {
background-color: #2ed573;
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(-10px);
}
.up-color {
background-color: #1e90ff;
}
.down-color {
background-color: #ffa502;
}
/* Mobile-specific styles */
@media (max-width: 768px) {
.container {
padding: 10px;
max-width: 100%;
}
/* Override desktop animation for mobile */
.image-card.new-card {
animation: none;
}
.swipe-container {
min-height: 60vh;
margin: 10px 0 15px;
}
.header {
margin-bottom: 10px;
}
/* Hide action buttons on mobile as swiping is the primary interaction */
.action-buttons {
display: none;
}
/* Hide the swipe legend on mobile to save space */
.swipe-legend {
display: none;
}
/* Make sure the history link is prominent but compact */
.history-link {
display: block;
text-align: center;
margin: 8px auto;
padding: 6px 15px;
font-size: 0.9rem;
}
/* Enhance swipe hints for better visibility on mobile */
.swipe-actions .action-hint {
font-size: 0.9rem;
padding: 5px;
background-color: rgba(0, 0, 0, 0.5);
color: white;
border-radius: 4px;
}
/* Adjust modal for mobile */
.modal-content {
width: 90%;
margin: 20% auto;
}
}
/* Modal styles */
.modal {
display: none;
position: fixed;
@@ -371,17 +304,13 @@ html, body {
height: 100%;
background-color: rgba(0, 0, 0, 0.9);
overflow: auto;
align-items: center;
justify-content: center;
}
.modal-content {
position: relative;
margin: auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 90%;
height: 90%;
max-width: 1200px;
padding: 20px;
}
@@ -390,55 +319,146 @@ html, body {
max-width: 100%;
max-height: 85vh;
object-fit: contain;
border: 2px solid white;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
border-radius: var(--border-radius);
box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}
.close-modal {
position: absolute;
top: 10px;
right: 20px;
top: 15px;
right: 30px;
color: white;
font-size: 35px;
font-size: 40px;
font-weight: bold;
cursor: pointer;
z-index: 1001;
}
.close-modal:hover,
.close-modal:focus {
color: #bbb;
text-decoration: none;
}
.modal-info {
margin-top: 15px;
color: white;
background-color: rgba(0, 0, 0, 0.5);
background-color: rgba(0, 0, 0, 0.7);
padding: 10px 20px;
border-radius: 5px;
border-radius: var(--border-radius);
text-align: center;
}
/* Make the card clickable */
.image-card {
cursor: pointer;
.history-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.image-card::after {
content: '🔍';
.selection-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 20px;
}
.selection-item {
background-color: var(--card-background);
border-radius: var(--border-radius);
box-shadow: var(--shadow);
overflow: hidden;
position: relative;
transition: transform 0.2s, box-shadow 0.2s;
}
.selection-item.selected {
box-shadow: 0 0 0 3px var(--primary-color), var(--shadow);
transform: translateY(-5px);
}
.selection-item img {
width: 100%;
height: 200px;
object-fit: cover;
}
.selection-info {
padding: 15px;
font-size: 0.9rem;
}
.selection-action {
position: absolute;
bottom: 10px;
top: 10px;
right: 10px;
background-color: rgba(255, 255, 255, 0.7);
color: #333;
padding: 5px 10px;
border-radius: 50%;
font-size: 16px;
opacity: 0.7;
border-radius: 20px;
color: white;
font-weight: bold;
font-size: 0.8rem;
}
.action-left { background-color: var(--danger-color); }
.action-right { background-color: var(--success-color); }
.action-up { background-color: var(--primary-color); }
.action-down { background-color: var(--warning-color); }
.selection-checkbox-container {
position: absolute;
top: 10px;
left: 10px;
z-index: 5;
}
.selection-checkbox {
width: 20px;
height: 20px;
}
.selection-controls {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: space-around;
padding: 8px 0;
opacity: 0;
transition: opacity 0.3s;
}
.image-card:hover::after {
.selection-item:hover .selection-controls {
opacity: 1;
}
.control-btn {
background: none;
border: none;
color: white;
cursor: pointer;
font-size: 1rem;
}
@media (max-width: 992px) {
.container {
padding: 10px;
}
.main-section {
flex-direction: column;
}
.side-panel {
position: static;
width: 100%;
}
.action-buttons {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: var(--card-background);
padding: 10px;
box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
z-index: 1500;
flex-direction: row;
border-radius: 0;
}
.swipe-container {
min-height: 60vh;
}
.swipe-legend {
display: none;
}
}