Skip to content

Commit f01ea38

Browse files
committed
Update
1 parent 987c30d commit f01ea38

4 files changed

Lines changed: 48 additions & 10 deletions

File tree

assets/css/main.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3221,3 +3221,18 @@ input, select, textarea {
32213221
}
32223222

32233223
}
3224+
3225+
/*my edits*/
3226+
.back-to-top {
3227+
position: fixed;
3228+
bottom: 30px;
3229+
right: 30px;
3230+
display: none; /* Hidden by default */
3231+
z-index: 999;
3232+
transition: opacity 0.3s ease-in-out;
3233+
}
3234+
3235+
.back-to-top.show {
3236+
display: inline-block;
3237+
opacity: 1;
3238+
}

assets/js/main.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,26 @@
114114

115115
});
116116

117-
})(jQuery);
117+
})(jQuery);
118+
119+
// Back to top button
120+
document.addEventListener("DOMContentLoaded", function () {
121+
const backToTopBtn = document.querySelector('.back-to-top');
122+
123+
window.addEventListener('scroll', () => {
124+
console.log('Scroll position:', window.scrollY);
125+
if (window.scrollY > 300) {
126+
backToTopBtn.classList.add('show');
127+
} else {
128+
backToTopBtn.classList.remove('show');
129+
}
130+
});
131+
132+
backToTopBtn.addEventListener('click', (e) => {
133+
e.preventDefault();
134+
window.scrollTo({
135+
top: 0,
136+
behavior: 'smooth'
137+
});
138+
});
139+
});

images/backtop.png

669 Bytes
Loading

index.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
<!DOCTYPE HTML>
2-
<!--
3-
Strata by HTML5 UP
4-
html5up.net | @ajlkn
5-
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
6-
-->
72
<html>
83
<head>
94
<title>Strata by HTML5 UP</title>
@@ -76,7 +71,7 @@ <h3>Dairy Farm Business</h3>
7671
</article>
7772
</div>
7873
<ul class="actions">
79-
<li><a href="#" class="button">Full Portfolio</a></li>
74+
<li><a href="https://github.com/WinnieYuDev/winnieyudev.github.io" class="button">Full Portfolio</a></li>
8075
</ul>
8176
</section>
8277

@@ -102,7 +97,7 @@ <h2>Skills</h2>
10297
<h2>Get In Touch</h2>
10398
<p>If you'd like to get in touch, feel free to reach out via email or connect with me on social media.</p>
10499
<ul class="actions">
105-
<li><a href="#" class="button">Contact Me</a></li>
100+
<li><a href="mailto:winnieyu.pro@gmail.com" class="button">Contact Me</a></li>
106101
</ul>
107102
</section>
108103

@@ -121,13 +116,19 @@ <h2>Get In Touch</h2>
121116
</div>
122117
</footer>
123118

119+
<!-- Back to Top -->
120+
<a href="#" class="back-to-top"><img src="images/backtop.png" alt="Arrow pointing up" /></a>
121+
124122
<!-- Scripts -->
125123
<script src="assets/js/jquery.min.js"></script>
126124
<script src="assets/js/jquery.poptrox.min.js"></script>
127125
<script src="assets/js/browser.min.js"></script>
128126
<script src="assets/js/breakpoints.min.js"></script>
129127
<script src="assets/js/util.js"></script>
130128
<script src="assets/js/main.js"></script>
131-
132129
</body>
133-
</html>
130+
</html>
131+
132+
<!--
133+
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
134+
-->

0 commit comments

Comments
 (0)