Skip to content

Commit

Permalink
fix hero images intersecting with background on older browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmar committed Aug 15, 2023
1 parent e938cec commit bd778f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const HeroImagesSC = styled.div(({ theme: _theme }) => {
transformStyle: 'preserve-3d',
perspective: '1200px',
transformOrigin: 'center',
transform: 'rotateY(-00deg) rotateX(0deg) rotateZ(0deg)',
transform: 'rotateY(-00deg) rotateX(0deg) rotateZ(0deg)',

position: 'relative',
width: '100%',
Expand Down Expand Up @@ -395,7 +395,6 @@ export default function Index({
position="50% 50%"
size="cover"
image="/images/gradients/gradient-bg-2.jpg"
className="[perspective:1000px]"
>
<HomePageHero
heading={
Expand Down
5 changes: 5 additions & 0 deletions src/components/layout/GradientBG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const GradientBGSC = styled.div<{
$image: image = '/images/gradients/gradient-bg-1.jpg',
}) => ({
position: 'relative',
'.bg': {
// Make sure background doesn't intersect 3d objects in older Safari
transform: `translateZ(-1000px)`,
perspective: 'none',
},
'.bg, .bg::after': {
'--blur-amount': '0px',
overflow: 'hidden',
Expand Down
4 changes: 2 additions & 2 deletions src/components/page-sections/HomepageFeaturesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ const MultiImageWrapSC = styled.div<ImgPropsSC & { $direction: 1 | -1 }>(
height: $height,
width: $width,
position: 'absolute',
transformStyle: 'preserve-3d',
perspective: PERSPECTIVE,
// Keep box shadow looking correct
// when containing rounded images
borderRadius: 10,
boxShadow: mShadows.light.moderate,
transformStyle: 'preserve-3d',
perspective: PERSPECTIVE,
})
)

Expand Down

0 comments on commit bd778f2

Please sign in to comment.