First commit
This commit is contained in:
1
scripts/aos.js
Normal file
1
scripts/aos.js
Normal file
File diff suppressed because one or more lines are too long
7
scripts/bootstrap.bundle.min.js
vendored
Normal file
7
scripts/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
scripts/bootstrap.bundle.min.js.map
Normal file
1
scripts/bootstrap.bundle.min.js.map
Normal file
File diff suppressed because one or more lines are too long
51
scripts/main.js
Normal file
51
scripts/main.js
Normal file
@@ -0,0 +1,51 @@
|
||||
AOS.init({
|
||||
anchorPlacement: 'top-left',
|
||||
duration: 1000
|
||||
});
|
||||
|
||||
document.querySelector('.avatar').addEventListener('mouseenter', () => {
|
||||
document.querySelector('.cover-bg').style.backgroundColor = 'var(--secondaryColor)';
|
||||
});
|
||||
|
||||
document.querySelector('.avatar').addEventListener('mouseleave', () => {
|
||||
document.querySelector('.cover-bg').style.backgroundColor = '';
|
||||
});
|
||||
|
||||
async function loadTable() {
|
||||
|
||||
const response = await fetch('./articles.json', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
data.forEach(entry => {
|
||||
const row = document.getElementById('myTable').querySelector('tbody').insertRow();
|
||||
|
||||
const dateCell = row.insertCell();
|
||||
dateCell.textContent = entry.date;
|
||||
|
||||
const nameCell = row.insertCell();
|
||||
nameCell.textContent = entry.name;
|
||||
|
||||
const descCell = row.insertCell();
|
||||
descCell.textContent = entry.description;
|
||||
});
|
||||
}
|
||||
|
||||
loadTable()
|
||||
|
||||
window.onscroll = function() {
|
||||
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
|
||||
document.querySelector('.back-to-top').style.display = 'block';
|
||||
} else {
|
||||
document.querySelector('.back-to-top').style.display = 'none';
|
||||
}
|
||||
};
|
||||
|
||||
document.querySelector('.back-to-top').addEventListener('click', function() {
|
||||
document.body.scrollTop = 0;
|
||||
document.documentElement.scrollTop = 0;
|
||||
});
|
||||
Reference in New Issue
Block a user