Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/israel #55

Merged
merged 36 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
10a501e
ru-content initial
pa7lux Nov 4, 2023
803956b
fix
pa7lux Nov 4, 2023
8878f01
better typing
pa7lux Nov 7, 2023
64bb9c4
new texts
pa7lux Nov 11, 2023
5ef72a9
text-wrap ballance and '—' symbol
pa7lux Nov 11, 2023
6f0a561
better author card
pa7lux Nov 11, 2023
67aa915
orpho
pa7lux Nov 11, 2023
6072c80
correction
pa7lux Nov 12, 2023
700600f
tire
pa7lux Nov 12, 2023
4deb8fa
en draft
pa7lux Nov 12, 2023
43fb198
fixes
pa7lux Nov 12, 2023
33456d0
localize names in bubbles with i18n
pa7lux Nov 14, 2023
9c4269d
start of pic redesign
pa7lux Nov 14, 2023
f2eaf1c
ua translation
fallintovoid Nov 14, 2023
ee91842
ru new images component
pa7lux Nov 14, 2023
2148e41
text fixes
pa7lux Nov 14, 2023
6e6b018
фильр
pa7lux Nov 14, 2023
bb3aa69
cover and aspect fix
pa7lux Nov 14, 2023
275438f
nofilter
pa7lux Nov 14, 2023
78d1556
cover and width on mobile
pa7lux Nov 14, 2023
7eb5afa
add image grid list to ua translation
fallintovoid Nov 15, 2023
25ce061
tire
pa7lux Nov 15, 2023
81bf9ed
punctuation
pa7lux Nov 15, 2023
4605e34
«» not ""
pa7lux Nov 15, 2023
431f765
год шимона, хлопцы
pa7lux Nov 15, 2023
c5785c4
eng text
pa7lux Nov 15, 2023
af70452
icon
pa7lux Nov 15, 2023
57b94a6
deleted unused
pa7lux Nov 15, 2023
34aa225
correct-link
pa7lux Nov 15, 2023
8077f84
og
pa7lux Nov 15, 2023
3f62a0c
corrected og-urls
pa7lux Nov 15, 2023
4f5d1e4
repositioning of the website
pa7lux Nov 15, 2023
37c1851
optimized images
pa7lux Nov 15, 2023
6d5af92
better og pics
pa7lux Nov 15, 2023
8e7d046
moms changes
fallintovoid Nov 16, 2023
d050a84
updated pubDate
pa7lux Nov 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ metaOgImage: 'some link on some image'
- `theme` - Main color which will be used on article's page. **Before writing name, ask if it exists**
- `svg` - Picture which will be used in button on home page. **Before writing name, ask if it exists**
- `metaTitle` - Title which will be the name for tab in browser. Mostly you need to write in this way: `'imhr.top - title'`
- `metaDescription` - Meta description. Mostly you need to write in this way: `'I am here. Сайт, на котором подростки из Украины рассказывают свои истории.'`. Inner text depends on language for which you currently creating an article.
- `metaDescription` - Meta description. Mostly you need to write in this way: `'I am here. Сайт, где подростки осмысляют войну и мир.'`. Inner text depends on language for which you currently creating an article.
- `metaOgTitle` - Mostly you need to write in this way: `'imhr.top - title'`
- `metaOgImage` - Image which will be shown as an icon for tab in browser.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import React, { FC, PropsWithChildren } from 'react';
import cn from 'classnames';

import BlockStyles from './LargeBlock.module.css';

const LargeBlock: FC<PropsWithChildren> = ({ children }) => {
return <div className={BlockStyles.block_large}>{children}</div>;
type Props = {
className?: string;
};

const LargeBlock: FC<PropsWithChildren<Props>> = ({ children, className }) => {
return (
<div className={cn(BlockStyles.block_large, className)}>{children}</div>
);
};

export { LargeBlock };
15 changes: 13 additions & 2 deletions components/ArticleComponents/AuthorCard/AuthorCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,23 @@
font-variation-settings: 'wght' 150;
}

.rtl-card .author_content {
padding-left: clamp(1.375rem, 0.9821rem + 1.9643vw, 2.75rem);
padding-right: clamp(5rem, 3.625rem + 6.875vw, 9.8125rem);
}

.author_image {
position: absolute;
top: 0;
left: 0;
width: 37.2%;
transform: translate(-50%, -6%);
transform: translate(-43%, -7%);
}

