Skip to content

Commit a1e1e89

Browse files
committed
fix
1 parent 7a28b12 commit a1e1e89

File tree

6 files changed

+244
-60
lines changed

6 files changed

+244
-60
lines changed

css/global.css

+57
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,63 @@ body{
7575
}
7676
}
7777

78+
.write {
79+
overflow: hidden;
80+
border-right: 2px solid transparent;
81+
width: auto;
82+
padding: 10px 30px;
83+
box-sizing: border-box;
84+
display: inline-block;
85+
max-width: 100%;
86+
word-wrap: break-word;
87+
position: relative;
88+
}
89+
90+
.write::after {
91+
content: "|";
92+
position: absolute;
93+
animation: blink-carets 1s infinite;
94+
color: #e3e3e3;
95+
}
96+
97+
.typing {
98+
display: inline-block;
99+
border-right: 2px solid transparent;
100+
}
101+
102+
.typing-effect {
103+
animation: typing 1s steps(20, end), blink-caret 0.5s step-end infinite;
104+
}
105+
106+
@keyframes typing {
107+
from {
108+
width: 0;
109+
}
110+
to {
111+
width: 100%;
112+
}
113+
}
114+
115+
@keyframes blink-carets {
116+
0%,
117+
100% {
118+
opacity: 1;
119+
} /* Fully visible caret at the start and end of the animation */
120+
50% {
121+
opacity: 0;
122+
} /* Invisible caret at the middle of the animation */
123+
}
124+
125+
@keyframes blink-caret {
126+
from, to {
127+
border-color: transparent;
128+
}
129+
50% {
130+
border-color: #e3e3e3;
131+
}
132+
}
133+
134+
78135
.content{
79136
display: none;
80137
overflow: hidden;

index.html

+41-21
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<title>Muhammad Rifzkhy All Fhayed</title>
88
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
99
integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous" />
10-
<link href="./css/global.css" rel="stylesheet">
10+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
11+
<link href="./css/global.css" rel="stylesheet">
1112
</link>
1213
<link href="./css/profile.css" rel="stylesheet">
1314
</link>
@@ -25,30 +26,30 @@ <h1 role="status">Hello World!</h1>
2526
<!-- TODO: Landing page -->
2627
<section>
2728
<div align="center">
28-
<h1 class="typing"></h1>
29+
<h1 class="write">Rifzkhy</h1>
2930
<h4>PORTFOLIO</h4>
3031
</div>
3132
</section>
3233

3334
<!-- TODO: About Me -->
3435
<section class="about" style="background-color: #101010; color: #e3e3e3;">
35-
<div class="jumbotron p-5">
36-
<div class="title pt-5 js-scroll fade-in-bottom" align="center">
36+
<div class="jumbotron p-5" align="center">
37+
<div class="title js-scroll fade-in-bottom">
3738
<h1>ABOUT ME</h1>
3839
</div>
39-
<div class="row justify-content-center">
40-
<div class="col-10">
41-
<h3 class="js-scroll fade-in-bottom">MUHAMMAD RIFZKHY ALL FHAYED</h3>
42-
<p class="js-scroll fade-in-bottom" style="text-align: justify;">Hello! I'm Rifzkhy, a Fullstack Developer who is deeply passionate
40+
<div class="row pt-3 justify-content-center">
41+
<div class="col p-3">
42+
<h3 class="write js-scroll fade-in-bottom">MUHAMMAD RIFZKHY ALL FHAYED</h3>
43+
<p class="write pt-3 js-scroll fade-in-bottom" style="text-align: justify;">Hello! I'm Rifzkhy, a Fullstack Developer who is deeply passionate
4344
about 3D modeling, game development, chatbot creation, and digital art. My goal is to create simple and
4445
clean solutions that deliver impactful experiences to users.</p>
45-
</div>
46-
<div class="col" align="center">
47-
<div class="card js-scroll fade-in-bottom" data-tilt>
48-
<!-- <img loading="lazy"src="src/rifzkhy.jpg" class="card-img-top" alt="..."> -->
46+
</div>
47+
<div class="col js-scroll fade-in-bottom">
48+
<div class="card" data-tilt>
4949
<img loading="lazy" src="./src/rifzkhy.webp" class="profile-pics">
5050
<div class="card-body">
51-
<button type="button" class="btn btn-secondary" style="width: 250px;" disabled>Hire me</button>
51+
<button type="button" class="btn btn-secondary" style="width: 250px;" disabled>Profile</button>
52+
<button type="button" class="btn btn-secondary mt-3" style="width: 250px;" disabled>Hire me</button>
5253
</div>
5354
</div>
5455
</div>
@@ -140,8 +141,8 @@ <h1>PROGRAMMING</h1>
140141
<h1>PROJECT</h1>
141142
</div>
142143
<div class="row pt-3">
143-
<div class="col">
144-
<div class="card js-scroll fade-in-bottom" data-tilt align="center" style="width: 18rem;">
144+
<div class="col js-scroll fade-in-bottom">
145+
<div class="card" data-tilt align="center" style="width: 18rem;">
145146
<img loading="lazy" src="./src/matsuri-ai.webp" class="project-pics">
146147
<img src="./src/whatsapp-background.webp" class="card-img-top">
147148
<div class="card-body">
@@ -158,7 +159,7 @@ <h5 class="card-title">MatsuriAI</h5>
158159

159160
<!-- TODO: Certificate -->
160161
<section>
161-
<div class="jumbotron p-3">
162+
<div class="jumbotron p-5 ">
162163
<div class="title pt-5 js-scroll fade-in-bottom" align="center">
163164
<h1>CERTIFICATE</h1>
164165
</div>
@@ -184,6 +185,24 @@ <h1>AWARD CERTIFICATE</h1>
184185
</div>
185186
</section>
186187

188+
<!-- TODO: Social media -->
189+
<section class="project" style="background-color: #101010; color: #e3e3e3;"><div class="jumbotron p-3">
190+
<div class="title pt-5 js-scroll fade-in-bottom" align="center">
191+
<h1>SOCIAL MEDIA</h1>
192+
</div>
193+
<div class="social-media" align="center">
194+
<div class="row p-3">
195+
<div class="col">
196+
<a href="https://www.instagram.com/rifzkhy/" class="btn btn-secondary m-1 js-scroll fade-in-bottom"><i class="bi bi-instagram"></i> Instagram</a>
197+
<a href="https://twitter.com/Rifzkhy" class="btn btn-secondary m-1 js-scroll fade-in-bottom"><i class="bi bi-twitter"></i> Twitter</a>
198+
<a href="https://www.facebook.com/rifzkhy/" class="btn btn-secondary m-1 js-scroll fade-in-bottom"><i class="bi bi-facebook"></i> Facebook</a>
199+
<a href="https://github.com/Rifzkhy" class="btn btn-secondary m-1 js-scroll fade-in-bottom"><i class="bi bi-github"></i> Github</a>
200+
<a href="" class="btn btn-secondary m-1 js-scroll fade-in-bottom"><i class="bi bi-reddit"></i> Reddit</a>
201+
</div>
202+
</div>
203+
</div>
204+
</div></section>
205+
187206
</div>
188207

189208
<script src="script/global.js"></script>
@@ -200,11 +219,12 @@ <h1>AWARD CERTIFICATE</h1>
200219
crossorigin="anonymous"></script>
201220
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
202221
<script>
203-
$(window).on('load', function () {
204-
$('html, body').animate({ scrollTop: 0 });
205-
$(".loader").fadeOut(1000);
206-
$(".content").fadeIn(1000);
207-
});
222+
$(window).on("load", function () {
223+
$("html, body").animate({ scrollTop: 0 });
224+
$(".loader").fadeOut(1000);
225+
$(".content").fadeIn(1000);
226+
setTimeout(type, 1000);
227+
});
208228
</script>
209229
<script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
210230
<script nomodule src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"></script>

script/global.js

+87-36
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,134 @@ document.addEventListener("contextmenu", (event) => {
22
event.preventDefault();
33
});
44

5-
const texts = ["I'm Rifzkhy", "I'm Programmer", "I'm Desainer"];
5+
const texts = ["I'm Rifzkhy", "I'm Programmer", "I'm Designer"];
66

7-
const typingElement = document.querySelector(".typing");
8-
let textIndex = 0;
7+
const typingElements = document.querySelectorAll(".typing");
98

10-
function type() {
9+
function type(element, text) {
1110
let i = 0;
12-
const text = texts[textIndex];
11+
1312
const typingInterval = setInterval(() => {
1413
if (i < text.length) {
15-
typingElement.textContent += text.charAt(i);
14+
element.textContent += text.charAt(i);
1615
i++;
1716
} else {
1817
clearInterval(typingInterval);
19-
setTimeout(erase, 1000); // Wait for a moment before erasing
18+
setTimeout(() => erase(element), 1000);
2019
}
21-
}, 200); // Adjust the typing speed by changing the interval (e.g., 50 for faster typing).
20+
}, 200);
2221
}
2322

