Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
426 changes: 426 additions & 0 deletions task5/css/style.css

Large diffs are not rendered by default.

Empty file added task5/img/.gitignore
Empty file.
Binary file added task5/img/av1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/av2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/bl.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/brush.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/cross.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/footer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/header.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions task5/img/like.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions task5/img/liked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/naruto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added task5/img/sham.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions task5/js/Data.js
Original file line number Diff line number Diff line change
@@ -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);
}
Loading