Skip to content

Commit

Permalink
fix: restore missing transparent section of background art (#37)
Browse files Browse the repository at this point in the history
* fix: restore landing background png

* Use separate mask for landing background

- To reduce asset size, compress the background JPEG and use a
  separate smaller transparent PNG as a `mask-image`
- This will become irrelevant once the layers are separated for a
  dynamic floating design

* fix: background and mask position to center bottom

---------

Co-authored-by: Taesung Hwang <[email protected]>
  • Loading branch information
samderanova and taesungh authored Nov 27, 2023
1 parent 4e11096 commit 8277cd1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
13 changes: 12 additions & 1 deletion apps/site/src/app/(home)/sections/Landing/Landing.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
.landingBackground {
background-image: url("~@/assets/backgrounds/landing-background.jpg");
background-position: center bottom;
background-repeat: no-repeat;
background-size: cover;
mask-image: url("~@/assets/backgrounds/landing-background-mask.png");
mask-position: center bottom;
mask-repeat: no-repeat;
mask-size: cover;
}

.fogLeft,
.fogRight {
animation-delay: 1.5s;
animation-delay: 2s;
animation-duration: 4s;
animation-fill-mode: forwards;
animation-timing-function: ease;
Expand Down
8 changes: 1 addition & 7 deletions apps/site/src/app/(home)/sections/Landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ import { View } from "@/components/canvas/View";
import Button from "@/lib/components/Button/Button";
import Fireflies from "../../components/Fireflies";

import landingBackground from "@/assets/backgrounds/landing-background.jpg";
import fogLeft from "@/assets/images/fog-left.png";
import fogRight from "@/assets/images/fog-right.png";

import styles from "./Landing.module.css";

const Landing = () => {
return (
<section
style={{
backgroundImage: `url(${landingBackground.src})`,
}}
className="bg-cover bg-no-repeat bg-center"
>
<section className={styles.landingBackground}>
<View className="absolute w-full h-full">
<Suspense fallback={null}>
<Fireflies />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/site/src/assets/backgrounds/landing-background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8277cd1

Please sign in to comment.