You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor Welcome page with ImageWithContent component
- Replace custom image and text layout with new ImageWithContent component
- Simplify markup and improve code readability
- Extract portrait image sources into a separate object
- Maintain existing content and styling
@@ -12,59 +13,41 @@ import portraitImageLarge from '../images/peter/peter-stackebrandt-portrait-larg
12
13
13
14
// Main content of the page
14
15
exportdefaultfunctionWelcome(){
16
+
constportraitSources={
17
+
small: portraitImageSmall,
18
+
medium: portraitImageMedium,
19
+
large: portraitImageLarge,
20
+
smallWebp: portraitImageSmallWebp,
21
+
mediumWebp: portraitImageMediumWebp,
22
+
largeWebp: portraitImageLargeWebp
23
+
};
24
+
15
25
return(
16
26
<divclassName="welcome">
17
27
<divclassName="welcome__container">
18
28
<PageTitle/>
19
29
20
-
<divclassName="welcome__intro">
21
-
<divclassName="welcome__image-container">
22
-
<picture>
23
-
<source
24
-
type="image/webp"
25
-
srcSet={`${portraitImageSmallWebp} 200w,
26
-
${portraitImageMediumWebp} 400w,
27
-
${portraitImageLargeWebp} 800w`}
28
-
sizes="(max-width: 768px) 200px,
29
-
(max-width: 1024px) 250px,
30
-
300px"
31
-
/>
32
-
<source
33
-
type="image/jpeg"
34
-
srcSet={`${portraitImageSmall} 200w,
35
-
${portraitImageMedium} 400w,
36
-
${portraitImageLarge} 800w`}
37
-
sizes="(max-width: 768px) 200px,
38
-
(max-width: 1024px) 250px,
39
-
300px"
40
-
/>
41
-
<img
42
-
src={portraitImageSmall}
43
-
alt="Peter Stackebrandt"
44
-
className="welcome__image"
45
-
width="300"
46
-
height="450"
47
-
fetchpriority="high"
48
-
/>
49
-
</picture>
50
-
</div>
51
-
52
-
<divclassName="welcome__text-content">
53
-
<pclassName="welcome__text">
54
-
Ich wohne in Feucht bei Nürnberg und habe langjährige Erfahrung in der Entwicklung von Apps und Services mit .NET. Neben meiner Leidenschaft für Webentwicklung interessiere ich mich besonders für den Einsatz von KI in der Softwareentwicklung.
55
-
</p>
30
+
<ImageWithContent
31
+
sources={portraitSources}
32
+
imageAlt="Peter Stackebrandt"
33
+
imagePosition="left"
34
+
imageWidth={300}
35
+
className="welcome__intro"
36
+
>
37
+
<pclassName="welcome__text">
38
+
Ich wohne in Feucht bei Nürnberg und habe langjährige Erfahrung in der Entwicklung von Apps und Services mit .NET. Neben meiner Leidenschaft für Webentwicklung interessiere ich mich besonders für den Einsatz von KI in der Softwareentwicklung.
39
+
</p>
56
40
57
-
<pclassName="welcome__text">
58
-
Diese Webseite ist eine zentrale Anlaufstelle, um mehr über meine Fertigkeiten und meine Projekte zu erfahren. Derzeit arbeite ich daran, hier öffentlich zugängliche Links zu meinen Projekten zu sammeln und zu präsentieren.
59
-
</p>
41
+
<pclassName="welcome__text">
42
+
Diese Webseite ist eine zentrale Anlaufstelle, um mehr über meine Fertigkeiten und meine Projekte zu erfahren. Derzeit arbeite ich daran, hier öffentlich zugängliche Links zu meinen Projekten zu sammeln und zu präsentieren.
0 commit comments