Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
Philippe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
Philippe
Commits
ef5e2bc8
Commit
ef5e2bc8
authored
Jul 01, 2021
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: dimension math, credits link, [id] overflow
parent
67e3e4a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
23 deletions
+19
-23
_app.js
pages/_app.js
+2
-6
credits.js
pages/credits.js
+4
-2
[id].js
pages/photos/[id].js
+13
-15
No files found.
pages/_app.js
View file @
ef5e2bc8
...
...
@@ -32,12 +32,8 @@ function MyApp({ Component, pageProps }) {
>
Paul
-
Louis
<
/Link>{" "
}
grace
aux
contenus
partag
é
s
par
les
proches
de
Philippe
.
<
/Text
>
<
Text
fontSize
=
"sm"
>
<
Link
href
=
"/credits"
>
Cr
é
dits
<
/Link
>
grace
aux
contenus
partag
é
s
par
les
proches
de
Philippe
-
{
" "
}
<
Link
href
=
"/credits"
>
Cr
é
dits
<
/Link
>
<
/Text
>
<
/Container
>
<
/ChakraProvider
>
...
...
pages/credits.js
View file @
ef5e2bc8
...
...
@@ -21,12 +21,12 @@ export async function getStaticProps() {
{
title
:
"Vercel"
,
text
:
"Pour l'hébergement de ces pages"
,
link
:
"vercel.com"
,
link
:
"
https://
vercel.com"
,
},
{
title
:
"Next.JS"
,
text
:
"Utilisé pour construire le site"
,
link
:
"nextjs.org"
,
link
:
"
https://
nextjs.org"
,
},
];
return
{
...
...
@@ -67,6 +67,7 @@ export default function Credits({ credits }) {
borderWidth
=
"1px"
borderRadius
=
{
"10px"
}
>
<
Link
href
=
{
credit
.
link
?
credit
.
link
:
"#"
}
>
<
Text
color
=
"gray.700"
fontWeight
=
"semibold"
...
...
@@ -75,6 +76,7 @@ export default function Credits({ credits }) {
>
{
credit
.
title
}
<
/Text
>
<
/Link
>
<
br
/>
<
Text
color
=
"gray.500"
fontWeight
=
"semibold"
fontSize
=
"sm"
m
=
"1rem"
>
{
credit
.
text
}
...
...
pages/photos/[id].js
View file @
ef5e2bc8
...
...
@@ -42,9 +42,9 @@ export async function getStaticProps({ params }) {
// Fix dimensions if really big picture
console
.
log
(
"Pic dims: "
,
photo
.
dimensions
.
width
,
photo
.
dimensions
.
height
);
if
(
photo
.
dimensions
.
width
s
>
1000
||
photo
.
dimensions
.
heigth
>
1000
)
{
if
(
photo
.
dimensions
.
width
>
1000
||
photo
.
dimensions
.
heigth
>
1000
)
{
photo
.
dimensions
.
width
/=
2
;
photo
.
dimensions
.
height
=
2
;
photo
.
dimensions
.
height
/
=
2
;
console
.
log
(
"Resized: "
,
photo
.
dimensions
.
width
,
photo
.
dimensions
.
height
);
}
if
(
photo
.
dimensions
.
width
>
1000
||
photo
.
dimensions
.
heigth
>
1000
)
{
...
...
@@ -74,19 +74,17 @@ export default function Photos({ photo, placeholder }) {
<
Center
>
<
Link
href
=
{
photo
.
path
}
>
<
Box
boxSize
=
{[
"xs"
,
"sm"
,
"md"
,
"lg"
]}
>
<
Image
src
=
{
photo
.
path
}
width
=
{
photo
.
dimensions
.
width
||
480
}
height
=
{
photo
.
dimensions
.
height
||
480
}
// objectFit="cover"
quality
=
{
80
}
priority
placeholder
=
"blur"
blurDataURL
=
{
placeholder
}
loading
=
"eager"
/>
<
/Box
>
<
Image
src
=
{
photo
.
path
}
width
=
{
photo
.
dimensions
.
width
||
480
}
height
=
{
photo
.
dimensions
.
height
||
480
}
// objectFit="cover"
quality
=
{
80
}
priority
placeholder
=
"blur"
blurDataURL
=
{
placeholder
}
loading
=
"eager"
/>
<
/Link
>
<
/Center
>
<
NavLinks
prev
=
{
photo
.
prev
}
next
=
{
photo
.
next
}
/
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment