Skip to content

Commit 98bceec

Browse files
committed
user modified
1 parent 9f92eb5 commit 98bceec

File tree

4 files changed

+74
-68
lines changed

4 files changed

+74
-68
lines changed

index.html

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<link rel="stylesheet" href="src/style.css">
99
<link rel="stylesheet" href="dist/effect-js.min.css">
1010
</head>
11-
1211
<body>
1312

1413
<nav class="nav">

src/all.min.js

+6-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/custom.js

+67-59
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,76 @@
11
// navbar scroll effect
2-
const nav = document.querySelector(".nav");
3-
window.addEventListener("scroll", () => {
4-
const scroll = Math.floor(window.scrollY);
5-
if (scroll > 20) {
6-
nav.classList.add("navEffect");
7-
} else {
8-
nav.classList.remove("navEffect");
9-
}
10-
});
2+
(function () {
3+
const nav = document.querySelector(".nav");
4+
window.addEventListener("scroll", () => {
5+
const scroll = Math.floor(window.scrollY);
6+
if (scroll > 20) {
7+
nav.classList.add("navEffect");
8+
} else {
9+
nav.classList.remove("navEffect");
10+
}
11+
});
1112

12-
// all effectJs name array
13-
const effectName = [
14-
"fade",
15-
"fade-up",
16-
"fade-down",
17-
"fade-left",
18-
"fade-right",
19-
"fade-up-right",
20-
"fade-up-left",
21-
"fade-down-right",
22-
"fade-down-left",
23-
"flip-up",
24-
"flip-down",
25-
"flip-left",
26-
"flip-right",
27-
"slide-up",
28-
"slide-down",
29-
"slide-left",
30-
"slide-right",
31-
"zoom-in",
32-
"zoom-in-up",
33-
"zoom-in-down",
34-
"zoom-in-left",
35-
"zoom-in-right",
36-
"zoom-out",
37-
"zoom-out-up",
38-
"zoom-out-down",
39-
"zoom-out-left",
40-
"zoom-out-right",
41-
];
13+
// all effectJs name array
14+
const effectName = [
15+
"fade",
16+
"fade-up",
17+
"fade-down",
18+
"fade-left",
19+
"fade-right",
20+
"fade-up-right",
21+
"fade-up-left",
22+
"fade-down-right",
23+
"fade-down-left",
24+
"flip-up",
25+
"flip-down",
26+
"flip-left",
27+
"flip-right",
28+
"slide-up",
29+
"slide-down",
30+
"slide-left",
31+
"slide-right",
32+
"zoom-in",
33+
"zoom-in-up",
34+
"zoom-in-down",
35+
"zoom-in-left",
36+
"zoom-in-right",
37+
"zoom-out",
38+
"zoom-out-up",
39+
"zoom-out-down",
40+
"zoom-out-left",
41+
"zoom-out-right",
42+
];
4243

43-
// create all effect html div
44-
const allEffect = document.getElementById("allEffect");
45-
document.addEventListener("DOMContentLoaded", () => {
46-
let efct = "";
47-
effectName.map((effect) => {
48-
efct += `
44+
// create all effect html div
45+
const allEffect = document.getElementById("allEffect");
46+
document.addEventListener("DOMContentLoaded", () => {
47+
let efct = "";
48+
effectName.map((effect) => {
49+
efct += `
4950
<div class="1500 effect" data-effectJs="${effect}">
5051
<span class="dataEffectText">data-effectJs="${effect}"</span>
5152
</div>
5253
`;
54+
});
55+
allEffect.innerHTML += efct;
5356
});
54-
allEffect.innerHTML += efct;
55-
});
5657

57-
const cssSelect = document.querySelector(".cssSelect");
58-
const cssLink = document.querySelector(".cssLink");
59-
const jsLink = document.querySelector(".jsLink");
60-
const jsSelect = document.querySelector(".jsSelect");
61-
function linkCopy(select, link) {
62-
link.select();
63-
document.execCommand("copy");
64-
select.classList.add("useSelect");
65-
setTimeout(() => { select.classList.remove("useSelect")}, 500);
66-
}
67-
function cssCopy() { linkCopy(cssSelect, cssLink) }
68-
function jsCopy() {linkCopy(jsSelect, jsLink)}
58+
const cssSelect = document.querySelector(".cssSelect");
59+
const cssLink = document.querySelector(".cssLink");
60+
const jsLink = document.querySelector(".jsLink");
61+
const jsSelect = document.querySelector(".jsSelect");
62+
function linkCopy(select, link) {
63+
link.select();
64+
document.execCommand("copy");
65+
select.classList.add("useSelect");
66+
setTimeout(() => {
67+
select.classList.remove("useSelect");
68+
}, 500);
69+
}
70+
function cssCopy() {
71+
linkCopy(cssSelect, cssLink);
72+
}
73+
function jsCopy() {
74+
linkCopy(jsSelect, jsLink);
75+
}
76+
})();

src/style.css

+1-4
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,7 @@ html {
212212
}
213213
.download a:hover{
214214
background:#fff;
215-
}
216-
.fixedName a .fa-github{
217-
margin-bottom:-2px !important;
218-
}
215+
}
219216
@media (max-width: 767px){
220217
#getStarted #allEffect {
221218
grid-template-columns: repeat(1, minmax(250px, 1fr));

0 commit comments

Comments
 (0)