Skip to content

Commit e8b35b7

Browse files
committed
chore: added optional image to the background overlay
1 parent c4d8de5 commit e8b35b7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

public/images/example.png

3.33 MB
Loading

src/pages/test.astro

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import "../styles/global.css";
3030
[x-cloak] {
3131
display: none !important;
3232
}
33+
3334
</style>
3435
</head>
3536
<body x-data="{ scrollPosition: 0, mobileMenuOpen: false }" @scroll.window="scrollPosition = window.scrollY" class="bg-white" :class="{ 'no-scroll': mobileMenuOpen }">
@@ -38,13 +39,21 @@ import "../styles/global.css";
3839
<!-- Text overlay as background texture with parallax effect -->
3940
<div class="absolute inset-0 w-full h-full overflow-hidden">
4041
<div
41-
class="text-darker-gray text-[50vw] sm:text-[33vw] font-black font-display leading-[0.9] text-center uppercase absolute top-1/2 left-1/2 w-[150%] select-none"
42+
class="text-darker-gray text-[50vw] sm:text-[25vw] font-black font-display leading-[0.9] text-center uppercase absolute top-1/2 left-1/2 w-[150%] select-none"
4243
x-bind:style="'transform: translate(-50%, -50%) rotate(45deg) translateY(' + scrollPosition * 0.6 + 'px)'"
4344
>
4445
Some blog entry headline thats quite long
4546
</div>
4647
</div>
4748

49+
50+
<!-- Red blob with horizontal parallax effect - positioned directly in the header -->'
51+
<div class="absolute top-0 bottom-0 left-0 right-0">
52+
<div class="max-w-screen-xl mx-auto h-full flex justify-end items-end">
53+
<img src="/images/example.png" class=" select-none h-[80%]" x-bind:style="'transform: translateY(' + scrollPosition * 0.67 + 'px)'"/>
54+
</div>
55+
</div>
56+
4857
<!-- Navigation Bar with transparent background -->
4958
<div class="relative z-10 flex justify-center text-white px-8 sm:px-20">
5059
<nav class="flex justify-between items-center py-6 w-full max-w-screen-md">
@@ -72,7 +81,7 @@ import "../styles/global.css";
7281
<!-- Headline with same padding as content -->
7382
<div class="relative z-10 text-center text-white max-w-screen-md mx-auto px-8 sm:px-20">
7483
<div class="py-15 sm:py-20">
75-
<h1 class="text-4xl sm:text-6xl font-bold font-display leading-tight">
84+
<h1 class="text-4xl sm:text-6xl font-bold font-display leading-tight text-stroke">
7685
Some blog entry headline that's quite long
7786
</h1>
7887
</div>
@@ -136,7 +145,7 @@ import "../styles/global.css";
136145
</div>
137146

138147
<!-- Black Footer with smaller navigation (always visible) -->
139-
<footer class="bg-black text-white py-10 mt-20">
148+
<footer class="bg-black text-white py-10">
140149
<div class="flex justify-center px-8 sm:px-20">
141150
<div class="flex justify-between items-center w-full max-w-screen-md">
142151
<div class="text-lg font-bold">LOGO</div>

0 commit comments

Comments
 (0)