Vissza a webes elemekhez
Fejlécek

Fényből születő

Élő előnézet – a komponens teljes méretben.

Élő előnézet
HTML · CSS · JS
HTML
<section class="hero-feny-szuletik" id="heroFenySzuletik">

    <div class="fs-glow fs-glow-1"></div>
    <div class="fs-glow fs-glow-2"></div>

    <div class="fs-grid"></div>

    <div class="fs-light-beam"></div>

    <div class="fs-lines">
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
    </div>

    <div class="fs-content">

        <div class="fs-kicker">
            <span class="fs-kicker-line"></span>
            <span class="fs-typing"></span>
            <span class="fs-cursor"></span>
        </div>

        <h1>
            <span>Valami</span>
            <strong>új kezdődik.</strong>
        </h1>

        <p>
            Vannak pillanatok, amikor egyetlen gondolat
            elég ahhoz, hogy minden más irányt váltson.
        </p>

        <a href="#" class="fs-button">
            Felfedezem
            <span>↗</span>
        </a>

    </div>

    <div class="fs-orbit">
        <div class="fs-orbit-ring fs-ring-1"></div>
        <div class="fs-orbit-ring fs-ring-2"></div>
        <div class="fs-orbit-ring fs-ring-3"></div>
        <div class="fs-orbit-core"></div>
    </div>

    <div class="fs-bottom-mark">
        <span>11</span>
        <i></i>
        <small>GONDOLAT · FORMA · MOZGÁS</small>
    </div>

</section>
CSS
.hero-feny-szuletik {
    position: relative;
    min-height: 720px;
    height: 88vh;
    max-height: 900px;
    overflow: hidden;

    color: #f7f4ec;
    background:
        radial-gradient(circle at 78% 35%, rgba(214, 190, 125, .15), transparent 24%),
        radial-gradient(circle at 15% 80%, rgba(71, 116, 104, .18), transparent 30%),
        linear-gradient(135deg, #101b1a 0%, #172b28 48%, #0b1515 100%);

    clip-path: polygon(
        0 0,
        100% 0,
        100% 76%,
        0 100%
    );

    isolation: isolate;
}

/* finom háttérrács */

.hero-feny-szuletik .fs-grid {
    position: absolute;
    inset: -10%;
    z-index: 0;

    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);

    background-size: 70px 70px;

    transform: perspective(700px) rotateX(58deg) scale(1.4);
    transform-origin: center bottom;

    opacity: .38;
    animation: fsGridMove 16s linear infinite;
}

@keyframes fsGridMove {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 0 70px, 70px 0;
    }
}


/* háttérfények */

.hero-feny-szuletik .fs-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(12px);
}

.hero-feny-szuletik .fs-glow-1 {
    width: 460px;
    height: 460px;
    right: 2%;
    top: 8%;

    background: radial-gradient(
        circle,
        rgba(217, 188, 116, .20),
        rgba(217, 188, 116, 0) 68%
    );

    animation: fsGlowOne 8s ease-in-out infinite alternate;
}

.hero-feny-szuletik .fs-glow-2 {
    width: 380px;
    height: 380px;
    left: -8%;
    bottom: -10%;

    background: radial-gradient(
        circle,
        rgba(86, 148, 133, .17),
        rgba(86, 148, 133, 0) 70%
    );

    animation: fsGlowTwo 10s ease-in-out infinite alternate;
}

@keyframes fsGlowOne {
    from {
        transform: translate3d(-20px, 20px, 0) scale(.9);
    }

    to {
        transform: translate3d(35px, -30px, 0) scale(1.12);
    }
}

@keyframes fsGlowTwo {
    from {
        transform: translate3d(20px, -10px, 0) scale(.9);
    }

    to {
        transform: translate3d(-25px, 25px, 0) scale(1.08);
    }
}


/* mozgó fénycsík */

