mirror of
https://github.com/mudabbir-ahmad/web-project.git
synced 2026-10-07 20:20:20 +00:00
new file: .cache/replit/nix/env.json
new file: .config/configstore/update-notifier-npm.json new file: .config/configstore/update-notifier-npm.json.2701252402 new file: .replit new file: .vscode/launch.json new file: Internet.html new file: about.html new file: case.html new file: cooling.html new file: cpu.html new file: css/about.css new file: css/home.css new file: css/log copy.css new file: css/log.css new file: css/parts.css new file: css/pc.css new file: css/profile.css new file: global.css new file: global.js new file: gpu.html new file: hdd.html new file: home.html new file: images/pc-case.png new file: images/sal.jpeg new file: includes/dbh.inc.php new file: includes/functions.inc.php new file: includes/login.inc.php new file: includes/signup.inc.php new file: index.html new file: js/log copy.js new file: js/log.js new file: keyb.html new file: log copy.html new file: log.html new file: monitor.html new file: mouse.html new file: pc.html new file: profile.html new file: psu.html new file: ram.html new file: register.html new file: replit.nix new file: ssd.html
This commit is contained in:
commit
e5d4d5dfe3
43 files changed
+2680
No files matched your search
@@ -0,0 +1,41 @@
|
||||
// makes it so the nav bar follows you as you scroll
|
||||
window.onscroll = function() {myFunction()};
|
||||
var navbar = document.getElementById("navbar");
|
||||
var sticky = navbar.offsetTop;
|
||||
function myFunction() {
|
||||
if (window.pageYOffset >= sticky) {
|
||||
navbar.classList.add("sticky")
|
||||
} else {
|
||||
navbar.classList.remove("sticky");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// for card allignment - allows filtering of results
|
||||
function showAllCards() {
|
||||
const cards = document.querySelectorAll(`.card`);
|
||||
|
||||
cards.forEach((item) => {
|
||||
item.style.display = null;
|
||||
});
|
||||
|
||||
document.getElementById("all").setAttribute('data-selected', true);
|
||||
document.querySelectorAll(`.pill:not([id="all"])`).forEach((pill) => pill.removeAttribute("data-selected"));
|
||||
}
|
||||
|
||||
function showCategory(category) {
|
||||
const CategoryItems = document.querySelectorAll(`.card[data-${category}]`);
|
||||
const AllElse = document.querySelectorAll(`.card:not([data-${category}])`);
|
||||
document.getElementById(category).setAttribute('data-selected', true);
|
||||
document.querySelectorAll(`.pill:not([id="${category}"])`).forEach((pill) => pill.removeAttribute("data-selected"));
|
||||
|
||||
CategoryItems.forEach((item) => {
|
||||
item.style.display = null;
|
||||
});
|
||||
|
||||
AllElse.forEach((item) => {
|
||||
item.style.display = 'none';
|
||||
});
|
||||
|
||||
document.getElementById("all").removeAttribute('data-selected');
|
||||
}
|
||||
Reference in new issue
Block a user