diff --git a/task5/css/style.css b/task5/css/style.css new file mode 100644 index 0000000..129abc1 --- /dev/null +++ b/task5/css/style.css @@ -0,0 +1,426 @@ +html{ + overflow-x: hidden; + overflow-y: hidden; +} +body{ + width: 100vw; + height: 100vh; + margin: 0; +} + +.main{ + width: 100vw; + height: 100vh; +} + +.main-header{ + width: 100vw; + height: 8vh; + border: none; + background: url("../img/header.jpg") no-repeat; + background-size: 100% 100%; +} + +.ver-button{ + width: 10%; + height: 50%; + margin: 1% 0 0 87%; + background-color: rgb(0, 163, 232); + border-radius: 10px; + text-align: center; + font-size: 1.1vw; +} + +.filter-page-part{ + width: 100vw; + height: 85vh; + border: none; + background: url("../img/bl.jpg") no-repeat; + background-size: 100% 100%; +} + +.question-user{ + width: 20%; + height: 10.5%; + background-color: rgb(200, 191, 231); + float:left; + margin-top: 1.6%; + margin-left: 4%; + border-radius: 10px; + border: 3px solid #000; + text-align: center; + display: flex; + align-items: center; + font-weight: bold; + font-size: 1.3vw; +} + +.filters-block{ + width: 30%; + height: 16.5%; + border: 3px solid #000; + float:left; + margin-top: 0.6%; + margin-left: 6%; + border-radius: 10px; + background-color: rgb(200, 191, 231); + padding: 0.2%; + padding-top: 0.7%; +} +.filter-single{ + width:100%; + height:30%; +} +#cb-author{ + width:3vw; + height: 3vh; + margin-top:4.4%; +} +.cb{ + float:left; + width:15%; + height:50%; + margin-left: 0%; +} +.label-filter{ + padding:1.2%; + width:35%; + height:50%; + float:left; +} +.filter-text-input{ + margin-top:1%; + font-size: 0.8vw; +} + +.text-of-filters{ + font-size:1.1vw; +} + +.filter-input-part{ + height:95%; + width:80%; + + float: left; +} +#cb-date{ + width:3vw; + height: 3vh; +} +#cb-hashtag{ + width:3vw; + height: 3vh; +} +.block-filter-button{ + height: 95%; + width:17%; + float:right; +} +.filter-button{ + width: 85%; + height: 50.5%; + background-color: rgb(200, 191, 231); + margin-top: 31.4%; + margin-left: 6%; + border-radius: 0.6vw; + font-size: 1.0vw; + outline: none; +} +.add-post-button{ + width: 17%; + height: 10.5%; + background-color: rgb(200, 191, 231); + float: right; + margin-top: 1.6%; + margin-right: 4%; + border-radius: 1.6vw; + font-size: 1.7vw; + outline: none; + visibility: hidden; +} +.cards { + + width: 35vw; + height: 100vw; + position: absolute; + top: -44%; + left: 32.5%; + overflow-x: hidden; + overflow-y: scroll; + transform: rotate(270deg); +} +.cards::-webkit-scrollbar { + display: none; +} +.cards-content { + background-color: rgb(200, 191, 231); + width: 23vw; + height: 30vw; + margin: 3px auto; + transform: rotate(90deg); + border-radius: 10px; + border: 3px solid #000; + +} + +.post-header{ + + width: 95%; + height: 10%; + margin:auto; + +} + +.edit-button{ + outline: none; + width: 15%; + height: 90%; + float:right; + margin-top:1%; + visibility: hidden; +} +.post-hashtags{ + margin-left: 6%; + width: 55%; + height: 90%; + display:inline-block; + font-size: 1vw; + font-style:italic; + overflow:hidden; + margin-top: 2%; +} +.delete-button{ + outline: none; + width: 15%; + height: 90%; + margin-left: 1%; + margin-top:2%; + float: left; + visibility: hidden; +} +.del-add-post-image{ + width: 95%; + height: 95%; + +} +.like-post-image{ + width: 95%; + height: 95%; +} +.like-button{ + outline: none; + width: 23%; + margin-left: 2%; + margin-top: 2%; + float:left; + visibility: hidden; +} +.like-and-comment{ + width: 98%; + height: 16.5%; +} +.image-post{ + margin-top: 1%; + margin-left: 14%; + width: 70%; +} +.post-body{ + height: 66%; + width: 100%; +} +.comments{ + width: 67%; + height: 72.6%; + margin-left: 4%; + margin-top: 2%; + border: 0.2vw solid black; + border-radius: 1vw; + padding: 1%; + background-color: rgb(200, 191, 231); + font-size: 1vw; + overflow:hidden; + float: left; +} +.logged-user{ + + height: 80%; + width: 15%; + margin-left: 83% +} +.user-avatar{ + height:88%; + width:22%; + margin-top: 3%; + background: url("../img/av1.png") no-repeat; + background-size: 100% 100%; + float: left +} +.user-name{ + margin-top: 5%; + float:left; + height:88%; + width:76%; + text-align: center; + font-size: 2vw; + font-weight:bold + +} +.post-data{ + + margin-top: 1%; + margin-left: 2%; + width: 70%; + float: left; + height: 6%; + background-color: rgb(200, 191, 231); + text-align: left; + font-size: 1.3vw; + font-style:italic +} +.post-name{ + margin-top: 1%; + margin-left: 1%; + width: 25%; + height: 6%; + float: left; + background-color: rgb(200, 191, 231); + text-align: right; + font-size: 1.3vw; + font-weight:bold +} +.main-footer{ + width: 100vw; + height: 7vh; + border: none; + background: url("../img/footer.jpg") no-repeat; + background-size: 100% 100%; + alignment: bottom; + padding-top: 1%; + padding-left: 0.5%; +} +.text-footer-date{ + opacity: 0.7; + font-size: 1.0vw; + float: left; +} + +.text-footer-creator{ + opacity: 0.9; + font-size: 1.0vw; + margin-left: 79%; +} +.auth-button{ + width: 57%; + height: 60.5%; + background-color: rgb(200, 191, 231); + float: right; + margin-top: 5%; + margin-right: 1%; + border-radius: 0.6vw; + font-size: 0.9vw; + outline: none; +} +.submit-auth-button{ + width: 25%; + height: 15%; + background-color: rgb(73, 113, 231); + margin-top: 5%; + margin-left: 37.5%; + border-radius: 0.6vw; + font-size: 0.9vw; + outline: none; +} +.cancel-auth-button{ + width: 25%; + height: 15%; + background-color: rgb(73, 113, 231); + margin-top: 5%; + float: right; + border-radius: 0.6vw; + font-size: 0.9vw; + outline: none; +} +.auth-window{ + position: absolute; + top: 20%; + left: 39%; + width: 22%; + height: 30.5%; + border-radius: 0.6vw; + padding: 0.5%; + border: 3px solid yellow; + background-color: rgb(200, 191, 231); + z-index: 100; +} +.ed-window{ + position: absolute; + top: 20%; + left: 39%; + width: 22%; + height: 30.5%; + border-radius: 0.6vw; + padding: 0.5%; + border: 3px solid yellow; + background-color: rgb(200, 191, 231); + z-index: 100; +} +.back-button-edit{ + width: 30%; + height: 51%; + border: solid #090400; + float: right; + alignment: right; + background-color: rgb(91, 164, 231); + cursor: pointer; + outline: none; +} +.user-name-edit{ + float: left; + font-size: 1.6vw; + font-weight: bold; + margin-top: 0; + color: #429eff; +} +.edit-header{ + width: 100%; + height: 25%; +} +.edit-main{ + width: 100%; + height:30%; +} + +.edit-footer{ + width: 100%; + height: 25%; +} +.description-edit{ + height: 100%; + width: 65%; + float: left; + margin-top: 0px; +} +.submit-button-edit{ + height: 112%; + width: 30%; + border: 2px solid #090400; + float: right; + background-color: rgb(91, 164, 231); + cursor: pointer; + outline: none; +} +.input-text-image-edit{ + width: 55%; + height: 16%; + alignment: left; +} +.font-image-edit{ + float: left; + font-size: 0.8vw; + font-weight: bold; + margin-top: 0; + color: #429eff; +} +.login-password-font-style{ + padding: 0 15px; +} diff --git a/task5/img/.gitignore b/task5/img/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/task5/img/av1.png b/task5/img/av1.png new file mode 100644 index 0000000..e337615 Binary files /dev/null and b/task5/img/av1.png differ diff --git a/task5/img/av2.png b/task5/img/av2.png new file mode 100644 index 0000000..5b3b82e Binary files /dev/null and b/task5/img/av2.png differ diff --git a/task5/img/avatar.png b/task5/img/avatar.png new file mode 100644 index 0000000..f2e96bc Binary files /dev/null and b/task5/img/avatar.png differ diff --git a/task5/img/bl.jpg b/task5/img/bl.jpg new file mode 100644 index 0000000..938babc Binary files /dev/null and b/task5/img/bl.jpg differ diff --git a/task5/img/brush.png b/task5/img/brush.png new file mode 100644 index 0000000..0f1ea10 Binary files /dev/null and b/task5/img/brush.png differ diff --git a/task5/img/cross.png b/task5/img/cross.png new file mode 100644 index 0000000..beb1a48 Binary files /dev/null and b/task5/img/cross.png differ diff --git a/task5/img/footer.jpg b/task5/img/footer.jpg new file mode 100644 index 0000000..0565037 Binary files /dev/null and b/task5/img/footer.jpg differ diff --git a/task5/img/header.jpg b/task5/img/header.jpg new file mode 100644 index 0000000..c6224e6 Binary files /dev/null and b/task5/img/header.jpg differ diff --git a/task5/img/like.svg b/task5/img/like.svg new file mode 100644 index 0000000..a1d32f5 --- /dev/null +++ b/task5/img/like.svg @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/task5/img/liked.svg b/task5/img/liked.svg new file mode 100644 index 0000000..d47dd0e --- /dev/null +++ b/task5/img/liked.svg @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/task5/img/naruto.png b/task5/img/naruto.png new file mode 100644 index 0000000..2029821 Binary files /dev/null and b/task5/img/naruto.png differ diff --git a/task5/img/sham.png b/task5/img/sham.png new file mode 100644 index 0000000..3920c9d Binary files /dev/null and b/task5/img/sham.png differ diff --git a/task5/js/Data.js b/task5/js/Data.js new file mode 100644 index 0000000..ac5f4ac --- /dev/null +++ b/task5/js/Data.js @@ -0,0 +1,112 @@ +var basicPosts = [ + { + id: '1', + description: 'NARUTO best anime', + createdAt: new Date('2014-12-12'), + author: 'Misha', + photoLink: 'img/naruto.png', + postVisibility: true, + hashTags: ['#NARUTOBESTANIME'], + likes: ['Alex'] + }, + + { + id: '2', + description: 'AVATAR best anime', + createdAt: new Date('2015-12-12'), + author: 'Misha', + photoLink: 'img/avatar.png', + postVisibility: true, + hashTags: ['#AVATARBESTANIME'], + likes: ['Egor'] + }, { + id: '3', + description: 'SHAMAN-KING best anime', + createdAt: new Date('2012-12-12'), + author: 'Misha2019', + photoLink: 'img/sham.png', + postVisibility: true, + hashTags: ['#SHAMANKINGBESTANIME'], + likes: ['Pomeedorka'] + }, + { + id: '4', + description: 'NARURO best anime', + createdAt: new Date('2013-12-12'), + author: 'Misha20', + photoLink: 'img/naruto.png', + postVisibility: true, + hashTags: ['#NARUTOBESTANIME'], + likes: ['Jora'] + }, + { + id: '5', + description: 'AVATAR best anime', + createdAt: new Date('2018-12-12'), + author: 'Misha', + photoLink: 'img/avatar.png', + postVisibility: true, + hashTags: ['#AVATARBESTANIME'], + likes: ['Jaga'] + }, + { + id: '6', + description: 'SHAMAN-KING best anime', + createdAt: new Date('2017-12-12'), + author: 'Misha22', + photoLink: 'img/sham.png', + postVisibility: true, + hashTags: ['#SHAMANKINGBESTANIME'], + likes: ['Jaguar'] + }, + { + id: '7', + description: 'NARUTO best anime', + createdAt: new Date('2016-12-12'), + author: 'Misha23', + photoLink: 'img/naruto.png', + postVisibility: true, + hashTags: ['#NARUTOBESTANIME'], + likes: ['Jagorka'] + }, + { + id: '8', + description: 'AVATAR best anime', + createdAt: new Date('2091-12-12'), + author: 'Misha', + photoLink: 'img/avatar.png', + postVisibility: true, + hashTags: ['#AVATARBESTANIME'], + likes: ['Igor'] + }, + { + id: '9', + description: 'SHAMAN-KING best anime', + createdAt: new Date('2020-12-12'), + author: 'Misha', + photoLink: 'img/sham.png', + postVisibility: true, + hashTags: ['#SHAMANKINGBESTANIME'], + likes: ['Egr'] + }, +]; + +for (var i = 0; i < basicPosts.length; i++) { + addPostToLocalStorage(basicPosts[i]); +} + +function addCurrentUserToLocalStorage(userName){ + localStorage.setItem("user", userName); +} + +function addPostToLocalStorage(post) { + localStorage.setItem(post.id, JSON.stringify(post)); +} + +function getPostFromLocalStorage(keyOfPost){ + return localStorage.getItem(keyOfPost); +} + +function removePostFromLocalStorage(keyOfPost){ + localStorage.removeItem(keyOfPost); +} diff --git a/task5/js/dom.js b/task5/js/dom.js new file mode 100644 index 0000000..d2d49b3 --- /dev/null +++ b/task5/js/dom.js @@ -0,0 +1,277 @@ +var domBlockOfFunc = (function () { + + function createAuthWindow() { + let windowForAuth = document.createElement('div'); + let authButton = document.getElementById('a-button'); + authButton.style.pointerEvents = 'none'; + authButton.style.cursor = 'default'; + let posts = document.getElementById('anime-header'); + windowForAuth.className = 'auth-window'; + windowForAuth.id = 'auth-window' + windowForAuth.innerHTML = `
Авторизация
+Логин :   
+Пароль :
+ + `; + posts.appendChild(windowForAuth); + } + + function cancelEditing() { + let edWindow = document.getElementById('ed-window'); + let posts = document.getElementById('anime-header'); + posts.removeChild(edWindow); + } + + function cancelAdding() { + let adWindow = document.getElementById('add-window'); + let posts = document.getElementById('anime-header'); + posts.removeChild(adWindow); + } + + function createEditPostDomWindow(edButtonId) { + let windowForEditing = document.createElement('div'); + let posts = document.getElementById('anime-header'); + windowForEditing.className = 'ed-window'; + windowForEditing.id = 'ed-window'; + var submitButtonId = edButtonId.replace('e', ''); + submitButtonId = 's' + submitButtonId; + windowForEditing.innerHTML = `${userName}
+Путь к изображению:
+Описание:
+${userName}
+Путь к изображению:
+Описание:
+