.hero-feny-szuletik .fs-light-beam {
    position: absolute;
    z-index: 2;

    width: 2px;
    height: 145%;
    left: 69%;
    top: -25%;

    background: linear-gradient(
        to bottom,
        transparent,
        rgba(235, 213, 153, .05),
        rgba(235, 213, 153, .7),
        rgba(255,255,255,.2),
        transparent
    );

    transform: rotate(24deg);
    filter: blur(.2px);

    opacity: .45;

    animation: fsBeam 7s ease-in-out infinite;
}

@keyframes fsBeam {
    0%, 100% {
        transform: translateX(-180px) rotate(24deg);
        opacity: 0;
    }

    35% {
        opacity: .55;
    }

    65% {
        opacity: .55;
    }

    100% {
        transform: translateX(240px) rotate(24deg);
        opacity: 0;
    }
}


/* dekoratív vonalak */

.hero-feny-szuletik .fs-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.hero-feny-szuletik .fs-lines span {
    position: absolute;
    display: block;

    width: 190px;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(224, 205, 157, .65),
        transparent
    );

    opacity: .5;
}

.hero-feny-szuletik .fs-lines span:nth-child(1) {
    top: 19%;
    left: 54%;
    transform: rotate(-19deg);
    animation: fsLine1 6s ease-in-out infinite alternate;
}

.hero-feny-szuletik .fs-lines span:nth-child(2) {
    top: 34%;
    left: 75%;
    width: 130px;
    transform: rotate(-19deg);
    animation: fsLine2 5s ease-in-out infinite alternate;
}

.hero-feny-szuletik .fs-lines span:nth-child(3) {
    top: 58%;
    left: 66%;
    width: 230px;
    transform: rotate(-19deg);
    animation: fsLine3 7s ease-in-out infinite alternate;
}

.hero-feny-szuletik .fs-lines span:nth-child(4) {
    top: 71%;
    left: 82%;
    width: 100px;
    transform: rotate(-19deg);
    animation: fsLine4 4s ease-in-out infinite alternate;
}

.hero-feny-szuletik .fs-lines span:nth-child(5) {
    top: 46%;
    left: 48%;
    width: 75px;
    transform: rotate(-19deg);
    animation: fsLine5 5.5s ease-in-out infinite alternate;
}

@keyframes fsLine1 {
    from { translate: 0 0; opacity: .25; }
    to { translate: 35px -18px; opacity: .7; }
}

@keyframes fsLine2 {
    from { translate: 0 0; opacity: .25; }
    to { translate: -25px 15px; opacity: .65; }
}

@keyframes fsLine3 {
    from { translate: 0 0; opacity: .25; }
    to { translate: 28px -10px; opacity: .7; }
}

@keyframes fsLine4 {
    from { translate: 0 0; opacity: .2; }
    to { translate: -20px 12px; opacity: .6; }
}

@keyframes fsLine5 {
    from { translate: 0 0; opacity: .2; }
    to { translate: 22px -14px; opacity: .65; }
}


/* tartalom */

.hero-feny-szuletik .fs-content {
    position: relative;
    z-index: 5;

    width: min(700px, 88%);
    margin-left: 10%;
    padding-top: 16vh;
}

.hero-feny-szuletik .fs-kicker {
    display: flex;
    align-items: center;
    gap: 13px;

    margin-bottom: 28px;

    color: #d8c38d;

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .27em;
    text-transform: uppercase;
}

.hero-feny-szuletik .fs-kicker-line {
    width: 42px;
    height: 1px;
    background: #d8c38d;
}

.hero-feny-szuletik .fs-cursor {
    width: 1px;
    height: 14px;
    background: #d8c38d;
    animation: fsCursor .7s steps(1) infinite;
}

@keyframes fsCursor {
    50% {
        opacity: 0;
    }
}


/* cím */

.hero-feny-szuletik h1 {
    margin: 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(70px, 8.7vw, 142px);
    line-height: .84;
    font-weight: 400;
    letter-spacing: -.065em;
}

