Skip to content

Commit

Permalink
Update package.json and fix small things
Browse files Browse the repository at this point in the history
  • Loading branch information
emmnunes committed Oct 4, 2022
1 parent fca5c18 commit 07ad62e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
44 changes: 19 additions & 25 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ export const onClientEntry = (_, pluginOptions) => {
z-index: -1;
top: 0;
left: 0;
padding: 2vh 0;
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
padding: 20px 0;
display: flex;
flex-direction: column;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.9);
transform: scale(1.1);
transition: transform 200ms, opacity 300ms, z-index 400ms;
pointer-events: none;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.modal.show {
Expand All @@ -38,33 +36,32 @@ export const onClientEntry = (_, pluginOptions) => {
}
.modal__content picture {
width: auto;
height: 83vh;
position: relative !important;
margin: auto;
}
.modal__content img {
object-fit: contain;
object-position: center center;
box-shadow: none !important;
max-width: 100%;
max-height: 90vh;
flex: 1;
position: relative !important;
}
.modal__content {
margin: auto;
display: grid;
width: 90%;
width: 80%;
max-width: 90%;
height: 100%;
}
#modal-caption {
font-family: 'base-mono-wide', 'Andale Mono', 'AndaleMono', 'Lucida Console', 'Lucida Sans Typewriter', 'Bitstream Vera Sans Mono', monospace;
display: flex;
align-items: center;
justify-content: center;
width: 90%;
height: 13vh;
margin: auto;
display: block;
width: 80%;
max-width: 700px;
text-align: center;
color: #ccc;
padding: 10px 0;
}
.modal__close {
Expand Down Expand Up @@ -123,19 +120,16 @@ function runZoom() {
}
}
if (children.length == 0) {
console.log(document.getElementsByTagName("span"));
console.log(document);
console.log(children);
console.log("No pictures found on this page");
return;
}
}
children.map((element) => {
element.onclick = function (e) {
let picture = this.getElementsByTagName("picture")[0];
let imgElement = this.getElementsByTagName("img")[0];
modalImg.innerHTML = picture.outerHTML;
captionText.innerHTML = imgElement.alt ? imgElement.alt : "";
let caption = element.querySelector("img.gatsby-resp-image-image").alt;
captionText.innerHTML = caption || "";
isModalVisible = true;
modal.classList.add("show");
e.stopPropagation();
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/pszafer/gatsby-remark-images-modal.git"
"url": "git+https://github.com/undersight/gatsby-remark-images-modal.git"
},
"keywords": [
"gatsby",
Expand All @@ -21,10 +21,10 @@
"zoom",
"modal"
],
"author": "Pawel Szafer",
"author": "Pawel Szafer & Eduardo Nunes",
"license": "MIT",
"bugs": {
"url": "https://github.com/pszafer/gatsby-remark-images-modal/issues"
"url": "https://github.com/undersight/gatsby-remark-images-modal/issues"
},
"homepage": "https://github.com/pszafer/gatsby-remark-images-modal#readme"
"homepage": "https://github.com/undersight/gatsby-remark-images-modal#readme"
}

0 comments on commit 07ad62e

Please sign in to comment.