Gitlab@Informatics
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MelonCloudDeploy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
65160392
MelonCloudDeploy
Commits
288f7f67
Commit
288f7f67
authored
2 months ago
by
65160392
Browse files
Options
Downloads
Patches
Plain Diff
Edit main.js
parent
661c778f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/js/main.js
+102
-22
102 additions, 22 deletions
public/js/main.js
with
102 additions
and
22 deletions
public/js/main.js
+
102
−
22
View file @
288f7f67
// Project Management System JavaScript functions
// Add fade-in animation to elements
// Auto-dismiss alerts after 5 seconds
document
.
addEventListener
(
'
DOMContentLoaded
'
,
function
()
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
function
()
{
// Auto-dismiss alerts
// Add fade-in animation to cards
setTimeout
(
function
()
{
const
cards
=
document
.
querySelectorAll
(
'
.card
'
);
const
alerts
=
document
.
querySelectorAll
(
'
.alert
'
);
cards
.
forEach
((
card
,
index
)
=>
{
alerts
.
forEach
(
function
(
alert
)
{
card
.
style
.
opacity
=
'
0
'
;
const
bsAlert
=
new
bootstrap
.
Alert
(
alert
);
card
.
style
.
animation
=
`fadeIn 0.5s ease forwards
${
index
*
0.1
}
s`
;
bsAlert
.
close
();
});
// Add hover effect to project cards
const
projectCards
=
document
.
querySelectorAll
(
'
.project-card
'
);
projectCards
.
forEach
(
card
=>
{
card
.
addEventListener
(
'
mouseenter
'
,
function
()
{
this
.
style
.
transform
=
'
translateY(-5px)
'
;
this
.
style
.
boxShadow
=
'
0 8px 15px rgba(0,0,0,0.1)
'
;
});
card
.
addEventListener
(
'
mouseleave
'
,
function
()
{
this
.
style
.
transform
=
'
translateY(0)
'
;
this
.
style
.
boxShadow
=
'
0 4px 6px rgba(0,0,0,0.1)
'
;
});
});
// Add smooth scroll behavior
document
.
querySelectorAll
(
'
a[href^="#"]
'
).
forEach
(
anchor
=>
{
anchor
.
addEventListener
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
document
.
querySelector
(
this
.
getAttribute
(
'
href
'
)).
scrollIntoView
({
behavior
:
'
smooth
'
});
});
});
// Add loading animation to buttons
const
buttons
=
document
.
querySelectorAll
(
'
.btn
'
);
buttons
.
forEach
(
button
=>
{
button
.
addEventListener
(
'
click
'
,
function
()
{
this
.
style
.
transform
=
'
scale(0.95)
'
;
setTimeout
(()
=>
{
this
.
style
.
transform
=
'
scale(1)
'
;
},
100
);
});
});
});
},
5000
);
// Enable tooltips
// Add search bar animation
const
tooltipTriggerList
=
[].
slice
.
call
(
document
.
querySelectorAll
(
'
[data-bs-toggle="tooltip"]
'
));
const
searchBar
=
document
.
querySelector
(
'
.search-bar
'
);
tooltipTriggerList
.
map
(
function
(
tooltipTriggerEl
)
{
if
(
searchBar
)
{
return
new
bootstrap
.
Tooltip
(
tooltipTriggerEl
);
searchBar
.
addEventListener
(
'
focus
'
,
function
()
{
this
.
style
.
transform
=
'
translateY(-2px)
'
;
this
.
style
.
boxShadow
=
'
0 8px 15px rgba(0,0,0,0.1)
'
;
});
});
// Enable popovers
searchBar
.
addEventListener
(
'
blur
'
,
function
()
{
const
popoverTriggerList
=
[].
slice
.
call
(
document
.
querySelectorAll
(
'
[data-bs-toggle="popover"]
'
));
this
.
style
.
transform
=
'
translateY(0)
'
;
popoverTriggerList
.
map
(
function
(
popoverTriggerEl
)
{
this
.
style
.
boxShadow
=
'
0 4px 6px rgba(0,0,0,0.1)
'
;
return
new
bootstrap
.
Popover
(
popoverTriggerEl
);
});
}
// Add table row hover effect
const
tableRows
=
document
.
querySelectorAll
(
'
.table-hover tbody tr
'
);
tableRows
.
forEach
(
row
=>
{
row
.
addEventListener
(
'
mouseenter
'
,
function
()
{
this
.
style
.
backgroundColor
=
'
rgba(92, 107, 192, 0.05)
'
;
this
.
style
.
transition
=
'
all 0.3s ease
'
;
});
row
.
addEventListener
(
'
mouseleave
'
,
function
()
{
this
.
style
.
backgroundColor
=
''
;
});
});
// Add task item animation
const
taskItems
=
document
.
querySelectorAll
(
'
.task-item
'
);
taskItems
.
forEach
(
item
=>
{
item
.
addEventListener
(
'
mouseenter
'
,
function
()
{
this
.
style
.
transform
=
'
translateX(5px)
'
;
this
.
style
.
boxShadow
=
'
0 8px 15px rgba(0,0,0,0.1)
'
;
});
item
.
addEventListener
(
'
mouseleave
'
,
function
()
{
this
.
style
.
transform
=
'
translateX(0)
'
;
this
.
style
.
boxShadow
=
'
0 4px 6px rgba(0,0,0,0.1)
'
;
});
});
// Add stat card counter animation
const
statValues
=
document
.
querySelectorAll
(
'
.stat-value
'
);
statValues
.
forEach
(
value
=>
{
const
target
=
parseInt
(
value
.
textContent
);
let
current
=
0
;
const
increment
=
target
/
50
;
const
duration
=
1000
;
const
step
=
duration
/
50
;
const
counter
=
setInterval
(()
=>
{
current
+=
increment
;
if
(
current
>=
target
)
{
value
.
textContent
=
target
;
clearInterval
(
counter
);
}
else
{
value
.
textContent
=
Math
.
round
(
current
);
}
},
step
);
});
});
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment