Skip to content

Commit e162ce6

Browse files
committed
Add new props to ValentineProposal for heart effect and text resizing; update CardTemplate and ExampleModal accordingly.
1 parent b71469d commit e162ce6

File tree

4 files changed

+13
-273
lines changed

4 files changed

+13
-273
lines changed

components/CardExample.tsx

Lines changed: 0 additions & 270 deletions
This file was deleted.

components/CardTemplate.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export default function ValentineProposal({
2626
senderName,
2727
message,
2828
selectedStamp = "stamp1",
29+
showClickHeartEffect = true,
30+
autoResizeEnvelopeText = true,
2931
}: ValentineProposalProps) {
3032
const [showModal, setShowModal] = useState(false)
3133
const [noClicked, setNoClicked] = useState(false)
@@ -91,7 +93,7 @@ export default function ValentineProposal({
9193
className="min-h-svh min-w-[100svw] bg-[#ffeded] flex flex-col items-center justify-center p-4 overflow-hidden relative"
9294
onMouseMove={handleMouseMove}
9395
>
94-
<ClickHeartEffect />
96+
{showClickHeartEffect && <ClickHeartEffect />}
9597
<HeartBackground />
9698

9799
<AnimatePresence>
@@ -126,7 +128,11 @@ export default function ValentineProposal({
126128
/>
127129
</div>
128130
<div
129-
className={`font-nanum text-white ${valentineName.length > 15 || senderName.length > 15 ? 'text-3xl md:text-6xl' : 'text-5xl md:text-7xl'} space-y-2 px-6`}
131+
className={`font-nanum text-white ${
132+
autoResizeEnvelopeText && (valentineName.length > 15 || senderName.length > 15)
133+
? "text-3xl md:text-6xl"
134+
: "text-5xl md:text-7xl"
135+
} space-y-2 px-6`}
130136
>
131137
<p>To: {valentineName}</p>
132138
<p>From: {senderName}</p>

components/ExampleModal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { motion, AnimatePresence } from "framer-motion"
44
import { X, Minus, Maximize2, Minimize2, RotateCw, Search } from "lucide-react"
5-
import ValentineProposal from "@/components/CardExample"
5+
import ValentineProposal from "@/components/CardTemplate"
66
import { useState } from "react"
77

88
interface ExampleModalProps {
@@ -85,6 +85,8 @@ export default function ExampleModal({ isOpen, onClose }: ExampleModalProps) {
8585
valentineName="Chaewon"
8686
senderName="Jordan"
8787
message="I've made reservations at Nobu for Friday. I'll see you at 7:30 then, it's gonna be great!"
88+
showClickHeartEffect={false}
89+
autoResizeEnvelopeText={false}
8890
/>
8991
</div>
9092
</div>

lib/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ export interface ValentineProposalProps {
77
senderName: string
88
message: string
99
selectedStamp?: string
10+
showClickHeartEffect?: boolean
11+
autoResizeEnvelopeText?: boolean
1012
}

0 commit comments

Comments
 (0)