网页开发(二):设计城市介绍页面

目录

结果演示:

主页面源代码:

注册页面源代码:


结果演示:

视频演示网页制作--介绍江城武汉-CSDN直播

主页面

登录注册页面:

主页面源代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./index.css">
    <title>介绍武汉</title>
</head>
<body>
    <div class="container">
        <div class="navbar">
            <img src="./汉标识.webp" class="logo">
            <nav>
                <ul>
                    <li><a href="./武汉地图.jpeg" target="_blank">行政区</a></li>
                    <li><a href="https://baike.baidu.com/item/%E6%AD%A6%E6%B1%89%E5%B8%82/195165#reference-229" target="_blank">了解</a></li>
                    <li><a href="./denglu1/register.html" target="_blank">注册/登录</a></li>
                </ul>
            </nav>
        </div>
        <div class="row">
            <div class="col">
                <h1><a href="https://www.bilibili.com/video/BV1Sz4y1m75b/?spm_id_from=333.337.search-card.all.click&vd_source=b8cc4f248e34e7cff7056a5e5e76fb7f" target="_blank">武汉</a></h1>
                <p>
                    武汉,长江与汉江在此相拥,百湖如珠镶嵌,故得 “江城” 之名。作为 “九省通衢”,它襟带南北、贯通东西,自古便是水陆交通要冲。
                </p>
                <p>这片土地浸透着厚重人文:盘龙城遗址见证三千年楚韵,武昌首义枪声改写近代中国,抗疫史诗里更见坚韧担当。街头巷尾,热干面的芝麻酱香与豆皮的焦脆共鸣,老里份的烟火气与黎黄陂路的文艺风交融,尽显江湖豪情与市井温情。</p>
                <p>科教之光同样璀璨:武汉大学的樱花、华中科技大学的梧桐,掩映着 60 余所高校的求知身影;“中国光谷” 从实验室到产业集群,让创新基因融入城市血脉。</p>
                <p>江风湖韵里,历史与当下碰撞,硬核与柔软共生 —— 这就是武汉,既有大江东去的壮阔,亦有烟火人间的鲜活。</p>
                <button type="button"><a href="https://baike.baidu.com/item/%E6%AD%A6%E6%B1%89%E5%B8%82/195165#reference-229" target="_blank">深入了解</a></button>

            </div>

            <div class="col">
                <div class="card1 card">
                    <h4><a href="https://www.bilibili.com/video/BV1A44y1q7PB/?spm_id_from=333.337.search-card.all.click&vd_source=b8cc4f248e34e7cff7056a5e5e76fb7f" target="_blank">武汉历史</a></h4>
                    <p> 昔人已乘黄鹤去,此地空余黄鹤楼。</p>
                </div>
                <div class="card2 card">
                    <h4><a href="https://www.bilibili.com/video/BV1Bu4m1F7od/?spm_id_from=333.337.search-card.all.click&vd_source=b8cc4f248e34e7cff7056a5e5e76fb7f" target="_blank">武汉美食</a></h4>
                    <p> 才饮长沙水,又食武昌鱼。</p>
                </div>
                <div class="card3 card">
                    <h4><a href="https://www.bilibili.com/video/BV1cu4y1Z7dk/?spm_id_from=333.337.search-card.all.click&vd_source=b8cc4f248e34e7cff7056a5e5e76fb7f" target="_blank">武汉教育</a></h4>
                    <p> 桃熟流丹李熟枝,英才济济笑开颜。</p>
                </div>
                <div class="card4 card">
                    <h4><a href="https://www.bilibili.com/video/BV1g84y1v7E6/?spm_id_from=333.337.search-card.all.click&vd_source=b8cc4f248e34e7cff7056a5e5e76fb7f" target="_blank">武汉地理</a></h4>
                    <p> 茫茫九派流中国,沉沉一线穿南北</p>
                </div>
            </div>
        </div>
        
    </div>
    
</body>
</html>

*{
    margin: 0;
    padding: 0;
    font-family: 'Poppins',sans-serif;
}

.container {
    width: 100%;
    height: 100vh;
    background-image: linear-gradient(rgba(0,0,0,0.7),rgba(0,0,0,0.7)),url(./c259e64e6df8602c828f26c209176410.jpeg);
    background-position: center;
    background-size: cover;
    padding-left: 8%;
    padding-right: 8%;
    box-sizing: border-box;
}

.navbar {
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.logo {
    padding-top: 2%;
    width: 60px;
}
.menu-icon {
    width: 30px;
    cursor: pointer;
    margin-left: 40px;

}
nav {
    flex: 1;
    text-align: center;
}
nav ul{
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 80px;
    margin: 0;
    padding: 0;
}
nav ul li {
    margin: 0;
}

nav ul li a {
    text-decoration: none;
    color: #fff;
    font-size: 16px;
}


.row {
    display: flex;
    height: 88%;
    align-items: center;
}
.col {
    flex-basis: 50%;

}
h1 {
    color: #fff;
    
}
.col h1 a{
    text-decoration: none;
    color: #fff;
    font-size: 100px;
    font-family: "华文行楷";
    src: url("./STXINGKA.TTF") format("truetype");
}
p {
    color: #fff;
    text-indent: 2em; 
    font-size: 13px;
    line-height: 15px;
}
.row .col button {
    width: 100px;
    color: #000;
    font-size: 13px;
    padding: 12px 0;
    background: #ffffff;
    border: 0;
    border-radius: 20px;
    outline: none;
    margin-top: 30px;
    cursor: pointer;
    text-decoration: none; 
}
.card {
    width: 200px;
    height: 230px;
    display: inline-block;
    border-radius: 10px;
    padding: 15px 25px;
    box-sizing: border-box;
    cursor: pointer;
    margin: 10px 15px;
    background-position: center;
    background-size: cover;
}
.card1 {
    background-image: url(./黄鹤楼.jpg);
    color: #fff;
}
.card2 {
    background-image: url(./武昌鱼.jpg);
}
.card3{
    background-image: url(./武汉大学.jpg);
}
.card4 {
    background-image: url(./武汉地图.jpeg);
}
.card:hover {
    transform: translateY(-10px);
}
.card h4 {
    color: #fff;
    text-shadow: 0 0 5px #999;
}
.card h4 a {
    color: #fff;
    text-decoration: none;
}
.card h4 a:hover {
    text-decoration: underline; 
}
.card p {
    text-shadow: 0 0 5px #000;
}
footer {
    color: #ffffff;
    font-size: 14px;
    text-align: center;
}

注册页面源代码:

该页面可参考我的另一篇网页开发一:设计登录页_uppercase b2b-CSDN博客

代码进行了小修改

图标来源网页Ionicons: Premium Open Source Icon Pack for Ionic Framework

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
    <script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
    <link rel="stylesheet" href="./r.css">
    <title>注册网页</title>
</head>
<body>
    <h2>登录 / 注册</h2>
    <div class="container" id="container">
        <div class="form-container sign-up-container">
            <form action="">
                <h1>注册用户</h1>
                <div class="social-container">
                    <a href="#"><i class="fab fa-facebook-f"><ion-icon name="logo-wechat"></ion-icon></i></a>
                    <a href="#"><i class="fab fa-google-plug-g"><ion-icon name="logo-twitter"></ion-icon></i></a>
                    <a href="#"><i class="fab fa-linkedin-in"><ion-icon name="logo-github"></ion-icon></i></a>
                </div>
                <span>或者使用您的电子邮件进行注册</span>
                <input type="text" placeholder="用户名">
                <input type="email" placeholder="邮箱">
                <input type="password" placeholder="密码">
                <button><a href="../index.html">注册</a></button>
            </form>
        </div>
        <div class="form-container sign-in-container">
            <form action="">
                <h1>登录</h1>
                <div class="social-container">
                    <a href="#"><i class="fab fa-facebook-f"><ion-icon name="logo-wechat"></ion-icon></i></a>
                    <a href="#"><i class="fab fa-google-plug-g"><ion-icon name="logo-twitter"></ion-icon></i></a>
                    <a href="#"><i class="fab fa-linkedin-in"><ion-icon name="logo-github"></ion-icon></i></a>
                </div>
                <span>或者用您的账户<span>
                <input type="email" placeholder="邮箱">
                <input type="password" placeholder="密码">
                <!-- <a href="#"> 忘记密码</a> -->
                <button><a href="../index.html">登录</a></button>
            </form>
        </div>
        <div class="overlay-container">
            <div class="overlay">
                <div class="overlay-panel overlay-left">
                    <h1>欢迎回来</h1>
                    <p>
                        为了保持联系,请注册您的个人信息!
                    </p>
                    <button class="ghost" id="signIn">登录</button>
                </div>
                <div class="overlay-panel overlay-right">
                    <h1>嘿,朋友!</h1>
                    <p>请填写您的个人信息,开始旅程!</p>
                    <button class="ghost" id="signUp">注册</button>
                </div>
            </div>
        </div>
    </div>
    <footer>
        <p>
            Created by Zhang Gaorui<i class="fa fa-heart"></i>
        </p>
    </footer>
    <script src="./r1.js"></script>
</body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;1,100&display=swap');
* {
  box-sizing: border-box;
}
body {
  background: #f6f5f7;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-family: 'Montserrat', sans-serif;
  height: 100vh;
  margin: -20px 0 50px;
}
h1 {
  font-weight: bold;
  margin: 0;
}
h2 {
  text-align: center;
}
p {
  font-size: 14px;
  font-weight: 100;
  line-height: 20px;
  letter-spacing: 0.5px;
  margin: 20px 0 30px;
}
span {
  font-size: 12px;
}
a {
  color: #333;
  font-size: 14px;
  text-decoration: none;
  margin: 15px 0;
}
button {
  border-radius: 20px;
  border: 2px solid #8e53f5;
  background-color: #ffffff;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  padding: 12px 45px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: transform 80ms ease-in;
}
button:active {
  transform: scale(0.95);
}
button:focus {
  outline: none;
}
button.ghost {
  background-color: transparent;
  border-color: #ffffff;
}
form {
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 50px;
  height: 100%;
  text-align: center;
}
input {
  background-color: #eee;
  border: none;
  padding: 12px 15px;
  margin: 8px 0;
  width: 100%;
}
.container {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
  width: 768px;
  max-width: 100%;
  min-height: 480px;
}
.form-container{
  position: absolute;
  top: 0;
  height: 100%;
  transition: all 0.6s ease-in-out;
}
.sign-in-container{
  left: 0;
  width: 50%;
  z-index: 2;
}
.container.right-panel-active .sign-in-container{
  transform: translateX(100%);
}
.sign-up-container{
  left: 0;
  width: 50%;
  opacity: 0;
z-index: 1;
}
.container.right-panel-active .sign-up-container{
  transform: translateX(100%);
  opacity: 1;
  z-index: 5;
  animation: show 0.6s;
}
@keyframes show {
  0%,49.99%{
    opacity: 0;
    z-index: 1;
  }
  50%,100%{
    opacity: 1;
    z-index: 5;
  }
}
.overlay-container{
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.6s ease-in-out;
  z-index: 100;
}
.container.right-panel-active .overlay-container{
  transform: translateX(-100%);
}
.overlay{
  background: #03c8ff;
  background: -webkit-linear-gradient(to right,#056dff,#f45b7f);
  background: linear-gradient(to right,#056dff,#ff416c);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 0 0;
  color: #ffffff;
  position: relative;
  left: -100%;
  height: 100%;
  width: 200%;
transform: translateX(0);
transition: transform 0.6s ease-in-out;
}
.container.right-panel-active .overlay{
  transform: translateX(50%);
}
.overlay-panel{
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  top: 0;
  height: 100%;
  width: 50%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}
.overlay-left{
  transform: translateX(-20%);
}
.container.right-panel-active .overlay-left{
  transform: translateX(0);
}
.overlay-right{
  right: 0;
  transform: translateX(0);
}
.container.right-panel-active .overlay-right{
  transform: translateX(20%);
}
.social-container{
  margin: 20px 0;
}
.social-container a{
  border: 1px solid #dddddd;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0 5px ;
  height: 40px ;
  width: 40px ;
}
footer{
  background-color: #222;
  color: #fff;
  font-size: 14px ;
  bottom: 0;
  position: fixed;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 999;
}
footer p{
  margin: 10px 0;

}
footer i{
  color: red;
}
footer a{
  color: #3c97bf;
  text-decoration: none;
}
const signUpButton = document.getElementById('signUp');
const signInButton = document.getElementById('signIn');
const container = document.getElementById('container');

signUpButton.addEventListener('click', () => {
    container.classList.add("right-panel-active");
});

signInButton.addEventListener('click', () => {
    container.classList.remove("right-panel-active");
});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值