Skip to content

Commit 808d6b9

Browse files
Jorislfadeskodiakhq[bot]
authoredSep 1, 2020
[EXAMPLE] with-framer-motion: fix broken images (#16714)
* refactor: remove useless console.log * fix: replace broken images * Updated title Co-authored-by: Luis Alvarez <luis@vercel.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 1c45f70 commit 808d6b9

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed
 

‎examples/with-framer-motion/components/Gallery.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Thumbnail = ({ id, i }) => (
3535
>
3636
<Link href="/image/[index]" as={`/image/${i}`} scroll={false}>
3737
<motion.img
38-
src={`https://static1.squarespace.com/static/5b475b2c50a54f54f9b4e1dc/t/${id}.jpg?format=1500w`}
38+
src={`https://images.unsplash.com/${id}?auto=format&fit=crop&w=1500`}
3939
alt="The Barbican"
4040
variants={imageVariants}
4141
transition={transition}
@@ -69,7 +69,7 @@ const Thumbnail = ({ id, i }) => (
6969

7070
const Gallery = () => (
7171
<>
72-
<h1>Barbican</h1>
72+
<h1>Motion</h1>
7373
<div className="gallery">
7474
<motion.div
7575
className="thumbnails"
@@ -118,14 +118,14 @@ const Gallery = () => (
118118
bottom: -130px;
119119
}
120120
}
121-
121+
122122
@media screen and (min-width: 800px) {
123123
h1 {
124124
font-size: 180px;
125125
bottom: -170px;
126126
}
127127
}
128-
128+
129129
@media screen and (min-width: 1000px) {
130130
h1 {
131131
font-size: 220px;

‎examples/with-framer-motion/components/SingleImage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const SingleImage = ({ index }) => (
2828
<motion.div className="single" initial="exit" animate="enter" exit="exit">
2929
<motion.img
3030
variants={imageVariants}
31-
src={`https://static1.squarespace.com/static/5b475b2c50a54f54f9b4e1dc/t/${images[index]}.jpg?format=1500w`}
31+
src={`https://images.unsplash.com/${images[index]}?auto=format&fit=crop&w=1500`}
3232
alt="The Barbican"
3333
/>
3434
<motion.div className="back" variants={backVariants}>
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export const images = [
2-
'5b5a3938562fa764113169a6/1532639559620/DSCF3338',
3-
'5b5a3628f950b7390fbfc5f8/1532639027872/DSCF3246',
4-
'5b5a3741575d1fccb5ac6b3f/1532639066455/DSCF3268',
5-
'5b5a376b0e2e728eeeaca8e4/1532683586969/DSCF3274',
6-
'5b5c228403ce64f3c80d4d8e/1532764845121/DSCF3348',
7-
'5b5a3b800e2e728eeead9575/1532640158813/DSCF3375',
2+
'photo-1520517601640-32ec514e4a15',
3+
'photo-1518780535463-bc357fa46e64',
4+
'photo-1555068178-89125fb6356d',
5+
'photo-1553503359-d4ff2537a6ea',
6+
'photo-1585211751845-37663b4ab614',
7+
'photo-1496467115032-c504ef76521b',
88
]

‎examples/with-framer-motion/pages/image/[index].js

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export async function getStaticProps({ params }) {
1717
export async function getStaticPaths() {
1818
return {
1919
paths: images.map((_id, index) => {
20-
console.log(index)
2120
return {
2221
params: {
2322
index: `${index}`,

0 commit comments

Comments
 (0)
Please sign in to comment.