-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header Detailpage #64 #11
Changes from all commits
febf7a2
3c3d6c0
73f7def
ac93d2e
abf3aed
69b911f
c06b0a9
0f1f21d
bd91d92
939e198
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script> | ||
export let alt = '' | ||
export let src = '' | ||
export let opacity = '' | ||
// Define different image sources for different resolutions or viewport widths | ||
export let Small = 'header-image-small.webp' | ||
export let Medium = 'header-image-medium.webp' | ||
export let Large = 'header-image-large.webp' | ||
</script> | ||
|
||
<picture> | ||
<!-- Source for small screens --> | ||
<source media="(max-width: 375px)" srcset={Small} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pretty nice but you only serve webp.. what if a browser doesn't support it? A good practice is serving a jpg as fallback next to a couple of different sized webp images.. |
||
|
||
<!-- Source for medium screens --> | ||
<source media="(max-width: 768px)" srcset={Medium} /> | ||
|
||
<!-- Source for large screens --> | ||
<source media="(max-width: 1024px)" srcset={Large} /> | ||
|
||
<img {src} {alt} style={`opacity: ${opacity}`} /> | ||
</picture> | ||
|
||
<style> | ||
img { | ||
object-fit: cover; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script> | ||
export let height = '' | ||
export let width = '' | ||
export let color = '' | ||
</script> | ||
|
||
<svg | ||
class="svg-location" | ||
{width} | ||
{height} | ||
fill={color} | ||
aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 24 24" | ||
> | ||
<path | ||
stroke="none" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm used to setting these in a style element or on the SVG main. |
||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
d="M12 .042a9.992 9.992 0 0 0-9.981 9.98c0 2.57 1.99 6.592 5.915 11.954a5.034 5.034 0 0 0 8.132 0c3.925-5.362 5.915-9.384 5.915-11.954A9.992 9.992 0 0 0 12 .042ZM12 14a4 4 0 1 1 4-4 4 4 0 0 1-4 4Z" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you pull this SVG through SVGOMG? |
||
/> | ||
</svg> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<script> | ||
import IconLocation from '../atoms/IconLocation.svelte' | ||
// Mockdata voor de header text | ||
const mockData = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perfect! |
||
{ | ||
title: 'Regular', | ||
subtitle: 'cocktail walk', | ||
label: 'route 1', | ||
location: 'Center, West', | ||
price: '€25,95', | ||
}, | ||
{ | ||
title: 'Premium', | ||
subtitle: 'cocktail walk', | ||
label: 'route 2', | ||
location: 'Center, West', | ||
price: '€26,95', | ||
}, | ||
{ | ||
title: 'Bols', | ||
subtitle: 'cocktail walk', | ||
label: 'route 3', | ||
location: 'Center, West', | ||
price: '€29,95', | ||
}, | ||
] | ||
</script> | ||
|
||
<section class="content-container"> | ||
<!-- First content row --> | ||
<div class="title-label"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this |
||
<h1>{mockData[0].title}</h1> | ||
<span class="label" aria-hidden="true">{mockData[0].label}</span> | ||
</div> | ||
|
||
<!-- Second content row --> | ||
<h1 class="subtitle">{mockData[0].subtitle}</h1> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ony one |
||
|
||
<!-- Last content row --> | ||
<div class="location-price"> | ||
<IconLocation width="15" height="15" color="hsl(21.23, 100%, 87.25%)" /> | ||
<p class="location">{mockData[0].location}</p> | ||
<p class="price">{mockData[0].price}</p> | ||
</div> | ||
</section> | ||
|
||
<style> | ||
.content-container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.6rem; | ||
margin: 5rem 2rem; | ||
} | ||
/* First content row */ | ||
h1 { | ||
display: flex; | ||
align-items: center; | ||
font-size: 2rem; | ||
text-transform: uppercase; | ||
color: white; | ||
} | ||
.title-label { | ||
display: flex; | ||
align-items: center; | ||
gap: 1rem; | ||
} | ||
.label { | ||
padding: 0.3rem 0.5rem; | ||
border: 1px solid var(--accent2-tertiary); | ||
border-radius: 3rem; | ||
font-size: 1rem; | ||
font-weight: 600; | ||
text-align: center; | ||
color: var(--accent2-tertiary); | ||
} | ||
/* Second content row */ | ||
.subtitle { | ||
font-size: 2rem; | ||
text-transform: uppercase; | ||
color: white; | ||
} | ||
/* Last content row */ | ||
.location-price { | ||
display: flex; | ||
align-items: center; | ||
} | ||
.location { | ||
margin: 0 1rem 0 0.5rem; | ||
color: var(--accent2-tertiary); | ||
} | ||
.price { | ||
font-weight: 600; | ||
color: var(--accent2-primary); | ||
} | ||
/* Large screens */ | ||
@media screen and (min-width: 768px) { | ||
.content-container { | ||
margin: 8rem 8rem; | ||
} | ||
h1 { | ||
font-size: 3rem; | ||
} | ||
.label { | ||
padding: 0.5rem 0.8rem; | ||
font-size: 1.3rem; | ||
} | ||
.subtitle { | ||
font-size: 3rem; | ||
} | ||
.location { | ||
font-size: 1.3rem; | ||
} | ||
.price { | ||
font-size: 1.3rem; | ||
} | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script> | ||
import HeaderContent from '../molecules/HeaderContent.svelte' | ||
import HeaderImage from '../atoms/HeaderImage.svelte' | ||
</script> | ||
|
||
<div class="header-container"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a lot of nested |
||
<HeaderImage src={'header-image-large.webp'} opacity="0.2" alt="cocktail" /> | ||
<div class="header-text"> | ||
<HeaderContent /> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.header-container { | ||
position: relative; | ||
width: 100vw; | ||
height: calc(100vh - 3rem); | ||
} | ||
.header-text { | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
} | ||
/* Large screens */ | ||
@media screen and (min-width: 48em) { | ||
.header-text { | ||
top: 0; | ||
} | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
import HeaderDetailPage from '../organisms/HeaderDetailPage.svelte' | ||
</script> | ||
|
||
<HeaderDetailPage /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,12 @@ | |
<kruimelpad parentSlug /> | ||
} --> | ||
|
||
<div> | ||
<!-- <div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're allowed to delete this ;) |
||
Dit is een slug!!!! | ||
</div> | ||
<style> | ||
div { | ||
color: red; | ||
} | ||
</style> | ||
</style> --> |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you pull this through SVGOMG? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some developers in some languages use capitals for objects. Is there purpose behind the capitals on Small, Medium and Large? If so.. is this set as a rule in the code-standards you use?