Skip to content

Commit d4bb379

Browse files
release/1.5.2 rc (#26)
* feat: ๐ŸŽธ Created Animate Counter * feat: ๐ŸŽธ Created Typewriter Animation * feat: ๐ŸŽธ Updated Yarn.lock * fix: ๐Ÿ› Correction in PurgeCSS [WEBPACK] * feat: ๐ŸŽธ Updated Version * feat: ๐ŸŽธ Created Animated Back to Top * style: ๐Ÿ’„ Removed Letter Spacing
1 parent cfa5cbc commit d4bb379

File tree

11 files changed

+2797
-39
lines changed

11 files changed

+2797
-39
lines changed

โ€Žpackage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "thiagosauddev.github.io",
3-
"version": "1.4.1-rc",
3+
"version": "1.5.2-rc",
44
"license": "MIT",
55
"main": "./src/index.js",
66
"description": "Turning ideas into reality, High-performance solutions, Take your business to the next level!",

โ€Žsrc/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
// SCRIPTS
1+
// SCRIPTS [IMPORTANTS]
22
import "@scripts/bootstrap.min.js";
33
import "@scripts/particles.js";
44
import "@scripts/google-analytics.js";
55

6+
// SCRIPTS [ANIMATIONS]
7+
import "@scripts/animate-back-to-top.js";
8+
import "@scripts/animate-counter.js";
9+
610
// SCSS
711
import "@scss/index.scss";

โ€Žsrc/pages/index.html

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ <h1 class="fs-2 fw-semibold my-0">SAUD</h1>
7272
<div class="ts-width-250 py-1 px-2 bg-secondary rounded-2 fw-medium fs-5 text-primary text-center text-dark">Front-End Developer</div>
7373

7474
<div class="mt-2 d-flex align-items-center flex-column text-center">
75-
<h1 class="fs-1 fw-bold text-white">Turning ideas into reality</h1>
75+
<h1 class="fs-1 fw-bold text-white typewriter">Turning ideas into reality</h1>
7676
<p class="fs-5 fw-light px-sm-1 mt-3 mb-0">High-performance solutions,</p>
7777
<p class="fs-5 fw-light px-sm-1">Take your business to the next level!</p>
7878
</div>
7979

8080
<div class="d-flex align-items-center gap-5">
8181
<div class="d-flex flex-column flex-lg-row align-items-center text-center gap-3">
82-
<h1 class="fs-1 fw-bold text-success m-0">+16</h1>
82+
<h1 id="animate-counter-years-experience" class="fs-1 fw-bold ts-width-68 text-success m-0">+0</h1>
8383
<span class="fs-6 fw-light">
8484
YEARS
8585
<br />
@@ -88,7 +88,7 @@ <h1 class="fs-1 fw-bold text-success m-0">+16</h1>
8888
</div>
8989

9090
<div class="d-flex flex-column flex-lg-row align-items-center text-center gap-3">
91-
<h1 class="fs-1 fw-bold text-success m-0">+10</h1>
91+
<h1 id="animate-counter-projects-delivered" class="fs-1 fw-bold ts-width-68 text-success m-0">+0</h1>
9292
<span class="fs-6 fw-light">
9393
PROJECTS
9494
<br />
@@ -441,6 +441,22 @@ <h1 class="fs-2 fw-light text-success">E-mail</h1>
441441
</footer>
442442
</main>
443443

444+
<!-- <div class="position-fixed bottom-0 end-0 bg-success rounded-2 fw-medium fs-5 text-primary">
445+
446+
</div> -->
447+
448+
<button
449+
id="animation-back-to-top"
450+
class="btn position-fixed bottom-0 end-0 bg-success text-primary rounded-2 border-0 mx-3 mb-5"
451+
type="button"
452+
data-bs-target="#carouselCustomers"
453+
data-bs-slide-to="0"
454+
aria-current="true"
455+
aria-label="Slider Carousel Customer 1"
456+
>
457+
<i class="bi bi-arrow-up fs-4"></i>
458+
</button>
459+
444460
<div id="particles-js" class="position-fixed top-0 z-n1 w-100 h-100"></div>
445461
</body>
446462

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const button = document.getElementById("animation-back-to-top");
2+
3+
window.addEventListener("scroll", () => {
4+
const scrollHeight = document.documentElement.scrollHeight;
5+
const scrollPosition = window.innerHeight + window.scrollY;
6+
7+
if ((scrollHeight - scrollPosition) / scrollHeight <= 0.4) {
8+
button.classList.add("show");
9+
} else {
10+
button.classList.remove("show");
11+
}
12+
});
13+
14+
button.addEventListener("click", () => {
15+
window.scrollTo({ top: 0, behavior: "smooth" });
16+
});

โ€Žsrc/scripts/animate-counter.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function animateCounter(elementID, maxValue) {
2+
let count = 0;
3+
4+
const COUNTER_ELEMENT = document.getElementById(elementID);
5+
const INCREMENT = maxValue / (2000 / 10);
6+
7+
const ANIMATE = setInterval(() => {
8+
if (count < maxValue) {
9+
count += INCREMENT;
10+
COUNTER_ELEMENT.innerText = `+${Math.ceil(count)}`;
11+
} else {
12+
clearInterval(ANIMATE);
13+
}
14+
}, 10);
15+
}
16+
17+
// START ANIMATION
18+
animateCounter("animate-counter-years-experience", 15);
19+
animateCounter("animate-counter-projects-delivered", 9);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* stylelint-disable selector-max-id */
2+
@import "@scss/mixins/breakpoints";
3+
4+
#animation-back-to-top {
5+
display: none;
6+
7+
@include breakpoint("xlg") {
8+
display: block;
9+
visibility: hidden;
10+
opacity: 0;
11+
transition: opacity 0.5s;
12+
13+
&.show {
14+
visibility: visible;
15+
opacity: 1;
16+
}
17+
}
18+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@keyframes typing {
2+
from {
3+
width: 0;
4+
}
5+
6+
to {
7+
width: 100%;
8+
}
9+
}
10+
11+
@keyframes blink-caret {
12+
50% {
13+
border-color: transparent;
14+
}
15+
}
16+
17+
*.typewriter {
18+
margin: 0 auto;
19+
overflow: hidden;
20+
white-space: nowrap;
21+
border-right: 0.15em solid #48e6c4;
22+
animation: typing 4.5s steps(40, end), blink-caret 0.75s step-end infinite;
23+
}

โ€Žsrc/scss/index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
@import "@scss/vendors/bootstrap/index";
33

44
// ANIMATIONS
5+
@import "@scss/animations/back-to-top";
56
@import "@scss/animations/floating";
7+
@import "@scss/animations/typewriter";
68

79
// MIXINS
810
@import "@scss/mixins/scrollbar";

โ€Žsrc/scss/mixins/_breakpoints.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$breakpoints: (
2+
"sm": 576px,
3+
"md": 768px,
4+
"lg": 992px,
5+
"xlg": 1200px,
6+
);
7+
8+
// Crie um mixin para lidar com os media queries
9+
@mixin breakpoint($name) {
10+
@if map-has-key($breakpoints, $name) {
11+
@media (min-width: map-get($breakpoints, $name)) {
12+
@content;
13+
}
14+
} @else {
15+
@warn "Unfortunately, no breakpoint was found with the name '#{$name}'.";
16+
}
17+
}

โ€Žwebpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ module.exports = {
153153
filename: "static/css/[name].[contenthash:8].css",
154154
chunkFilename: "static/css/[id].[contenthash:8].chunk.css",
155155
}),
156-
new PurgeCSSPlugin({ paths: GLOB.sync(`${PATH.join(__dirname, "src")}/**/*`, { nodir: true }) }),
156+
new PurgeCSSPlugin({
157+
paths: GLOB.sync(`${PATH.join(__dirname, "src")}/**/*`, { nodir: true }),
158+
only: ["bundle", "vendor"],
159+
}),
157160
new CopyPlugin({
158161
patterns: [
159162
{

0 commit comments

Comments
ย (0)