Skip to content

Commit

Permalink
including task 2
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaBilynska committed May 29, 2023
1 parent e2d5aac commit c10605e
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 4 deletions.
53 changes: 53 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"url": "https://github.com/goitacademy/parcel-project-template/issues"
},
"dependencies": {
"@vimeo/player": "^2.20.1",
"lodash.throttle": "^4.1.1",
"modern-normalize": "^1.1.0",
"simplelightbox": "^2.14.1"
},
Expand Down
1 change: 1 addition & 0 deletions src/css/01-gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
justify-content: center;
margin-left: auto;
margin-right: auto;
list-style: none;
}

.gallery__item {
Expand Down
4 changes: 0 additions & 4 deletions src/js/01-gallery.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Add imports above this line
import { galleryItems } from './gallery-items';
// Change code below this line
import SimpleLightbox from "simplelightbox";
// Додатковий імпорт стилів
import "simplelightbox/dist/simple-lightbox.min.css";
console.log(galleryItems);

const makeGalleryMarkup = images => {
return images.map(({ preview, original, description }) => {
Expand Down
26 changes: 26 additions & 0 deletions src/js/02-video.js
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
import Vimeo from '@vimeo/player';
import throttle from 'lodash.throttle';

const iframe = document.querySelector('iframe');
const player = new Vimeo(iframe);


player.on('timeupdate', throttle(() => {
player.getCurrentTime().then(function (seconds) {
console.log(seconds);
localStorage.setItem("videoplayer-current-time", seconds);
}).catch(function (error) {
console.log(error);
});
}, 1000));

player.setCurrentTime(localStorage.getItem("videoplayer-current-time")).then(function (seconds) {
console.log(seconds);
}).catch(function(error) {
switch (error.name) {
case 'RangeError':
break;
default:
break;
}
});

0 comments on commit c10605e

Please sign in to comment.