add files
This commit is contained in:
370
src/styles/components/ContentGrid.css
Normal file
370
src/styles/components/ContentGrid.css
Normal file
@@ -0,0 +1,370 @@
|
||||
/* styles/components/ContentGrid.css */
|
||||
|
||||
/* Глобальные стили (только для этого компонента) */
|
||||
.posts-section {
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px 20px;
|
||||
}
|
||||
|
||||
.posts-section h2 {
|
||||
margin-bottom: 30px;
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.posts-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20px;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* ОСНОВНОЙ СТИЛЬ: ВСЕ ПЛИТКИ КВАДРАТНЫЕ */
|
||||
.post-card {
|
||||
flex: 1 0 calc(25% - 15px); /* 4 колонки по умолчанию */
|
||||
background: white;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
min-width: 0;
|
||||
aspect-ratio: 1 / 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Большие плитки на десктопе - ТОЖЕ КВАДРАТНЫЕ */
|
||||
@media (min-width: 1200px) {
|
||||
.post-card-large {
|
||||
flex: 0 0 calc(50% - 10px) !important; /* Занимает 2 колонки */
|
||||
aspect-ratio: 2 / 1 !important; /* Ширина в 2 раза больше высоты */
|
||||
}
|
||||
}
|
||||
|
||||
.post-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.post-card-link {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.post-image-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.post-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.post-card:hover .post-image {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.post-image-placeholder {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
}
|
||||
|
||||
/* Бейдж рубрики */
|
||||
.post-category-badge {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
background: #2563eb;
|
||||
color: white;
|
||||
padding: 5px 10px;
|
||||
border-radius: 4px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
z-index: 2;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
||||
max-width: 80%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.post-card-large .post-category-badge {
|
||||
font-size: 12px;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Оверлей с текстом */
|
||||
.post-content-overlay {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 20px 15px 15px;
|
||||
background: linear-gradient(
|
||||
to top,
|
||||
rgba(0, 0, 0, 0.9) 0%,
|
||||
rgba(0, 0, 0, 0.7) 50%,
|
||||
rgba(0, 0, 0, 0) 100%
|
||||
);
|
||||
color: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.post-card-large .post-content-overlay {
|
||||
padding: 25px 20px 20px;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.post-meta-overlay {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.post-date-overlay {
|
||||
font-size: 12px;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
opacity: 0.9;
|
||||
display: block;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.post-card-large .post-date-overlay {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.post-title-overlay {
|
||||
font-size: 16px;
|
||||
line-height: 1.3;
|
||||
font-weight: 600;
|
||||
margin: 0;
|
||||
color: white;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.post-card-large .post-title-overlay {
|
||||
font-size: 18px;
|
||||
line-height: 1.4;
|
||||
-webkit-line-clamp: 3;
|
||||
}
|
||||
}
|
||||
|
||||
.author-name {
|
||||
font-size: 12px;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
margin-top: 3px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.post-card-large .author-name {
|
||||
font-size: 13px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Для скринридеров */
|
||||
.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;
|
||||
}
|
||||
|
||||
/* Стили для индикаторов загрузки */
|
||||
.loading-indicator {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 3px solid #f3f3f3;
|
||||
border-top: 3px solid #2563eb;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.no-more-posts {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
border-top: 1px solid #eee;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* Адаптивность */
|
||||
|
||||
/* Для ноутбуков: 3 в ряд (без больших плиток) */
|
||||
@media (min-width: 992px) and (max-width: 1199px) {
|
||||
.posts-grid {
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.post-card {
|
||||
flex: 1 0 calc(33.333% - 14px);
|
||||
aspect-ratio: 1 / 1;
|
||||
}
|
||||
|
||||
.post-card-large {
|
||||
flex: 1 0 calc(33.333% - 14px) !important;
|
||||
aspect-ratio: 1 / 1 !important;
|
||||
margin-left: 0 !important;
|
||||
order: initial !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Для планшетов: 2 в ряд */
|
||||
@media (min-width: 768px) and (max-width: 991px) {
|
||||
.posts-grid {
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.post-card {
|
||||
flex: 1 0 calc(50% - 10px);
|
||||
aspect-ratio: 1 / 1;
|
||||
}
|
||||
|
||||
.post-card-large {
|
||||
flex: 1 0 calc(50% - 10px) !important;
|
||||
aspect-ratio: 1 / 1 !important;
|
||||
margin-left: 0 !important;
|
||||
order: initial !important;
|
||||
}
|
||||
|
||||
.post-title-overlay {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Для мобильных: 1 в ряд */
|
||||
@media (max-width: 767px) {
|
||||
.posts-grid {
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.post-card {
|
||||
flex: 1 0 100%;
|
||||
aspect-ratio: 2 / 1; /* На мобильных горизонтальные плитки */
|
||||
}
|
||||
|
||||
.post-card-large {
|
||||
flex: 1 0 100% !important;
|
||||
aspect-ratio: 2 / 1 !important;
|
||||
margin-left: 0 !important;
|
||||
order: initial !important;
|
||||
}
|
||||
|
||||
.posts-section {
|
||||
padding: 0 15px 15px;
|
||||
}
|
||||
|
||||
.posts-section h2 {
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.post-content-overlay {
|
||||
padding: 15px 12px 12px;
|
||||
}
|
||||
|
||||
.post-title-overlay {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.post-category-badge {
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
font-size: 10px;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.no-more-posts {
|
||||
padding: 20px 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Для очень маленьких экранов */
|
||||
@media (max-width: 480px) {
|
||||
.post-card {
|
||||
aspect-ratio: 3 / 2; /* Немного более вертикальные на маленьких экранах */
|
||||
}
|
||||
|
||||
.post-card-large {
|
||||
aspect-ratio: 3 / 2 !important;
|
||||
}
|
||||
|
||||
.post-content-overlay {
|
||||
padding: 12px 10px 10px;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.post-title-overlay {
|
||||
font-size: 14px;
|
||||
-webkit-line-clamp: 3;
|
||||
}
|
||||
|
||||
.post-category-badge {
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
padding: 3px 6px;
|
||||
font-size: 9px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Стиль для пустого состояния */
|
||||
.no-posts {
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
color: #666;
|
||||
font-size: 18px;
|
||||
}
|
||||
51
src/styles/global.css
Normal file
51
src/styles/global.css
Normal file
@@ -0,0 +1,51 @@
|
||||
@import './reset.css';
|
||||
@import './components/ContentGrid.css';
|
||||
|
||||
html{
|
||||
font-family: Roboto,sans-serif;
|
||||
line-height: 1.15;
|
||||
}
|
||||
|
||||
body {
|
||||
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.container{
|
||||
margin: 0 auto;
|
||||
width: 1200px;
|
||||
}
|
||||
|
||||
.header-info{
|
||||
width: 100%;
|
||||
background: #303030;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.header__widgets{
|
||||
padding: 0.4375rem 0;
|
||||
color: #fff;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.2;
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.current-date{
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
.maimnewsline{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media (max-width: 767px) {
|
||||
|
||||
.container{
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
100
src/styles/reset.css
Normal file
100
src/styles/reset.css
Normal file
@@ -0,0 +1,100 @@
|
||||
:root {
|
||||
/* CSS Custom Properties */
|
||||
--font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
--font-mono: 'SF Mono', Monaco, 'Cascadia Mono', monospace;
|
||||
--color-bg: #ffffff;
|
||||
--color-text: #1a1a1a;
|
||||
}
|
||||
|
||||
/* Reset */
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: var(--font-sans);
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--color-bg);
|
||||
color: var(--color-text);
|
||||
min-height: 100vh;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* Typography */
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* Media */
|
||||
img, picture, video, canvas, svg {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
input, button, textarea, select {
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Links */
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* Lists */
|
||||
ul, ol {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
/* Accessibility */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print styles */
|
||||
@media print {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
background: transparent !important;
|
||||
color: #000 !important;
|
||||
box-shadow: none !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user