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

little changes #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
146 changes: 75 additions & 71 deletions src/components/LoveLetter/LoveLetter.css
Original file line number Diff line number Diff line change
@@ -1,73 +1,77 @@
@import url('https://fonts.googleapis.com/css2?family=Sedan:ital@0;1&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Sedan:ital@0;1&display=swap");

.base {
position: relative;
top: 50px;
}
.envelope {
position: relative;
width: 600px;
height: 400px;
margin: 50px auto;
cursor: pointer;
perspective: 1000px;
background: url('https://static.vecteezy.com/system/resources/previews/010/029/965/non_2x/love-letter-pattern-texture-with-text-effect-on-a-white-background-valentine-s-day-special-seamless-pattern-design-with-love-shapes-love-endless-pattern-decoration-for-bed-sheets-and-wallpapers-vector.jpg');
border-radius: 8px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
transition: transform 0.6s ease;
}
.flap {
position: absolute;
width: 100%;
height: 50%;
background: url('https://static.vecteezy.com/system/resources/previews/010/029/965/non_2x/love-letter-pattern-texture-with-text-effect-on-a-white-background-valentine-s-day-special-seamless-pattern-design-with-love-shapes-love-endless-pattern-decoration-for-bed-sheets-and-wallpapers-vector.jpg');
transform-origin: bottom;
transition: transform 0.8s ease;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.body {
position: absolute;
top: 50%;
width: 100%;
height: 50%;
background: url('https://static.vecteezy.com/system/resources/previews/010/029/965/non_2x/love-letter-pattern-texture-with-text-effect-on-a-white-background-valentine-s-day-special-seamless-pattern-design-with-love-shapes-love-endless-pattern-decoration-for-bed-sheets-and-wallpapers-vector.jpg');
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
z-index: -1;
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}
.letter {
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 50%;
background-color: #fafafa;
overflow: hidden;
transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
transform-origin: bottom;
z-index: -2;
opacity: 0;
font-family: "Sedan", serif;
font-weight: 400;
font-style: normal;
font-size: 20px;
padding: 20px;
box-sizing: border-box;
text-align: justify;
}
.open .flap {
transform: rotateX(-180deg);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.letter.fullSize {
top: 0%;
height: 100%; /* Expand to full screen */
opacity: 1;
z-index: -2;
transform: scale(1); /* Scale up if necessary */
}
width: 700px;
height: 500px;
margin: 50px auto;
cursor: pointer;
perspective: 1000px;
background: url("https://static.vecteezy.com/system/resources/previews/010/029/965/non_2x/love-letter-pattern-texture-with-text-effect-on-a-white-background-valentine-s-day-special-seamless-pattern-design-with-love-shapes-love-endless-pattern-decoration-for-bed-sheets-and-wallpapers-vector.jpg");
border-radius: 18px;
box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3);
transition: transform 0.6s ease;
}

.flap {
position: absolute;
width: 100%;
height: 50%;
background: url("https://static.vecteezy.com/system/resources/previews/010/029/965/non_2x/love-letter-pattern-texture-with-text-effect-on-a-white-background-valentine-s-day-special-seamless-pattern-design-with-love-shapes-love-endless-pattern-decoration-for-bed-sheets-and-wallpapers-vector.jpg");
transform-origin: bottom;
transition: transform 0.8s ease;
border-top-left-radius: 18px;
border-top-right-radius: 18px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.body {
position: absolute;
top: 50%;
width: 100%;
height: 50%;
background: url("https://static.vecteezy.com/system/resources/previews/010/029/965/non_2x/love-letter-pattern-texture-with-text-effect-on-a-white-background-valentine-s-day-special-seamless-pattern-design-with-love-shapes-love-endless-pattern-decoration-for-bed-sheets-and-wallpapers-vector.jpg");
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
z-index: -1;
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.letter {
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 50%;
background-color: rgb(226, 196, 218);
overflow: hidden;
transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
transform-origin: bottom;
z-index: -2;
opacity: 0;
font-family: "Sedan", serif;
font-weight: 400;
font-style: normal;
font-size: 20px;
padding: 20px;
box-sizing: border-box;
text-align: justify;
box-shadow: 1px 1px 10px black;
border-radius: 10px;
}

.open .flap {
transform: rotateX(-180deg);
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.5);
}

.letter.fullSize {
top: 0%;
height: 100%; /* Expand to full screen */
opacity: 1;
z-index: -2;
transform: scale(1); /* Scale up if necessary */
}
5 changes: 3 additions & 2 deletions src/components/LoveLetter/LoveLetter.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ const LoveLetter = () => {
};

return (
<div className="base">
<div className={`envelope ${isOpen ? 'open' : ''}`} onClick={!isFullSize ? handleOpenLetter : handleCloseLetter}>
<div className="flap"></div>
<div className="body"></div>
<div className="body1"></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 />
Expand All @@ -42,7 +43,7 @@ const LoveLetter = () => {
</div>
<audio ref={audioRef} src={audioFile} onError={(e) => console.error('Audio error:', e.message)} />
</div>
</div>
);
};

export default LoveLetter;
Binary file added src/components/LoveLetter/background-img.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
.App{
position: absolute;
background-image: url("./components/LoveLetter/background-img.jpeg");
background-repeat: no-repeat;
background-size: cover;
width: 100%;
height: 100%;
}