|
29 | 29 | <a href="index.html"> |
30 | 30 | <img src="https://raw.githubusercontent.com/SCodeGit/scode.git.io/main/images/scode.jpg" alt="SCode logo" class="hero-logo neon-glow"> |
31 | 31 | </a> |
32 | | -<div class="hero-text" style="line-height:1.2;"> |
33 | | - <h1 class="name glitch">Developer <small style="font-size:12px;color:var(--muted);margin-left:6px">— SCode</small></h1> |
34 | | - <p class="tagline" style="margin-top:4px;"><span id="typed">Crafting sleek, responsive web experiences with precision and creativity.</span></p> |
35 | | - <div class="hero-cta" style="margin-top:8px;"> |
36 | | - <a class="btn primary neon-btn" id="whatsappBtn" href="https://wa.me/233555578864" target="_blank" rel="noopener">Hire Me (WhatsApp)</a> |
37 | | - </div> |
38 | | -</div> |
39 | | - |
40 | | -<!-- Professional Introduction --> |
41 | | -<section class="section about" id="about" style="padding-top:40px;"> |
42 | | - <div class="container" style="line-height:1.4;"> |
43 | | - <p>Hi, I’m <strong>SCode</strong>. I specialize in building modern, responsive websites for startups, NGOs, and businesses, blending design, code, and user experience with precision and creativity.</p> |
44 | | - </div> |
45 | | -</section> |
| 32 | +<script> |
| 33 | + // Typewriter function |
| 34 | + function typeWriter(element, text, speed = 40, callback = null) { |
| 35 | + let i = 0; |
| 36 | + element.textContent = ''; |
| 37 | + function type() { |
| 38 | + if (i < text.length) { |
| 39 | + element.textContent += text.charAt(i); |
| 40 | + i++; |
| 41 | + setTimeout(type, speed); |
| 42 | + } else if (callback) { |
| 43 | + callback(); |
| 44 | + } |
| 45 | + } |
| 46 | + type(); |
| 47 | + } |
| 48 | + |
| 49 | + // Hero section elements |
| 50 | + const titleEl = document.querySelector('.name'); |
| 51 | + const titleSmall = titleEl.querySelector('small'); |
| 52 | + const taglineEl = document.getElementById('typed'); |
| 53 | + const btnEl = document.getElementById('whatsappBtn'); |
| 54 | + |
| 55 | + // Hero text content |
| 56 | + const titleText = 'SCode'; |
| 57 | + const titleSuffix = ' — Developer'; |
| 58 | + const taglineText = 'Crafting sleek, responsive web experiences with precision and creativity.'; |
| 59 | + const btnText = 'Hire Me (WhatsApp)'; |
| 60 | + |
| 61 | + // About/intro paragraph |
| 62 | + const introEl = document.querySelector('#about p'); |
| 63 | + const introText = 'Hi, I’m SCode. I specialize in building modern, responsive websites for startups, NGOs, and businesses, blending design, code, and user experience with precision and creativity.'; |
| 64 | + |
| 65 | + // Animate hero section sequentially |
| 66 | + typeWriter(titleEl, titleText, 50, () => { |
| 67 | + titleSmall.textContent = titleSuffix; |
| 68 | + typeWriter(taglineEl, taglineText, 30, () => { |
| 69 | + typeWriter(btnEl, btnText, 40, () => { |
| 70 | + // After hero finishes, animate intro |
| 71 | + typeWriter(introEl, introText, 25); |
| 72 | + }); |
| 73 | + }); |
| 74 | + }); |
| 75 | +</script> |
| 76 | + |
46 | 77 |
|
47 | 78 | </section> |
48 | 79 |
|
|
0 commit comments