Skip to content

Commit 104e7a4

Browse files
authored
Update index.html
1 parent 0a4d924 commit 104e7a4

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

index.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,4 +528,89 @@ <h3>Message</h3>
528528
})();
529529
</script>
530530
</body>
531+
<section class="section hero" id="hero">
532+
<div class="container">
533+
<div class="hero-text">
534+
<h1 id="heroName" class="name glitch"></h1>
535+
<p id="heroIntro"></p>
536+
<div class="hero-cta">
537+
<a id="hireBtn" class="btn primary neon-btn" href="https://wa.me/233555578864" target="_blank" rel="noopener">Hire Me (WhatsApp)</a>
538+
</div>
539+
</div>
540+
</div>
541+
</section>
542+
543+
<style>
544+
.hero-text {
545+
font-family: "Source Code Pro", monospace;
546+
color: #00ff9f;
547+
overflow: hidden;
548+
}
549+
550+
.name, #heroIntro {
551+
margin: 10px 0;
552+
}
553+
554+
/* Cursor effect */
555+
.typewriter-cursor {
556+
display: inline-block;
557+
width: 2px;
558+
background-color: #00ff9f;
559+
margin-left: 2px;
560+
animation: blinkCursor 0.8s steps(1) infinite;
561+
}
562+
563+
@keyframes blinkCursor {
564+
0%,50%{opacity:1;}
565+
51%,100%{opacity:0;}
566+
}
567+
568+
/* Button animation */
569+
#hireBtn {
570+
opacity: 0;
571+
transform: translateY(20px);
572+
transition: all 0.6s ease-out;
573+
}
574+
575+
#hireBtn.show {
576+
opacity: 1;
577+
transform: translateY(0);
578+
}
579+
</style>
580+
581+
<script>
582+
const nameText = "I’m SCode";
583+
const introText = "Hi — I’m SCode, a creative developer passionate about design, code, and user experience. I build clean, responsive websites for NGOs, startups, and businesses.";
584+
585+
const nameEl = document.getElementById("heroName");
586+
const introEl = document.getElementById("heroIntro");
587+
const hireBtn = document.getElementById("hireBtn");
588+
589+
function typeWriter(el, text, speed = 50, callback = null) {
590+
let i = 0;
591+
const cursor = document.createElement("span");
592+
cursor.className = "typewriter-cursor";
593+
el.appendChild(cursor);
594+
595+
function type() {
596+
if (i < text.length) {
597+
cursor.insertAdjacentText("beforebegin", text.charAt(i));
598+
i++;
599+
setTimeout(type, speed);
600+
} else {
601+
if(callback) callback();
602+
}
603+
}
604+
605+
type();
606+
}
607+
608+
// Start typing sequence
609+
typeWriter(nameEl, nameText, 100, () => {
610+
typeWriter(introEl, introText, 40, () => {
611+
hireBtn.classList.add("show"); // show button after typing done
612+
});
613+
});
614+
</script>
615+
531616
</html>

0 commit comments

Comments
 (0)