Files
swiper/styles.css

328 lines
5.3 KiB
CSS

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Arial', sans-serif;
}
body {
background-color: #f5f5f5;
color: #333;
}
.container {
max-width: 500px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
margin-bottom: 20px;
}
.subtitle {
color: #666;
margin-top: -10px;
margin-bottom: 10px;
}
.history-link {
display: inline-block;
margin-bottom: 20px;
padding: 8px 15px;
background-color: #333;
color: white;
text-decoration: none;
border-radius: 5px;
font-size: 0.9rem;
transition: background-color 0.3s;
}
.history-link:hover {
background-color: #555;
}
.swipe-container {
position: relative;
height: 400px;
margin-bottom: 20px;
perspective: 1000px;
}
.image-card {
position: absolute;
width: 100%;
height: 100%;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
transition: transform 0.3s ease-out;
transform-origin: center center;
background-color: white;
touch-action: none; /* Prevents default touch actions like scrolling */
}
.image-card img {
width: 100%;
height: 100%;
object-fit: contain;
transition: opacity 0.3s ease;
}
.loading-indicator {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #999;
font-weight: bold;
opacity: 0;
transition: opacity 0.3s;
}
.image-card.loading .loading-indicator {
opacity: 1;
}
.image-card.swiping {
transition: none; /* Remove transition during active swiping */
}
.image-card.swipe-left {
transform: translateX(-150%) rotate(-20deg);
opacity: 0;
}
.image-card.swipe-right {
transform: translateX(150%) rotate(20deg);
opacity: 0;
}
.image-card.swipe-up {
transform: translateY(-150%) rotate(5deg);
opacity: 0;
}
.image-card.swipe-down {
transform: translateY(150%) rotate(-5deg);
opacity: 0;
}
.action-hint {
position: absolute;
background-color: rgba(255, 255, 255, 0.8);
padding: 8px 15px;
border-radius: 20px;
font-weight: bold;
opacity: 0;
transition: opacity 0.3s;
}
.left-hint {
left: 10px;
top: 50%;
transform: translateY(-50%);
color: #ff4757;
}
.right-hint {
right: 10px;
top: 50%;
transform: translateY(-50%);
color: #2ed573;
}
.up-hint {
top: 10px;
left: 50%;
transform: translateX(-50%);
color: #1e90ff;
}
.down-hint {
bottom: 10px;
left: 50%;
transform: translateX(-50%);
color: #ffa502;
}
.action-buttons {
display: flex;
justify-content: center;
gap: 10px;
margin-bottom: 20px;
}
.action-btn {
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-weight: bold;
transition: all 0.2s;
}
#btn-left {
background-color: #ff4757;
color: white;
}
#btn-right {
background-color: #2ed573;
color: white;
}
#btn-up {
background-color: #1e90ff;
color: white;
}
#btn-down {
background-color: #ffa502;
color: white;
}
.action-btn:hover {
transform: scale(1.05);
}
.action-btn:active {
transform: scale(0.95);
}
.status-area {
text-align: center;
padding: 15px;
background-color: white;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
#last-action {
font-weight: bold;
margin-top: 5px;
margin-bottom: 15px;
}
.swipe-legend {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
margin-top: 10px;
}
.legend-item {
display: flex;
align-items: center;
font-size: 0.9rem;
}
.legend-color {
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
margin-right: 5px;
}
.left-color {
background-color: #ff4757;
}
.right-color {
background-color: #2ed573;
}
.up-color {
background-color: #1e90ff;
}
.down-color {
background-color: #ffa502;
}
/* Modal styles */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.9);
overflow: auto;
}
.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;
}
#fullscreen-image {
max-width: 100%;
max-height: 85vh;
object-fit: contain;
border: 2px solid white;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}
.close-modal {
position: absolute;
top: 10px;
right: 20px;
color: white;
font-size: 35px;
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);
padding: 10px 20px;
border-radius: 5px;
text-align: center;
}
/* Make the card clickable */
.image-card {
cursor: pointer;
}
.image-card::after {
content: '🔍';
position: absolute;
bottom: 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;
transition: opacity 0.3s;
}
.image-card:hover::after {
opacity: 1;
}