forked from yilv/mstech_website
1.0.0 添加了index界面,并添加css和js
This commit is contained in:
1 parent
6530da83d6
commit
f4bffbc30d
5 files changed
+493
No files matched your search
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": [
|
||||
"development"
|
||||
],
|
||||
"hints": {
|
||||
"no-inline-styles": "off"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
/* === CSS Variables === */
|
||||
:root {
|
||||
--primary-color: #1e3799;
|
||||
--secondary-color: #4a69bd;
|
||||
--accent-color: #6c5ce7;
|
||||
--text-color: #ffffff;
|
||||
--background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
/* === Base Styles === */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Segoe UI', sans-serif;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
visibility: hidden; /* 防止FOUC */
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--background-color);
|
||||
padding-top: 70px;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* === Navigation === */
|
||||
nav {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
background: rgba(30, 55, 153, 0.95);
|
||||
padding: 1rem 5%;
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.nav-scrolled {
|
||||
background: var(--primary-color) !important;
|
||||
padding: 0.8rem 5%;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.nav-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.logo {
|
||||
color: var(--text-color);
|
||||
font-size: 1.8rem;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.logo:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
color: var(--text-color);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-links a:hover {
|
||||
background: rgba(255,255,255,0.1);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
/* === Slideshow === */
|
||||
.slideshow-container {
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
margin-top: -70px;
|
||||
}
|
||||
|
||||
.slide {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
transition: opacity 1s ease-in-out;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
animation: kenburns 20s infinite;
|
||||
}
|
||||
|
||||
@keyframes kenburns {
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(1.05); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
|
||||
.slide.active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.slideshow-container::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(
|
||||
45deg,
|
||||
rgba(30, 55, 153, 0.7) 0%,
|
||||
rgba(78, 105, 189, 0.3) 100%
|
||||
);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* === Loading Spinner === */
|
||||
.loading-spinner {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 5px solid rgba(255,255,255,0.3);
|
||||
border-top-color: var(--text-color);
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: translate(-50%, -50%) rotate(360deg); }
|
||||
}
|
||||
|
||||
/* === Slide-up Content === */
|
||||
.slide-up-content {
|
||||
transform: translateY(100%);
|
||||
opacity: 0;
|
||||
transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
padding: 6rem 5%;
|
||||
background: white;
|
||||
box-shadow: 0 -4px 30px rgba(0,0,0,0.1);
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
border-radius: 30px 30px 0 0;
|
||||
margin-top: -150px;
|
||||
}
|
||||
|
||||
.slide-up-content.active {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* === Three Columns === */
|
||||
.three-columns {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 3rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.column {
|
||||
padding: 2.5rem;
|
||||
background: white;
|
||||
border-radius: 15px;
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
box-shadow: 0 5px 25px rgba(0,0,0,0.08);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.column::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -50%;
|
||||
left: -50%;
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
background: linear-gradient(
|
||||
45deg,
|
||||
transparent 45%,
|
||||
rgba(108, 92, 231, 0.1) 100%
|
||||
);
|
||||
transform: rotate(45deg);
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.column:hover {
|
||||
transform: translateY(-10px);
|
||||
box-shadow: 0 8px 30px rgba(30,55,153,0.15);
|
||||
}
|
||||
|
||||
.column > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.column h2 {
|
||||
color: var(--primary-color);
|
||||
margin-bottom: 1.5rem;
|
||||
font-size: 1.5rem;
|
||||
position: relative;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.column h2::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 3px;
|
||||
background: var(--accent-color);
|
||||
}
|
||||
|
||||
/* === Footer === */
|
||||
footer {
|
||||
background: var(--primary-color);
|
||||
color: var(--text-color);
|
||||
padding: 4rem 5%;
|
||||
margin-top: auto;
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 3rem;
|
||||
}
|
||||
|
||||
.footer-section h3 {
|
||||
margin-bottom: 1.5rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.footer-section ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.footer-section a {
|
||||
color: rgba(255,255,255,0.8);
|
||||
text-decoration: none;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.footer-section a:hover {
|
||||
color: var(--text-color);
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
.footer-bottom {
|
||||
text-align: center;
|
||||
margin-top: 3rem;
|
||||
padding-top: 2rem;
|
||||
border-top: 1px solid rgba(255,255,255,0.15);
|
||||
}
|
||||
|
||||
/* === Responsive Design === */
|
||||
@media (max-width: 1200px) {
|
||||
.three-columns {
|
||||
gap: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.nav-links {
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.three-columns {
|
||||
grid-template-columns: 1fr;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.column {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.logo {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: none; /* 移动端隐藏菜单,需要添加汉堡菜单 */
|
||||
}
|
||||
|
||||
.slide-up-content {
|
||||
padding: 3rem 5%;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
body {
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
.slide-up-content {
|
||||
margin-top: -100px;
|
||||
}
|
||||
|
||||
.column {
|
||||
padding: 2rem;
|
||||
}
|
||||
}
|
||||
/* 让a标签继承column样式 */
|
||||
.column {
|
||||
display: block; /* 必须设为块级元素 */
|
||||
color: inherit; /* 继承字体颜色 */
|
||||
text-decoration: none; /* 去除下划线 */
|
||||
cursor: pointer;
|
||||
}
|
||||
/* 解决火浏览器点击闪烁问题 */
|
||||
.column {
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 MiB |
@@ -0,0 +1,58 @@
|
||||
// 轮播图控制
|
||||
let currentSlide = 0;
|
||||
const slides = document.querySelectorAll('.slide');
|
||||
|
||||
function showSlide(n) {
|
||||
slides.forEach(slide => {
|
||||
slide.style.animation = 'none';
|
||||
slide.offsetHeight; // 触发重绘
|
||||
slide.style.animation = null;
|
||||
});
|
||||
slides.forEach(slide => slide.classList.remove('active'));
|
||||
slides[n].classList.add('active');
|
||||
}
|
||||
|
||||
function nextSlide() {
|
||||
currentSlide = (currentSlide + 1) % slides.length;
|
||||
showSlide(currentSlide);
|
||||
}
|
||||
|
||||
// 初始化轮播
|
||||
setInterval(nextSlide, 6000);
|
||||
|
||||
// 滚动动画控制
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('active');
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.15 });
|
||||
|
||||
document.querySelectorAll('.slide-up-content').forEach(content => {
|
||||
observer.observe(content);
|
||||
});
|
||||
|
||||
// 导航栏滚动效果
|
||||
window.addEventListener('scroll', () => {
|
||||
const nav = document.querySelector('nav');
|
||||
window.scrollY > 100 ?
|
||||
nav.classList.add('nav-scrolled') :
|
||||
nav.classList.remove('nav-scrolled');
|
||||
});
|
||||
|
||||
// 加载状态控制
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
document.documentElement.classList.remove('slideshow-loading');
|
||||
});
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
const loader = document.querySelector('.loading-spinner');
|
||||
if (loader) loader.style.display = 'none';
|
||||
});
|
||||
|
||||
// 防止页面加载时的布局闪烁
|
||||
document.documentElement.style.visibility = 'hidden';
|
||||
window.addEventListener('load', () => {
|
||||
document.documentElement.style.visibility = 'visible';
|
||||
});
|
||||
@@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>欢迎来到mstech</title>
|
||||
<link rel="stylesheet" href="../static/css/styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<!-- 加载指示器 -->
|
||||
<div class="loading-spinner"></div>
|
||||
|
||||
<!-- 固定导航 -->
|
||||
<nav>
|
||||
<div class="nav-container">
|
||||
<a href="#" class="logo">MStech</a>
|
||||
<ul class="nav-links">
|
||||
<li><a href="#home">首页</a></li>
|
||||
<li><a href="#products">项目</a></li>
|
||||
<li><a href="#services">服务</a></li>
|
||||
<li><a href="#about">关于</a></li>
|
||||
<li><a href="#contact">联系</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- 轮播图 -->
|
||||
<div class="slideshow-container">
|
||||
<div class="slide active" style="background-image: url('../static/image/1.png')"></div>
|
||||
<div class="slide" style="background-image: url('../static/image/1.png')"></div>
|
||||
<div class="slide" style="background-image: url('../static/image/1.png')"></div>
|
||||
</div>
|
||||
|
||||
<!-- 滑动内容区 -->
|
||||
<main>
|
||||
<div class="slide-up-content">
|
||||
<div class="three-columns">
|
||||
<a href="/service" class="column">
|
||||
<h2>项目介绍</h2>
|
||||
<p>此处添加内容</p>
|
||||
</a>
|
||||
<a href="/news" class="column">
|
||||
<h2>组员介绍</h2>
|
||||
<p>此处添加内容</p>
|
||||
</a>
|
||||
<a href="/support" class="column">
|
||||
<h2>指导老师</h2>
|
||||
<p>此处添加内容</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- 页脚 -->
|
||||
<footer>
|
||||
<div class="footer-content">
|
||||
<div class="footer-section">
|
||||
<h3>联系我们</h3>
|
||||
<p>地址:中南民族大学</p>
|
||||
<p>电话:010-88886666</p>
|
||||
<p>邮件:contact@techblue.com</p>
|
||||
</div>
|
||||
<div class="footer-section">
|
||||
<h3>快速链接</h3>
|
||||
<ul>
|
||||
<li><a href="#privacy">中南民族大学</a></li>
|
||||
<li><a href="#terms">服务条款</a></li>
|
||||
<li><a href="#careers">加入我们</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom">
|
||||
<p>© 2025 mstech 版权所有 </p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="../static/javascript/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user