Skip to content

Commit c7a2f7b

Browse files
committed
multiple full screens of projects
1 parent b1c0ce8 commit c7a2f7b

12 files changed

Lines changed: 183 additions & 41 deletions

File tree

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,24 @@ Trigger it with Commit and Push to master.
3131

3232
## TODO
3333

34+
- add more images of pro project: features/pages !!
3435
- add new projects (kineval, tarava?, todolist?)
3536
- shorten cv old web experience? + add senior dev? + new skills to filter?
3637
- review images (avoid bg-img, use different resolutions: https://dev.to/builderio/optimal-images-in-html-5bg9)
3738
- review design: https://anthonyhobday.com/sideprojects/saferules/
3839

3940
X.X
41+
- advertisements in blog posts ?
4042
- back to top button
4143
- site search ??
42-
- add more images of features/pages?
4344

44-
Blog posts => ads ?
45-
- series of posts: links inside the posts
45+
Blog posts
4646
- firebase series: rules, cloud fx, diff env., backup
47-
- react advanced?
4847
- use prism in your nextjs markdown (+scss)
4948
- css posts: dropdown, input with label animation
5049
- use mdx with nextjs
51-
- local ssg site with python
52-
- props to parent/child
5350
- md to html
5451
- SSG vs SSR
55-
- dev.to
5652

5753
## BLOG POSTS
5854

@@ -71,6 +67,7 @@ Blog posts => ads ?
7167
- Write the post with keywords, speaking with we, code examples and a final result on codepen or codesandbox
7268
- Review spell on https://languagetool.org/
7369
- Create blog post image and upload in /public/images/posts
70+
- Dimensions of 1200x630px reduced to 600x315px in .jpg
7471
- `yarn screen:bm <file-name.extension>` (eg. `yarn screen:bm article.jpg`)
7572
- OR https://codepen.io/beumsk/full/wvjYygY
7673
- Create blog content image and upload in /public/images/content
@@ -103,10 +100,11 @@ Blog posts => ads ?
103100
```
104101
- Create an optimized miniature image and upload in /public/images/projects
105102
- Dimensions of 1366x768px reduced to 683x384px in .jpg (or 1200x630px & 600x315px)
106-
- `yarn screen:pm <project-url> <file-name.extension>` (eg. `yarn screen:pm https://remybeumier.be rb.jpg`)
107-
- Create an optimized full size screenshot of live version and upload in /public/images/projects
108-
- Dimensions of 1920x100% (reduced?) in .jpg
109-
- `yarn screen:pf <project-url> <file-name-screen.extension>` (eg. `yarn screen:pf https://remybeumier.be rb-screen.jpg`)
103+
- `yarn screen:pm <project-url> <project-name.extension>` (eg. `yarn screen:pm https://remybeumier.be remybeumier.jpg`)
104+
- Create one or more optimized full size screenshots of live version and upload in /public/images/projects
105+
- Dimensions of 1200x100% (reduced?) in .jpg
106+
- `yarn screen:pf <project-url> <project-name-screen.extension>` (eg. `yarn screen:pf https://remybeumier.be remybeumier-screen.jpg`)
107+
- `yarn screen:pf <project-url> <project-name-screen-index.extension>` (eg. `yarn screen:pf https://remybeumier.be remybeumier-screen-1.jpg`)
110108

111109
### PERSO
112110

@@ -132,7 +130,7 @@ Blog posts => ads ?
132130
```
133131
- Create an optimized miniature image and upload in /public/images/projects
134132
- Dimensions of 1366x768px reduced to 683x384px in .jpg (or 1200x630px & 600x315px)
135-
- `yarn screen:pm <project-url> <file-name.extension>` (eg. `yarn screen:pm https://remybeumier.be rb.jpg`)
133+
- `yarn screen:pm <project-url> <project-name.extension>` (eg. `yarn screen:pm https://remybeumier.be rb.jpg`)
136134

137135
## DATA (COMMITS)
138136

components/screens.tsx

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { HTMLAttributes, useEffect, useState } from 'react';
2+
import { AiFillCaretLeft, AiFillCaretRight } from 'react-icons/ai';
3+
import { MdHeight } from 'react-icons/md';
4+
import useJavaScriptEnabled from '@hooks/useJavaScript';
5+
import { ProjectType } from '@types';
6+
7+
type LinkType = {
8+
project: ProjectType;
9+
} & HTMLAttributes<HTMLDivElement>;
10+
11+
export default function Screens({ project, ...props }: LinkType) {
12+
const isJavaScriptEnabled = useJavaScriptEnabled();
13+
const [index, setIndex] = useState(0);
14+
const [isFull, setIsFull] = useState(true);
15+
16+
function handleSwipe(dir: 'left' | 'right') {
17+
if (dir === 'left') {
18+
setIndex((prev) => (prev === 0 ? project.screens.length - 1 : prev - 1));
19+
} else {
20+
setIndex((prev) => (prev === project.screens.length - 1 ? 0 : prev + 1));
21+
}
22+
}
23+
24+
useEffect(() => {
25+
setIndex(0);
26+
}, [project.link]);
27+
28+
return (
29+
<>
30+
{isJavaScriptEnabled ? (
31+
<div className="space-between-x mb-4">
32+
{project.screens.length > 1 ? (
33+
<button title="See previous screenshot" onClick={() => handleSwipe('left')}>
34+
<AiFillCaretLeft className="mr-1" />
35+
Previous
36+
</button>
37+
) : null}
38+
<button onClick={() => setIsFull((c) => !c)}>
39+
<MdHeight className="mr-1" />
40+
{isFull ? 'Set screenshot scrollable' : 'Set screenshot full size'}
41+
<MdHeight className="ml-1" />
42+
</button>
43+
{project.screens.length > 1 ? (
44+
<button title="See next screenshot" onClick={() => handleSwipe('right')}>
45+
Next
46+
<AiFillCaretRight className="ml-1" />
47+
</button>
48+
) : null}
49+
</div>
50+
) : null}
51+
<div className="project__screen" {...props}>
52+
<figure className={isFull ? '' : 'scrollable'}>
53+
<img
54+
src={project.screens[index]}
55+
alt={`Screenshot of ${project.current}`}
56+
width="300"
57+
height="400"
58+
loading="lazy"
59+
/>
60+
<figcaption className="sr-only">{`Full size screenshot of ${project.title} website`}</figcaption>
61+
</figure>
62+
{isJavaScriptEnabled && project.screens.length > 1 ? (
63+
<>
64+
<div
65+
title="See previous screenshot"
66+
onClick={() => handleSwipe('left')}
67+
tabIndex={0}
68+
role="button"
69+
aria-label="See previous screenshot"
70+
className="left"
71+
></div>
72+
<div
73+
title="See next screenshot"
74+
onClick={() => handleSwipe('right')}
75+
tabIndex={0}
76+
role="button"
77+
aria-label="See next screenshot"
78+
className="right"
79+
></div>
80+
</>
81+
) : null}
82+
</div>
83+
</>
84+
);
85+
}

data/projects.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const projects = [
66
// current: 'https://kine-clarinval.be/',
77
// past: '',
88
// img: '/images/projects/kine-clarinval.jpg',
9-
// screen: '/images/projects/kine-clarinval-screen.png',
9+
// screens: ['/images/projects/kine-clarinval-screen.png'],
1010
// modified: '2024-07-27',
1111
// intro: '',
1212
// tech: ['react', 'firebase','next.js', 'typescript', 'mdx', 'sass'],
@@ -21,8 +21,12 @@ const projects = [
2121
current: 'https://tripser.blog/',
2222
past: 'https://web.archive.org/web/20240403175710/https://tripser.blog/',
2323
img: '/images/projects/tripser-blog.jpg',
24-
screen: '/images/projects/tripser-blog-screen.jpg',
25-
modified: '2024-07-15',
24+
screens: [
25+
'/images/projects/tripser-blog-screen.jpg',
26+
'/images/projects/tripser-blog-screen-1.jpg',
27+
'/images/projects/tripser-blog-screen-2.jpg',
28+
],
29+
modified: '2024-12-23',
2630
intro: 'Tripser blog built with Next.js, Sass, i18n and MDX.',
2731
tech: ['react', 'next.js', 'typescript', 'mdx', 'sass', 'i18n'],
2832
chall: [
@@ -41,7 +45,7 @@ const projects = [
4145
current: 'https://www.parispadelmajor.com/',
4246
past: 'https://web.archive.org/web/20220714150729/https://www.parispadelmajor.com/',
4347
img: '/images/projects/padel.jpg',
44-
screen: '/images/projects/padel-screen.png',
48+
screens: ['/images/projects/padel-screen.png'],
4549
modified: '2023-11-27',
4650
intro:
4751
'Paris Premier Padel Major website built with React. PPPM official website giving access to the latest news, pictures and videos as well as live scoring and ticketing system.',
@@ -63,7 +67,7 @@ const projects = [
6367
current: 'https://www.parcomega.ca/',
6468
past: 'https://web.archive.org/web/20211213130150/https://app.staging.parcomega.ca/en/',
6569
img: '/images/projects/omega.jpg',
66-
screen: '/images/projects/omega-screen.png',
70+
screens: ['/images/projects/omega-screen.png'],
6771
modified: '2023-11-27',
6872
intro:
6973
'Omega zoo booking website with React. Information about the park and its animals as well as ability to book your stay, table or entrance via ticketing system.',
@@ -84,7 +88,7 @@ const projects = [
8488
current: 'https://www.onomohotels.com/',
8589
past: 'https://web.archive.org/web/20211213130244/https://app.staging.onomohotels.com/',
8690
img: '/images/projects/onomo.jpg',
87-
screen: '/images/projects/onomo-screen.png',
91+
screens: ['/images/projects/onomo-screen.png'],
8892
modified: '2023-11-27',
8993
intro:
9094
'Onomo hotels booking website with React. Possibility to search and book hotels through a complete booking journey.',
@@ -104,7 +108,7 @@ const projects = [
104108
current: 'https://www.eliparis.com/',
105109
past: 'http://web.archive.org/web/20220120123422/https://www.eliparis.com/accueil',
106110
img: '/images/projects/eli-paris.jpg',
107-
screen: '/images/projects/eli-paris-screen.png',
111+
screens: ['/images/projects/eli-paris-screen.png'],
108112
modified: '2023-04-27',
109113
intro:
110114
'Eli Paris jewelry store website built with Angular, Node and Strapi. Complete back office to manage the content of the site. Cart, payment and invoice processes.',
@@ -124,7 +128,7 @@ const projects = [
124128
current: 'https://careers.kpmg.be/',
125129
past: 'https://web.archive.org/web/20200803122755/https://careers.kpmg.be/',
126130
img: '/images/projects/kpmg-careers.jpg',
127-
screen: '/images/projects/kpmg-careers-screen.png',
131+
screens: ['/images/projects/kpmg-careers-screen.png'],
128132
modified: '2022-04-25',
129133
intro: 'KPMG Belgium recruitment website built with Umbraco CMS.',
130134
tech: ['umbraco', 'c#', 'html', 'css', 'javascript', 'sass'],
@@ -145,7 +149,7 @@ const projects = [
145149
current: 'https://www.kpmglaw.be/',
146150
past: 'https://web.archive.org/web/20200812114928/https://www.klaw.be/',
147151
img: '/images/projects/kpmg-law.jpg',
148-
screen: '/images/projects/kpmg-law-screen.png',
152+
screens: ['/images/projects/kpmg-law-screen.png'],
149153
modified: '2022-04-25',
150154
intro: 'KPMG Law (previously Klaw) website built with Umbraco CMS.',
151155
tech: ['umbraco', 'c#', 'html', 'css', 'javascript', 'sass'],

pages/projects/[slug].tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Codesandbox from '@components/codesandbox';
66
import Grid from '@components/grid';
77
import Layout from '@components/layout';
88
import Linkk from '@components/linkk';
9+
import Screens from '@components/screens';
910
import Tech from '@components/tech';
1011
import { ProjectType } from '@types';
1112

@@ -52,21 +53,25 @@ export default function DynamicProject({ project, relatedLinks, img, url }: Dyna
5253
</>
5354
) : null}
5455

55-
{!isPro && project.pen ? <Codepen pen={project.pen} title={project.title} /> : null}
56+
{!isPro && project.pen ? (
57+
<>
58+
<h2>Demo</h2>
59+
<Codepen pen={project.pen} title={project.title} />
60+
</>
61+
) : null}
5662

57-
{!isPro && project.sandbox ? <Codesandbox sandbox={project.sandbox} title={project.title} /> : null}
63+
{!isPro && project.sandbox ? (
64+
<>
65+
<h2>Demo</h2>
66+
<Codesandbox sandbox={project.sandbox} title={project.title} />
67+
</>
68+
) : null}
5869

59-
{isPro && project.screen ? (
60-
<figure className="project__screen">
61-
<img
62-
src={project.screen}
63-
alt={`Screenshot of ${project.current}`}
64-
width="300"
65-
height="400"
66-
loading="lazy"
67-
/>
68-
<figcaption className="sr-only">{`Full size screenshot of ${project.title} website homepage`}</figcaption>
69-
</figure>
70+
{isPro && project.screens.length ? (
71+
<>
72+
<h2>Visual{project.screens.length > 1 ? 's' : ''}</h2>
73+
<Screens project={project} className="project__screen" />
74+
</>
7075
) : null}
7176

7277
<div className="mb-15">
722 KB
Loading
157 KB
Loading
41.3 KB
Loading

public/styles/base/_general.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,17 @@ figure {
160160
margin: 0;
161161
}
162162

163+
input,
164+
optgroup,
165+
select,
166+
textarea {
167+
color: var(--text);
168+
background: var(--bg);
169+
}
170+
163171
select {
164172
padding: 0.25rem 0.5rem;
165173
cursor: pointer;
166-
background: var(--bg);
167174
}
168175

169176
button {

public/styles/pages/_projects.scss

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,47 @@
3939
border: solid 1px var(--primary);
4040
box-shadow: var(--shadows6);
4141
margin-bottom: calc(2.5rem + 12px);
42+
position: relative;
43+
44+
figure.scrollable {
45+
max-height: 80vh;
46+
overflow: auto;
47+
-ms-overflow-style: none;
48+
scrollbar-width: none;
49+
50+
&::-webkit-scrollbar {
51+
display: none;
52+
}
53+
}
54+
55+
.left,
56+
.right {
57+
position: absolute;
58+
top: 0;
59+
display: flex;
60+
justify-content: center;
61+
align-items: center;
62+
width: 10%;
63+
height: 100%;
64+
background: var(--bg);
65+
z-index: 1;
66+
transition: all var(--transition);
67+
cursor: pointer;
68+
--gradient-color: var(--text40);
69+
70+
&:hover,
71+
&:focus {
72+
opacity: 0.5;
73+
}
74+
}
75+
76+
.left {
77+
left: 0;
78+
background: linear-gradient(to right, var(--gradient-color), transparent);
79+
}
80+
81+
.right {
82+
right: 0;
83+
background: linear-gradient(to left, var(--gradient-color), transparent);
84+
}
4285
}

screen-project-full.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const [url, output] = process.argv.slice(2);
55

66
if (url && output) {
77
console.log(`Taking project screenshot of ${url} and saving it to ${output}.jpg`);
8-
takeScreenshot(url, output, { w: 1920, h: 1080 }, true, false)
9-
.then((path) => sharpit(path, {}, 80, true))
8+
takeScreenshot(url, output, { w: 1200, h: 1080 }, true, false)
9+
// .then((path) => sharpit(path, {}, 40, true))
1010
.catch((err) => console.error(err));
1111
} else {
1212
console.error('Invalid or missing arguments');

0 commit comments

Comments
 (0)