├── style.css
├── .gitignore
├── practice-01
├── .eslintrc.json
├── app
│ ├── favicon.ico
│ ├── page.module.scss
│ ├── layout.js
│ ├── globals.css
│ └── page.js
├── jsconfig.json
├── next.config.mjs
├── components
│ ├── SwitchTheme
│ │ ├── SwitchTheme.module.scss
│ │ └── index.js
│ ├── JokeNotice
│ │ ├── JokeNotice.module.scss
│ │ └── index.js
│ ├── Comment
│ │ ├── Comment.module.scss
│ │ └── Comment.js
│ ├── RandomQuestionsFrequency
│ │ ├── RandomQuestionsFrequency.module.scss
│ │ └── index.js
│ ├── RandomQuestionsList
│ │ ├── RandomQuestionsList.module.scss
│ │ └── index.js
│ ├── QuestionNotice
│ │ └── index.js
│ ├── RandomQuestions
│ │ ├── RandomQuestions.module.scss
│ │ └── index.js
│ ├── Timer
│ │ └── index.js
│ ├── Top5dieFive
│ │ ├── Five.module.scss
│ │ └── index.js
│ ├── QuestionOfTheDay
│ │ └── index.js
│ └── Questions
│ │ ├── Questions.module.scss
│ │ └── index.js
├── package.json
├── .gitignore
├── public
│ └── icons
│ │ └── next.svg
├── README.md
└── questions.js
├── lecture02
├── advanced
│ ├── chugaev
│ │ └── graph.png
│ ├── spesivtsev
│ │ └── graph.png
│ ├── style.css
│ └── index.html
└── basic
│ ├── trebunskih
│ └── Saiky.png
│ ├── index.html
│ ├── chugaev
│ └── index.html
│ ├── kuznetsov
│ └── index.html
│ ├── ankudinova
│ └── index.html
│ ├── Harin
│ └── index.html
│ ├── gladkov
│ └── index.html
│ └── Puchkov
│ └── puchkov.html
├── lecture04
├── basic
│ ├── trebunskih
│ │ └── graph.png
│ ├── kuznetsov
│ │ ├── assets
│ │ │ └── avatar.png
│ │ └── scss
│ │ │ ├── style.scss
│ │ │ ├── abstracts
│ │ │ ├── _common.scss
│ │ │ └── _vars.scss
│ │ │ ├── components
│ │ │ └── _button.scss
│ │ │ ├── style.css.map
│ │ │ ├── sections
│ │ │ └── _graph.scss
│ │ │ └── style.css
│ ├── style.css
│ ├── index.html
│ ├── chugaev
│ │ └── index.html
│ └── lecture.html
└── advanced
│ └── index.js
├── practice-02
├── components
│ ├── randomQuestionNotice
│ │ ├── index.php
│ │ └── notifications.js
│ ├── questionsOfDay
│ │ ├── index.php
│ │ └── script.js
│ ├── randomQuestionFrequency
│ │ ├── index.php
│ │ └── script.js
│ ├── TextValidator
│ │ ├── index.php
│ │ └── script.js
│ ├── simpleRandom
│ │ ├── index.php
│ │ └── script.js
│ ├── checkEmail
│ │ ├── script.js
│ │ └── index.php
│ ├── questions
│ │ ├── index.php
│ │ └── script.js
│ └── questionsByIds
│ │ ├── index.php
│ │ └── script.js
├── api
│ ├── getQuestionOfDay.php
│ ├── getRandomQuestion.php
│ ├── getRandomQuestionFrequency.php
│ ├── getSimpleRandomQuestionsHistory.php
│ ├── getSimpleRandomQuestions.php
│ ├── getQuestionsByIds.php
│ ├── checkEmail.php
│ ├── getQuestions.php
│ ├── validateText.php
│ └── addQuestion.php
├── services
│ ├── SessionManager.php
│ ├── RandomSmileService.php
│ ├── RenderResultTrait.php
│ ├── RandomQuestionService.php
│ ├── CheckEmailService.php
│ ├── RandomQuestionFrequency.php
│ ├── SimpleRandomQuestionsService.php
│ ├── QuestionOfDayService.php
│ ├── QuestionsByIdsService.php
│ └── QuestionsService.php
└── index.php
├── lecture03
├── advanced
│ ├── style.css
│ ├── index.html
│ ├── chugaev
│ │ └── index.html
│ └── spesivtsev
│ │ └── index.html
└── basic
│ ├── index.html
│ ├── chugaev
│ └── index.html
│ ├── trebunskih
│ ├── css
│ │ └── style.css
│ └── index.html
│ ├── Puchkov
│ └── index2.html
│ ├── kuznetsov
│ └── index.html
│ ├── Ankudinova-basic-lecture03
│ └── index.html
│ ├── gladkov
│ └── index.html
│ ├── Harin
│ └── index.html
│ └── britvin
│ └── index.html
├── lecture05
└── index.js
├── package.json
├── index.html
├── lecture07
├── chugaev
│ └── index.php
└── index.php
├── lecture06
└── index.php
├── script.js
└── README.md
/style.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .DS_Store
3 |
4 | node_modules
5 | package-lock.json
--------------------------------------------------------------------------------
/practice-01/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/practice-01/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/m-chugaev/teach-web/HEAD/practice-01/app/favicon.ico
--------------------------------------------------------------------------------
/lecture02/advanced/chugaev/graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/m-chugaev/teach-web/HEAD/lecture02/advanced/chugaev/graph.png
--------------------------------------------------------------------------------
/lecture02/basic/trebunskih/Saiky.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/m-chugaev/teach-web/HEAD/lecture02/basic/trebunskih/Saiky.png
--------------------------------------------------------------------------------
/lecture04/basic/trebunskih/graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/m-chugaev/teach-web/HEAD/lecture04/basic/trebunskih/graph.png
--------------------------------------------------------------------------------
/practice-01/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "paths": {
4 | "@/*": ["./*"]
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/lecture02/advanced/spesivtsev/graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/m-chugaev/teach-web/HEAD/lecture02/advanced/spesivtsev/graph.png
--------------------------------------------------------------------------------
/practice-01/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {};
3 |
4 | export default nextConfig;
5 |
--------------------------------------------------------------------------------
/lecture04/basic/kuznetsov/assets/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/m-chugaev/teach-web/HEAD/lecture04/basic/kuznetsov/assets/avatar.png
--------------------------------------------------------------------------------
/lecture04/basic/kuznetsov/scss/style.scss:
--------------------------------------------------------------------------------
1 | @import 'abstracts/vars';
2 | @import 'abstracts/common';
3 |
4 | @import 'components/button';
5 |
6 | @import 'sections/graph';
--------------------------------------------------------------------------------
/practice-02/components/randomQuestionNotice/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/lecture02/advanced/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: PT Sans, sans-serif;
3 | color: #464646;
4 | background-color: #eee;
5 | padding: 16px;
6 | margin: 0 auto;
7 | width: 100%;
8 | max-width: 1100px;
9 | }
--------------------------------------------------------------------------------
/lecture03/advanced/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: PT Sans, sans-serif;
3 | color: #464646;
4 | background-color: #eee;
5 | padding: 16px;
6 | margin: 0 auto;
7 | width: 100%;
8 | max-width: 1100px;
9 | }
--------------------------------------------------------------------------------
/lecture04/basic/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: PT Sans, sans-serif;
3 | color: #464646;
4 | background-color: #eee;
5 | padding: 16px;
6 | margin: 0 auto;
7 | width: 100%;
8 | max-width: 1100px;
9 | }
--------------------------------------------------------------------------------
/practice-02/api/getQuestionOfDay.php:
--------------------------------------------------------------------------------
1 | getQuestionOfDay();
7 | $service->renderResult($questionOfDay);
8 |
--------------------------------------------------------------------------------
/practice-01/app/page.module.scss:
--------------------------------------------------------------------------------
1 | .main {
2 | width: 100%;
3 | max-width: 1100px;
4 | padding: 16px;
5 | margin: 0 auto;
6 | }
7 |
8 | .icon {
9 | position: fixed;
10 | right: 16px;
11 | bottom: 16px;
12 | z-index: 10;
13 | }
--------------------------------------------------------------------------------
/practice-02/api/getRandomQuestion.php:
--------------------------------------------------------------------------------
1 | getRandomQuestion();
7 | $service->renderResult($question);
8 |
9 |
--------------------------------------------------------------------------------
/practice-02/services/SessionManager.php:
--------------------------------------------------------------------------------
1 |
2 | Вопрос дня (Задание 13)
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lecture02/basic/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Best
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/lecture03/basic/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Best
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/lecture05/index.js:
--------------------------------------------------------------------------------
1 | import { Chugaev } from 'chugaev-lecture04'
2 | const chugaev = new Chugaev('Сделал задание 4 лекции.');
3 | chugaev.checkIn();
4 |
5 | import { SecondName } from 'spesivtsev'
6 | const person = new SecondName('Спесивцев', 'Привет!');
7 | person.checkIn();
--------------------------------------------------------------------------------
/practice-02/services/RandomSmileService.php:
--------------------------------------------------------------------------------
1 | getRandomQuestions();
7 | header('Content-Type: application/json');
8 | echo json_encode($randomQuestions);
--------------------------------------------------------------------------------
/lecture04/basic/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | All
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/practice-02/api/getSimpleRandomQuestionsHistory.php:
--------------------------------------------------------------------------------
1 | getRequestsHistory();
10 | $service->renderResult($history);
--------------------------------------------------------------------------------
/practice-02/services/RenderResultTrait.php:
--------------------------------------------------------------------------------
1 | saveRequest();
10 | $randomQuestions = $service->getRandomQuestions();
11 | $service->renderResult($randomQuestions);
--------------------------------------------------------------------------------
/practice-02/components/randomQuestionFrequency/index.php:
--------------------------------------------------------------------------------
1 |
2 |
Список 5 вопросов с разной частотой выпадения (4 задание)
3 |
4 |
5 |
6 | Сгенерировать 5
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/practice-02/api/getQuestionsByIds.php:
--------------------------------------------------------------------------------
1 | validateQuery($_GET);
8 |
9 | if (isset($validate['error'])) {
10 | $service->renderResult($validate);
11 | exit;
12 | }
13 |
14 | $result = $service->getQuestionsByIds($validate['ids']);
15 |
16 | $service->renderResult($result);
--------------------------------------------------------------------------------
/practice-02/components/TextValidator/index.php:
--------------------------------------------------------------------------------
1 |
2 |
Проверка текста
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/lecture04/advanced/index.js:
--------------------------------------------------------------------------------
1 | import { Chugaev } from 'chugaev-lecture04'
2 |
3 | const chugaev = new Chugaev('Сделал задание 4 лекции.');
4 | chugaev.checkIn();
5 |
6 | // Богатырев
7 | // Сорокин
8 | // Черенева
9 | // Саилов
10 | import { SecondName } from 'spesivtsev'
11 |
12 | const person = new SecondName('Спесивцев', 'Привет!');
13 | person.checkIn();
14 | // Булгаков
15 | // Голубчикова
16 | // Михалев
17 | // Рычин
18 | // Пучков
19 | // Помаскин
--------------------------------------------------------------------------------
/practice-02/api/checkEmail.php:
--------------------------------------------------------------------------------
1 | save();
16 | $check = $service->checkEmail(); // Здесь возвращаем итог строчку
17 | $service->renderResult($check); // Сюда передаём итог строчку
--------------------------------------------------------------------------------
/practice-02/api/getQuestions.php:
--------------------------------------------------------------------------------
1 | getPaginatedQuestions($page, $pageSize);
13 |
14 | $service->renderResult($result);
--------------------------------------------------------------------------------
/practice-02/api/validateText.php:
--------------------------------------------------------------------------------
1 | $isValid]);
12 | } else {
13 | echo json_encode(['error' => 'Недопустимый запрос']);
14 | }
15 | ?>
16 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "teach-web",
3 | "version": "1.0.0",
4 | "type": "module",
5 | "description": "Репозиторий для изучения web-разработки",
6 | "scripts": {
7 | "lecture04": "node lecture04/advanced/index.js",
8 | "lecture05": "node lecture05/index.js"
9 | },
10 | "dependencies": {
11 | "chugaev-lecture04": "github:m-chugaev/lecture04-lib",
12 | "spesivtsev": "github:AfordiumSX/lecture4"
13 | },
14 | "license": "ISC"
15 | }
16 |
--------------------------------------------------------------------------------
/practice-02/components/simpleRandom/index.php:
--------------------------------------------------------------------------------
1 |
2 |
Простой список случайных вопросов (1 задание)
3 |
4 |
5 |
6 | Сгенерировать 5
7 | Показать историю
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/practice-01/app/layout.js:
--------------------------------------------------------------------------------
1 | import { Inter } from "next/font/google";
2 | import "./globals.css";
3 |
4 | const inter = Inter({ subsets: ["latin"] });
5 |
6 | export const metadata = {
7 | title: "Questions App",
8 | description: "Приложение для проведения собеседования",
9 | };
10 |
11 | export default function RootLayout({ children }) {
12 | return (
13 |
14 | {children}
15 |
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/practice-01/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "practice-01",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "next": "14.1.0",
13 | "react": "^18",
14 | "react-dom": "^18",
15 | "sass": "^1.71.1"
16 | },
17 | "devDependencies": {
18 | "eslint": "^8",
19 | "eslint-config-next": "14.1.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/practice-02/components/randomQuestionNotice/notifications.js:
--------------------------------------------------------------------------------
1 | document.addEventListener('DOMContentLoaded', (event) => {
2 | function fetchRandomQuestion() {
3 | fetch('/practice-02/api/getRandomQuestion.php')
4 | .then(response => response.json())
5 | .then(encodedQuestion => {
6 | showNotice(encodedQuestion);
7 | })
8 | .catch(error => console.error('Ошибка:', error));
9 | }
10 |
11 | setTimeout(() => {
12 | fetchRandomQuestion();
13 | }, 1000);
14 | });
--------------------------------------------------------------------------------
/practice-02/services/RandomQuestionService.php:
--------------------------------------------------------------------------------
1 | getQuestionsText();
16 | $randomKey = array_rand($all);
17 | return $all[$randomKey];
18 | }
19 | }
--------------------------------------------------------------------------------
/practice-01/app/globals.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | padding: 0;
4 | margin: 0;
5 | }
6 |
7 | html,
8 | body {
9 | max-width: 100vw;
10 | overflow-x: hidden;
11 | }
12 |
13 | body {
14 | font-family: PT Sans, sans-serif;
15 | color: #464646;
16 | background-color: #eee;
17 | }
18 |
19 | a {
20 | color: inherit;
21 | text-decoration: none;
22 | }
23 |
24 | .dark {
25 | background-color: #333;
26 | color: #fff;
27 | }
28 |
29 | .light {
30 | background-color: #fff;
31 | color: #333;
32 | }
33 |
--------------------------------------------------------------------------------
/practice-02/components/checkEmail/script.js:
--------------------------------------------------------------------------------
1 | // fetch to /api/checkEmail
2 | // handle result
3 |
4 | (function (){
5 | const form = document.querySelector('.formEmail_js');
6 | form.addEventListener('submit', async (event) => {
7 | event.preventDefault();
8 |
9 | fetch(API_BASE_URL + 'checkEmail.php', {
10 | method: 'POST',
11 | body: (new FormData(form))
12 | })
13 | .then((response) => response.json())
14 | .then((text) => showNotice(text))
15 | });
16 | })()
--------------------------------------------------------------------------------
/practice-02/components/questions/index.php:
--------------------------------------------------------------------------------
1 |
2 |
Вопросы для собеседования
3 |
4 |
6 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/practice-01/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 | .yarn/install-state.gz
8 |
9 | # testing
10 | /coverage
11 |
12 | # next.js
13 | /.next/
14 | /out/
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | *.pem
22 |
23 | # debug
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # local env files
29 | .env*.local
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/lecture02/basic/chugaev/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Chugaev
7 |
8 |
9 | Основные теги
10 |
11 |
12 | block
13 | inline
14 |
15 |
16 |
--------------------------------------------------------------------------------
/lecture02/advanced/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | All
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/lecture03/advanced/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | All
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/practice-02/api/addQuestion.php:
--------------------------------------------------------------------------------
1 | addQuestion($newQuestion);
13 |
14 | $page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
15 | $pageSize = isset($_GET['pageSize']) ? (int)$_GET['pageSize'] : 10;
16 |
17 | $result = $questionsService->getPaginatedQuestions($page, $pageSize);
18 | $questionsService->renderResult($result);
--------------------------------------------------------------------------------
/lecture04/basic/chugaev/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Chugaev
8 |
9 |
10 |
11 | Chugaev
12 |
13 |
14 |
15 |
18 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/practice-02/components/questionsByIds/index.php:
--------------------------------------------------------------------------------
1 |
2 |
Вопросы по идентификатору (17 задание)
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/lecture04/basic/kuznetsov/scss/abstracts/_common.scss:
--------------------------------------------------------------------------------
1 | @import url(https://fonts.googleapis.com/css?family=PT+Sans:regular,italic,700,700italic);
2 |
3 | body {
4 | font-family: 'PT Sans', sans-serif;
5 | background-color: var(--color-gray);
6 | color: var(--color-font-black);
7 | }
8 |
9 |
10 | *,
11 | *::before,
12 | *::after {
13 | box-sizing: border-box;
14 | margin: 0;
15 | padding: 0;
16 | }
17 |
18 | .container {
19 | padding: 0 12px;
20 | margin: 0 auto;
21 | max-width: 1100px;
22 | }
23 |
24 | .svg-icon {
25 | fill: currentColor;
26 | width: 24px;
27 | height: 24px;
28 | }
--------------------------------------------------------------------------------
/practice-02/components/checkEmail/index.php:
--------------------------------------------------------------------------------
1 | getLatest();
10 | ?>
11 |
12 |
13 |
Чекни свой email
14 |
15 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/practice-01/components/JokeNotice/JokeNotice.module.scss:
--------------------------------------------------------------------------------
1 | .notice {
2 | position: fixed;
3 | top: 20px;
4 | right: 20px;
5 | background-color: #007bff; /* Синий цвет фона */
6 | color: #fff; /* Белый цвет текста */
7 | padding: 15px;
8 | border-radius: 10px;
9 | animation: slideIn 0.5s ease-out forwards; /* Анимация появления */
10 | box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); /* Тень */
11 | z-index: 1000; /* Поднимаем над другими элементами */
12 | }
13 |
14 | @keyframes slideIn {
15 | from {
16 | opacity: 0;
17 | transform: translateY(-50px); /* Начальное положение */
18 | }
19 | to {
20 | opacity: 1;
21 | transform: translateY(0); /* Конечное положение */
22 | }
23 | }
--------------------------------------------------------------------------------
/practice-01/components/Comment/Comment.module.scss:
--------------------------------------------------------------------------------
1 | // Comment.module.scss
2 | .container {
3 | border: 1px solid #ccc;
4 | padding: 20px;
5 | max-width: 600px;
6 | margin: 20px auto 0;
7 | }
8 |
9 | .title {
10 | margin-top: 0;
11 | margin-bottom: 10px;
12 | font-size: 1.5rem;
13 | }
14 |
15 | .comments {
16 | margin-bottom: 20px;
17 | }
18 |
19 | .comment {
20 | margin-bottom: 10px;
21 | }
22 |
23 | .textarea {
24 | width: 100%;
25 | height: 100px;
26 | margin-bottom: 10px;
27 | }
28 |
29 | .button {
30 | padding: 10px 20px;
31 | background-color: #007bff;
32 | color: #fff;
33 | border: none;
34 | border-radius: 5px;
35 | cursor: pointer;
36 | }
37 |
38 | .button:hover {
39 | background-color: #0056b3;
40 | }
41 |
--------------------------------------------------------------------------------
/practice-02/components/questionsOfDay/script.js:
--------------------------------------------------------------------------------
1 |
2 | function getQuestionOfDay() {
3 | return fetch('/practice-02/api/getQuestionOfDay.php')
4 | .then((response) => {
5 | return response.json();
6 | });
7 | }
8 |
9 | function fillQuestionOfDay() {
10 | const container = document.getElementById("questionOfDay");
11 |
12 | if (!container) {
13 | console.error('Ошибка! Не удалось найти контейнер для вопроса дня.');
14 | return;
15 | }
16 |
17 | getQuestionOfDay()
18 | .then((question) => {
19 | container.innerText = question;
20 | })
21 | .catch((error) => {
22 | console.error('Произошла ошибка при получении вопроса дня:', error);
23 | });
24 | }
25 |
26 | window.onload = fillQuestionOfDay;
27 |
--------------------------------------------------------------------------------
/lecture03/basic/chugaev/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Chugaev
7 |
8 |
9 | Основные CSS свойства
10 |
11 | Список всех CSS свойств
12 |
13 |
26 |
27 |
--------------------------------------------------------------------------------
/practice-02/services/CheckEmailService.php:
--------------------------------------------------------------------------------
1 | email = $email;
15 | }
16 |
17 | public function checkEmail(): string
18 | {
19 | if (filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
20 | return "Контакт сохранен";
21 | } else {
22 | return "Ошибка валидации email";
23 | }
24 | }
25 |
26 | public function getLatest(): string
27 | {
28 | return $_SESSION[self::SESSION_KEY] ?? "";
29 | }
30 |
31 | public function save(): void
32 | {
33 | $_SESSION[self::SESSION_KEY] = $this->email;
34 | }
35 | }
36 | ?>
--------------------------------------------------------------------------------
/practice-01/components/RandomQuestionsFrequency/RandomQuestionsFrequency.module.scss:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | border: 1px solid #ccc;
3 | max-width: 800px;
4 | margin: 20px auto 0;
5 | text-align: center; /* Центрирование содержимого по горизонтали */
6 | }
7 |
8 | .container {
9 | text-align: center;
10 | padding: 20px;
11 | margin-top: 10px;
12 | }
13 |
14 | .header {
15 | font-weight: bold;
16 | margin-bottom: 10px;
17 | font-size: 1.5rem;
18 | }
19 |
20 | .button {
21 | padding: 10px 20px;
22 | background-color: #007bff;
23 | color: #fff;
24 | border: none;
25 | border-radius: 5px;
26 | cursor: pointer;
27 | margin-top: 10px;
28 | }
29 |
30 | .button:hover {
31 | background-color: #0056b3;
32 | }
33 |
34 | .list {
35 | margin-top: 20px;
36 | text-align: left;
37 | }
38 |
39 | .item {
40 | margin-top: 10px;
41 | }
42 |
--------------------------------------------------------------------------------
/practice-01/components/SwitchTheme/index.js:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { useState, useEffect } from "react";
3 | import styles from "./SwitchTheme.module.scss";
4 |
5 | export default function SwitchTheme() {
6 | const [theme, setTheme] = useState("light");
7 |
8 | useEffect(() => {
9 | const savedTheme = localStorage.getItem("theme");
10 | if (savedTheme) {
11 | setTheme(savedTheme);
12 | }
13 | }, []);
14 |
15 | const toggleTheme = () => {
16 | const newTheme = theme === "light" ? "dark" : "light";
17 | setTheme(newTheme);
18 | localStorage.setItem("theme", newTheme);
19 | };
20 |
21 | useEffect(() => {
22 | document.body.className = theme;
23 | }, [theme]);
24 |
25 | return (
26 |
27 |
28 | {theme === "light" ? "Dark Theme" : "Light Theme"}
29 |
30 |
31 | );
32 | }
33 |
--------------------------------------------------------------------------------
/practice-01/components/RandomQuestionsList/RandomQuestionsList.module.scss:
--------------------------------------------------------------------------------
1 | .container {
2 | border: 1px solid #ccc;
3 | padding: 20px;
4 | max-width: 800px;
5 | margin: 20px auto 0;
6 | text-align: center; /* Выравнивание заголовков по центру */
7 | }
8 |
9 | .title {
10 | font-size: 1.5rem;
11 | margin-bottom: 20px;
12 | }
13 |
14 | .button {
15 | padding: 10px 20px;
16 | background-color: #007bff;
17 | color: #fff;
18 | border: none;
19 | border-radius: 5px;
20 | cursor: pointer;
21 | }
22 |
23 | .button:hover {
24 | background-color: #0056b3;
25 | }
26 |
27 | .list {
28 | margin-top: 20px; /* Добавлен отступ сверху для контейнера с вопросами */
29 | text-align: left; /* Выравнивание рандомных вопросов по левому краю */
30 | }
31 |
32 | .history {
33 | margin-top: 20px;
34 | }
35 |
36 | .history h2 {
37 | margin-bottom: 10px;
38 | }
39 |
40 | .history ol {
41 | text-align: left; /* Выравнивание текста в списке по левому краю */
42 | }
43 |
--------------------------------------------------------------------------------
/practice-02/services/RandomQuestionFrequency.php:
--------------------------------------------------------------------------------
1 | count = $count;
15 | }
16 |
17 | public function getRandomQuestions(): array
18 | {
19 | $questionsService = new QuestionsService();
20 | $questionFrequencies = $questionsService->calculateQuestionFrequencies();
21 | $weightedQuestions = [];
22 |
23 | foreach ($questionFrequencies as $question => $frequency) {
24 | for ($i = 0; $i < $frequency; $i++) {
25 | $weightedQuestions[] = $question;
26 | }
27 | }
28 |
29 | shuffle($weightedQuestions);
30 |
31 | $selectedQuestions = array_slice($weightedQuestions, 0, $this->count);
32 |
33 | return $selectedQuestions;
34 | }
35 | }
--------------------------------------------------------------------------------
/lecture04/basic/kuznetsov/scss/components/_button.scss:
--------------------------------------------------------------------------------
1 | .base-button {
2 | padding: 0;
3 | background-color: transparent;
4 | border-radius: 0;
5 | border: none;
6 | text-align: inherit;
7 | outline: 0;
8 | display: inline-flex;
9 | align-items: center;
10 | justify-content: center;
11 | color: inherit;
12 | cursor: pointer;
13 | }
14 |
15 | .base-button--size-l {
16 | padding: 7px 15px;
17 | min-height: 36px;
18 | font-weight: 700;
19 | font-size: 16px;
20 | line-height: 20px;
21 | }
22 |
23 | .base-button--appearance-extra {
24 | border-radius: 4px;
25 | background: transparent;
26 | color: var(--color-gray-3);
27 | font-weight: 700;
28 | border: 1px solid var(--color-ui-gray-bg);
29 | }
30 |
31 | .base-dropdown__toggle>* {
32 | cursor: pointer;
33 | }
34 |
35 | .base-button--appearance-extra:hover {
36 | background-color: var(--color-gray-light-2);
37 | }
38 | .base-button:hover {
39 | text-decoration: none;
40 | }
--------------------------------------------------------------------------------
/practice-01/components/QuestionNotice/index.js:
--------------------------------------------------------------------------------
1 | 'use client'
2 | import React, {useState} from 'react';
3 | import questions from '@/questions';
4 |
5 | const QuestionNotice = () => {
6 | const [showNotice, setShowNotice] = useState(true);
7 | const randomIndex = Math.floor(Math.random() * questions.length);
8 | const question = questions[randomIndex].text;
9 |
10 | React.useEffect(() => {
11 | const timer = setTimeout(() => {
12 | setShowNotice(false);
13 | }, 5000);
14 |
15 | return () => clearTimeout(timer);
16 | }, []);
17 |
18 | return (
19 |
32 | {question}
33 |
34 | );
35 | };
36 |
37 | export default QuestionNotice;
--------------------------------------------------------------------------------
/lecture02/basic/kuznetsov/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | kuznetsov
7 |
8 |
9 |
10 |
11 | Текст абзаца
12 |
13 |
14 |
15 |
16 | Видево прикол
19 |
20 |
21 |
22 | Элемент списка
23 |
24 | block
25 | inline
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/practice-01/components/RandomQuestions/RandomQuestions.module.scss:
--------------------------------------------------------------------------------
1 | .container {
2 | border: 1px solid #ccc;
3 | padding: 20px;
4 | max-width: 800px; /* Увеличение максимальной ширины контейнера */
5 | margin: 20px auto 0;
6 | }
7 |
8 | .wrapper {
9 | margin-bottom: 20px; /* Отступ снизу блока wrapper */
10 | }
11 |
12 | .title {
13 | font-size: 1.5rem;
14 | margin-bottom: 20px;
15 | }
16 |
17 | .form {
18 | display: flex;
19 | }
20 |
21 | .input {
22 | flex: 1;
23 | padding: 10px;
24 | border: 1px solid #ccc;
25 | border-radius: 5px;
26 | margin-right: 10px;
27 | }
28 |
29 | .button {
30 | padding: 10px 20px;
31 | background-color: #007bff;
32 | color: #fff;
33 | border: none;
34 | border-radius: 5px;
35 | cursor: pointer;
36 | }
37 |
38 | .button:hover {
39 | background-color: #0056b3;
40 | }
41 |
42 | .result {
43 | margin-top: 20px; /* Отступ сверху блока result */
44 | }
45 |
46 | .result h3 {
47 | margin-bottom: 10px; /* Отступ снизу заголовка */
48 | }
49 |
50 | .result ol {
51 | padding-left: 20px;
52 | }
--------------------------------------------------------------------------------
/practice-02/services/SimpleRandomQuestionsService.php:
--------------------------------------------------------------------------------
1 | count = $count;
21 | }
22 |
23 | public function getRandomQuestions(): array
24 | {
25 | $all = (new QuestionsService)->getQuestionsText();
26 |
27 | return array_rand(array_flip($all), $this->count);
28 | }
29 |
30 | public function getRequestsHistory(): array
31 | {
32 | return $_SESSION[self::SESSION_KEY] ?? [];
33 | }
34 |
35 | public function saveRequest(): void
36 | {
37 | $current = $this->getRequestsHistory();
38 | $current[] = date('Y-m-d H:i:s');
39 | $_SESSION[self::SESSION_KEY] = $current;
40 | }
41 | }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | WEB Development
10 |
11 |
12 | Вопросы для собеседования
13 |
14 |
15 |
16 |
17 |
Случайные вопросы
18 |
19 |
20 |
21 | Сгенерировать 5
22 | Сгенерировать ещё 1
23 | Попытки
24 | Бонусы
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/practice-02/components/TextValidator/script.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | const form = document.getElementById('textValidatorForm');
3 | const textInput = document.getElementById('textInput');
4 | const validationResult = document.getElementById('validationResult');
5 |
6 | form.addEventListener('submit', function (event) {
7 | console.log('sdfsdfsfd');
8 | event.preventDefault();
9 |
10 | const text = textInput.value.trim();
11 |
12 | fetch(API_BASE_URL + 'validateText.php', {
13 | method: 'POST',
14 | body: JSON.stringify({ text: text }),
15 | headers: {
16 | 'Content-Type': 'application/json'
17 | }
18 | })
19 | .then(response => response.json())
20 | .then(data => {
21 | if (data.valid) {
22 | showNotice('Успешно', 'Текст корректен');
23 | } else {
24 | showNotice('Ошибка', 'Текст содержит недопустимые символы');
25 | }
26 | })
27 | .catch(error => {
28 | console.error('Ошибка:', error);
29 | });
30 | });
31 | }());
32 |
--------------------------------------------------------------------------------
/practice-01/components/JokeNotice/index.js:
--------------------------------------------------------------------------------
1 | 'use client'
2 | // components/JokeNotice.js
3 | import styles from './JokeNotice.module.scss';
4 | import React, { useState, useEffect } from 'react';
5 |
6 | const jokes = [
7 | 'Почему программисты так не любят пляж? Потому что в нем есть много багов!',
8 | 'Какой JavaScript-фреймворк самый быстрый? Ответ: React, потому что он всегда в состоянии!',
9 | 'Что говорит один HTML-элемент другому? "Ты выглядишь как div!"',
10 | 'Как программисты проводят выходные? В своем коде!',
11 | 'Знаете ли вы, почему не можем использовать фоновую музыку в коде? Потому что код постоянно находится в цикле!'
12 | ];
13 |
14 | const JokeNotice = () => {
15 | const [showNotice, setShowNotice] = useState(true);
16 | const joke = jokes[Math.floor(Math.random() * jokes.length)];
17 |
18 | useEffect(() => {
19 | const timer = setTimeout(() => {
20 | setShowNotice(false);
21 | }, 5000); // Уведомление исчезнет через 5 секунд
22 |
23 | return () => clearTimeout(timer);
24 | }, []);
25 |
26 | return (
27 |
28 | {joke}
29 |
30 | );
31 | };
32 |
33 | export default JokeNotice;
--------------------------------------------------------------------------------
/lecture07/chugaev/index.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Form
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
32 |
33 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/practice-01/public/icons/next.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/practice-01/components/Timer/index.js:
--------------------------------------------------------------------------------
1 | 'use client';
2 |
3 | import { useEffect, useState } from 'react';
4 |
5 | export default function Timer() {
6 | const [time, setTime] = useState(300);
7 | const [isRunning, setIsRunning] = useState(false);
8 |
9 | useEffect(() => {
10 | if (isRunning) {
11 | const timer = setInterval(() => {
12 | setTime(prevTime => prevTime - 1);
13 | }, 1000);
14 |
15 | return () => clearInterval(timer);
16 | }
17 | }, [isRunning]);
18 |
19 | useEffect(() => {
20 | if (time === 0) {
21 | alert('Таймер закончился');
22 | const resetTimer = window.confirm('Хотите сбросить таймер к 5 минутам?');
23 | if (resetTimer) {
24 | setTime(300);
25 | setIsRunning(false);
26 | }
27 | }
28 | }, [time]);
29 |
30 | const handleToggle = () => {
31 | setIsRunning(prevIsRunning => !prevIsRunning);
32 | };
33 | const resetTime = () => {
34 | setTime(300);
35 | setIsRunning(false);
36 | };
37 |
38 | return (
39 |
40 |
{Math.floor(time / 60)}:{(time % 60).toString().padStart(2, '0')}
41 | {isRunning ? '⛔️' : '▶️'}
42 | 🔄
43 |
44 | );
45 | };
--------------------------------------------------------------------------------
/practice-01/app/page.js:
--------------------------------------------------------------------------------
1 | import Image from "next/image";
2 | import styles from "./page.module.scss";
3 | import Questions from '../components/Questions';
4 | import RandomQuestionsList from '../components/RandomQuestionsList';
5 | import JokeNotice from '../components/JokeNotice';
6 | import QuestionNotice from '../components/QuestionNotice';
7 | import RandomQuestions from '../components/RandomQuestions';
8 | import RandomQuestionsFrequency from '../components/RandomQuestionsFrequency';
9 | import Comment from '../components/Comment/Comment';
10 | import SwitchTheme from "../components/SwitchTheme";
11 | import Random5Questions from "@/components/Top5dieFive";
12 | import QuestionOfTheDay from "@/components/QuestionOfTheDay";
13 | import Timer from "@/components/Timer"
14 |
15 | export default function Home() {
16 | return (
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
36 |
37 |
38 | );
39 | }
40 |
--------------------------------------------------------------------------------
/practice-01/components/Top5dieFive/Five.module.scss:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | border: 1px solid #ccc;
3 | padding: 20px;
4 | max-width: 800px; /* Увеличение максимальной ширины контейнера */
5 | margin: 20px auto 0;
6 | }
7 |
8 | .title {
9 | text-align: center; /* Центрирование текста */
10 | font-size: 1.5rem; /* Установка размера шрифта */
11 | }
12 |
13 | .button_1 {
14 | color: #ffffff; // Изменение цвета текста кнопки на белый
15 | background-color: #007bff; // Изменение цвета фона кнопки
16 | padding: 10px 20px;
17 | border: none;
18 | border-radius: 10px;
19 | cursor: pointer;
20 | transition: background-color 0.3s ease; // Плавное изменение цвета фона при наведении
21 | }
22 |
23 | .button_1:hover {
24 | background-color: #0056b3; // Изменение цвета фона кнопки при наведении
25 | }
26 |
27 | .button_2 {
28 | color: #ffffff; // Изменение цвета текста кнопки на белый
29 | background-color: #dc3545; // Изменение цвета фона кнопки
30 | padding: 10px 20px;
31 | border: none;
32 | border-radius: 10px;
33 | cursor: pointer;
34 | transition: background-color 0.3s ease; // Плавное изменение цвета фона при наведении
35 | }
36 |
37 | .button_2:hover {
38 | background-color: #bd2130; // Изменение цвета фона кнопки при наведении
39 | }
40 |
41 | .container {
42 | display: flex;
43 | justify-content: center;
44 | gap: 20px; /* Отступ между кнопками */
45 | margin-bottom: 20px;
46 | margin-top: 20px;
47 | }
48 |
--------------------------------------------------------------------------------
/practice-02/services/QuestionOfDayService.php:
--------------------------------------------------------------------------------
1 | getQuestionsText();
22 | foreach ($all_questions as $question) {
23 | if (!in_array($question, $_SESSION['shown_questions'])) {
24 | $question_of_day = $question;
25 | break;
26 | }
27 | }
28 | if ($question_of_day === null) {
29 | $_SESSION['shown_questions'] = array();
30 | $question_of_day = $all_questions[0];
31 | }
32 | $_SESSION['last_question_date'] = $today;
33 | $_SESSION['shown_questions'][] = $question_of_day;
34 | } else {
35 | $question_of_day = $_SESSION['shown_questions'][count($_SESSION['shown_questions']) - 1];
36 | }
37 |
38 | return $question_of_day;
39 | }
40 | }
41 | ?>
42 |
--------------------------------------------------------------------------------
/practice-01/README.md:
--------------------------------------------------------------------------------
1 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2 |
3 | ## Getting Started
4 |
5 | First, run the development server:
6 |
7 | ```bash
8 | npm run dev
9 | # or
10 | yarn dev
11 | # or
12 | pnpm dev
13 | # or
14 | bun dev
15 | ```
16 |
17 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18 |
19 | You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
20 |
21 | This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22 |
23 | ## Learn More
24 |
25 | To learn more about Next.js, take a look at the following resources:
26 |
27 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29 |
30 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31 |
32 | ## Deploy on Vercel
33 |
34 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35 |
36 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
37 |
--------------------------------------------------------------------------------
/practice-02/services/QuestionsByIdsService.php:
--------------------------------------------------------------------------------
1 | getQuestions();
12 |
13 | $questions = [];
14 | $missingIds = [];
15 |
16 | foreach ($ids as $id) {
17 | $index = $id - 1;
18 |
19 | if (isset($all[$index])) {
20 | $questions[] = $all[$index];
21 | } else {
22 | $missingIds[] = $id;
23 | }
24 | }
25 |
26 | return [
27 | 'questions' => $questions,
28 | 'missing_ids' => $missingIds,
29 | ];
30 | }
31 |
32 | public function validateQuery(mixed $params): mixed
33 | {
34 | $idsParam = isset($params['ids']) ? $params['ids'] : '';
35 |
36 | if (empty($idsParam)) {
37 | return ['error' => 'Идентификаторы не найдены'];
38 | }
39 |
40 | $ids = array_map('intval', explode(',', $idsParam));
41 |
42 | foreach ($ids as $id) {
43 | if ($id <= 0) {
44 | return ['error' => 'Идентификаторы должны быть положительными числами'];
45 | }
46 | }
47 |
48 | return [
49 | 'success' => true,
50 | 'ids' => $ids
51 | ];
52 | }
53 |
54 | }
--------------------------------------------------------------------------------
/practice-02/components/randomQuestionFrequency/script.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | function getRandomQuestionFrequency() {
3 | return fetch(API_BASE_URL + 'getRandomQuestionFrequency.php')
4 | .then((response) => {
5 | return response.json();
6 | });
7 | }
8 |
9 | function fillRandomQuestionFrequency() {
10 | const container = document.querySelector('.js-random-question-frequency');
11 |
12 | if (!container) {
13 | console.error('Ошибка! Не удалось найти элемент .js-random-question-frequency на странице.');
14 | return;
15 | }
16 |
17 | getRandomQuestionFrequency()
18 | .then((questions) => {
19 | container.innerHTML = '';
20 | questions.forEach((question) => {
21 | const node = document.createElement("li");
22 | node.textContent = question;
23 | container.appendChild(node);
24 | });
25 | })
26 | .catch((error) => {
27 | console.error('Произошла ошибка при получении вопросов:', error);
28 | });
29 | }
30 |
31 | function listenButtons() {
32 | const buttonAll = document.querySelector('.js-question-frequency');
33 |
34 | if (!buttonAll) {
35 | console.error('Ошибка! Не удалось найти элементы .js-question-frequency на странице.');
36 | return;
37 | }
38 |
39 | buttonAll.addEventListener('click', fillRandomQuestionFrequency);
40 | }
41 |
42 | listenButtons();
43 | }());
--------------------------------------------------------------------------------
/practice-02/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | WEB Development
12 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/practice-01/components/RandomQuestions/index.js:
--------------------------------------------------------------------------------
1 | 'use client';
2 |
3 | import styles from './RandomQuestions.module.scss';
4 | import questions from "../../questions.js"
5 | import React from 'react';
6 |
7 | export default function RandomQuestions() {
8 | const [randomQuestions, setRandomQuestions] = React.useState([]);
9 |
10 | const handleSubmit = (e) => {
11 | e.preventDefault();
12 | const formData = new FormData(e.currentTarget);
13 | const count = formData.get('count');
14 |
15 | const randomQuestions = questions
16 | .sort(() => Math.random() - 0.5)
17 | .slice(0, count);
18 |
19 | setRandomQuestions(randomQuestions);
20 | }
21 |
22 | return (
23 |
24 |
25 |
Генератор определённого количества вопросов
26 |
30 |
31 | {randomQuestions.length > 0 && (
32 |
33 |
Сгенерированные вопросы:
34 |
35 | {randomQuestions.map((question, index) => (
36 | {question.text}
37 | ))}
38 |
39 |
40 | )}
41 |
42 | );
43 | }
--------------------------------------------------------------------------------
/lecture04/basic/kuznetsov/scss/abstracts/_vars.scss:
--------------------------------------------------------------------------------
1 | :root {
2 | --color-white: #fff;
3 | --color-gray: #eee;
4 | --color-gray-light: #c4c4c4;
5 | --color-gray-dark: #999;
6 | --color-gray-light-2: #f4f4f4;
7 | --color-gray-light-3: #e4e4e4;
8 | --color-gray-3: #4d5057;
9 | --color-icon-gray: #929ca5;
10 | --color-icon-purple: #a876d0;
11 | --color-icon-purple-light: #c09cdd;
12 | --color-ui-gray-bg: #ededed;
13 | --color-ui-checkbox-bg: #666;
14 | --color-ui-lightgray: #f7f7f7;
15 | --color-link-blue: #1463d9;
16 | --color-ui-blue: #5677fc;
17 | --color-ui-blue-overlay: rgba(86, 119, 252, .12);
18 | --color-font-black: #464646;
19 | --color-font-gray: #757575;
20 | --color-ui-red: #d34c09;
21 | --color-ui-red-overlay: rgba(211, 76, 9, .12);
22 | --color-ui-red-second: #ff7e75;
23 | --color-ui-green: #64c178;
24 | --color-ui-green-overlay: rgba(100, 193, 120, .12);
25 | --color-ui-yellow: #e8a700;
26 | --color-ui-orange: #f9a21f;
27 | --color-ui-yellow-overlay: rgba(232, 167, 0, .12);
28 | --color-green: #0c8326;
29 | --color-ui-overlay: rgba(70, 70, 70, .5);
30 | --color-input-focus: #f5f6f7;
31 | --color-light-purple: #dbdbff;
32 | --color-light-purple2: #8F7BF6;
33 | --color-button-range-active: #be86eb;
34 | --color-chip-bg-inactive: #ebf3ff;
35 | --color-chip-bg-hover: #d1e4ff;
36 | --color-chip-bg-press: #b8d5ff;
37 | --color-chip-border: #a3c4f5;
38 | --color-bar-blueviolet: #9f8cfa;
39 | --color-blueviolet-gradient: linear-gradient(90deg, #b09fff 0%, #8d79f6 100%);
40 | --color-bar-grey: rgba(237, 237, 237, .6);
41 | --color-toggle-border: #9783fc;
42 | }
--------------------------------------------------------------------------------
/practice-01/components/QuestionOfTheDay/index.js:
--------------------------------------------------------------------------------
1 | 'use client';
2 | import React, { useState, useEffect } from 'react';
3 | import questions from "@/questions";
4 |
5 | const QuestionOfTheDay = () => {
6 | const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0);
7 | const [currentQuestion, setCurrentQuestion] = useState('');
8 |
9 | useEffect(() => {
10 | const storedIndex = localStorage.getItem('questionIndex');
11 | const storedDate = localStorage.getItem('lastUpdateDate');
12 |
13 | if (storedIndex !== null && storedDate !== null) {
14 | const storedDateTime = new Date(storedDate).getTime();
15 | const currentDateTime = new Date().getTime();
16 |
17 | if (currentDateTime - storedDateTime > (1000 * 60 * 60 * 24)) {
18 | const newIndex = (parseInt(storedIndex) + 1) % questions.length;
19 | setCurrentQuestionIndex(newIndex);
20 | setCurrentQuestion(questions[newIndex]?.text || '');
21 | localStorage.setItem('questionIndex', newIndex);
22 | localStorage.setItem('lastUpdateDate', new Date().toISOString());
23 | } else {
24 | setCurrentQuestionIndex(parseInt(storedIndex));
25 | setCurrentQuestion(questions[parseInt(storedIndex)]?.text || '');
26 | }
27 | } else {
28 | setCurrentQuestionIndex(0);
29 | setCurrentQuestion(questions[0]?.text || '');
30 | localStorage.setItem('questionIndex', 0);
31 | localStorage.setItem('lastUpdateDate', new Date().toISOString());
32 | }
33 | }, []);
34 |
35 | return (
36 |
37 |
Вопрос дня
38 |
{currentQuestion}
39 |
40 | );
41 | };
42 |
43 | export default QuestionOfTheDay;
--------------------------------------------------------------------------------
/practice-02/components/simpleRandom/script.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | function getRandomQuestions() {
3 | return fetch(API_BASE_URL + 'getSimpleRandomQuestions.php')
4 | .then((response) => {
5 | return response.json();
6 | });
7 | }
8 |
9 | function fillRandomQuestions() {
10 | const container = document.querySelector('.js-simple-random-questions');
11 |
12 | if (container === undefined) {
13 | console.error('Ошибка! Не смогли найти элемент .js-simple-random-questions на странице.');
14 | return;
15 | }
16 |
17 | getRandomQuestions()
18 | .then((questions) => {
19 | container.innerHTML = '';
20 | questions.map((question) => {
21 | const node = document.createElement("li");
22 | node.textContent = question;
23 | container.appendChild(node);
24 | });
25 | });
26 | }
27 |
28 | function showHistory() {
29 | fetch(API_BASE_URL + 'getSimpleRandomQuestionsHistory.php')
30 | .then((response) => {
31 | return response.text();
32 | })
33 | .then((text) => {
34 | showNotice('История', text);
35 | });
36 | }
37 |
38 | function listenButtons() {
39 | const buttonAll = document.querySelector('.js-simple-random');
40 | const buttonOne = document.querySelector('.js-simple-random-history');
41 |
42 | if (buttonAll === undefined || buttonOne === undefined) {
43 | console.error('Ошибка! Не смогли найти элементы .js-simple-random на странице.');
44 | return;
45 | }
46 |
47 | buttonAll.addEventListener('click', () => fillRandomQuestions());
48 | buttonOne.addEventListener('click', () => showHistory());
49 | }
50 |
51 | listenButtons();
52 | }());
53 |
--------------------------------------------------------------------------------
/practice-01/components/Questions/Questions.module.scss:
--------------------------------------------------------------------------------
1 | .container {
2 | font-family: Arial, sans-serif;
3 | color: #333333;
4 | font-size: 16px;
5 | line-height: 1.5;
6 |
7 | }
8 |
9 | .tags {
10 | margin-top: 10px;
11 | }
12 |
13 | .tags span {
14 | display: inline-block;
15 | padding: 8px;
16 | background-color: #007bff; /* изменение цвета фона */
17 | color: #ffffff;
18 | border-radius: 5px;
19 | margin-right: 8px;
20 | font-size: 12px;
21 | }
22 |
23 | .tags span:last-child {
24 | margin-right: 0;
25 | }
26 |
27 | .question {
28 | display: flex;
29 | padding-top: 5px;
30 | padding-bottom: 5px;
31 | justify-content: space-between;
32 | align-items: center;
33 | }
34 |
35 | .large {
36 | font-size: 1.5rem; /* увеличение размера шрифта */
37 |
38 | color: #101828;
39 | }
40 |
41 | .accord {
42 | flex-direction: column;
43 | justify-content: flex-start;
44 | align-items: stretch;
45 | border-bottom: 1px solid #cccccc; /* изменение цвета границы */
46 | }
47 |
48 | .faqList {
49 | max-width: 800px; /* увеличение максимальной ширины */
50 | margin: 0 auto; /* центрирование на странице */
51 | }
52 |
53 | .title {
54 | margin-top: 2rem; /* увеличение отступа сверху */
55 | margin-bottom: 1rem;
56 | font-size: 2rem; /* уменьшение размера шрифта */
57 | font-weight: bold; /* усиление шрифта */
58 | text-align: center;
59 | }
60 | .filterContainer {
61 | display: flex;
62 | align-items: center;
63 | justify-content: space-between;
64 | margin-bottom: 20px; /* добавим отступ снизу */
65 | border: 1px solid #ccc; /* добавим рамку */
66 | padding: 10px; /* добавим отступ внутри рамки */
67 | }
68 |
69 | .label {
70 | margin-right: 10px; /* добавим отступ справа для метки */
71 | }
72 |
73 | /* Обновленные стили для селекта */
74 | .select {
75 | padding: 8px;
76 | font-size: 16px;
77 | border: 1px solid #ccc;
78 | border-radius: 5px;
79 | }
--------------------------------------------------------------------------------
/practice-01/components/Comment/Comment.js:
--------------------------------------------------------------------------------
1 | 'use client'
2 | import styles from './Comment.module.scss'; // Подключаем стили
3 | import React, { useState, useEffect } from 'react';
4 |
5 |
6 | export default function Comment() {
7 | const [comments, setComments] = useState([]);
8 | const [text, setText] = useState("");
9 |
10 | useEffect(() => {
11 | const loadedComments = JSON.parse(localStorage.getItem('comments'));
12 | setComments(loadedComments || []);
13 | }, []);
14 |
15 | const addNewComment = (e) => {
16 | e.preventDefault();
17 |
18 | const newComment = {
19 | text,
20 | createdAt: new Date().toISOString(),
21 | };
22 |
23 | const updatedComments = [...comments, newComment];
24 | setComments(updatedComments);
25 | setText('');
26 |
27 | localStorage.setItem('comments', JSON.stringify(updatedComments));
28 | };
29 |
30 | return (
31 |
32 |
Добавить комментарий {/* Надпись "Добавить комментарий" */}
33 |
34 | {comments && comments.map((comment, index) => (
35 |
36 |
{comment.text}
37 |
{comment.createdAt}
38 |
39 | ))}
40 |
41 |
50 |
51 | );
52 | }
--------------------------------------------------------------------------------
/lecture02/basic/ankudinova/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Ankudinova
7 |
8 |
9 | Основные теги
10 |
11 |
57 | block
58 | inline
59 |
60 |
61 |
--------------------------------------------------------------------------------
/practice-01/components/RandomQuestionsFrequency/index.js:
--------------------------------------------------------------------------------
1 | 'use client';
2 | import styles from './RandomQuestionsFrequency.module.scss';
3 | import questions from "../../questions.js"
4 | import React from 'react';
5 |
6 | export default function RandomQuestionsFrequency() {
7 | const [randomQuestions, setRandomQuestions] = React.useState([]);
8 |
9 | const generateRandomQuestionsFrequency = () => {
10 | const totalQuestionsCount = questions.reduce((total, question) => total + (question.frequency ?? 100), 0);
11 | const selectedQuestions = [];
12 |
13 | for (let i = 0; i < 5; i++) {
14 | const randomNumber = Math.floor(Math.random() * totalQuestionsCount);
15 |
16 | let cumulativeFrequency = 0;
17 | let selectedQuestion;
18 | for (const question of questions) {
19 | cumulativeFrequency += (question.frequency ?? 100);
20 | if (randomNumber < cumulativeFrequency) {
21 | selectedQuestion = question;
22 | break;
23 | }
24 | }
25 |
26 | selectedQuestions.push(selectedQuestion);
27 | }
28 |
29 | setRandomQuestions(selectedQuestions);
30 | }
31 |
32 | return (
33 |
34 |
35 |
Рандомные вопросы с частотой
36 |
Сгенерировать рандомные вопросы
37 |
38 | {randomQuestions.map(function(question, index) {
39 | if (question && question.text) {
40 | return {question.text} ; {/* Добавлен класс стиля для элементов списка */}
41 | } else {
42 | return null;
43 | }
44 | })}
45 |
46 |
47 |
48 | );
49 | }
--------------------------------------------------------------------------------
/lecture03/basic/trebunskih/css/style.css:
--------------------------------------------------------------------------------
1 | .background{
2 | background-color: aqua;
3 | }
4 | .background2{
5 | background-image: linear-gradient(#c8bdf2, #4441e6);
6 | }
7 |
8 | .background3{
9 | background-image: url(https://img.freepik.com/free-photo/adorable-looking-kitten-with-yarn_23-2150886292.jpg?w=740&t=st=1707209036~exp=1707209636~hmac=bdfe58529dc9628fa0a3de7063cc03f14f4cec462bb34fa546ffd9f413ca4d9c);
10 | }
11 |
12 |
13 |
14 |
15 | #border{
16 | border: solid red;
17 | }
18 | .border2{
19 | border: dashed rgb(14, 26, 255);
20 | }
21 | .border3{
22 | border: 4mm ridge rgba(211, 220, 50, .6);;
23 | }
24 |
25 |
26 |
27 |
28 | .color{
29 | color:brown;
30 | }
31 | .color2{
32 | color: aqua;
33 | }
34 | .color3{
35 | color: blueviolet;
36 | }
37 |
38 |
39 |
40 |
41 | .cursor{
42 | cursor: wait;
43 | }
44 | .cursor2{
45 | cursor: pointer;
46 | }
47 | .cursor3{
48 | cursor: all-scroll;
49 | }
50 |
51 |
52 |
53 |
54 | .content {
55 | display: block;
56 | }
57 | .content1{
58 | display: flex;
59 | }
60 | .content2{
61 | display: grid;
62 | }
63 |
64 |
65 |
66 | .filter{
67 | filter: blur(3px);
68 | }
69 | .filter2{
70 | filter: drop-shadow(2px 3px 5px black);
71 | }
72 | .filter3{
73 | filter: contrast(20%);
74 | }
75 |
76 |
77 |
78 | .margin{
79 | margin: 10px 50px 20px;
80 | }
81 | .margin2{
82 | margin: 150px;
83 | }
84 | .margin3{
85 | margin: 10% auto;
86 | }
87 |
88 |
89 |
90 | .padding{
91 | padding: 25px 50px 75px 100px;
92 | }
93 | .padding2{
94 | padding: 10px 20px;
95 | }
96 |
97 | .padding3{
98 | padding: 10px 3% 20px;
99 | }
100 |
101 |
102 | .font{
103 | font: small-caps bold 24px/1 sans-serif;
104 | }
105 | .font2{
106 | font: italic 1.2rem "Fira Sans", serif;
107 | }
108 | .font3{
109 | font: bold italic large serif;
110 | }
111 |
112 |
113 | .transform{
114 | transform: scale(2, 0.5);
115 | }
116 |
117 | .transform2{
118 | transform: rotate(0.5turn);
119 | }
120 | .transform3{
121 | transform: skew(10deg, 5deg);
122 | }
--------------------------------------------------------------------------------
/practice-01/components/Top5dieFive/index.js:
--------------------------------------------------------------------------------
1 | 'use client';
2 |
3 | import styles from './Five.module.scss';
4 | import questions from "../../questions.js"
5 | import React, { useState } from 'react';
6 |
7 | export default function Random5Questions() {
8 | const [count, setCount] = useState(5);
9 | const [randomQuestions, setRandomQuestions] = useState([]);
10 | const [remainingQuestions, setRemainingQuestions] = useState([...questions]); // Копия исходного массива вопросов
11 | const [showQuestions, setShowQuestions] = useState(false);
12 |
13 | const handleSubmit = (e) => {
14 | e.preventDefault();
15 | generateRandomQuestions();
16 | setShowQuestions(true);
17 | }
18 |
19 | const handleReset = () => {
20 | setShowQuestions(false);
21 | setRandomQuestions([]);
22 | setRemainingQuestions([...questions]); // Восстанавливаем копию исходного массива
23 | }
24 |
25 | const generateRandomQuestions = () => {
26 | if (remainingQuestions.length < count) {
27 | setRandomQuestions(remainingQuestions);
28 | setRemainingQuestions([]);
29 | } else {
30 | const selectedQuestions = [];
31 | for (let i = 0; i < count; i++) {
32 | const randomIndex = Math.floor(Math.random() * remainingQuestions.length);
33 | const randomQuestion = remainingQuestions[randomIndex];
34 | selectedQuestions.push(randomQuestion);
35 | remainingQuestions.splice(randomIndex, 1);
36 | }
37 | setRandomQuestions(selectedQuestions);
38 | }
39 | }
40 |
41 | return (
42 |
43 |
Рандомные вопросы
44 |
45 | Сгенерировать
46 | Сбросить
47 |
48 | {showQuestions && (
49 |
50 | {randomQuestions.map((question, index) => (
51 | {question.text}
52 | ))}
53 |
54 | )}
55 |
56 | );
57 | }
58 |
--------------------------------------------------------------------------------
/practice-01/components/RandomQuestionsList/index.js:
--------------------------------------------------------------------------------
1 | "use client"
2 | import styles from './RandomQuestionsList.module.scss';
3 | import { useState } from 'react';
4 | import questions from '@/questions';
5 |
6 | export default function RandomQuestionsList() {
7 | const [questionsList, setQuestionsList] = useState([]);
8 | const [history, setHistory] = useState([]);
9 | const [showMessage, setShowMessage] = useState(true);
10 |
11 | const generateRandomQuestions = () => {
12 | setShowMessage(false);
13 | const randomQuestions = [];
14 | while (randomQuestions.length < 5) {
15 | const randomIndex = Math.floor(Math.random() * questions.length);
16 | if (!randomQuestions.includes(questions[randomIndex])) {
17 | randomQuestions.push(questions[randomIndex]);
18 | }
19 | }
20 |
21 | setQuestionsList(randomQuestions);
22 | updateHistory(randomQuestions);
23 | };
24 |
25 | const updateHistory = (newQuestions) => {
26 | const currentDate = new Date().toLocaleString();
27 | const historyItem = `${currentDate} - ${JSON.stringify(newQuestions.map(question => question.text))}`;
28 |
29 | const updatedHistory = [historyItem, ...history.slice(0, 9)];
30 | setHistory(updatedHistory);
31 | };
32 |
33 | return (
34 |
35 |
Рандомные вопросы с историей
36 |
Сгенерировать рандомные вопросы
37 |
38 | {questionsList.length > 0 && (
39 |
40 | {questionsList.map((question, index) => (
41 | {question.text}
42 | ))}
43 |
44 | )}
45 |
46 |
47 |
History
48 |
49 | {history.map((item, index) => (
50 | {item}
51 | ))}
52 |
53 |
54 | {showMessage &&
Тыкни кнопочку выше чтобы появилась история :()
}
55 |
56 | );
57 | }
--------------------------------------------------------------------------------
/lecture03/basic/Puchkov/index2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Kuznetsov
7 |
8 |
9 | Основные CSS свойства
10 |
11 | Список всех CSS свойств
14 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/lecture03/basic/kuznetsov/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Kuznetsov
7 |
8 |
9 | Основные CSS свойства
10 |
11 | Список всех CSS свойств
14 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/lecture03/basic/Ankudinova-basic-lecture03/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Ankudinova
7 |
8 |
9 | Основные CSS свойства
10 |
11 | Список 10 CSS свойств
12 |
13 |
74 |
75 |
--------------------------------------------------------------------------------
/lecture03/basic/gladkov/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | gladkov
7 |
8 |
9 | Основные CSS свойства
10 |
11 | Список всех CSS свойств
12 |
13 |
78 |
79 |
--------------------------------------------------------------------------------
/lecture03/basic/Harin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Harin
7 |
8 |
9 | Основные CSS свойства
10 |
11 | Список всех CSS свойств
12 |
13 |
76 |
77 |
--------------------------------------------------------------------------------
/lecture06/index.php:
--------------------------------------------------------------------------------
1 | age = $age;
11 | }
12 | }
13 |
14 | $obj = new Test('test');
15 |
16 | try {
17 | throw new CustomException();
18 | var_dump($obj->age);
19 | } catch (CustomException $e) {
20 | var_dump('CustomException');
21 | } catch (\Throwable $e) {
22 | var_dump('Throwable');
23 | }
24 |
25 | abstract class Human {
26 | public $name;
27 | public $age;
28 |
29 | // Инкапсуляция. Скрытие внутреннего состояния и функций объекта и предоставление доступа только через открытый набор функций.
30 | // --- private, protected, public
31 | private $pasport;
32 |
33 | public function __construct($name, $age) {
34 | $this->name = $name;
35 | $this->age = $age;
36 | }
37 |
38 | function getInfo() {
39 | return 'Меня зовут '.$this->name.'. И мне '.$this->age. $this->getPasport();
40 | }
41 |
42 | function getPasport() {
43 | return $this->pasport;
44 | }
45 |
46 | function setPasport($value) {
47 | $this->pasport = $value;
48 | return $this;
49 | }
50 |
51 | // Абстракция. Моделирование требуемых атрибутов и взаимодействий сущностей в виде классов для определения абстрактного представления системы.--- abstract
52 | abstract function check();
53 | }
54 |
55 | interface IPRegisterable {
56 | function register();
57 | }
58 |
59 | class Student extends Human implements IPRegisterable {
60 | private const ADULT_AGE = 18;
61 |
62 | function isAdult() {
63 | return $this->age >= self::ADULT_AGE;
64 | }
65 |
66 | // Полиморфизм. Возможность реализации наследуемых свойств или методов отличающимися способами в рамках множества абстракций.
67 | // --- переопределение функций
68 | function getInfo() {
69 | return 'Я студент '.$this->name.'. И мне '.$this->age. $this->getPasport();
70 | }
71 |
72 | function register() {
73 | return md5($this->age.$this->name);
74 | }
75 |
76 | function check() {
77 | return 0;
78 | }
79 | }
80 |
81 | // Наследование. Возможность создания новых абстракций на основе существующих.--- extends
82 | class Teacher extends Human implements IPRegisterable {
83 | function register() {
84 | return md5($this->age);
85 | }
86 |
87 | function check() {
88 | return 0;
89 | }
90 | }
91 |
92 | function check(IPRegisterable $human) {
93 | return $human->register();
94 | }
95 |
96 | $student = new Student('Антон', 18);
97 | $teacher = new Teacher('Миша',25);
98 |
99 | print_r($student->getInfo());
100 | echo "\n";
101 | var_dump($student->isAdult());
102 | echo "\n";
103 | var_dump($student->register());
104 | var_dump($teacher->register());
105 | var_dump(check($teacher));
106 |
107 | ?>
--------------------------------------------------------------------------------
/lecture02/basic/Harin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Harin
7 |
8 |
9 | Основные теги
10 |
11 |
12 |
13 |
51 |
52 |
53 | inline
54 |
55 |
56 |
--------------------------------------------------------------------------------
/practice-02/components/questionsByIds/script.js:
--------------------------------------------------------------------------------
1 | const getQuestionsByIds = async (query) => {
2 | try {
3 | const response = await fetch(`${API_BASE_URL}getQuestionsByIds.php?ids=${query}`);
4 | if (!response.ok) {
5 | console.error("Ошибка запроса");
6 | return null;
7 | }
8 | return await response.json();
9 | } catch (error) {
10 | console.error(error);
11 | return null;
12 | }
13 | }
14 |
15 | const getQuestionsByIdsFill = (questionsArray) => {
16 | const container = document.querySelector('.js-questions-by-ids');
17 |
18 | if (!container) {
19 | console.error('Ошибка! Не смогли найти элемент .js-questions-by-ids на странице.');
20 | return;
21 | }
22 |
23 | container.textContent = '';
24 |
25 | for(const question of questionsArray) {
26 | const node = document.createElement("li");
27 | node.textContent = question?.text || "Текст не найден";
28 | container.appendChild(node);
29 | }
30 | }
31 |
32 | const getQuestionsByIdsFillMissing = (missingIdsArray) => {
33 | const container = document.querySelector('.js-questions-missing-ids');
34 |
35 | if (!container) {
36 | console.error('Ошибка! Не смогли найти элемент .js-questions-missing-ids на странице.');
37 | return;
38 | }
39 | container.textContent = '';
40 | for(const questionId of missingIdsArray) {
41 | const node = document.createElement("li");
42 | node.textContent = `Вопрос с идентификатором ${questionId} не найден`;
43 | container.appendChild(node);
44 | }
45 | }
46 |
47 | const getQuestionsByIdsClickHandler = async () => {
48 | const form = document.querySelector('.js-questions-by-ids-form')
49 |
50 | if (!form) {
51 | console.error('Ошибка! Не смогли найти элемент .js-questions-by-ids-form на странице.');
52 | return;
53 | }
54 |
55 | const question_ids = form.querySelector('[name="question_ids"]')
56 |
57 | if (!question_ids) {
58 | console.error('Ошибка! Не смогли найти инпут question_ids на странице.');
59 | return;
60 | }
61 |
62 | const questions = await getQuestionsByIds(question_ids.value).catch((error) => {
63 | console.error(error)
64 | })
65 |
66 | if(!questions) {
67 | showNotice('Ошибка при получении данных.');
68 | return
69 | }
70 |
71 | if(questions.error) {
72 | showNotice('Ошибка', questions.error)
73 | return
74 | }
75 |
76 | if(!questions.questions || !questions.missing_ids) {
77 | showNotice('Ошибка', 'Получены некорректные данные.')
78 | return
79 | }
80 |
81 | getQuestionsByIdsFill(questions.questions)
82 | getQuestionsByIdsFillMissing(questions.missing_ids)
83 | };
84 |
85 | (() => {
86 | const getQuestionsButton= document.querySelector('.js-questions-by-ids-button')
87 |
88 | if (!getQuestionsButton) {
89 | console.error('Ошибка! Не смогли найти элементы .js-questions-by-ids-button на странице.');
90 | return
91 | }
92 |
93 | getQuestionsButton.addEventListener('click', (event) => {
94 | event.preventDefault();
95 | getQuestionsByIdsClickHandler();
96 | })
97 | })();
98 |
99 |
--------------------------------------------------------------------------------
/lecture03/basic/britvin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Chugaev
7 |
8 |
9 | Основные CSS свойства
10 |
11 | Список всех CSS свойств
12 |
13 |
86 |
87 |
--------------------------------------------------------------------------------
/lecture02/basic/gladkov/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | gladkov
7 |
8 |
9 | Основные теги
10 |
11 |
12 | -
13 | -
14 | block -
15 | -
16 | block до block -
17 | block
-
18 | inline -
19 | inline -
20 | block
-
21 | inline -
22 | -
23 | block -
24 | list-item -
25 | -
26 | table-row -
27 | table-cell -
28 | table-cell -
29 | block -
30 | inline-block -
31 | inline-block -
32 | inline-block -
33 | block -
34 | block -
35 | inline -
36 | inline -
37 | block -
38 | inline -
39 | inline -
40 | block -
41 | inline -
42 | block -
43 | -
44 | inline -
45 | inline -
46 | inline-block -
47 | inline-block -
48 | -
49 | -
50 | block
51 | inline
52 |
53 |
54 |
--------------------------------------------------------------------------------
/practice-02/components/questions/script.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | let currentPage = 1;
3 | const pageSize = 10;
4 |
5 | function getQuestions(page = currentPage) {
6 | const url = `${API_BASE_URL}getQuestions.php?page=${page}&pageSize=${pageSize}`;
7 | return fetch(url)
8 | .then(response => response.json());
9 | }
10 |
11 | function updateURL(page) {
12 | const newURL = `${window.location.protocol}//${window.location.host}${window.location.pathname}?page=${page}`;
13 | window.history.pushState({ path: newURL }, '', newURL);
14 | }
15 |
16 | function fillQuestions() {
17 | const container = document.querySelector('.js-questions');
18 |
19 | getQuestions().then(data => {
20 | container.innerHTML = '';
21 | const questions = data.questions;
22 | questions.forEach((question, index) => {
23 | const questionNode = document.createElement('li');
24 | questionNode.textContent = question.text + " " + question.smile;
25 |
26 | container.appendChild(questionNode);
27 | });
28 | updatePaginationControls(data.totalQuestions);
29 | });
30 | }
31 |
32 | function navigate(page) {
33 | currentPage = page;
34 | updateURL(page);
35 | fillQuestions();
36 | }
37 |
38 | function updatePaginationControls(totalQuestions) {
39 | const paginationContainer = document.querySelector('.js-pagination');
40 | paginationContainer.innerHTML = '';
41 |
42 | if (currentPage > 1) {
43 | const prevButton = document.createElement('button');
44 | prevButton.textContent = 'Назад';
45 | prevButton.addEventListener('click', () => navigate(currentPage - 1));
46 | paginationContainer.appendChild(prevButton);
47 | }
48 |
49 | const pageInfo = document.createElement('span');
50 | pageInfo.textContent = `Страница ${currentPage}`;
51 | paginationContainer.appendChild(pageInfo);
52 |
53 | if (totalQuestions > currentPage * pageSize) {
54 | const nextButton = document.createElement('button');
55 | nextButton.textContent = 'Вперед';
56 | nextButton.addEventListener('click', () => navigate(currentPage + 1));
57 | paginationContainer.appendChild(nextButton);
58 | }
59 | }
60 |
61 | document.addEventListener('DOMContentLoaded', () => {
62 | const params = new URLSearchParams(window.location.search);
63 | const page = parseInt(params.get('page'), 10);
64 | if (page) {
65 | currentPage = page;
66 | }
67 | fillQuestions();
68 | });
69 |
70 | document.getElementById('addQuestionForm').addEventListener('submit', function(event) {
71 | event.preventDefault();
72 |
73 | const newQuestion = document.getElementById('newQuestion').value;
74 |
75 | fetch('/practice-02/api/addQuestion.php', {
76 | method: 'POST',
77 | body: new URLSearchParams({ newQuestion })
78 | })
79 | .then(response => {
80 | if (response.ok) {
81 | showNotice('Вопрос добавлен');
82 | fillQuestions();
83 | } else {
84 | throw new Error('Ошибка при добавлении вопроса');
85 | }
86 | })
87 | .catch(error => {
88 | showNotice('Ошибка', error.message);
89 | });
90 | });
91 |
92 |
93 | }());
94 |
--------------------------------------------------------------------------------
/lecture04/basic/kuznetsov/scss/style.css.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["abstracts/_common.scss","abstracts/_vars.scss","style.css","components/_button.scss","sections/_graph.scss"],"names":[],"mappings":"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","file":"style.css"}
--------------------------------------------------------------------------------
/lecture02/basic/Puchkov/puchkov.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Puchkov
7 |
8 |
9 |
10 | Определяет текст как аббревиатуру или акроним
11 |
12 | Элемент-контейнер для разделов HTML-документа
13 |
14 | Контейнер для строчных элементов
15 |
16 | Текст абзаца
17 |
18 | Создает маркированный список
19 |
20 | Элемент маркированного или нумерованного списка
21 |
22 | Используется для залаговков
23 |
24 | Задает контактные данные автора/владельца документа или статьи.
25 |
26 | Задает полужирное начертание отрывка текста, не придавая акцент или важность выделенному
27 |
28 | Перенос текста на новую строку
29 |
30 | Создает интерактивную кнопку. Элемент может содержать текст или изображение
31 |
32 |
33 | <input>
34 |
35 | type="button" – Кнопка с надписью.
36 | type="checkbox" – Флажок.
37 | type="color" – Виджет для выбора цвета.
38 | type="date" – Поле для ввода календарной даты (год, месяц, день).
39 | type="datetime" – Поле для ввода даты и времени.
40 | type="datetime"-local – Поле для ввода даты и местного времени.
41 | type="email" – Поле для ввода адреса электронной почты.
42 | type="file" – Поле для ввода имени файла, который пересылается на сервер.
43 | type="hidden" – Скрытое поле (не отображается на Web-странице).
44 | type="image" – Графическая кнопка отправки данных формы на сервер. Вместе с этим значением нужно использовать атрибут src, чтобы определить адрес изображения и атрибут alt для определения альтернативного текста. Можно также задать атрибуты width и height, чтобы определить размер изображения в пикселях.
45 | type="month" – Поле для ввода месяца и года.
46 | type="number" – Поле для ввода чисел.
47 | type="password" – Поле для ввода пароля.
48 | type="radio" – Переключатели (радио-кнопки).
49 | type="range" – Ползунок для ввода чисел в указанном диапазоне.
50 | type="reset" – Кнопка сброса данных формы в первоначальное состояние.
51 | type="search" – Поле для ввода строки поиска.
52 | type="submit" – Кнопка для отправки данных формы на сервер.
53 | type="tel" – Поле для ввода номера телефона.
54 | type="text" – Текстовое поле.
55 | type="time" – Поле для ввода времени.
56 | type="url" – Поле для ввода Web-адреса.
57 | type="week" – Поле для ввода номера недели и года.
58 |
59 |
60 |
61 |
62 |
63 | Видео
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |