Skip to content
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

Update LoveLetter.js #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/components/LoveLetter/LoveLetter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import React, { useState, useRef } from 'react';
import './LoveLetter.css';
import audioFile from './kushi.mp3';
import audioFile from './Ninnila.mp3';

const LoveLetter = () => {
const [isOpen, setIsOpen] = useState(false);
Expand All @@ -10,7 +11,7 @@ const LoveLetter = () => {
const handleOpenLetter = () => {
setIsOpen(true);
setTimeout(() => {
setIsFullSize(true);
setIsFullSize=>(true);
// Ensuring audio play is directly a result of this user interaction
if (audioRef.current) {
audioRef.current.play()
Expand All @@ -35,10 +36,10 @@ const LoveLetter = () => {
<div className="flap"></div>
<div className="body"></div>
<div className={`letter ${isFullSize ? 'fullSize' : ''}`}>
mah dear kundanapu bomma🖤,<br />
never have i been so blessed as to fall in love with someone as wonderful as you...<br />i loveeee youuuu :)<br />
always yours,<br />
@niihaaarrrr
Hiiiiiii Bingoooo🖤,<br />
Wishh youu a veryy HAPPYY HAPPPYY HAPPIESTT BIRTHDAYYY!!<br />May thiss bday bringss uu all joyy and happinesss)<br />
I amm veryy luckyy to havee youu inn myy lifee bangarammm!!,<br />
@tommm
</div>
<audio ref={audioRef} src={audioFile} onError={(e) => console.error('Audio error:', e.message)} />
</div>
Expand Down