diff --git a/config/config.php b/config/config.php
new file mode 100644
index 0000000..f49f632
--- /dev/null
+++ b/config/config.php
@@ -0,0 +1,11 @@
+image_type = $image_info[2];
+ if( $this->image_type == IMAGETYPE_JPEG ) {
+ $this->image = imagecreatefromjpeg($filename);
+ } elseif( $this->image_type == IMAGETYPE_GIF ) {
+ $this->image = imagecreatefromgif($filename);
+ } elseif( $this->image_type == IMAGETYPE_PNG ) {
+ $this->image = imagecreatefrompng($filename);
+ }
+ }
+ function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) {
+ if( $image_type == IMAGETYPE_JPEG ) {
+ imagejpeg($this->image,$filename,$compression);
+ } elseif( $image_type == IMAGETYPE_GIF ) {
+ imagegif($this->image,$filename);
+ } elseif( $image_type == IMAGETYPE_PNG ) {
+ imagepng($this->image,$filename);
+ }
+ if( $permissions != null) {
+ chmod($filename,$permissions);
+ }
+ }
+ function output($image_type=IMAGETYPE_JPEG) {
+ if( $image_type == IMAGETYPE_JPEG ) {
+ imagejpeg($this->image);
+ } elseif( $image_type == IMAGETYPE_GIF ) {
+ imagegif($this->image);
+ } elseif( $image_type == IMAGETYPE_PNG ) {
+ imagepng($this->image);
+ }
+ }
+ function getWidth() {
+ return imagesx($this->image);
+ }
+ function getHeight() {
+ return imagesy($this->image);
+ }
+ function resizeToHeight($height) {
+ $ratio = $height / $this->getHeight();
+ $width = $this->getWidth() * $ratio;
+ $this->resize($width,$height);
+ }
+ function resizeToWidth($width) {
+ $ratio = $width / $this->getWidth();
+ $height = $this->getheight() * $ratio;
+ $this->resize($width,$height);
+ }
+ function scale($scale) {
+ $width = $this->getWidth() * $scale/100;
+ $height = $this->getheight() * $scale/100;
+ $this->resize($width,$height);
+ }
+ function resize($width,$height) {
+ $new_image = imagecreatetruecolor($width, $height);
+ imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());
+ $this->image = $new_image;
+ }
+}
\ No newline at end of file
diff --git a/engine/functions.php b/engine/functions.php
new file mode 100644
index 0000000..1b8d9ef
--- /dev/null
+++ b/engine/functions.php
@@ -0,0 +1,26 @@
+ renderTemplate($page, $params),
+ 'menu' => renderTemplate('menu'),
+ ]
+ );
+}
+
+function renderTemplate($page, $params = []){
+ ob_start();
+
+ if (!is_null($params))
+ extract($params);
+
+ $fileName = TEMPLATES_DIR . $page . ".php";
+
+ if (file_exists($fileName)) {
+ include $fileName;
+ } else {
+ Die("Страницы {$fileName} не существует.");
+ }
+
+ return ob_get_clean();
+}
\ No newline at end of file
diff --git a/engine/gallery.php b/engine/gallery.php
new file mode 100644
index 0000000..643cbd4
--- /dev/null
+++ b/engine/gallery.php
@@ -0,0 +1,40 @@
+";
+ exit;
+ }
+
+ if ($_FILES['image']['size'] > 1024 * 5 * 1024) {
+ echo "Размер файла не более 5 Мб
";
+ exit;
+ }
+
+ $blacklist = ['.php', '.phtml', '.php3', '.php4'];
+ foreach ($blacklist as $item) {
+ if(preg_match("/$item\$/i", $_FILES['image']['name'])){
+ echo "Загрузка php-файлов запрещена
";
+ exit;
+ }
+ }
+
+ if (move_uploaded_file($_FILES['image']['tmp_name'], $path_big)) {
+
+ $image = new SimpleImage();
+ $image->load($path_big);
+ $image->resizeToWidth(250);
+ $image->save($path_small);
+ header("Location: /?page=gallery");
+ } else {
+ echo "Ошибка ресайза файла
";
+ }
+}
\ No newline at end of file
diff --git a/engine/log.php b/engine/log.php
new file mode 100644
index 0000000..e69de29
diff --git a/public/images/gallery_img/big/n_70.jpg b/public/images/gallery_img/big/n_70.jpg
new file mode 100644
index 0000000..d1c5b21
Binary files /dev/null and b/public/images/gallery_img/big/n_70.jpg differ
diff --git a/public/images/gallery_img/big/n_72.jpg b/public/images/gallery_img/big/n_72.jpg
new file mode 100644
index 0000000..aa1d97c
Binary files /dev/null and b/public/images/gallery_img/big/n_72.jpg differ
diff --git a/public/images/gallery_img/big/n_73.jpg b/public/images/gallery_img/big/n_73.jpg
new file mode 100644
index 0000000..e36fb36
Binary files /dev/null and b/public/images/gallery_img/big/n_73.jpg differ
diff --git a/public/images/gallery_img/big/n_76.jpg b/public/images/gallery_img/big/n_76.jpg
new file mode 100644
index 0000000..cff5f93
Binary files /dev/null and b/public/images/gallery_img/big/n_76.jpg differ
diff --git a/public/images/gallery_img/big/n_82.jpg b/public/images/gallery_img/big/n_82.jpg
new file mode 100644
index 0000000..7b92921
Binary files /dev/null and b/public/images/gallery_img/big/n_82.jpg differ
diff --git a/public/images/gallery_img/big/n_95.jpg b/public/images/gallery_img/big/n_95.jpg
new file mode 100644
index 0000000..b6929b1
Binary files /dev/null and b/public/images/gallery_img/big/n_95.jpg differ
diff --git a/public/images/gallery_img/small/n_70.jpg b/public/images/gallery_img/small/n_70.jpg
new file mode 100644
index 0000000..3184065
Binary files /dev/null and b/public/images/gallery_img/small/n_70.jpg differ
diff --git a/public/images/gallery_img/small/n_72.jpg b/public/images/gallery_img/small/n_72.jpg
new file mode 100644
index 0000000..f6105c7
Binary files /dev/null and b/public/images/gallery_img/small/n_72.jpg differ
diff --git a/public/images/gallery_img/small/n_73.jpg b/public/images/gallery_img/small/n_73.jpg
new file mode 100644
index 0000000..e14dfb8
Binary files /dev/null and b/public/images/gallery_img/small/n_73.jpg differ
diff --git a/public/images/gallery_img/small/n_76.jpg b/public/images/gallery_img/small/n_76.jpg
new file mode 100644
index 0000000..4a8ee15
Binary files /dev/null and b/public/images/gallery_img/small/n_76.jpg differ
diff --git a/public/images/gallery_img/small/n_82.jpg b/public/images/gallery_img/small/n_82.jpg
new file mode 100644
index 0000000..0636790
Binary files /dev/null and b/public/images/gallery_img/small/n_82.jpg differ
diff --git a/public/images/gallery_img/small/n_95.jpg b/public/images/gallery_img/small/n_95.jpg
new file mode 100644
index 0000000..88e8903
Binary files /dev/null and b/public/images/gallery_img/small/n_95.jpg differ
diff --git a/public/index.php b/public/index.php
new file mode 100644
index 0000000..f145234
--- /dev/null
+++ b/public/index.php
@@ -0,0 +1,31 @@
+ {
+ if (e.target.classList.contains('gallery_img')) {
+ e.target.classList.toggle('active');
+ }
+ });
+}
+handleEvents();
\ No newline at end of file
diff --git a/public/styles/style.css b/public/styles/style.css
new file mode 100644
index 0000000..eee1b7e
--- /dev/null
+++ b/public/styles/style.css
@@ -0,0 +1,227 @@
+@import url(https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic);
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+body {
+ font-family: 'Roboto', Arial, sans-serif;
+ background-color: #ebebeb;
+ overflow-x: hidden;
+ text-align: center;
+}
+
+header {
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+ width: 100%;
+ height: 80px;
+ background-color: #6b6d79c7;
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
+}
+
+.nav-li {
+ line-height: 30px;
+ display: flex;
+}
+
+.nav-ul {
+ display: flex;
+}
+
+.nav-link:hover {
+ background-color: rgba(0, 0, 0, 0.1);
+ cursor: pointer;
+}
+.nav-link {
+ font-size: 15px;
+ font-weight: 300;
+ text-transform: uppercase;
+ text-decoration: none;
+ padding: 8px 10px;
+ width: 150px;
+ margin: 2%;
+ text-align: center;
+ background-color: #4c4848b8;
+ color: #fbfbfb;
+ border-radius: 2px;
+ transition: background-color 0.2s ease;
+}
+
+.nav-link:hover {
+ background-color: #212121;
+ cursor: pointer;
+}
+
+h1 {
+ font-weight: 100;
+ margin-bottom: 25px;
+}
+
+p {
+ text-align: center;
+ padding: 10px;
+ color: #aaa;
+ font-weight: 500;
+}
+
+.container {
+ margin-top: 50px;
+ min-width: 900px;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.block {
+ margin: 10px;
+ border: 1px solid black;
+}
+
+.block_flex-wrapper {
+ padding: 15px;
+}
+
+.block_main {
+ display: flex;
+ justify-content: space-between;
+}
+
+.block_exp {
+ padding: 5px;
+}
+
+.block_exp-border-none {
+ border-right: none;
+}
+
+.header_3 {
+ margin: 20px;
+}
+
+.ul-hidden {
+ display: none;
+}
+
+.hover:hover > .ul-hidden {
+ display: block;
+ position: absolute;
+ top: 65px;
+}
+
+.gallery_wrapper {
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ max-width: 900px;
+ margin-bottom: 70px;
+}
+
+.gallery_img {
+ width: inherit;
+ border-radius: 4px;
+ border: 1px solid black;
+}
+
+.gallery_block {
+ width: 250px;
+ margin-bottom: 15px;
+ -webkit-transition: -webkit-transform 0.7s;
+ transition: transform 0.7s;
+}
+
+.gallery_block:hover {
+ -webkit-transform: scale(1.1);
+ transform: scale(1.1);
+}
+
+.modal {
+ -webkit-transition: -webkit-transform 0.7s;
+ transition: transform 0.7s;
+}
+
+.active {
+ -webkit-transform: scale(2);
+ transform: scale(2);
+}
+
+.upload_image {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: 80px;
+ background-color: #747578;
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
+}
+
+.form-group {
+ padding: 1em;
+ margin: 1em;
+}
+
+input[type="file"] {
+ outline: 0;
+ opacity: 0;
+ pointer-events: none;
+ user-select: none;
+}
+
+.label {
+ height: 60px;
+ width: 190px;
+ border: 2px dashed #fbfbfb;
+ border-radius: 5px;
+ display: flex;
+ padding: 1em;
+ align-items: center;
+ transition: border 300ms ease;
+ cursor: pointer;
+ text-align: center;
+}
+.label i {
+ display: block;
+ font-size: 42px;
+}
+.label i,
+.label .title {
+ font-weight: 400;
+ color: #fbfbfb;
+ transition: 200ms color;
+}
+.label:hover {
+ border: 2px solid black;
+}
+.label:hover i,
+.label:hover .title {
+ color: black;
+}
+
+.submit_button:hover {
+ background-color: rgba(0, 0, 0, 0.1);
+ cursor: pointer;
+}
+.submit_button {
+ border: none;
+ line-height: 30px;
+ font-size: 15px;
+ font-weight: 300;
+ text-transform: uppercase;
+ text-decoration: none;
+ padding: 8px 10px;
+ width: 150px;
+ margin: 2%;
+ text-align: center;
+ background-color: #4c4848b8;
+ color: #fbfbfb;
+ border-radius: 2px;
+ transition: background-color 0.2s ease;
+}
+
+.submit_button:hover {
+ background-color: #212121;
+ cursor: pointer;
+}
\ No newline at end of file
diff --git a/templates/gallery.php b/templates/gallery.php
new file mode 100644
index 0000000..808dcb7
--- /dev/null
+++ b/templates/gallery.php
@@ -0,0 +1,15 @@
+
С помощью цикла while вывести все числа в промежутке от 0 до 100, которые делятся на 3 без остатка.
С помощью цикла do…while написать функцию для вывода чисел от 0 до 10.
Объявить массив, в котором в качестве ключей будут использоваться названия областей, а в качестве значений – массивы с названиями городов из соответствующей области. Вывести в цикле значения массива. + Вывести на экран только города, начинающиеся с буквы «К»
Объявить массив, индексами которого являются буквы русского языка, а значениями – соответствующие латинские буквосочетания.