infamous Griddy
This commit is contained in:
@@ -1,70 +1,14 @@
|
|||||||
.gallerycontainer {
|
.image:hover {
|
||||||
display: flex;
|
cursor: pointer;
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
// justify-content: space-between;
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
gap: 2rem;
|
|
||||||
.galleryimg {
|
|
||||||
--mheight: 18rem;
|
|
||||||
position: relative;
|
|
||||||
display: block;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
max-height: var(--mheight);
|
|
||||||
animation-name: goIn;
|
|
||||||
animation-duration: 350ms;
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
text-decoration: none;
|
|
||||||
max-height: none;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
@keyframes goIn {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translate(0, 8px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
max-height: var(--mheight);
|
|
||||||
border-radius: 8px;
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
max-width: 280px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
article {
|
|
||||||
position: absolute;
|
|
||||||
backdrop-filter: blur(8px);
|
|
||||||
background: rgba(#fff, 0.4);
|
|
||||||
color: var(--backdrop);
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0.25rem 0.5rem;
|
|
||||||
border-radius: 8px;
|
|
||||||
border-top-left-radius: 0;
|
|
||||||
border-top-right-radius: 0;
|
|
||||||
transition-duration: 100ms;
|
|
||||||
opacity: 0;
|
|
||||||
p {
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
display: block;
|
|
||||||
position: relative;
|
|
||||||
background: unset;
|
|
||||||
color: var(--white0);
|
|
||||||
padding: 0;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:hover {
|
|
||||||
article {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
.title {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import styles from "./IndexGallery.module.scss";
|
import styles from "./IndexGallery.module.scss";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
import ImageList from "@mui/material/ImageList";
|
||||||
|
import ImageListItem from "@mui/material/ImageListItem";
|
||||||
|
import ImageListItemBar from "@mui/material/ImageListItemBar";
|
||||||
|
import { useTheme } from "@mui/material/styles";
|
||||||
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
||||||
|
|
||||||
const IndexGallery = () => {
|
const IndexGallery = () => {
|
||||||
type apiResType = {
|
type apiResType = {
|
||||||
@@ -24,39 +29,40 @@ const IndexGallery = () => {
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
function redirect(
|
||||||
|
Link: string
|
||||||
|
): import("react").MouseEventHandler<HTMLImageElement> {
|
||||||
|
return (event: React.MouseEvent<HTMLImageElement>) => {
|
||||||
|
window.open(Link, "_blank");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const theme = useTheme();
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<main>
|
<main>
|
||||||
<h2>galeria zdjęć idących mocno</h2>
|
<h2>galeria zdjęć idących mocno</h2>
|
||||||
</main>
|
</main>
|
||||||
<main className={styles.gallerycontainer}>
|
<main>
|
||||||
{data.map((el: apiResType) => {
|
<ImageList variant="masonry" cols={isMobile ? 1 : 3} gap={8}>
|
||||||
return (
|
{data.map((el: apiResType) => (
|
||||||
<Link key={el.Id} href={el.Link} className={styles.galleryimg}>
|
<>
|
||||||
<img src={el.Link} alt={el.Description || el.Title} />
|
<ImageListItem key={el.Id}>
|
||||||
<article>
|
<img
|
||||||
<h3>{el.Title}</h3>
|
src={el.Link}
|
||||||
<p>
|
alt={el.Description || el.Title}
|
||||||
{el.Place || ""}
|
loading="lazy"
|
||||||
{el.Place && el.Date ? ", " : ""}
|
onClick={redirect(el.Link)}
|
||||||
{el.Date
|
className={styles.image}
|
||||||
? new Date(el.Date).getDate().toString().length == 2
|
></img>
|
||||||
? new Date(el.Date).getDate()
|
<ImageListItemBar
|
||||||
: "0" + new Date(el.Date).getDate()
|
title={el.Title}
|
||||||
: ""}
|
subtitle={el.Place}
|
||||||
{"."}
|
></ImageListItemBar>
|
||||||
{el.Date
|
</ImageListItem>
|
||||||
? (new Date(el.Date).getMonth() + 1).toString().length == 2
|
</>
|
||||||
? new Date(el.Date).getMonth() + 1
|
))}
|
||||||
: "0" + (new Date(el.Date).getMonth() + 1)
|
</ImageList>
|
||||||
: ""}
|
|
||||||
{"."}
|
|
||||||
{el.Date ? new Date(el.Date).getFullYear() : ""}
|
|
||||||
</p>
|
|
||||||
</article>
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</main>
|
</main>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
1409
package-lock.json
generated
1409
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,10 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth0/nextjs-auth0": "^2.0.1",
|
"@auth0/nextjs-auth0": "^2.0.1",
|
||||||
|
"@emotion/react": "^11.11.3",
|
||||||
|
"@emotion/styled": "^11.11.0",
|
||||||
|
"@mui/lab": "^5.0.0-alpha.163",
|
||||||
|
"@mui/material": "^5.15.7",
|
||||||
"@types/node": "18.11.12",
|
"@types/node": "18.11.12",
|
||||||
"@types/react": "18.0.26",
|
"@types/react": "18.0.26",
|
||||||
"@types/react-dom": "18.0.9",
|
"@types/react-dom": "18.0.9",
|
||||||
|
|||||||
Reference in New Issue
Block a user