24-
function erase() {
23+
function erase(element) {
24+
const text = element.textContent;
25+
2526
const typingInterval = setInterval(() => {
26-
if (typingElement.textContent.length > 0) {
27-
typingElement.textContent = typingElement.textContent.slice(0, -1);
27+
if (element.textContent.length > 0) {
28+
element.textContent = element.textContent.slice(0, -1);
2829
} else {
2930
clearInterval(typingInterval);
30-
textIndex = (textIndex + 1) % texts.length; // Move to the next text
31-
setTimeout(type, 500); // Wait for a moment before typing the next text
31+
setTimeout(() => {
32+
textIndex = (textIndex + 1) % texts.length;
33+
type(element, texts[textIndex]);
34+
}, 500);
3235
}
33-
}, 50); // Adjust the erasing speed if needed
36+
}, 50);
3437
}
3538

36-
window.addEventListener("load", () => {
37-
$(window).on("load", function () {
38-
$("html, body").animate({ scrollTop: 0 });
39-
$(".loader").fadeOut(1000);
40-
$(".content").fadeIn(1000);
41-
setTimeout(type, 1000);
39+
function checkInView() {
40+
typingElements.forEach((element) => {
41+
const rect = element.getBoundingClientRect();
42+
if (rect.top >= 0 && rect.bottom <= window.innerHeight) {
43+
// Element is in view, start typing effect
44+
if (element.textContent === "") {
45+
textIndex = (textIndex + 1) % texts.length;
46+
type(element, texts[textIndex]);
47+
}
48+
} else {
49+
// Element is out of view, reset effect
50+
element.textContent = "";
51+
}
4252
});
43-
});
53+
}
54+
55+
// Check if elements are in view when the page loads
56+
checkInView();
57+
58+
// Check if elements are in view when the user scrolls
59+
window.addEventListener("scroll", checkInView);
4460

61+
//! Scroll effect
4562
const scrollElements = document.querySelectorAll(".js-scroll");
4663

47-
const elementInView = (el, dividend = 1) => {
64+
function elementInView(el, dividend = 1) {
4865
const elementTop = el.getBoundingClientRect().top;
49-
5066
return (
5167
elementTop <=
5268
(window.innerHeight || document.documentElement.clientHeight) / dividend
5369
);
54-
};
70+
}
5571

56-
const elementOutofView = (el) => {
72+
function elementOutofView(el) {
5773
const elementTop = el.getBoundingClientRect().top;
58-
5974
return (
6075
elementTop > (window.innerHeight || document.documentElement.clientHeight)
6176
);
62-
};
77+
}
6378

64-
const displayScrollElement = (element) => {
79+
function displayScrollElement(element) {
6580
element.classList.add("scrolled");
66-
};
81+
}
6782

68-
const hideScrollElement = (element) => {
83+
function hideScrollElement(element) {
6984
element.classList.remove("scrolled");
70-
};
85+
}
7186

72-
const handleScrollAnimation = () => {
87+
function handleScrollAnimation() {
7388
scrollElements.forEach((el) => {
7489
if (elementInView(el, 1.25)) {
7590
displayScrollElement(el);
7691
} else if (elementOutofView(el)) {
7792
hideScrollElement(el);
7893
}
7994
});
80-
};
95+
}
8196

82-
window.addEventListener("scroll", () => {
83-
handleScrollAnimation();
84-
});
97+
// Check if elements are in view when the page loads
98+
handleScrollAnimation();
99+
100+
// Check if elements are in view when the user scrolls
101+
window.addEventListener("scroll", handleScrollAnimation);
102+
103+
//! Writing effect
104+
const elements = document.querySelectorAll(".write");
105+
106+
function type(element) {
107+
const text = element.textContent;
108+
element.textContent = "";
109+
110+
let i = 0;
111+
112+
function typeCharacter() {
113+
if (i < text.length) {
114+
element.textContent += text.charAt(i);
115+
i++;
116+
setTimeout(typeCharacter, 200);
117+
}
118+
}
119+
120+
function checkInView() {
121+
const rect = element.getBoundingClientRect();
122+
if (rect.top >= 0 && rect.bottom <= window.innerHeight) {
123+
// Element is in view, start typing effect
124+
typeCharacter();
125+
}
126+
}
127+
128+
// Check if element is in view when the page loads
129+
checkInView();
130+
131+
// Check if element is in view when the user scrolls
132+
window.addEventListener("scroll", checkInView);
133+
}
134+
135+
elements.forEach(type);

src/carousel/test.png

176 Bytes
Loading

src/icon/paintnet.webp

-552 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)