This commit is contained in:
2025-11-07 17:43:37 +01:00
parent c3f837b90f
commit a645c87020
47 changed files with 238 additions and 2203 deletions

View File

@@ -17,20 +17,19 @@ export default function ContactMeForm() {
if (!opened) {
setOpened(true)
setOpeningBehind(false)
setContentMoveUp(false)
setContentMoveUp(false)
// Wait for the rotate-opening animation to finish before moving content up
// The actual moveUp will be handled in onTransitionEnd
} else {
setContentMoveUp(false)
setOpeningBehind(false)
setTimeout(() => setOpened(false), 1000) // match transition duration
setTimeout(() => setOpened(false), 1000) // match transition duration
}
}
const handleTransitionEnd = (e: React.TransitionEvent<HTMLDivElement>) => {
if (opened && e.propertyName === "transform") {
setContentMoveUp(true)
// Move the opening behind after the animation
setContentMoveUp(true)
setTimeout(() => setOpeningBehind(true), 10)
}
if (!opened && e.propertyName === "transform") {
@@ -39,6 +38,7 @@ export default function ContactMeForm() {
}
return (
<div className={styles["contact-me"]}>
<div
ref={openingRef}
@@ -56,11 +56,10 @@ export default function ContactMeForm() {
</div>
<div
className={
contentMoveUp
? `${styles.content} ${styles["content-moveup"]}`
: styles.content
}
className={[
styles.content,
contentMoveUp ? styles["content-moveup"] : ''
].filter(Boolean).join(' ')}
>
<form onSubmit={handleSubmit}>
<input

View File

@@ -1,15 +1,16 @@
.contact-me {
margin: 5em auto;
margin: 15em auto;
margin-top: 15em;
margin-bottom: 3em;
position: relative;
aspect-ratio: 16 / 9;
background-color: #c8c8c8;
background: var(--c-background-light);
max-width: 100vw;
border: 2px solid var(--c-lines);
border-radius: 0.75em;
width: 30em;
}
.contact-me + .mail-box{
}
/* .mail-box sibling styles were unused; removed to satisfy linter */
.contact-me .opening {
width: 100%;
@@ -17,21 +18,17 @@
position: absolute;
top: 0;
left: 0;
z-index: 2;
transform-origin: top;
padding-top: 4em;
clip-path: polygon(0 0, 100% 0, 50% 50%);
background-color: #d2d2d2;
transition: all 1s ease;
background: linear-gradient(135deg, var(--c-boxes), var(--c-other));
transition: transform 1s ease, background 0.5s ease;
text-align: center;
color: var(--c-text);
}
.rotate-opening{
background-color: #c8c8c8;
background: linear-gradient(135deg, var(--c-background-light), var(--c-boxes));
transform: rotateX(180deg);
}
@@ -52,22 +49,22 @@
.content-moveup{
transform: translateY(-70%);
}
.content-moveup-index {
z-index: 2 !important;
}
.content-moveup-index { z-index: 2 !important; }
.contact-me .content form{
width: 80%;
width: 90%;
display: flex;
gap: 1em;
flex-direction: column;
align-items: flex-start;
align-items: stretch;
justify-content: center;
margin: auto;
background-color: #deefff;
padding: 1em;
border: 0.5em dashed #88d4ed;
border-radius: 0.25em;
background: color-mix(in hsl, var(--c-background-light), transparent 35%);
backdrop-filter: blur(6px);
padding: 1.5em;
border: 0.35em dashed var(--c-lines);
border-radius: 0.75em;
color: var(--c-text);
}
.contact-me .content form div{
width: -webkit-fill-available;
@@ -77,26 +74,37 @@
.contact-me .content form input[type=submit]{
margin: auto;
border: none;
background: #4ca4d5;
color: #ffffff;
padding: 1em 1.5em;
background: linear-gradient(135deg, var(--c-other), var(--c-boxes));
color: var(--c-text);
padding: 0.85em 1.5em;
cursor: pointer;
border-radius: 1em;
border-radius: 0.75em;
font-weight: 600;
box-shadow: 0 0 12px -3px rgba(112,162,136,0.5);
transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.contact-me .content form input[type=submit]:hover {
transform: translateY(-2px);
box-shadow: 0 0 20px -2px rgba(112,162,136,0.65);
}
.contact-me .content form input[type=text],
.contact-me .content form input[type=email],
.contact-me .content form textarea{
background-color: #bfe8ff;
border: none;
border-bottom: 0.15em solid #064c7d;
padding: 0.5em;
background: var(--c-background-light);
border: 1px solid var(--c-lines);
padding: 0.6em 0.75em;
border-radius: 0.5em;
color: var(--c-text);
}
.contact-me .content form input[type=text]::placeholder,
.contact-me .content form input[type=email]::placeholder,
.contact-me .content form textarea::placeholder{ color: color-mix(in srgb, var(--c-lines), white 25%); }
.opening-behind { z-index: 0 !important; }
.contact-me .cover {
border-radius: 1em;
position: absolute;
bottom: 0;
left: 0;
@@ -104,9 +112,10 @@
height: 100%;
z-index: 2;
clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
background-color: #f0f0f0;
background: var(--c-background);
}
.contact-me .triangle{
border-radius: 1em;
position: absolute;
bottom: 0;
right: 0;
@@ -114,7 +123,7 @@
width: 100%;
height: 100%;
clip-path: polygon(100% 0, 0 100%, 100% 100%);
background-color: rgb(255 255 255);
background: linear-gradient(135deg, var(--c-boxes), var(--c-background-light));
}
@keyframes shake {
@@ -140,6 +149,13 @@
@media only screen and (max-width: 990px){
.contact-me{
aspect-ratio: unset;
margin-top: 7ch;
margin-top: 3ch;
background: transparent;
border: none;
}
.contact-me .opening,
.contact-me .cover,
.contact-me .triangle { display: none; }
.contact-me .content { position: relative; width: 100%; transform: none !important; }
.contact-me .content form { backdrop-filter: none; border: 1px solid var(--c-lines); }
}