Compare commits
2 Commits
Lab_2_Back
...
Lab_5
| Author | SHA1 | Date | |
|---|---|---|---|
| 76d62c085d | |||
| ffd8187188 |
24
ИП5/111/.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
12
ИП5/111/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# React + Vite
|
||||
|
||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||
|
||||
Currently, two official plugins are available:
|
||||
|
||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
|
||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
||||
|
||||
## Expanding the ESLint configuration
|
||||
|
||||
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
|
||||
33
ИП5/111/eslint.config.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
|
||||
export default [
|
||||
{ ignores: ['dist'] },
|
||||
{
|
||||
files: ['**/*.{js,jsx}'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
ecmaFeatures: { jsx: true },
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'react-hooks': reactHooks,
|
||||
'react-refresh': reactRefresh,
|
||||
},
|
||||
rules: {
|
||||
...js.configs.recommended.rules,
|
||||
...reactHooks.configs.recommended.rules,
|
||||
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
|
||||
'react-refresh/only-export-components': [
|
||||
'warn',
|
||||
{ allowConstantExport: true },
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
13
ИП5/111/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + React</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
3787
ИП5/111/package-lock.json
generated
Normal file
30
ИП5/111/package.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "111",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@popperjs/core": "^2.11.8",
|
||||
"bootstrap": "^5.3.5",
|
||||
"bootstrap-icons": "^1.11.3",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.22.0",
|
||||
"@types/react": "^19.0.10",
|
||||
"@types/react-dom": "^19.0.4",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"eslint": "^9.22.0",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.19",
|
||||
"globals": "^16.0.0",
|
||||
"vite": "^6.3.1"
|
||||
}
|
||||
}
|
||||
4
ИП5/111/public/source/exit-icon.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.002 0H2.002C0.899001 0 0.00200081 0.897 0.00200081 2V6H2.002V2H16.002V16H2.002V12H0.00200081V16C0.00200081 17.103 0.899001 18 2.002 18H16.002C17.105 18 18.002 17.103 18.002 16V2C18.002 0.897 17.104 0 16.002 0Z" fill="white"/>
|
||||
<path d="M8 13L13 9L8 5V8.001H0V10.001H8V13Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 403 B |
3
ИП5/111/public/source/home-icon.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="48" height="47" viewBox="0 0 48 47" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M23.9629 0.054492C23.753 0.0617304 23.5507 0.134847 23.3848 0.263476L0.384755 18.2107C0.175483 18.3739 0.0396014 18.6135 0.00700236 18.8769C-0.0255966 19.1402 0.0477576 19.4058 0.210928 19.615C0.374098 19.8243 0.613719 19.9602 0.877075 19.9928C1.14043 20.0254 1.40595 19.952 1.61522 19.7889L2.99999 18.7088V44.9998C3.00002 45.265 3.10538 45.5194 3.29291 45.7069C3.48044 45.8944 3.73478 45.9998 3.99999 45.9998H17.832C17.94 46.0177 18.0502 46.0177 18.1582 45.9998H29.832C29.94 46.0177 30.0502 46.0177 30.1582 45.9998H44C44.2652 45.9998 44.5195 45.8944 44.7071 45.7069C44.8946 45.5194 45 45.265 45 44.9998V18.7088L46.3848 19.7889C46.4884 19.8697 46.6069 19.9293 46.7336 19.9643C46.8602 19.9993 46.9925 20.009 47.1229 19.9928C47.2533 19.9767 47.3793 19.935 47.4936 19.8702C47.6079 19.8054 47.7083 19.7187 47.7891 19.6151C47.8699 19.5115 47.9295 19.3929 47.9645 19.2663C47.9995 19.1396 48.0092 19.0073 47.993 18.8769C47.9769 18.7465 47.9352 18.6205 47.8704 18.5062C47.8056 18.3919 47.7189 18.2915 47.6152 18.2107L40 12.2693V4.9998H34V7.58574L24.6152 0.263476C24.4292 0.119197 24.1981 0.0451914 23.9629 0.054492ZM24 2.32207L43 17.1482V43.9998H31V24.9998H17V43.9998H4.99999V17.1482L24 2.32207ZM36 6.9998H38V10.7088L36 9.14629V6.9998ZM19 26.9998H29V43.9998H19V26.9998Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
6
ИП5/111/public/source/logo.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="323" height="330" viewBox="0 0 323 330" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M166.19 69.5299L100.78 62.6699L29.04 131.77L66.49 169.75L166.19 69.5299Z" fill="#FCD116"/>
|
||||
<path d="M99.6401 136.43L279.07 317.44L282.17 320.6C282.17 320.6 284.35 323.07 288.2 323.86C292.06 324.65 292.55 325.94 300.36 323.86C308.17 321.78 310.65 316.74 310.65 316.74C310.65 316.74 314.7 310.71 314.61 306.65C314.51 302.6 313.72 297.75 310.56 294.49C307.4 291.23 297.8 281.24 297.8 281.24L125.74 110.19L99.6401 136.43Z" fill="#BF1723"/>
|
||||
<path d="M97.8098 232.52C97.8098 232.52 94.8398 228.96 91.2798 228.76C87.7198 228.56 85.3498 228.96 82.9698 230.64C80.5898 232.32 81.5898 234.3 81.5898 234.3H77.8298C77.8298 234.3 69.7198 236.48 68.3398 238.45C66.9598 240.43 62.7998 247.55 62.4098 250.32C62.0198 253.09 30.5598 271.88 30.5598 271.88C30.5598 271.88 14.1398 286.52 11.3698 291.66C8.59979 296.8 5.82979 304.32 7.21979 311.04C8.59979 317.77 13.7498 321.52 13.7498 321.52C13.7498 321.52 21.0698 325.67 26.7998 324.88C32.5298 324.09 34.9098 324.68 45.7898 315.78C56.6698 306.88 62.0098 297.98 62.0098 297.98L72.2998 281.56L78.4298 271.87C78.4298 271.87 81.1998 271.28 84.5598 269.69C87.9198 268.11 95.2398 264.55 96.6298 260.79C98.0098 257.03 97.8198 255.84 97.8198 255.84C97.8198 255.84 99.3998 255.84 101.38 250.89C103.36 245.94 97.8098 232.52 97.8098 232.52Z" fill="#BF1723"/>
|
||||
<path d="M171.99 3.37012L190.48 14.7401L210.75 28.9801L231.82 45.6901L245.17 57.9501L255.26 68.6301L263.63 78.4201C263.63 78.4201 275.5 92.8601 278.93 99.9101C282.36 106.96 290.37 118.87 294.03 130.64C297.69 142.41 302.24 158.73 302.14 170.4C302.04 182.07 300.16 204.52 295.61 214.41C291.06 224.3 281.76 245.86 271.28 254.17C260.8 262.48 237.06 280.58 237.06 280.58C237.06 280.58 212.93 291.06 197.5 292.45C182.07 293.84 157.74 291.07 149.83 287.5C141.92 283.94 118.38 275.63 107.1 263.57C95.8299 251.5 88.1099 240.82 88.1099 240.82L107.1 222.62C107.1 222.62 120.15 237.46 134.59 242.6C149.03 247.74 164.26 253.28 184.04 251.3C203.82 249.32 224.19 239.63 224.19 239.63C224.19 239.63 244.76 226.58 253.46 206.79C262.16 187.01 262.95 161.3 255.24 135.98C247.53 110.66 234.87 88.1101 234.87 88.1101C234.87 88.1101 208.17 44.2001 203.42 40.8401C198.69 37.4901 171.99 3.37012 171.99 3.37012Z" fill="#FCD116"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
BIN
ИП5/111/public/source/meme1.jpg
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
ИП5/111/public/source/meme2.jpg
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
ИП5/111/public/source/meme3.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
ИП5/111/public/source/meme4.jpg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
ИП5/111/public/source/meme5.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
6
ИП5/111/public/source/message-icon.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="669" height="608" viewBox="0 0 669 608" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M33.265 607.169C29.796 607.169 26.387 605.874 23.763 603.432C19.932 599.868 18.419 594.459 19.844 589.424L53.914 469.04C18.725 419.919 0.162003 363.025 0.162003 304.06C0.162003 262.963 9.06701 223.103 26.63 185.588C43.542 149.463 67.724 117.046 98.503 89.237C161.523 32.301 245.217 0.945007 334.168 0.945007C423.122 0.945007 506.818 32.301 569.839 89.237C600.618 117.046 624.801 149.463 641.713 185.588C659.276 223.103 668.181 262.963 668.181 304.06C668.181 345.155 659.276 385.014 641.713 422.528C624.801 458.653 600.618 491.069 569.839 518.877C506.818 575.813 423.122 607.169 334.168 607.169C272.121 607.169 211.813 591.697 159.3 562.364L38.017 606.334C36.467 606.896 34.859 607.169 33.265 607.169ZM160.612 533.107C163.057 533.107 165.487 533.75 167.648 535.012C217.214 563.97 274.796 579.277 334.167 579.277C416.199 579.277 493.255 550.477 551.139 498.181C608.627 446.243 640.287 377.304 640.287 304.061C640.287 230.815 608.627 161.873 551.139 109.936C493.255 57.64 416.2 28.839 334.167 28.839C252.138 28.839 175.084 57.64 117.201 109.936C59.714 161.874 28.054 230.816 28.054 304.061C28.054 359.198 46.133 412.396 80.337 457.905C82.954 461.386 83.794 465.891 82.608 470.082L54.093 570.837L155.86 533.942C157.401 533.383 159.01 533.107 160.612 533.107Z" fill="white"/>
|
||||
<path d="M440.419 402.182H153.893C146.191 402.182 139.947 395.938 139.947 388.236C139.947 380.534 146.191 374.29 153.893 374.29H440.419C448.121 374.29 454.365 380.534 454.365 388.236C454.365 395.938 448.121 402.182 440.419 402.182Z" fill="white"/>
|
||||
<path d="M514.448 318.003H153.893C146.191 318.003 139.947 311.759 139.947 304.057C139.947 296.355 146.191 290.111 153.893 290.111H514.448C522.15 290.111 528.394 296.355 528.394 304.057C528.394 311.759 522.15 318.003 514.448 318.003Z" fill="white"/>
|
||||
<path d="M514.448 233.826H153.893C146.191 233.826 139.947 227.582 139.947 219.88C139.947 212.178 146.191 205.934 153.893 205.934H514.448C522.15 205.934 528.394 212.178 528.394 219.88C528.394 227.582 522.15 233.826 514.448 233.826Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
BIN
ИП5/111/public/source/photo.jpg
Normal file
|
After Width: | Height: | Size: 356 KiB |
10
ИП5/111/public/source/profile-icon.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<svg width="428" height="428" viewBox="0 0 428 428" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3_100)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M199.5 1.03578C163.394 3.43679 127.681 15.3168 98 34.8018C84.295 43.7998 76.669 49.9688 64.63 61.7998C30.476 95.3648 9.58699 136.587 2.45399 184.5C0.201994 199.629 0.212996 227.823 2.478 243.5C7.987 281.635 23.311 317.238 47.026 347C55.453 357.575 75.042 376.781 85 384.231C114.449 406.264 147.76 420.093 184.5 425.538C199.308 427.733 228.803 427.738 243.5 425.547C280.235 420.073 313.627 406.207 343 384.231C352.958 376.781 372.547 357.575 380.974 347C404.616 317.33 419.695 282.336 425.573 243.5C427.791 228.843 427.78 199.441 425.55 184.5C420.85 153.009 409.639 123.097 393.055 97.7978C384.244 84.3568 378.038 76.6828 366.2 64.5908C322.341 19.7908 262.214 -3.13322 199.5 1.03578ZM229.699 23.0078C303.453 29.5368 365.275 75.5218 392.359 144C401.417 166.902 405.28 187.832 405.277 214C405.274 240.064 401.203 261.901 392.036 285.032C384.876 303.1 372.169 324.192 360.227 337.835L354.682 344.169L352.497 338.835C338.115 303.72 309.622 274.318 275.006 258.871C269.002 256.192 263.619 254 263.045 254C262.47 254 262 253.55 262 253C262 252.45 262.455 252 263.011 252C264.865 252 280.202 236.58 284.206 230.691C294.644 215.336 299.182 200.581 299.182 182C299.182 166.457 297.058 157.518 290.034 143.5C281.672 126.813 268.989 114.121 252.5 105.937C238.374 98.9258 229.474 96.8178 214 96.8178C198.457 96.8178 189.518 98.9418 175.5 105.966C153.687 116.897 137.129 137.499 130.869 161.5C127.953 172.676 127.976 191.296 130.919 202.5C133.458 212.167 139.441 224.98 144.784 232.194C149.052 237.957 163.388 252 165.003 252C167.922 252 165.162 253.949 158.75 256.416C122.293 270.443 90.705 301.717 75.503 338.835L73.318 344.169L67.773 337.835C55.831 324.192 43.124 303.1 35.964 285.032C22.115 250.088 18.83 211.588 26.53 174.457C42.729 96.3408 107.189 35.7338 186 24.5228C204.236 21.9278 213.766 21.5978 229.699 23.0078ZM230.539 120.552C254.543 126.804 272.639 147.171 276.797 172.616C278.179 181.068 278.177 182.942 276.779 191.494C272.202 219.505 251.505 240.202 223.494 244.779C214.942 246.177 213.068 246.179 204.616 244.797C185.349 241.649 168.746 230.529 159.241 214.408C144.475 189.366 148.503 157.592 169.048 137.048C185.179 120.916 208.213 114.737 230.539 120.552ZM235.619 269.546C281.127 277.466 318.697 309.167 334.407 352.901L337.066 360.301L334.824 362.687C330.891 366.874 309.862 380.423 299 385.77C280.495 394.878 262.6 400.459 241.585 403.676C226.794 405.941 201.177 405.936 186.346 403.666C162.687 400.045 137.287 391.18 117.956 379.797C108.563 374.266 92.822 363.139 91.606 361.171C91.263 360.617 92.169 356.865 93.617 352.832C107.023 315.514 136.007 286.96 173.055 274.576C178.86 272.636 187.185 270.403 191.555 269.614C202.39 267.658 224.575 267.623 235.619 269.546Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3_100">
|
||||
<rect width="428" height="428" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
1
ИП5/111/public/source/react.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
3
ИП5/111/public/source/settings-icon.svg
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
1
ИП5/111/public/vite.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
225
ИП5/111/src/App.css
Normal file
@@ -0,0 +1,225 @@
|
||||
|
||||
|
||||
body {
|
||||
color: #c5c6c7;
|
||||
background-color: #141414;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:visited {
|
||||
color: white;
|
||||
}
|
||||
a:hover {
|
||||
color: #BF1723;
|
||||
background-color: #2a2a2a;
|
||||
}
|
||||
a:active {
|
||||
color: #FCD116;
|
||||
}
|
||||
img {
|
||||
width: 50px;
|
||||
}
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
main {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Шапка */
|
||||
header .container-fluid {
|
||||
border-bottom: 3px solid #BF1723;
|
||||
border-bottom-right-radius: 25px;
|
||||
border-bottom-left-radius: 25px;
|
||||
}
|
||||
|
||||
.right-part > img {
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Основная страница */
|
||||
.leftbar {
|
||||
width: 10%;
|
||||
background-color: #222222;
|
||||
border-radius: 15px;
|
||||
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.leftbar-content > a {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.leftbar-settings {
|
||||
border-top: 1px solid rgba(128, 128, 128, 0.479);
|
||||
}
|
||||
|
||||
.leftbar-settings > a{
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid rgba(128, 128, 128, 0.479);
|
||||
}
|
||||
|
||||
.footer > span {
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
}
|
||||
|
||||
span:hover {
|
||||
color: #BF1723;
|
||||
}
|
||||
|
||||
.footer:hover .footer-menu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
top: 150%;
|
||||
left: -6%;
|
||||
|
||||
width: 110%;
|
||||
|
||||
position: absolute;
|
||||
|
||||
background-color: #222222;
|
||||
border-radius: 10px;
|
||||
|
||||
padding: 10px;
|
||||
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.footer-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.footer-menu > a {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.content {
|
||||
background-color: #222222;
|
||||
border-radius: 15px;
|
||||
border: 0.1px solid #BF1723;
|
||||
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
.post-header {
|
||||
color: #fff;
|
||||
border-top: 0.5px solid #BF1723;
|
||||
padding-top: 3%;
|
||||
}
|
||||
|
||||
.image .post-img {
|
||||
border-radius: 2%;
|
||||
}
|
||||
|
||||
.post-footer {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.rightbar {
|
||||
height: 100%;
|
||||
width: 10%;
|
||||
background-color: #222222;
|
||||
border-radius: 15px;
|
||||
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.rightbar-content > a {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.bottombar{
|
||||
bottom: 0;
|
||||
border-top: 3px solid #BF1723;
|
||||
border-top-right-radius: 25px;
|
||||
border-top-left-radius: 25px;
|
||||
background-color: #222222;
|
||||
}
|
||||
|
||||
.bottombar > a > img {
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
|
||||
/*Форма для добавления*/
|
||||
.formContainer{
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
background-color: #f9f9f9;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Обновлённые стили для кнопок управления постом */
|
||||
.post-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.post-actions {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.post-actions button {
|
||||
font-size: 0.8rem;
|
||||
padding: 0.1rem 0.4rem;
|
||||
}
|
||||
|
||||
/* Стили для изображений */
|
||||
.image-preview {
|
||||
max-width: 100%;
|
||||
max-height: 200px;
|
||||
margin-top: 10px;
|
||||
display: none;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.post-img {
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.like-btn {
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.like-btn.text-danger {
|
||||
color: #dc3545 !important;
|
||||
}
|
||||
|
||||
|
||||
.post-header small {
|
||||
font-size: 0.8rem;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.post-group {
|
||||
font-weight: 500;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
115
ИП5/111/src/App.jsx
Normal file
@@ -0,0 +1,115 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { PostService } from './services/PostService';
|
||||
import { PostForm } from './components/PostForm';
|
||||
import { Post } from './components/Post';
|
||||
import Header from './components/Header/Header';
|
||||
import Leftbar from './components/Leftbar/Leftbar';
|
||||
import Rightbar from './components/Rightbar/Rightbar';
|
||||
import Bottombar from './components/Bottombar/Bottombar';
|
||||
import './App.css';
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
import 'bootstrap/dist/js/bootstrap.bundle.min';
|
||||
import "bootstrap-icons/font/bootstrap-icons.css";
|
||||
|
||||
function App() {
|
||||
const [posts, setPosts] = useState([]);
|
||||
const [showForm, setShowForm] = useState(false);
|
||||
const [editingPost, setEditingPost] = useState(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const savedPosts = PostService.getPosts();
|
||||
setPosts(savedPosts || PostService.getInitialPosts());
|
||||
}, []);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (posts.length > 0) {
|
||||
PostService.savePosts(posts);
|
||||
}
|
||||
}, [posts]);
|
||||
|
||||
const handleShowForm = () => {
|
||||
setShowForm(true);
|
||||
setEditingPost(null);
|
||||
};
|
||||
|
||||
const handleSubmit = (formData) => {
|
||||
const newPost = {
|
||||
id: editingPost ? editingPost.id : Date.now(),
|
||||
text: formData.text,
|
||||
image: formData.image ? URL.createObjectURL(formData.image) : formData.imagePreview,
|
||||
group: 'Моя группа',
|
||||
likes: editingPost ? editingPost.likes : 0,
|
||||
comments: editingPost ? editingPost.comments : 0,
|
||||
shares: editingPost ? editingPost.shares : 0,
|
||||
createdAt: editingPost ? editingPost.createdAt : new Date().toISOString()
|
||||
};
|
||||
|
||||
if (editingPost) {
|
||||
setPosts(posts.map(post => post.id === editingPost.id ? newPost : post));
|
||||
} else {
|
||||
setPosts([newPost, ...posts]);
|
||||
}
|
||||
|
||||
setShowForm(false);
|
||||
setEditingPost(null);
|
||||
};
|
||||
|
||||
const handleEdit = (post) => {
|
||||
setEditingPost(post);
|
||||
setShowForm(true);
|
||||
};
|
||||
|
||||
const handleDelete = (postId) => {
|
||||
if (window.confirm('Вы уверены, что хотите удалить этот пост?')) {
|
||||
setPosts(posts.filter(post => post.id !== postId));
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<header><Header /></header>
|
||||
|
||||
<main>
|
||||
<section className='w-100'>
|
||||
<div className="page d-flex justify-content-center mt-3">
|
||||
<Leftbar />
|
||||
|
||||
<div className="content h-100 w-25 m-1 p-2 mb-5 d-flex flex-column justify-content-center">
|
||||
<button
|
||||
className="btn btn-danger add-post-btn m-3"
|
||||
onClick={handleShowForm}
|
||||
>
|
||||
<i className="bi bi-plus-circle"></i> Добавить пост
|
||||
</button>
|
||||
|
||||
{showForm && (
|
||||
<PostForm
|
||||
onSubmit={handleSubmit}
|
||||
onCancel={() => setShowForm(false)}
|
||||
initialData={editingPost || {}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{posts.map(post => (
|
||||
<Post
|
||||
key={post.id}
|
||||
post={post}
|
||||
onEdit={handleEdit}
|
||||
onDelete={handleDelete}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<Rightbar />
|
||||
</div>
|
||||
|
||||
<Bottombar />
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
4
ИП5/111/src/assets/exit-icon.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.002 0H2.002C0.899001 0 0.00200081 0.897 0.00200081 2V6H2.002V2H16.002V16H2.002V12H0.00200081V16C0.00200081 17.103 0.899001 18 2.002 18H16.002C17.105 18 18.002 17.103 18.002 16V2C18.002 0.897 17.104 0 16.002 0Z" fill="white"/>
|
||||
<path d="M8 13L13 9L8 5V8.001H0V10.001H8V13Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 403 B |
3
ИП5/111/src/assets/home-icon.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="48" height="47" viewBox="0 0 48 47" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M23.9629 0.054492C23.753 0.0617304 23.5507 0.134847 23.3848 0.263476L0.384755 18.2107C0.175483 18.3739 0.0396014 18.6135 0.00700236 18.8769C-0.0255966 19.1402 0.0477576 19.4058 0.210928 19.615C0.374098 19.8243 0.613719 19.9602 0.877075 19.9928C1.14043 20.0254 1.40595 19.952 1.61522 19.7889L2.99999 18.7088V44.9998C3.00002 45.265 3.10538 45.5194 3.29291 45.7069C3.48044 45.8944 3.73478 45.9998 3.99999 45.9998H17.832C17.94 46.0177 18.0502 46.0177 18.1582 45.9998H29.832C29.94 46.0177 30.0502 46.0177 30.1582 45.9998H44C44.2652 45.9998 44.5195 45.8944 44.7071 45.7069C44.8946 45.5194 45 45.265 45 44.9998V18.7088L46.3848 19.7889C46.4884 19.8697 46.6069 19.9293 46.7336 19.9643C46.8602 19.9993 46.9925 20.009 47.1229 19.9928C47.2533 19.9767 47.3793 19.935 47.4936 19.8702C47.6079 19.8054 47.7083 19.7187 47.7891 19.6151C47.8699 19.5115 47.9295 19.3929 47.9645 19.2663C47.9995 19.1396 48.0092 19.0073 47.993 18.8769C47.9769 18.7465 47.9352 18.6205 47.8704 18.5062C47.8056 18.3919 47.7189 18.2915 47.6152 18.2107L40 12.2693V4.9998H34V7.58574L24.6152 0.263476C24.4292 0.119197 24.1981 0.0451914 23.9629 0.054492ZM24 2.32207L43 17.1482V43.9998H31V24.9998H17V43.9998H4.99999V17.1482L24 2.32207ZM36 6.9998H38V10.7088L36 9.14629V6.9998ZM19 26.9998H29V43.9998H19V26.9998Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
6
ИП5/111/src/assets/logo.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="323" height="330" viewBox="0 0 323 330" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M166.19 69.5299L100.78 62.6699L29.04 131.77L66.49 169.75L166.19 69.5299Z" fill="#FCD116"/>
|
||||
<path d="M99.6401 136.43L279.07 317.44L282.17 320.6C282.17 320.6 284.35 323.07 288.2 323.86C292.06 324.65 292.55 325.94 300.36 323.86C308.17 321.78 310.65 316.74 310.65 316.74C310.65 316.74 314.7 310.71 314.61 306.65C314.51 302.6 313.72 297.75 310.56 294.49C307.4 291.23 297.8 281.24 297.8 281.24L125.74 110.19L99.6401 136.43Z" fill="#BF1723"/>
|
||||
<path d="M97.8098 232.52C97.8098 232.52 94.8398 228.96 91.2798 228.76C87.7198 228.56 85.3498 228.96 82.9698 230.64C80.5898 232.32 81.5898 234.3 81.5898 234.3H77.8298C77.8298 234.3 69.7198 236.48 68.3398 238.45C66.9598 240.43 62.7998 247.55 62.4098 250.32C62.0198 253.09 30.5598 271.88 30.5598 271.88C30.5598 271.88 14.1398 286.52 11.3698 291.66C8.59979 296.8 5.82979 304.32 7.21979 311.04C8.59979 317.77 13.7498 321.52 13.7498 321.52C13.7498 321.52 21.0698 325.67 26.7998 324.88C32.5298 324.09 34.9098 324.68 45.7898 315.78C56.6698 306.88 62.0098 297.98 62.0098 297.98L72.2998 281.56L78.4298 271.87C78.4298 271.87 81.1998 271.28 84.5598 269.69C87.9198 268.11 95.2398 264.55 96.6298 260.79C98.0098 257.03 97.8198 255.84 97.8198 255.84C97.8198 255.84 99.3998 255.84 101.38 250.89C103.36 245.94 97.8098 232.52 97.8098 232.52Z" fill="#BF1723"/>
|
||||
<path d="M171.99 3.37012L190.48 14.7401L210.75 28.9801L231.82 45.6901L245.17 57.9501L255.26 68.6301L263.63 78.4201C263.63 78.4201 275.5 92.8601 278.93 99.9101C282.36 106.96 290.37 118.87 294.03 130.64C297.69 142.41 302.24 158.73 302.14 170.4C302.04 182.07 300.16 204.52 295.61 214.41C291.06 224.3 281.76 245.86 271.28 254.17C260.8 262.48 237.06 280.58 237.06 280.58C237.06 280.58 212.93 291.06 197.5 292.45C182.07 293.84 157.74 291.07 149.83 287.5C141.92 283.94 118.38 275.63 107.1 263.57C95.8299 251.5 88.1099 240.82 88.1099 240.82L107.1 222.62C107.1 222.62 120.15 237.46 134.59 242.6C149.03 247.74 164.26 253.28 184.04 251.3C203.82 249.32 224.19 239.63 224.19 239.63C224.19 239.63 244.76 226.58 253.46 206.79C262.16 187.01 262.95 161.3 255.24 135.98C247.53 110.66 234.87 88.1101 234.87 88.1101C234.87 88.1101 208.17 44.2001 203.42 40.8401C198.69 37.4901 171.99 3.37012 171.99 3.37012Z" fill="#FCD116"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
BIN
ИП5/111/src/assets/meme1.jpg
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
ИП5/111/src/assets/meme2.jpg
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
ИП5/111/src/assets/meme3.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
ИП5/111/src/assets/meme4.jpg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
ИП5/111/src/assets/meme5.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
6
ИП5/111/src/assets/message-icon.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="669" height="608" viewBox="0 0 669 608" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M33.265 607.169C29.796 607.169 26.387 605.874 23.763 603.432C19.932 599.868 18.419 594.459 19.844 589.424L53.914 469.04C18.725 419.919 0.162003 363.025 0.162003 304.06C0.162003 262.963 9.06701 223.103 26.63 185.588C43.542 149.463 67.724 117.046 98.503 89.237C161.523 32.301 245.217 0.945007 334.168 0.945007C423.122 0.945007 506.818 32.301 569.839 89.237C600.618 117.046 624.801 149.463 641.713 185.588C659.276 223.103 668.181 262.963 668.181 304.06C668.181 345.155 659.276 385.014 641.713 422.528C624.801 458.653 600.618 491.069 569.839 518.877C506.818 575.813 423.122 607.169 334.168 607.169C272.121 607.169 211.813 591.697 159.3 562.364L38.017 606.334C36.467 606.896 34.859 607.169 33.265 607.169ZM160.612 533.107C163.057 533.107 165.487 533.75 167.648 535.012C217.214 563.97 274.796 579.277 334.167 579.277C416.199 579.277 493.255 550.477 551.139 498.181C608.627 446.243 640.287 377.304 640.287 304.061C640.287 230.815 608.627 161.873 551.139 109.936C493.255 57.64 416.2 28.839 334.167 28.839C252.138 28.839 175.084 57.64 117.201 109.936C59.714 161.874 28.054 230.816 28.054 304.061C28.054 359.198 46.133 412.396 80.337 457.905C82.954 461.386 83.794 465.891 82.608 470.082L54.093 570.837L155.86 533.942C157.401 533.383 159.01 533.107 160.612 533.107Z" fill="white"/>
|
||||
<path d="M440.419 402.182H153.893C146.191 402.182 139.947 395.938 139.947 388.236C139.947 380.534 146.191 374.29 153.893 374.29H440.419C448.121 374.29 454.365 380.534 454.365 388.236C454.365 395.938 448.121 402.182 440.419 402.182Z" fill="white"/>
|
||||
<path d="M514.448 318.003H153.893C146.191 318.003 139.947 311.759 139.947 304.057C139.947 296.355 146.191 290.111 153.893 290.111H514.448C522.15 290.111 528.394 296.355 528.394 304.057C528.394 311.759 522.15 318.003 514.448 318.003Z" fill="white"/>
|
||||
<path d="M514.448 233.826H153.893C146.191 233.826 139.947 227.582 139.947 219.88C139.947 212.178 146.191 205.934 153.893 205.934H514.448C522.15 205.934 528.394 212.178 528.394 219.88C528.394 227.582 522.15 233.826 514.448 233.826Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
BIN
ИП5/111/src/assets/photo.jpg
Normal file
|
After Width: | Height: | Size: 356 KiB |
10
ИП5/111/src/assets/profile-icon.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<svg width="428" height="428" viewBox="0 0 428 428" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3_100)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M199.5 1.03578C163.394 3.43679 127.681 15.3168 98 34.8018C84.295 43.7998 76.669 49.9688 64.63 61.7998C30.476 95.3648 9.58699 136.587 2.45399 184.5C0.201994 199.629 0.212996 227.823 2.478 243.5C7.987 281.635 23.311 317.238 47.026 347C55.453 357.575 75.042 376.781 85 384.231C114.449 406.264 147.76 420.093 184.5 425.538C199.308 427.733 228.803 427.738 243.5 425.547C280.235 420.073 313.627 406.207 343 384.231C352.958 376.781 372.547 357.575 380.974 347C404.616 317.33 419.695 282.336 425.573 243.5C427.791 228.843 427.78 199.441 425.55 184.5C420.85 153.009 409.639 123.097 393.055 97.7978C384.244 84.3568 378.038 76.6828 366.2 64.5908C322.341 19.7908 262.214 -3.13322 199.5 1.03578ZM229.699 23.0078C303.453 29.5368 365.275 75.5218 392.359 144C401.417 166.902 405.28 187.832 405.277 214C405.274 240.064 401.203 261.901 392.036 285.032C384.876 303.1 372.169 324.192 360.227 337.835L354.682 344.169L352.497 338.835C338.115 303.72 309.622 274.318 275.006 258.871C269.002 256.192 263.619 254 263.045 254C262.47 254 262 253.55 262 253C262 252.45 262.455 252 263.011 252C264.865 252 280.202 236.58 284.206 230.691C294.644 215.336 299.182 200.581 299.182 182C299.182 166.457 297.058 157.518 290.034 143.5C281.672 126.813 268.989 114.121 252.5 105.937C238.374 98.9258 229.474 96.8178 214 96.8178C198.457 96.8178 189.518 98.9418 175.5 105.966C153.687 116.897 137.129 137.499 130.869 161.5C127.953 172.676 127.976 191.296 130.919 202.5C133.458 212.167 139.441 224.98 144.784 232.194C149.052 237.957 163.388 252 165.003 252C167.922 252 165.162 253.949 158.75 256.416C122.293 270.443 90.705 301.717 75.503 338.835L73.318 344.169L67.773 337.835C55.831 324.192 43.124 303.1 35.964 285.032C22.115 250.088 18.83 211.588 26.53 174.457C42.729 96.3408 107.189 35.7338 186 24.5228C204.236 21.9278 213.766 21.5978 229.699 23.0078ZM230.539 120.552C254.543 126.804 272.639 147.171 276.797 172.616C278.179 181.068 278.177 182.942 276.779 191.494C272.202 219.505 251.505 240.202 223.494 244.779C214.942 246.177 213.068 246.179 204.616 244.797C185.349 241.649 168.746 230.529 159.241 214.408C144.475 189.366 148.503 157.592 169.048 137.048C185.179 120.916 208.213 114.737 230.539 120.552ZM235.619 269.546C281.127 277.466 318.697 309.167 334.407 352.901L337.066 360.301L334.824 362.687C330.891 366.874 309.862 380.423 299 385.77C280.495 394.878 262.6 400.459 241.585 403.676C226.794 405.941 201.177 405.936 186.346 403.666C162.687 400.045 137.287 391.18 117.956 379.797C108.563 374.266 92.822 363.139 91.606 361.171C91.263 360.617 92.169 356.865 93.617 352.832C107.023 315.514 136.007 286.96 173.055 274.576C178.86 272.636 187.185 270.403 191.555 269.614C202.39 267.658 224.575 267.623 235.619 269.546Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3_100">
|
||||
<rect width="428" height="428" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
1
ИП5/111/src/assets/react.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
3
ИП5/111/src/assets/settings-icon.svg
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
11
ИП5/111/src/components/Bottombar/Bottombar.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.bottombar{
|
||||
bottom: 0;
|
||||
border-top: 3px solid #BF1723;
|
||||
border-top-right-radius: 25px;
|
||||
border-top-left-radius: 25px;
|
||||
background-color: #222222;
|
||||
}
|
||||
|
||||
.bottombar > a > img {
|
||||
width: 25px;
|
||||
}
|
||||
12
ИП5/111/src/components/Bottombar/Bottombar.jsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import './Bottombar.css'
|
||||
|
||||
export default function Bottombar() {
|
||||
return(
|
||||
<div class="bottombar d-flex d-sm-none position-fixed w-100 justify-content-evenly py-2 px-0">
|
||||
<a href="lenta.html"><img src="src/assets/home-icon.svg" alt="" /></a>
|
||||
<a href="messages.html"><img src="src/assets/message-icon.svg" alt="" /></a>
|
||||
<a href="profile.html"><img src="src/assets/profile-icon.svg" alt="" /></a>
|
||||
<a href="index.html"><img src="src/assets/exit-icon.svg" alt="" /></a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
16
ИП5/111/src/components/Header/Header.css
Normal file
@@ -0,0 +1,16 @@
|
||||
/* Шапка */
|
||||
header .container-fluid {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
|
||||
border-bottom: 3px solid #BF1723;
|
||||
border-bottom-right-radius: 25px;
|
||||
border-bottom-left-radius: 25px;
|
||||
}
|
||||
.left-part{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.right-part > img {
|
||||
border-radius: 25px;
|
||||
}
|
||||
17
ИП5/111/src/components/Header/Header.jsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import './Header.css'
|
||||
|
||||
export default function Header() {
|
||||
return(
|
||||
<header>
|
||||
<div class="container-fluid">
|
||||
<div class="left-part">
|
||||
<img src="src/assets/logo.svg" alt="Logo" width="50" />
|
||||
</div>
|
||||
|
||||
<div class="right-part d-none d-sm-flex me-4 my-1">
|
||||
<img src="src/assets/photo.jpg" alt="" class="account-image" />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
61
ИП5/111/src/components/Leftbar/Leftbar.css
Normal file
@@ -0,0 +1,61 @@
|
||||
.leftbar {
|
||||
width: 10%;
|
||||
background-color: #222222;
|
||||
border-radius: 15px;
|
||||
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.leftbar-content > a {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.leftbar-settings {
|
||||
border-top: 1px solid rgba(128, 128, 128, 0.479);
|
||||
}
|
||||
|
||||
.leftbar-settings > a{
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid rgba(128, 128, 128, 0.479);
|
||||
}
|
||||
|
||||
.footer > span {
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
}
|
||||
|
||||
span:hover {
|
||||
color: #BF1723;
|
||||
}
|
||||
|
||||
.footer:hover .footer-menu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
top: 150%;
|
||||
left: -6%;
|
||||
|
||||
width: 110%;
|
||||
|
||||
position: absolute;
|
||||
|
||||
background-color: #222222;
|
||||
border-radius: 10px;
|
||||
|
||||
padding: 10px;
|
||||
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.footer-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.footer-menu > a {
|
||||
border-radius: 5px;
|
||||
}
|
||||
29
ИП5/111/src/components/Leftbar/Leftbar.jsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import './Leftbar.css'
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
import 'bootstrap/dist/js/bootstrap.bundle.min';
|
||||
|
||||
export default function Leftbar() {
|
||||
return(
|
||||
<div class="leftbar d-none h-100 m-1 d-sm-flex flex-column">
|
||||
<div class="leftbar-content d-flex flex-column mt-2 mx-2 mb-1">
|
||||
<a class="mb-1 p-1" href="profile.html">Профиль</a>
|
||||
<a class="mb-1 p-1" href="lenta.html">Лента</a>
|
||||
<a class="mb-1 p-1" href="messages.html">Сообщения</a>
|
||||
</div>
|
||||
|
||||
<div class="leftbar-settings d-flex flex-column mt-2 mx-2 mb-0 pt-1">
|
||||
<a class="p-1" href="index.html">Настройки</a>
|
||||
</div>
|
||||
|
||||
<div class="footer position-relative m-2 pt-1">
|
||||
<span class="position-relative">Ещё ▼</span>
|
||||
<div class="footer-menu">
|
||||
<a class="mb-1 p-1" href="#">Разработчикам</a>
|
||||
<a class="mb-1 p-1" href="#">О нас</a>
|
||||
<a class="mb-1 p-1" href="#">Правовая информация</a>
|
||||
<a class="mb-1 p-1" href="#">Помощь</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
62
ИП5/111/src/components/Post.jsx
Normal file
@@ -0,0 +1,62 @@
|
||||
export const Post = ({ post, onEdit, onDelete }) => {
|
||||
const formatDate = (dateString) => {
|
||||
const date = new Date(dateString);
|
||||
const now = new Date();
|
||||
const diffInHours = Math.floor((now - date) / (1000 * 60 * 60));
|
||||
|
||||
if (diffInHours < 24) {
|
||||
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
||||
} else {
|
||||
return date.toLocaleDateString([], { day: 'numeric', month: 'long' });
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="post mb-3">
|
||||
<div className="post-header mb-2 d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<i className='bi bi-people'></i>
|
||||
<label>{post.group}</label>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
className="btn btn-sm btn-outline-secondary me-1"
|
||||
onClick={() => onEdit(post)}
|
||||
>
|
||||
<i className="bi bi-pencil"></i>
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-sm btn-outline-danger"
|
||||
onClick={() => onDelete(post.id)}
|
||||
>
|
||||
<i className="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Блок с изображением */}
|
||||
{post.image && (
|
||||
<div className="image position-relative w-98 p-1 mb-2">
|
||||
<img
|
||||
src={post.image}
|
||||
className="post-img w-100 h-100 object-fit-cover"
|
||||
alt="Post content"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Текст */}
|
||||
{post.text && <div className="post-text mb-2 p-2">{post.text}</div>}
|
||||
|
||||
{/* Подвал */}
|
||||
<div className="post-footer p-1">
|
||||
<i className='bi bi-heart me-2'><span className="ms-1">{post.likes}</span></i>
|
||||
<i className='bi bi-chat-left me-2'><span className="ms-1">{post.comments}</span></i>
|
||||
<i className='bi bi-reply me-2'><span className="ms-1">{post.shares}</span></i>
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
{formatDate(post.createdAt)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
106
ИП5/111/src/components/PostForm.jsx
Normal file
@@ -0,0 +1,106 @@
|
||||
import { useState, useRef } from 'react';
|
||||
import 'bootstrap-icons/font/bootstrap-icons.css';
|
||||
|
||||
export const PostForm = ({ onSubmit, onCancel, initialData = {} }) => {
|
||||
const [formData, setFormData] = useState({
|
||||
text: initialData.text || '',
|
||||
image: null,
|
||||
imagePreview: initialData.image || ''
|
||||
});
|
||||
|
||||
const fileInputRef = useRef(null);
|
||||
|
||||
const handleInputChange = (e) => {
|
||||
setFormData({ ...formData, text: e.target.value });
|
||||
};
|
||||
|
||||
const handleImageChange = (e) => {
|
||||
const file = e.target.files[0];
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
reader.onloadend = () => {
|
||||
setFormData({
|
||||
...formData,
|
||||
image: file,
|
||||
imagePreview: reader.result
|
||||
});
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
};
|
||||
|
||||
const handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
if (!formData.text && !formData.image) {
|
||||
alert('Пост должен содержать текст или изображение');
|
||||
return;
|
||||
}
|
||||
onSubmit(formData);
|
||||
};
|
||||
|
||||
const triggerFileInput = () => {
|
||||
fileInputRef.current.click();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="add-post-form mb-4 pb-3">
|
||||
<h5>{initialData.id ? 'Редактировать пост' : 'Новый пост'}</h5>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div className="mb-3">
|
||||
<textarea
|
||||
className="form-control"
|
||||
placeholder="Напишите что-нибудь..."
|
||||
rows="3"
|
||||
value={formData.text}
|
||||
onChange={handleInputChange}
|
||||
></textarea>
|
||||
</div>
|
||||
<div className="mb-3">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-outline-secondary"
|
||||
onClick={triggerFileInput}
|
||||
>
|
||||
<i className="bi bi-image"></i> {formData.imagePreview ? 'Заменить изображение' : 'Выбрать изображение'}
|
||||
</button>
|
||||
<input
|
||||
type="file"
|
||||
ref={fileInputRef}
|
||||
accept="image/*"
|
||||
className="d-none"
|
||||
onChange={handleImageChange}
|
||||
/>
|
||||
{formData.imagePreview && (
|
||||
<div className="mt-2">
|
||||
<img
|
||||
src={formData.imagePreview}
|
||||
className="img-thumbnail"
|
||||
style={{ maxHeight: '200px' }}
|
||||
alt="Превью"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-sm btn-outline-danger ms-2"
|
||||
onClick={() => setFormData({ ...formData, image: null, imagePreview: '' })}
|
||||
>
|
||||
<i className="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="d-flex justify-content-between">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-outline-secondary"
|
||||
onClick={onCancel}
|
||||
>
|
||||
Отмена
|
||||
</button>
|
||||
<button type="submit" className="btn btn-danger">
|
||||
<i className="bi bi-send"></i> {initialData.id ? 'Обновить' : 'Опубликовать'}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
12
ИП5/111/src/components/Rightbar/Rightbar.css
Normal file
@@ -0,0 +1,12 @@
|
||||
.rightbar {
|
||||
height: 100%;
|
||||
width: 10%;
|
||||
background-color: #222222;
|
||||
border-radius: 15px;
|
||||
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.rightbar-content > a {
|
||||
border-radius: 5px;
|
||||
}
|
||||
15
ИП5/111/src/components/Rightbar/Rightbar.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import './Rightbar.css'
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
import 'bootstrap/dist/js/bootstrap.bundle.min';
|
||||
|
||||
export default function Rightbar() {
|
||||
return(
|
||||
<div class="rightbar d-none d-sm-flex m-1">
|
||||
<div class="rightbar-content d-flex flex-column m-2">
|
||||
<a class="mb-1 p-1" href="#">Все</a>
|
||||
<a class="mb-1 p-1" href="#">Непрочитанные</a>
|
||||
<a class="mb-1 p-1" href="#">Архив</a>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
7
ИП5/111/src/index.css
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
body {
|
||||
color: #c5c6c7;
|
||||
background-color: #0b0c10;
|
||||
margin: 0px;
|
||||
min-height: 100%;
|
||||
}
|
||||
10
ИП5/111/src/main.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
import App from './App.jsx'
|
||||
|
||||
createRoot(document.getElementById('root')).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
)
|
||||
37
ИП5/111/src/services/PostService.js
Normal file
@@ -0,0 +1,37 @@
|
||||
export class PostService {
|
||||
static STORAGE_KEY = 'posts';
|
||||
|
||||
static getPosts() {
|
||||
const savedPosts = localStorage.getItem(this.STORAGE_KEY);
|
||||
return savedPosts ? JSON.parse(savedPosts) : null;
|
||||
}
|
||||
|
||||
static savePosts(posts) {
|
||||
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(posts));
|
||||
}
|
||||
|
||||
static getInitialPosts() {
|
||||
return [
|
||||
{
|
||||
id: 1,
|
||||
text: '',
|
||||
image: 'source/meme1.jpg',
|
||||
group: 'Какая-то группа 1',
|
||||
likes: 8,
|
||||
comments: 2,
|
||||
shares: 1,
|
||||
createdAt: new Date(now - 86400000 * 2).toISOString()
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
text: '',
|
||||
image: 'src/assets/meme2.jpg',
|
||||
group: 'Какая-то группа 2',
|
||||
likes: 785,
|
||||
comments: 102,
|
||||
shares: 14,
|
||||
createdAt: new Date(now - 86400000 * 2).toISOString()
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
7
ИП5/111/vite.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
})
|
||||