Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최원석
/
2021-1-database-project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
1seok2
2021-05-05 21:11:07 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6e21766099f630cbe9528381985a2e3491446c9c
6e217660
1 parent
b9729edb
refactor: remove useless codes
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
app/src/components/page.loader.ts
app/src/components/page.transition.ts
app/src/components/page.loader.ts
View file @
6e21766
export
const
togglePageLoader
=
(
type
:
boolean
):
void
=>
{
const
$loader
:
HTMLDivElement
|
null
=
document
.
querySelector
(
".page-loader"
)
;
if
(
$loader
)
{
if
(
typ
e
)
{
const
$loader
=
document
.
querySelector
(
".page-loader"
)
as
HTMLDivElement
;
if
(
type
===
tru
e
)
{
$loader
.
style
.
display
=
"block"
;
$loader
.
style
.
zIndex
=
"1"
;
}
else
{
$loader
.
style
.
display
=
"none"
;
$loader
.
style
.
zIndex
=
"-1"
;
}
}
};
export
default
function
createLoaderElement
()
{
...
...
app/src/components/page.transition.ts
View file @
6e21766
...
...
@@ -4,6 +4,8 @@
* @description : 페이지 이동 효과 주는 함수
**/
import
{
getElement
}
from
"./functions"
;
let
$div
:
HTMLDivElement
;
const
pageTransitionClassList
=
[
...
...
@@ -12,8 +14,7 @@ const pageTransitionClassList = [
"transition-2"
,
];
const
getDivs
=
():
HTMLDivElement
=>
document
.
querySelector
(
".page-transition"
)
as
HTMLDivElement
;
const
getDivs
=
()
=>
getElement
(
".page-transition"
)
as
HTMLDivElement
;
const
turnOnAndOff
=
(
idx
:
number
)
=>
{
$div
.
classList
.
toggle
(
pageTransitionClassList
[
idx
]);
...
...
@@ -30,7 +31,7 @@ const turnOnAndOff = (idx: number) => {
export
const
initialTrantition
=
()
=>
{
$div
=
$div
||
getDivs
();
$div
&&
turnOnAndOff
(
0
);
turnOnAndOff
(
0
);
};
export
const
randomTransition
=
()
=>
{
...
...
@@ -39,7 +40,7 @@ export const randomTransition = () => {
Math
.
random
()
*
(
pageTransitionClassList
.
length
-
1
)
+
1
);
$div
&&
turnOnAndOff
(
randomIndex
);
turnOnAndOff
(
randomIndex
);
};
export
default
function
animatePage
()
{
...
...
Please
register
or
login
to post a comment