Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tsinghua
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zhefu Li
Tsinghua
Commits
95b36960
Commit
95b36960
authored
6 months ago
by
HouTeng Chan
Browse files
Options
Downloads
Patches
Plain Diff
Update file home.html
parent
7361a62e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wiki/pages/home.html
+100
-4
100 additions, 4 deletions
wiki/pages/home.html
with
100 additions
and
4 deletions
wiki/pages/home.html
+
100
−
4
View file @
95b36960
...
...
@@ -149,6 +149,7 @@
margin
:
20px
;
}
}
.loader-container
{
position
:
fixed
;
top
:
0
;
...
...
@@ -167,7 +168,33 @@
width
:
150px
;
height
:
150px
;
}
.line-container
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
pointer-events
:
none
;
z-index
:
1
;
}
.line
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
fill
:
none
;
stroke
:
pink
;
stroke-width
:
2
;
stroke-linecap
:
round
;
opacity
:
0.7
;
}
#sachet
{
position
:
fixed
;
bottom
:
20px
;
right
:
20px
;
width
:
100px
;
height
:
100px
;
z-index
:
2
;
}
</style>
</head>
<body>
...
...
@@ -176,9 +203,20 @@
<img
src=
"https://static.igem.wiki/teams/5187/art/loading.gif"
alt=
"Loading"
class=
"loader-gif"
>
</div>
<div
id=
"menu"
>
{% include 'menu.html' %}
</div>
<div
class=
"line-container"
>
<svg
width=
"100%"
height=
"100%"
preserveAspectRatio=
"none"
>
<path
class=
"line"
id=
"line1"
d=
"M0 0 Q 0 0, 0 0"
/>
<path
class=
"line"
id=
"line2"
d=
"M0 0 Q 0 0, 0 0"
/>
<path
class=
"line"
id=
"line3"
d=
"M0 0 Q 0 0, 0 0"
/>
</svg>
</div>
<img
id=
"sachet"
src=
"https://static.igem.wiki/teams/5187/art/icon.png"
alt=
"Sachet"
>
<div
id=
"menu"
>
{% include 'menu.html' %}
</div>
<div
class=
"content-wrapper"
>
<!-- 内容块 1 -->
...
...
@@ -336,6 +374,64 @@
},
500
);
},
2000
);
// Hide after 2 seconds (adjust as needed)
});
// Animated lines
const
lines
=
document
.
querySelectorAll
(
'
.line
'
);
const
sachet
=
document
.
getElementById
(
'
sachet
'
);
let
mouseX
=
0
,
mouseY
=
0
;
function
updateLines
()
{
const
rect
=
sachet
.
getBoundingClientRect
();
const
sachetX
=
rect
.
left
+
rect
.
width
/
2
;
const
sachetY
=
rect
.
top
+
rect
.
height
/
2
;
lines
.
forEach
((
line
,
index
)
=>
{
const
startX
=
Math
.
random
()
*
window
.
innerWidth
;
const
startY
=
Math
.
random
()
*
window
.
innerHeight
;
const
midX
=
(
startX
+
sachetX
)
/
2
+
(
Math
.
random
()
-
0.5
)
*
200
;
const
midY
=
(
startY
+
sachetY
)
/
2
+
(
Math
.
random
()
-
0.5
)
*
200
;
const
path
=
`M
${
startX
}
${
startY
}
Q
${
midX
}
${
midY
}
,
${
sachetX
}
${
sachetY
}
`
;
line
.
setAttribute
(
'
d
'
,
path
);
});
}
function
animateLines
()
{
updateLines
();
requestAnimationFrame
(
animateLines
);
}
animateLines
();
document
.
addEventListener
(
'
mousemove
'
,
(
e
)
=>
{
mouseX
=
e
.
clientX
;
mouseY
=
e
.
clientY
;
lines
.
forEach
((
line
)
=>
{
const
distanceX
=
mouseX
-
line
.
getBoundingClientRect
().
left
;
const
distanceY
=
mouseY
-
line
.
getBoundingClientRect
().
top
;
const
distance
=
Math
.
sqrt
(
distanceX
*
distanceX
+
distanceY
*
distanceY
);
if
(
distance
<
100
)
{
line
.
style
.
strokeWidth
=
4
;
line
.
style
.
opacity
=
1
;
}
else
{
line
.
style
.
strokeWidth
=
2
;
line
.
style
.
opacity
=
0.7
;
}
});
});
// Existing scripts
window
.
addEventListener
(
'
load
'
,
function
()
{
const
loaderContainer
=
document
.
querySelector
(
'
.loader-container
'
);
setTimeout
(
function
()
{
loaderContainer
.
style
.
opacity
=
'
0
'
;
loaderContainer
.
style
.
transition
=
'
opacity 0.5s ease
'
;
setTimeout
(()
=>
{
loaderContainer
.
style
.
display
=
'
none
'
;
},
500
);
},
2000
);
});
</script>
</html>
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