-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
151 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-513 KB
static/images/gallery/369999333_1029069688361766_1351452372179140801_n.jpg
Binary file not shown.
Binary file removed
BIN
-833 KB
static/images/gallery/370273055_1030692108199524_5216889637740853896_n.jpg
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { switcher, clipboard, toggleToc } from './components/components'; | ||
import { header } from './layouts/header'; | ||
import { home } from './pages/home'; | ||
import { gallerySetter } from './layouts/gallery'; | ||
|
||
|
||
|
||
// import { galleryHtmlGen } from './layouts/gallery'; | ||
// galleryHtmlGen(); | ||
|
||
gallerySetter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,60 @@ | ||
const Http = new XMLHttpRequest(); | ||
const url = 'https://www.googleapis.com/drive/v3/drives'; | ||
Http.open("GET", url); | ||
Http.send(); | ||
let currentId = 1; | ||
const imagesArray = document.querySelectorAll(".photo_container"); | ||
let noOfImg = imagesArray.length; | ||
|
||
Http.onreadystatechange = (e) => { | ||
console.log(Http.responseText) | ||
let options = { | ||
threshold: 0.2, | ||
} | ||
|
||
const drivePhotosId = [ | ||
'1EH6CkWErvD40nmqWu_IgsuumcJkUgcxm', | ||
]; | ||
|
||
let galleryHtml = ''; | ||
export function galleryHtmlGen() { | ||
drivePhotosId.forEach(id => { | ||
galleryHtml += ` | ||
<div class="photo_container"> | ||
<img alt="gallery" class="photos_container" src="https://i.postimg.cc/c194sx7z/photo-6298466705638275023-y.jpg" /> | ||
</div> | ||
` | ||
}); | ||
|
||
document.querySelector(".photos_grid").innerHTML = galleryHtml; | ||
let callback = (entries, observer) => { | ||
entries.forEach(entry => { | ||
if (entry.intersectionRatio > options.threshold) { | ||
galleryScroller(); | ||
// console.log('hi') | ||
} else { | ||
clearTimeout(galleryTimeout); | ||
// console.log('hello') | ||
}; | ||
}) | ||
} | ||
let observer = new IntersectionObserver(callback, options); | ||
|
||
let target = document.querySelector(".photos_grid"); | ||
observer.observe(target); | ||
|
||
|
||
function galleryScroller() { | ||
// console.log(currentId) | ||
gallerySetter(); | ||
galleryTimeout = setTimeout(() => { | ||
currentId = currentId == noOfImg ? 1 : currentId + 1; | ||
galleryScroller(); | ||
}, 3000) | ||
} | ||
|
||
export function gallerySetter() { | ||
// console.log(noOfImg); | ||
prevLeftId = (currentId - 2 <= 0) ? currentId + noOfImg - 2 : currentId - 2; | ||
nextRightId = (currentId + 2 > noOfImg) ? currentId - noOfImg + 2 : currentId + 2; | ||
leftId = (currentId - 1 <= 0) ? currentId + noOfImg - 1 : currentId - 1; | ||
rightId = (currentId + 1 > noOfImg) ? currentId - noOfImg + 1 : currentId + 1; | ||
currentImg = document.querySelector(`.img_id_${currentId}`); | ||
leftImg = document.querySelector(`.img_id_${leftId}`); | ||
rightImg = document.querySelector(`.img_id_${rightId}`); | ||
prevLeftImg = document.querySelector(`.img_id_${prevLeftId}`); | ||
|
||
|
||
prevLeftImg.classList.remove("photo_container__left"); | ||
currentImg.classList.remove("photo_container__left"); | ||
currentImg.classList.remove("photo_container__right"); | ||
leftImg.classList.remove("photo_container__right"); | ||
leftImg.classList.remove("photo_container__show"); | ||
rightImg.classList.remove("photo_container__left"); | ||
rightImg.classList.remove("photo_container__show"); | ||
|
||
|
||
|
||
currentImg.classList.add("photo_container__show"); | ||
leftImg.classList.add("photo_container__left"); | ||
rightImg.classList.add("photo_container__right"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters