mirror of
https://github.com/kennethreitz/kennethreitz.org.git
synced 2026-06-05 22:50:17 +00:00
e996cb4689
Adds comprehensive mobile optimizations including responsive breakpoints, touch-friendly interfaces, and performance enhancements. Reduces sacred geometry complexity on mobile devices and implements touch gesture support with improved typography scaling for better readability across all screen sizes.
555 lines
9.8 KiB
CSS
555 lines
9.8 KiB
CSS
/* Mobile-Specific Component Styles */
|
|
|
|
/* Post Layout Mobile Optimizations */
|
|
@media (max-width: 768px) {
|
|
.post-container {
|
|
padding: 1rem;
|
|
margin: 0;
|
|
max-width: 100%;
|
|
}
|
|
|
|
.post-header {
|
|
text-align: left;
|
|
padding: 1rem 0;
|
|
border-bottom: 1px solid #e5e7eb;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.post-title {
|
|
font-size: 1.75rem !important;
|
|
line-height: 1.2;
|
|
margin-bottom: 0.5rem;
|
|
word-wrap: break-word;
|
|
hyphens: auto;
|
|
}
|
|
|
|
.post-meta {
|
|
font-size: 0.875rem;
|
|
color: #6b7280;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.post-content {
|
|
font-size: 1rem;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.post-content p {
|
|
margin-bottom: 1.25rem;
|
|
text-align: left;
|
|
}
|
|
|
|
.post-content h2 {
|
|
font-size: 1.5rem;
|
|
margin-top: 2rem;
|
|
margin-bottom: 1rem;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.post-content h3 {
|
|
font-size: 1.25rem;
|
|
margin-top: 1.5rem;
|
|
margin-bottom: 0.75rem;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.post-content img {
|
|
width: 100%;
|
|
height: auto;
|
|
border-radius: 0.5rem;
|
|
margin: 1.5rem 0;
|
|
}
|
|
|
|
.post-content pre {
|
|
font-size: 0.8rem;
|
|
line-height: 1.4;
|
|
overflow-x: auto;
|
|
-webkit-overflow-scrolling: touch;
|
|
border-radius: 0.5rem;
|
|
margin: 1rem 0;
|
|
padding: 1rem;
|
|
}
|
|
|
|
.post-content code {
|
|
font-size: 0.85rem;
|
|
padding: 0.25rem 0.4rem;
|
|
border-radius: 0.25rem;
|
|
word-break: break-word;
|
|
}
|
|
|
|
.post-content blockquote {
|
|
margin: 1.5rem 0;
|
|
padding: 1rem;
|
|
border-left: 3px solid #3b82f6;
|
|
background: #f8fafc;
|
|
border-radius: 0.5rem;
|
|
font-style: italic;
|
|
}
|
|
|
|
.post-content ul, .post-content ol {
|
|
margin: 1rem 0;
|
|
padding-left: 1.5rem;
|
|
}
|
|
|
|
.post-content li {
|
|
margin-bottom: 0.5rem;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.post-navigation {
|
|
margin-top: 2rem;
|
|
padding-top: 1.5rem;
|
|
border-top: 1px solid #e5e7eb;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.post-nav-link {
|
|
display: block;
|
|
padding: 0.75rem;
|
|
background: #f9fafb;
|
|
border-radius: 0.5rem;
|
|
text-decoration: none;
|
|
color: #374151;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.post-nav-link:hover {
|
|
background: #f3f4f6;
|
|
}
|
|
|
|
.post-nav-link .nav-direction {
|
|
font-size: 0.8rem;
|
|
color: #6b7280;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
|
|
.post-nav-link .nav-title {
|
|
font-weight: 500;
|
|
margin-top: 0.25rem;
|
|
}
|
|
}
|
|
|
|
/* Directory Layout Mobile Optimizations */
|
|
@media (max-width: 768px) {
|
|
.directory-container {
|
|
padding: 1rem;
|
|
max-width: 100%;
|
|
}
|
|
|
|
.directory-header {
|
|
text-align: center;
|
|
margin-bottom: 2rem;
|
|
padding: 1rem 0;
|
|
}
|
|
|
|
.directory-title {
|
|
font-size: 2rem !important;
|
|
line-height: 1.2;
|
|
margin-bottom: 0.5rem;
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
.directory-description {
|
|
font-size: 1rem;
|
|
color: #6b7280;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.directory-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr;
|
|
gap: 1rem;
|
|
margin: 2rem 0;
|
|
}
|
|
|
|
.directory-item {
|
|
background: #ffffff;
|
|
border: 1px solid #e5e7eb;
|
|
border-radius: 0.75rem;
|
|
padding: 1.25rem;
|
|
transition: all 0.2s;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.directory-item:hover {
|
|
border-color: #3b82f6;
|
|
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.directory-item-type {
|
|
font-size: 0.75rem;
|
|
color: #6b7280;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.directory-item-title {
|
|
font-size: 1.125rem;
|
|
font-weight: 600;
|
|
color: #1f2937;
|
|
margin-bottom: 0.5rem;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.directory-item-description {
|
|
font-size: 0.875rem;
|
|
color: #6b7280;
|
|
line-height: 1.5;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.directory-item-meta {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 0.8rem;
|
|
color: #9ca3af;
|
|
}
|
|
|
|
.directory-item-date {
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
.directory-item-icon {
|
|
width: 1rem;
|
|
height: 1rem;
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.directory-breadcrumb {
|
|
margin-bottom: 1.5rem;
|
|
padding: 0.75rem;
|
|
background: #f9fafb;
|
|
border-radius: 0.5rem;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.directory-breadcrumb a {
|
|
color: #3b82f6;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.directory-breadcrumb a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.directory-breadcrumb-separator {
|
|
margin: 0 0.5rem;
|
|
color: #9ca3af;
|
|
}
|
|
}
|
|
|
|
/* Search and Filter Mobile Styles */
|
|
@media (max-width: 768px) {
|
|
.search-container {
|
|
margin-bottom: 1.5rem;
|
|
padding: 0;
|
|
}
|
|
|
|
.search-input {
|
|
width: 100%;
|
|
padding: 0.75rem 1rem;
|
|
border: 1px solid #d1d5db;
|
|
border-radius: 0.5rem;
|
|
font-size: 1rem;
|
|
background: #ffffff;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.search-input:focus {
|
|
outline: none;
|
|
border-color: #3b82f6;
|
|
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
}
|
|
|
|
.filter-container {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.5rem;
|
|
margin: 1rem 0;
|
|
}
|
|
|
|
.filter-tag {
|
|
padding: 0.5rem 0.75rem;
|
|
background: #f3f4f6;
|
|
border: 1px solid #d1d5db;
|
|
border-radius: 9999px;
|
|
font-size: 0.8rem;
|
|
color: #374151;
|
|
text-decoration: none;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.filter-tag:hover,
|
|
.filter-tag.active {
|
|
background: #3b82f6;
|
|
color: #ffffff;
|
|
border-color: #3b82f6;
|
|
}
|
|
|
|
.sort-container {
|
|
margin: 1rem 0;
|
|
}
|
|
|
|
.sort-select {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
border: 1px solid #d1d5db;
|
|
border-radius: 0.5rem;
|
|
font-size: 0.875rem;
|
|
background: #ffffff;
|
|
}
|
|
}
|
|
|
|
/* Photo Gallery Mobile Optimizations */
|
|
@media (max-width: 768px) {
|
|
.photo-container {
|
|
padding: 1rem;
|
|
}
|
|
|
|
.photo-header {
|
|
text-align: center;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.photo-title {
|
|
font-size: 1.5rem;
|
|
margin-bottom: 0.5rem;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.photo-meta {
|
|
font-size: 0.875rem;
|
|
color: #6b7280;
|
|
}
|
|
|
|
.photo-image {
|
|
width: 100%;
|
|
height: auto;
|
|
border-radius: 0.75rem;
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
margin: 1.5rem 0;
|
|
}
|
|
|
|
.photo-description {
|
|
font-size: 1rem;
|
|
line-height: 1.6;
|
|
color: #374151;
|
|
margin: 1.5rem 0;
|
|
}
|
|
|
|
.photo-exif {
|
|
background: #f9fafb;
|
|
border-radius: 0.5rem;
|
|
padding: 1rem;
|
|
margin: 1.5rem 0;
|
|
}
|
|
|
|
.photo-exif-title {
|
|
font-weight: 600;
|
|
margin-bottom: 0.75rem;
|
|
color: #1f2937;
|
|
}
|
|
|
|
.photo-exif-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.photo-exif-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 0.5rem 0;
|
|
border-bottom: 1px solid #e5e7eb;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.photo-exif-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.photo-exif-label {
|
|
color: #6b7280;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.photo-exif-value {
|
|
color: #1f2937;
|
|
text-align: right;
|
|
}
|
|
|
|
.photo-navigation {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1rem;
|
|
margin-top: 2rem;
|
|
padding-top: 1.5rem;
|
|
border-top: 1px solid #e5e7eb;
|
|
}
|
|
|
|
.photo-nav-link {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
padding: 1rem;
|
|
background: #f9fafb;
|
|
border-radius: 0.5rem;
|
|
text-decoration: none;
|
|
color: #374151;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.photo-nav-link:hover {
|
|
background: #f3f4f6;
|
|
}
|
|
|
|
.photo-nav-thumbnail {
|
|
width: 3rem;
|
|
height: 3rem;
|
|
border-radius: 0.375rem;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.photo-nav-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.photo-nav-direction {
|
|
font-size: 0.75rem;
|
|
color: #9ca3af;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
|
|
.photo-nav-title {
|
|
font-weight: 500;
|
|
margin-top: 0.25rem;
|
|
}
|
|
}
|
|
|
|
/* Loading States for Mobile */
|
|
@media (max-width: 768px) {
|
|
.loading-skeleton {
|
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
background-size: 200% 100%;
|
|
animation: loading 1.5s infinite;
|
|
border-radius: 0.5rem;
|
|
}
|
|
|
|
.loading-text {
|
|
height: 1rem;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.loading-title {
|
|
height: 1.5rem;
|
|
width: 75%;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.loading-image {
|
|
height: 12rem;
|
|
width: 100%;
|
|
margin: 1rem 0;
|
|
}
|
|
|
|
@keyframes loading {
|
|
0% {
|
|
background-position: -200% 0;
|
|
}
|
|
100% {
|
|
background-position: 200% 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Error States for Mobile */
|
|
@media (max-width: 768px) {
|
|
.error-container {
|
|
text-align: center;
|
|
padding: 2rem 1rem;
|
|
}
|
|
|
|
.error-icon {
|
|
width: 3rem;
|
|
height: 3rem;
|
|
margin: 0 auto 1rem;
|
|
color: #ef4444;
|
|
}
|
|
|
|
.error-title {
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
color: #1f2937;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.error-message {
|
|
color: #6b7280;
|
|
margin-bottom: 1.5rem;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.error-button {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
padding: 0.75rem 1.5rem;
|
|
background: #3b82f6;
|
|
color: #ffffff;
|
|
border: none;
|
|
border-radius: 0.5rem;
|
|
font-weight: 500;
|
|
text-decoration: none;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.error-button:hover {
|
|
background: #2563eb;
|
|
}
|
|
}
|
|
|
|
/* Accessibility Improvements for Mobile */
|
|
@media (max-width: 768px) {
|
|
.sr-only {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
|
|
.focus-visible {
|
|
outline: 2px solid #3b82f6;
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.tap-target {
|
|
min-height: 44px;
|
|
min-width: 44px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.high-contrast {
|
|
border: 1px solid #000000;
|
|
}
|
|
|
|
.reduced-motion * {
|
|
animation-duration: 0.01ms !important;
|
|
animation-iteration-count: 1 !important;
|
|
transition-duration: 0.01ms !important;
|
|
}
|
|
} |