.rtl-card .author_image {
left: auto;
right: 0;
transform: translate(43%, -7%);
}

.author_heading {
Expand Down Expand Up @@ -56,6 +67,6 @@
padding-right: clamp(1.25rem, 0.732rem + 2.7624vw, 2.5rem);
padding-bottom: clamp(1.25rem, 0.732rem + 2.7624vw, 2.5rem);
padding-left: clamp(3.75rem, 2.7141rem + 5.5249vw, 6.25rem);
transform: translateX(2vw);
/* transform: translateX(2vw); */
}
}
14 changes: 12 additions & 2 deletions components/ArticleComponents/AuthorCard/AuthorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ import CardStyles from './AuthorCard.module.css';

type Props = {
src: string;
direction?: 'ltr' | 'rtl';
};

const AuthorCard: FC<PropsWithChildren<Props>> = ({ children, src }) => {
const AuthorCard: FC<PropsWithChildren<Props>> = ({
children,
src,
direction,
}) => {
return (
<div className={CardStyles.author_block}>
<div
className={cn(
CardStyles.author_block,
direction === 'rtl' && CardStyles['rtl-card']
)}
>
<div className={cn(CardStyles.author_content, 'box-radius')}>
<svg
className={CardStyles.author_image}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.image_grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 2vw 4vw;
width: 100%;
padding: 2vw 4vw;
background-color: #1e1e1e;
border-radius: var(--radius-main);
align-items: start;
}

.image_grid:has(li:nth-child(3)) {
grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
}

@media (max-width: 650px) {
.image_grid {
grid-template-columns: 1fr;
}

.image_grid:has(li:nth-child(3)) {
grid-template-columns: 1fr;
}
}

.image_grid_item {
width: 100%;
}

.image_grid_item :global(.text-type-caption) {
color: #f5f5f5;
text-align: center;
}

.image_grid_item > :global(div) {
margin-top: 0;
margin-bottom: 0;
}

.image_grid_item :global(img) {
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
max-height: 300px;
/* filter: contrast(1.3) brightness(1.2) grayscale(0.5) sepia(0.4); */
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { FC } from 'react';
import cn from 'classnames';
import { Children, cloneElement } from 'react';

import styles from './ContentImageGridList.module.css';

type Props = {
children: JSX.Element[];
className?: string;
};

const ContentImageGridList: FC<Props> = ({ children, className }) => {
return (
<ul className={cn(styles.image_grid, className)}>
{Children.map(children, (child, i) => {
return (
<li className={cn(styles.image_grid_item)} key={i}>
{cloneElement(child)}
</li>
);
})}
</ul>
);
};

export { ContentImageGridList };
44 changes: 44 additions & 0 deletions components/ArticleComponents/DialogBubble/DialogBubble.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.bubble_block {
display: flex;
gap: 20px;
background-color: var(--accent-color);
align-items: center;
padding: 60px 20px 40px;
border-radius: 16px;
margin: 80px 0 80px;
position: relative;
}

.bubble_block:last-of-type {
margin-bottom: 60px;
}

.people_list {
display: flex;
gap: 10px;
text-align: center;
position: absolute;
top: 0;
left: 0;
transform: translate(20px, -40%);
}

.people_list img {
display: block;
width: 80px;
aspect-ratio: 1/1;
object-fit: cover;
object-position: center;
border-radius: 50%;
}

.people_list span {
display: block;
margin-top: 4px;
font-weight: bold;
transform: translate(0, -70%);
background-color: #fff;
border-radius: 8px;
padding: 0.2em;
font-size: 0.8em;
}
44 changes: 44 additions & 0 deletions components/ArticleComponents/DialogBubble/DialogBubble.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React, { FC, PropsWithChildren } from 'react';
import cn from 'classnames';
import { useTranslation } from 'next-i18next';
import CardStyles from './DialogBubble.module.css';

type Props = {
people: string;
direction?: 'ltr' | 'rtl';
};

const DialogBubble: FC<PropsWithChildren<Props>> = ({
children,
people,
direction,
}) => {
const { t } = useTranslation('bubble-authors');
const peopleIdArray: string[] = people.split(',');

return (
<div
className={cn(
CardStyles.bubble_block,
direction === 'rtl' && CardStyles['rtl-card']
)}
>
<ul className={cn(CardStyles.people_list)}>
{peopleIdArray.map((person) => {
return (
<li key={t(`${person}.name`)}>
<img
src={t(`${person}.img`) as string}
alt={`На фото ${`${person}.name`}`}
/>
<span>{t(`${person}.name`)}</span>
</li>
);
})}
</ul>
<div className={cn(CardStyles.text)}>{children}</div>
</div>
);
};

export { DialogBubble };
1 change: 0 additions & 1 deletion components/ArticleComponents/Heading/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ let cx = classNames.bind(HeadingStyles);

const Heading: FC<Props> = ({ photoLeft = false, author, title, img }) => {
const { t } = useTranslation('components');

return (
<section
className={cx({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.big_heading_and_text {
/* margin-bottom: calc(3 * var(--size-unit)); */
position: relative;
margin: 0;
}

.big_heading_and_text .heading_big {
Expand Down
9 changes: 7 additions & 2 deletions components/ArticleComponents/TextWithUnder/TextWithUnder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ import { useTranslation } from 'react-i18next';

type Props = {
author: string;
hasAuthor?: boolean;
};

const TextWithUnder: FC<PropsWithChildren<Props>> = ({ children, author }) => {
const TextWithUnder: FC<PropsWithChildren<Props>> = ({
children,
author,
hasAuthor,
}) => {
const { t } = useTranslation('components');

return (
Expand All @@ -20,7 +25,7 @@ const TextWithUnder: FC<PropsWithChildren<Props>> = ({ children, author }) => {
'text-type-p mt-2'
)}
>
{t('heading')} {author}
{!hasAuthor && t('heading')} {author}
</p>
</section>
);
Expand Down
3 changes: 1 addition & 2 deletions components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { FC, useEffect } from 'react';
import { useEffect } from 'react';
import Link from 'next/link';
import { withTheme } from '../../store/context/themeContext';
import { useRouter } from 'next/router';
import cn from 'classnames';
import { useTranslation } from 'next-i18next';
import { GetStaticProps } from 'next';

import HeaderStyles from './Header.module.css';

Expand Down
4 changes: 2 additions & 2 deletions components/SendStory/SendStory.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.story {
/* .story {
aspect-ratio: 433/236;
}
} */

.story.large {
aspect-ratio: 1366/102;
Expand Down
5 changes: 3 additions & 2 deletions components/Story/Story.module.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.story {
/* .story {
aspect-ratio: 433/236;
}

@media screen and (max-width: 600px) {
.story {
aspect-ratio: initial;
}
}
} */

.story_link {
display: block;
Expand Down Expand Up @@ -44,6 +44,7 @@
font-variation-settings: var(--text-weight-bold);
line-height: 1.2;
color: var(--text-color-primary);
margin-bottom: var(--space-m);
}

@media screen and (max-width: 1035px) {
Expand Down
4 changes: 4 additions & 0 deletions components/UI/IconSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Route } from './route-icon/route-icon';
import { Star } from './star-icon/star-icon';
import { Lightning } from './lightning-icon/lightning-icon';
import { Rain } from './rain-icon/rain-icon';
import { IsraelStar } from './israel-star-icon/israel-star-icon';

type Props = {
className?: string;
Expand Down Expand Up @@ -48,6 +49,9 @@ const IconSelector: FC<Props> = ({ className, icon }) => {
case 'rain':
return <Rain className={className} />;

case 'israel-star':
return <IsraelStar className={className} />;

default:
return <Backpack />;
}
Expand Down
41 changes: 41 additions & 0 deletions components/UI/israel-star-icon/israel-star-icon.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.svg {
position: absolute;
height: 100%;
z-index: 0;
}

.svg path {
stroke-dasharray: 1000;
stroke-dashoffset: 1000;
animation-timing-function: ease-out;
animation-fill-mode: forwards;
}

.svg.svg_israel-star {
width: 25%;
right: 3%;
bottom: -30%;
}

@media (width <= 600px) {
.svg.svg_israel-star {
width: 15%;
right: 3%;
bottom: -20%;
}
}

.svg.svg_israel-star path:not(:first-child) {
animation-duration: 3s;
animation-delay: 0.3s;
}

.svg.svg_israel-star path:first-child {
animation-duration: 1s;
}

@keyframes svgAnimation {
to {
stroke-dashoffset: 0;
}
}
Loading