.hero-feny-szuletik h1 span {
    display: block;
    color: #f4f1e8;

    animation: fsTitleOne 1s cubic-bezier(.2,.8,.2,1) both;
}

.hero-feny-szuletik h1 strong {
    display: block;

    margin-left: 17%;

    color: #d8c38d;
    font-weight: 400;
    font-style: italic;

    animation: fsTitleTwo 1.2s .16s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes fsTitleOne {
    from {
        opacity: 0;
        transform: translateX(-45px);
        clip-path: inset(0 100% 0 0);
    }

    to {
        opacity: 1;
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }
}

@keyframes fsTitleTwo {
    from {
        opacity: 0;
        transform: translateX(65px);
        clip-path: inset(0 0 0 100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }
}


/* leírás */

.hero-feny-szuletik .fs-content p {
    max-width: 470px;
    margin: 38px 0 28px 3px;

    color: rgba(247,244,236,.66);

    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;

    animation: fsFadeUp 1s .55s ease both;
}


/* gomb */

.hero-feny-szuletik .fs-button {
    display: inline-flex;
    align-items: center;
    gap: 22px;

    padding: 14px 20px;

    color: #17201f;
    background: #d8c38d;

    text-decoration: none;

    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;

    transition:
        transform .35s ease,
        background .35s ease,
        box-shadow .35s ease;

    animation: fsFadeUp 1s .72s ease both;
}

.hero-feny-szuletik .fs-button span {
    font-size: 19px;
    line-height: 1;
}

.hero-feny-szuletik .fs-button:hover {
    transform: translateY(-4px);
    background: #f0dcaa;
    box-shadow: 0 15px 35px rgba(216,195,141,.18);
}


/* orbit */

.hero-feny-szuletik .fs-orbit {
    position: absolute;
    z-index: 3;

    width: 430px;
    height: 430px;

    right: 10%;
    top: 18%;

    animation: fsOrbitFloat 7s ease-in-out infinite alternate;
}

.hero-feny-szuletik .fs-orbit-ring {
    position: absolute;
    inset: 0;

    border: 1px solid rgba(216,195,141,.18);
    border-radius: 50%;
}

.hero-feny-szuletik .fs-ring-1 {
    transform: rotate(28deg) scaleX(.62);
    animation: fsRingOne 12s linear infinite;
}

.hero-feny-szuletik .fs-ring-2 {
    transform: rotate(-31deg) scaleX(.72);
    border-color: rgba(216,195,141,.12);

    animation: fsRingTwo 15s linear infinite reverse;
}

.hero-feny-szuletik .fs-ring-3 {
    transform: rotate(76deg) scaleX(.45);
    border-color: rgba(255,255,255,.09);

    animation: fsRingThree 10s linear infinite;
}

@keyframes fsRingOne {
    to {
        rotate: 360deg;
    }
}

@keyframes fsRingTwo {
    to {
        rotate: 360deg;
    }
}

@keyframes fsRingThree {
    to {
        rotate: -360deg;
    }
}

.hero-feny-szuletik .fs-orbit-core {
    position: absolute;

    width: 90px;
    height: 90px;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 35% 30%,
            rgba(255,255,255,.9),
            rgba(216,195,141,.45) 18%,
            rgba(216,195,141,.08) 55%,
            transparent 72%
        );

    box-shadow:
        0 0 35px rgba(216,195,141,.22),
        0 0 100px rgba(216,195,141,.1);

    animation: fsCore 3.5s ease-in-out infinite alternate;
}

@keyframes fsCore {
    from {
        transform: translate(-50%, -50%) scale(.88);
    }

    to {
        transform: translate(-50%, -50%) scale(1.08);
    }
}

@keyframes fsOrbitFloat {
    from {
        transform: translate3d(0, 8px, 0);
    }

    to {
        transform: translate3d(0, -18px, 0);
    }
}


/* alsó jelölés */

.hero-feny-szuletik .fs-bottom-mark {
    position: absolute;
    z-index: 6;

    left: 10%;
    bottom: 7%;

    display: flex;
    align-items: center;
    gap: 16px;

    color: rgba(247,244,236,.42);

    font-family: Arial, sans-serif;
}

.hero-feny-szuletik .fs-bottom-mark span {
    color: #d8c38d;
    font-size: 13px;
    font-weight: 700;
}

.hero-feny-szuletik .fs-bottom-mark i {
    width: 42px;
    height: 1px;
    background: rgba(216,195,141,.45);
}

.hero-feny-szuletik .fs-bottom-mark small {
    font-size: 9px;
    letter-spacing: .24em;
}


/* általános */

@keyframes fsFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* mobil */

@media (max-width: 900px) {

    .hero-feny-szuletik {
        min-height: 700px;
        height: 88vh;

        clip-path: polygon(
            0 0,
            100% 0,
            100% 84%,
            0 100%
        );
    }

    .hero-feny-szuletik .fs-content {
        margin-left: 7%;
        padding-top: 15vh;
    }

    .hero-feny-szuletik .fs-orbit {
        width: 300px;
        height: 300px;

        right: -70px;
        top: 35%;
        opacity: .7;
    }

    .hero-feny-szuletik h1 {
        font-size: clamp(58px, 13vw, 95px);
    }

    .hero-feny-szuletik h1 strong {
        margin-left: 9%;
    }

    .hero-feny-szuletik .fs-bottom-mark {
        left: 7%;
    }
}

@media (max-width: 600px) {

    .hero-feny-szuletik {
        min-height: 650px;

        clip-path: polygon(
            0 0,
            100% 0,
            100% 89%,
            0 100%
        );
    }

    .hero-feny-szuletik .fs-content {
        width: 90%;
        margin-left: 6%;
        padding-top: 14vh;
    }

    .hero-feny-szuletik h1 {
        font-size: clamp(53px, 16vw, 78px);
        line-height: .88;
    }

    .hero-feny-szuletik h1 strong {
        margin-left: 5%;
    }

    .hero-feny-szuletik .fs-content p {
        max-width: 330px;
        font-size: 14px;
        line-height: 1.65;
    }

    .hero-feny-szuletik .fs-orbit {
        width: 230px;
        height: 230px;

        right: -80px;
        top: 47%;

        opacity: .38;
    }

    .hero-feny-szuletik .fs-bottom-mark small {
        display: none;
    }

    .hero-feny-szuletik .fs-light-beam {
        left: 82%;
    }
}

@media (prefers-reduced-motion: reduce) {

    .hero-feny-szuletik *,
    .hero-feny-szuletik *::before,
    .hero-feny-szuletik *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
JavaScript
(() => {

    const hero = document.getElementById("heroFenySzuletik");

    if (!hero) return;

    const typing = hero.querySelector(".fs-typing");

    const phrases = [
        "Új gondolatok",
        "Szabad lehetőségek",
        "Más irányok",
        "Merész elképzelések"
    ];

    let phraseIndex = 0;
    let charIndex = 0;
    let deleting = false;

    function typeLoop() {

        const current = phrases[phraseIndex];

        if (!deleting) {
            charIndex++;
            typing.textContent = current.slice(0, charIndex);

            if (charIndex === current.length) {
                deleting = true;
                setTimeout(typeLoop, 1900);
                return;
            }

            setTimeout(typeLoop, 75);

        } else {

            charIndex--;
            typing.textContent = current.slice(0, charIndex);

            if (charIndex === 0) {
                deleting = false;
                phraseIndex = (phraseIndex + 1) % phrases.length;

                setTimeout(typeLoop, 450);
                return;
            }

            setTimeout(typeLoop, 42);
        }
    }

    typeLoop();

})();