category page
This commit is contained in:
parent
47d32113f4
commit
dce37df4f6
22
src/App.tsx
22
src/App.tsx
|
|
@ -1,19 +1,20 @@
|
||||||
// Modules
|
// Modules
|
||||||
import { Routes, Route } from 'react-router-dom';
|
import { Routes, Route } from "react-router-dom";
|
||||||
|
|
||||||
// Styles
|
// Styles
|
||||||
import 'react-lazy-load-image-component/src/effects/blur.css';
|
import "react-lazy-load-image-component/src/effects/blur.css";
|
||||||
import 'react-calendar/dist/Calendar.css';
|
import "react-calendar/dist/Calendar.css";
|
||||||
import './styles/style.scss';
|
import "./styles/style.scss";
|
||||||
|
|
||||||
// Pages
|
// Pages
|
||||||
import Main from './pages/Main';
|
import Main from "./pages/Main";
|
||||||
import NewsArticle from './pages/NewsArticle';
|
import NewsArticle from "./pages/NewsArticle";
|
||||||
|
import Category from "./pages/Category";
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import Header from './components/header/Header';
|
import Header from "./components/header/Header";
|
||||||
import Videos from './components/videos/Videos';
|
import Videos from "./components/videos/Videos";
|
||||||
import Footer from './components/footer/Footer';
|
import Footer from "./components/footer/Footer";
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -21,8 +22,7 @@ const App = () => {
|
||||||
<Header />
|
<Header />
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<Main />} />
|
<Route path="/" element={<Main />} />
|
||||||
</Routes>
|
<Route path="/category/:category" element={<Category />} />
|
||||||
<Routes>
|
|
||||||
<Route path="/news/:id" element={<NewsArticle />} />
|
<Route path="/news/:id" element={<NewsArticle />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
<Videos />
|
<Videos />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
// Modules
|
||||||
|
import { LazyLoadImage } from "react-lazy-load-image-component";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
img: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const MainImg = ({ img }: IProps) => {
|
||||||
|
return (
|
||||||
|
<Link to={"/news/123"} className="main-img">
|
||||||
|
<LazyLoadImage
|
||||||
|
src={img}
|
||||||
|
alt={img}
|
||||||
|
useIntersectionObserver
|
||||||
|
effect="blur"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="main-img-overlay">
|
||||||
|
<h2>
|
||||||
|
Полезная информация для поступающих на программы подготовки научных
|
||||||
|
кадров в Туркменистане
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
<span>Политика</span>
|
||||||
|
<span>12.01.2023</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MainImg;
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Components
|
||||||
|
import Aside from "../components/aside/Aside";
|
||||||
|
import NewsScroll from "../components/global/NewsScroll";
|
||||||
|
import MainImg from "../components/category/MainImg";
|
||||||
|
|
||||||
|
// Images
|
||||||
|
import Placeholder from "../assets/images/placeholder3.png";
|
||||||
|
|
||||||
|
const Category = () => {
|
||||||
|
return (
|
||||||
|
<main className="category">
|
||||||
|
<div className="container">
|
||||||
|
<div className="category-inner">
|
||||||
|
<div className="category-left">
|
||||||
|
<MainImg img={Placeholder} />
|
||||||
|
<NewsScroll />
|
||||||
|
</div>
|
||||||
|
<div className="category-right">
|
||||||
|
<Aside />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Category;
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
.main-img {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
max-height: 40rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-img-overlay {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(
|
||||||
|
180deg,
|
||||||
|
rgba(0, 0, 0, 0) 50%,
|
||||||
|
rgba(0, 0, 0, 0.7) 100%
|
||||||
|
);
|
||||||
|
z-index: 2;
|
||||||
|
pointer-events: none;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 2.4rem;
|
||||||
|
padding: 2.4rem;
|
||||||
|
color: $white;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 2.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 2.4rem;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
span {
|
||||||
|
&:first-child {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
&:last-child {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-inner {
|
||||||
|
padding: 5.6rem 0;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 2fr 1fr;
|
||||||
|
gap: 2.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-img {
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
span,
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-left {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2.4rem;
|
||||||
|
}
|
||||||
|
|
@ -1,16 +1,17 @@
|
||||||
@import './variables';
|
@import "./variables";
|
||||||
@import './mixins';
|
@import "./mixins";
|
||||||
@import './general';
|
@import "./general";
|
||||||
@import './nav';
|
@import "./nav";
|
||||||
@import './main';
|
@import "./main";
|
||||||
@import './videos';
|
@import "./videos";
|
||||||
@import './section-title';
|
@import "./section-title";
|
||||||
@import './footer';
|
@import "./footer";
|
||||||
@import './news';
|
@import "./news";
|
||||||
@import './newsCategory';
|
@import "./newsCategory";
|
||||||
@import './newsDate';
|
@import "./newsDate";
|
||||||
@import './newsScroll';
|
@import "./newsScroll";
|
||||||
@import './asideNews';
|
@import "./asideNews";
|
||||||
@import './aside';
|
@import "./aside";
|
||||||
@import './news-section';
|
@import "./news-section";
|
||||||
@import './news-article';
|
@import "./news-article";
|
||||||
|
@import "./category";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue