index.html
我的主页
欢迎光临我的网站
如果您是路过此网站,那这里并没有您想要的东西
如果是想要了解我的朋友,请向下拉↓
我的简历
个人信息(我;站长)
姓名: 刘宇桐
年龄: 20
邮箱: xi.er.xi@qq.com
邮箱: 1724540286@qq.com
电话: 13147767530
查看此页面源代码
scripts.js:
// 监听滚动事件
window.addEventListener('scroll', function () {
const mainContent = document.querySelector('.main-content');
const scrollContent = document.querySelector('.scroll-content');
const scrollPosition = window.scrollY;
// 当滚动到一定位置时显示内容
if (scrollPosition > window.innerHeight / 2) {
scrollContent.classList.add('visible');
mainContent.style.opacity = 0; // 隐藏欢迎内容
} else {
scrollContent.classList.remove('visible');
mainContent.style.opacity = 1; // 显示欢迎内容
}
});
styles.css:
/* 全局样式 */
body, html {
margin: 0;
padding: 0;
height: 100%;
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
overflow-x: hidden;
}
/* 主页中央内容 */
.main-content {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
animation: fadeIn 2s ease-in-out;
position: relative;
z-index: 1;
background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}
.welcome-text {
font-size: 3rem;
color: #333;
margin-bottom: 20px;
animation: slideIn 1.5s ease-in-out;
}
.sub-text {
font-size: 1.2rem;
color: #666;
animation: slideIn 2s ease-in-out;
}
/* 向下滚动后显示的内容 */
.scroll-content {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
transform: translateY(50px);
transition: opacity 1s ease, transform 1s ease;
position: relative;
z-index: 2;
}
.scroll-content.visible {
opacity: 1;
transform: translateY(0);
}
.link-section {
display: flex;
gap: 20px;
margin-bottom: 40px;
}
.animated-link {
font-size: 1.5rem;
color: #409EFF;
text-decoration: none;
padding: 10px 20px;
border: 2px solid #409EFF;
border-radius: 5px;
transition: background 0.3s ease, color 0.3s ease;
}
.animated-link:hover {
background: #409EFF;
color: #fff;
}
.resume-section {
width: 80%;
max-width: 1200px;
margin: 0 auto;
text-align: center;
}
.resume-section h2 {
font-size: 2rem;
color: #333;
margin-bottom: 20px;
}
.pdf-gallery {
display: flex;
gap: 20px;
justify-content: center;
margin-bottom: 40px;
}
.pdf-image {
width: 100%;
max-width: 300px;
border: 1px solid #ddd;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.pdf-image:hover {
transform: scale(1.05);
}
.info-container {
text-align: left;
max-width: 600px;
margin: 0 auto;
}
.info-container h2 {
font-size: 2rem;
color: #333;
margin-bottom: 20px;
}
.info-container p {
font-size: 1.2rem;
color: #666;
margin-bottom: 10px;
}
.source-code-link {
color: #409EFF;
text-decoration: none;
font-weight: bold;
}
.source-code-link:hover {
text-decoration: underline;
}
/* 备案信息 */
.footer {
text-align: center;
padding: 20px;
background: rgba(255, 255, 255, 0.8);
position: relative;
z-index: 3;
}
/* 动画效果 */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes slideIn {
from {
transform: translateY(-50px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
/* 星星样式 */
.star1 {
position: absolute;
width: 100px;
height: 100px;
top: 1100px;
left: 300px;
}
.star2 {
position: absolute;
width: 100px;
height: 100px;
top: 1100px;
left: 1500px;
}