Implement modern media gallery with enhanced features
Some checks failed
continuous-integration/drone/push Build is failing

- Fix CSS loading issue in project_detail.html template
- Add comprehensive ModernMediaGallery JavaScript class with touch navigation
- Implement glassmorphism design with backdrop-filter effects
- Add responsive breakpoint system for mobile devices
- Include embedded critical CSS styles for gallery functionality
- Add technology sidebar with vertical list layout and hover effects
- Support for images, videos, and embedded content with thumbnails
- Add lightbox integration and media type badges
- Implement progress bar and thumbnail navigation
- Add keyboard controls (arrow keys) and touch swipe gestures
- Include supplementary styles for video/embed placeholders
- Fix template block naming compatibility (extra_css → extra_styles)
This commit is contained in:
2025-11-26 18:52:07 +09:00
parent 8e1751ef5d
commit b51d79c5a1
18 changed files with 9277 additions and 353 deletions

View File

@@ -0,0 +1,589 @@
/* Современная медиа-галерея */
.modern-media-gallery {
background: white;
border-radius: 24px;
overflow: hidden;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
border: 1px solid #f1f5f9;
margin-bottom: 3rem;
}
/* Основное медиа */
.main-media-container {
position: relative;
aspect-ratio: 16/10;
overflow: hidden;
background: #f8fafc;
}
.main-media-wrapper {
position: relative;
width: 100%;
height: 100%;
}
.main-media-item {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 0.5s ease;
}
.main-media-item.active {
opacity: 1;
}
.main-media-img,
.main-media-video {
width: 100%;
height: 100%;
object-fit: cover;
cursor: pointer;
}
.embed-container {
position: relative;
width: 100%;
height: 100%;
}
.main-media-embed {
width: 100%;
height: 100%;
border: none;
}
/* Overlay с информацией */
.media-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
padding: 2rem;
color: white;
opacity: 0;
transition: opacity 0.3s ease;
display: flex;
justify-content: space-between;
align-items: end;
}
.main-media-item:hover .media-overlay {
opacity: 1;
}
.media-info {
flex: 1;
}
.media-title {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 0.25rem;
}
.media-meta {
font-size: 0.9rem;
opacity: 0.8;
}
.media-action-btn {
width: 48px;
height: 48px;
background: rgba(255, 255, 255, 0.2);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
cursor: pointer;
transition: all 0.3s ease;
margin-left: 1rem;
}
.media-action-btn:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.1);
}
/* Навигационные кнопки */
.media-nav-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 48px;
height: 48px;
background: rgba(255, 255, 255, 0.9);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
border: none;
border-radius: 50%;
color: #4f46e5;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.1rem;
cursor: pointer;
opacity: 0;
transition: all 0.3s ease;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.main-media-wrapper:hover .media-nav-btn {
opacity: 1;
}
.prev-btn {
left: 20px;
}
.next-btn {
right: 20px;
}
.media-nav-btn:hover {
background: white;
transform: translateY(-50%) scale(1.1);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
/* Миниатюры */
.thumbnails-container {
padding: 1.5rem;
background: #fafbfc;
border-top: 1px solid #f1f5f9;
}
.thumbnails-wrapper {
display: flex;
gap: 12px;
overflow-x: auto;
padding-bottom: 8px;
}
/* Для Firefox */
.thumbnails-wrapper {
scrollbar-width: thin;
scrollbar-color: #cbd5e0 transparent;
}
/* Для Webkit браузеров */
.thumbnails-wrapper::-webkit-scrollbar {
height: 6px;
}
.thumbnails-wrapper::-webkit-scrollbar-track {
background: transparent;
}
.thumbnails-wrapper::-webkit-scrollbar-thumb {
background: #cbd5e0;
border-radius: 3px;
}
.thumbnail-item {
position: relative;
width: 80px;
height: 60px;
border-radius: 8px;
overflow: hidden;
cursor: pointer;
transition: all 0.3s ease;
flex-shrink: 0;
border: 2px solid transparent;
}
.thumbnail-item:hover {
transform: scale(1.05);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.thumbnail-item.active {
border-color: #4f46e5;
transform: scale(1.05);
box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.thumbnail-img {
width: 100%;
height: 100%;
object-fit: cover;
}
.video-thumbnail-placeholder,
.embed-thumbnail-placeholder {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 1.5rem;
}
.media-type-badge {
position: absolute;
top: 4px;
right: 4px;
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.7rem;
color: white;
}
.media-type-badge.video {
background: #ef4444;
}
.media-type-badge.embed {
background: #06b6d4;
}
.thumbnail-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.3s ease;
}
.thumbnail-item:hover .thumbnail-overlay {
opacity: 1;
}
.thumbnail-number {
color: white;
font-weight: 600;
font-size: 0.9rem;
}
/* Индикатор прогресса */
.gallery-progress {
height: 4px;
background: #f1f5f9;
position: relative;
overflow: hidden;
}
.progress-bar {
height: 100%;
background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
transition: width 0.4s ease;
border-radius: 2px;
}
/* Placeholder для проектов без изображений */
.project-placeholder-image {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #64748b;
text-align: center;
}
.project-placeholder-image i {
font-size: 4rem;
margin-bottom: 1rem;
opacity: 0.5;
}
.project-placeholder-image p {
font-size: 1.1rem;
font-weight: 500;
margin: 0;
opacity: 0.7;
}
/* Адаптивность */
@media (max-width: 1024px) {
.main-media-container {
aspect-ratio: 16/9;
}
.media-overlay {
padding: 1.5rem;
}
.thumbnails-container {
padding: 1rem;
}
.thumbnail-item {
width: 70px;
height: 52px;
}
}
@media (max-width: 768px) {
.modern-media-gallery {
border-radius: 16px;
margin-bottom: 2rem;
}
.media-overlay {
padding: 1rem;
background: rgba(0, 0, 0, 0.7);
opacity: 1;
}
.media-nav-btn {
opacity: 1;
width: 40px;
height: 40px;
font-size: 1rem;
}
.prev-btn {
left: 12px;
}
.next-btn {
right: 12px;
}
.thumbnails-container {
padding: 0.75rem;
}
.thumbnail-item {
width: 60px;
height: 45px;
}
.media-action-btn {
width: 40px;
height: 40px;
font-size: 1rem;
}
}
/* HTML-контент в описании проекта */
.description-text h1,
.description-text h2,
.description-text h3,
.description-text h4,
.description-text h5,
.description-text h6 {
margin-top: 2rem;
margin-bottom: 1rem;
font-weight: 600;
color: #1a202c;
}
.description-text h1 { font-size: 2rem; }
.description-text h2 { font-size: 1.75rem; }
.description-text h3 { font-size: 1.5rem; }
.description-text h4 { font-size: 1.25rem; }
.description-text h5 { font-size: 1.1rem; }
.description-text h6 { font-size: 1rem; }
.description-text p {
margin-bottom: 1.2rem;
line-height: 1.8;
}
.description-text ul,
.description-text ol {
margin: 1.5rem 0;
padding-left: 2rem;
}
.description-text li {
margin-bottom: 0.5rem;
line-height: 1.7;
}
.description-text blockquote {
border-left: 4px solid #4f46e5;
padding-left: 1.5rem;
margin: 2rem 0;
font-style: italic;
background: #f8fafc;
padding: 1.5rem;
border-radius: 8px;
}
.description-text code {
background: #f1f5f9;
padding: 0.2rem 0.4rem;
border-radius: 4px;
font-family: 'Monaco', 'Menlo', monospace;
font-size: 0.9em;
color: #e53e3e;
}
.description-text pre {
background: #1a202c;
color: #fff;
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
margin: 1.5rem 0;
}
.description-text pre code {
background: none;
color: inherit;
padding: 0;
}
.description-text a {
color: #4f46e5;
text-decoration: none;
border-bottom: 1px solid transparent;
transition: border-color 0.3s ease;
}
.description-text a:hover {
border-bottom-color: #4f46e5;
}
.description-text strong,
.description-text b {
font-weight: 600;
color: #1a202c;
}
.description-text em,
.description-text i {
font-style: italic;
}
.description-text img {
max-width: 100%;
height: auto;
border-radius: 8px;
margin: 1.5rem 0;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.description-text hr {
border: none;
height: 2px;
background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
margin: 3rem 0;
border-radius: 1px;
}
.description-text table {
width: 100%;
border-collapse: collapse;
margin: 2rem 0;
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.description-text th,
.description-text td {
padding: 1rem;
text-align: left;
border-bottom: 1px solid #e2e8f0;
}
.description-text th {
background: #f8fafc;
font-weight: 600;
color: #1a202c;
}
/* HTML-контент в технологиях */
.technologies-html-content {
line-height: 1.6;
}
.technologies-html-content p {
margin-bottom: 1rem;
}
.technologies-html-content code {
background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
color: white;
padding: 0.5rem 1rem;
border-radius: 8px;
font-family: 'Monaco', 'Menlo', monospace;
font-size: 0.9rem;
font-weight: 500;
display: inline-block;
margin: 0.25rem 0;
box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
transition: all 0.3s ease;
}
.technologies-html-content code:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.technologies-html-content p code {
margin: 0.2rem;
white-space: nowrap;
}
.technologies-html-content h1,
.technologies-html-content h2,
.technologies-html-content h3,
.technologies-html-content h4,
.technologies-html-content h5,
.technologies-html-content h6 {
margin-top: 1.5rem;
margin-bottom: 0.75rem;
font-weight: 600;
color: #1a202c;
}
.technologies-html-content ul,
.technologies-html-content ol {
margin: 1rem 0;
padding-left: 1.5rem;
}
.technologies-html-content li {
margin-bottom: 0.4rem;
}
.technologies-html-content strong,
.technologies-html-content b {
font-weight: 600;
color: #1a202c;
}
.technologies-html-content em,
.technologies-html-content i {
font-style: italic;
}
.technologies-html-content a {
color: #4f46e5;
text-decoration: none;
border-bottom: 1px solid transparent;
transition: border-color 0.3s ease;
}
.technologies-html-content a:hover {
border-bottom-color: #4f46e5;
}