HTML+CSS+Vue3的静态网页,免费开源,可当作作业使用

news2024/12/15 6:48:40

拿走请吱一声,点个关注吧,代码如下,网页有移动端适配

HTML

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/index.css">
    </link>
    <title>Document</title>
</head>

<body style="margin: 0;">
    <div id="app">
        <div class="meun-btn" @click="showMeun"></div>
        <div id="sidebar" class="sidebar">
            <img class="close-btn" src="img/close.svg" @click="closeMeun" />
            <div class="content">
                <ul>
                    <li>Home</li>
                    <li>Track My Order</li>
                    <li>Contact us</li>
                </ul>
                <ul>
                    <li>FAQs</li>
                    <li>Return Policy</li>
                    <li>Payment Methods</li>
                    <li>Terms of Service</li>
                    <li>Privacy Policy</li>
                    <li>Shipping Policy</li>
                </ul>
            </div>
        </div>
        <div class="overlay" v-show="show" @click="closeMeun"></div>
        <div style="background-color: #f7f7f7">
            <div class="logo">
                <img src="img/logo.gif" width="100">
            </div>
            <div class="content">
                <div class="left">
                    <div class="img" :style="{backgroundImage: `url('/img/${optionIndex}.jpg')`}"></div>
                    <div class="img-bar">
                        <div class="front" @click="frontImg">
                            <img src="img/zuojiantou.svg" alt="">
                        </div>
                        <div class="product-bar">
                            <div class="product-image" v-for="(item, index) in options" :key="index"
                                @click="optionIndex=index">
                                <img :src="`img/${index}.jpg`">
                            </div>
                        </div>
                        <div class="next" @click="nextImg">
                            <img src="img/youjiantou.svg" alt="">
                        </div>
                    </div>
                </div>
                <div class="right">
                    <h1>🔥LAST DAY 60% OFF🎁Intelligent Electric Heating Scarf🔥</h1>
                    <div class="price">
                        <span class="old">$45.96 </span>
                        <span class="new">$22.98</span>
                    </div>
                    <hr>
                    <div class="text">
                        <p>HURRY! ONLY <span style="color: red;">250</span> LEFT IN STOCK.</p>
                        <p>
                            <span>98%</span> customer buy <span>3-5</span> items to use
                            daily and gifts for their beloved
                            one
                        </p>
                        <p><span>3555</span> People are viewing right now</p>
                    </div>
                    <p style="color: #626262;">Sale ending in</p>
                    <div class="bar">
                        <div class="value"></div>
                    </div>
                    <p class="timer">08:41</p>
                    <h4>Color</h4>
                    <div class="options">
                        <div class="item" :class="optionIndex==index?'active':''" v-for="(item, index) in  options"
                            :key="index" @click="optionIndex=index">{{item}}
                        </div>
                    </div>
                    <div class="pay">
                        <div class="top">
                            <div class="count">
                                <span @click="count--">➖</span>
                                <input v-model="count"></input>
                                <span @click="count++">➕</span>
                            </div>
                            <div class="block cart">
                                <img src="img/card.svg" width="20">
                                <span>Add to cart</span>
                            </div>
                            <div class="block now">
                                <img src="img/buy.svg" width="20">
                                <span>Buy it now</span>
                            </div>
                        </div>
                        <div class="center">
                            <img src="img/paypal.svg" height="20">
                        </div>
                        <img src="img/safe-checkout.png" width="100%">
                    </div>
                </div>
            </div>
        </div>
        <div class="description">
            <div class="left">
                Description
            </div>
            <div class="right">
                <p><span>The Newly Upgraded Scarf</span></p>
                <p style="margin: 25px 0 5px;"><span>It adopts the principle of infrared heating, rapid heating,
                        three-speed</span></p>
                <p style="margin: 0;"><span>temperature adjustment, not afraid of cold winter.</span></p>
                <img src="img/img1.jpg" width="100%">
                <p style="font-size: 25px;">FEATURES</p>
                <ul>
                    <li>
                        ⭐<span>Intelligent Heating</span>: Heats up in 3 seconds with an efficient graphene carbon fiber
                        heating
                        system. Intelligent heating settings (35°C-45°C-55°C/95°F-113°F-131°F) to suit your needs.
                    </li>
                    <li>
                        ⭐<span>Comfortable Material</span>: Breathable and ultra-light material. Comfortable and soft
                        cotton with
                        decent elasticity.
                    </li>
                </ul>
                <img src="img/img2.jpg" width="100%">
                <ul>
                    <li>
                        ⭐<span>Health Benefits:</span> Graphene heating technology and release of 8-9mm far-infrared
                        rays aid blood
                        circulation and help relax tense neck muscles. The position of the heated pad can be adjusted
                        for targeted therapy.
                    </li>
                    <li>
                        ⭐<span>Human-friendly</span>: The output current is 5V, which is a weak current within
                        the
                        acceptable range
                        of the human body and will not cause harm to the body.
                    </li>
                    <li>
                        ⭐<span>Notes:</span> It is washable (hand wash, machine wash); an external power bank is
                        required. Please be
                        sure to remove the mobile power supply before washing.
                    </li>
                </ul>
                <p style="font-size: 25px;"><span> SPECIFICATION</span></p>
                <ul>
                    <li><span>Material:</span> Cotton</li>
                    <li><span>Current:</span>5V</li>
                    <li><span>Color:</span>red; pink; gray; blue; navy blue; black</li>
                    <li><span>Weight:</span> 110g / 0.24lb</li>
                    <li><span>Size:</span> 80*10cm / 31.49*3.93in</li>
                </ul>
                <p style="font-size: 25px;"><span>PACKAGE INCLUDED</span></p>
                <ul>
                    <li>1 × Upgraded Heating Scarf</li>
                </ul>
                <p>Power Bank not included</p>
            </div>
        </div>
        <div class="footer">
            <div class="left">
                <p><span>Order</span></p>
                <p>Track My Order</p>
                <p>Shipping Policy</p>
                <p style="margin-bottom: 30px;">Return & Refund Policy</p>
                <p><span>How can we help you?</span></p>
                <div class="btn">
                    Contact Us
                </div>
            </div>
            <div class="center">
                <p><span>Resources</span></p>
                <p>About Us</p>
                <p>FAQs</p>
                <p>Payment Methods</p>
                <p>Terms of Service</p>
                <p>Privacy Policy</p>
            </div>
            <div class="right">
                <div class="btn">sigmakin.com</div>
                <div class="email">
                    <img src="img/email.svg" width="20">
                    <span>
                        support@sigmakin.com
                    </span>
                </div>
            </div>
        </div>
        <div class="info">
            <div class="left">
                <p>© 2024 sigmakin.com. All rights reserved.</p>
            </div>
            <div class="right" @click="goTop">
                <p> Go to top⬆</p>
            </div>
        </div>
    </div>
</body>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
    const { createApp, ref, watch } = Vue
    createApp({
        setup() {

            const options = ref([
                'Red', 'Pink', 'Gray', 'Navy Blue', 'Yellow',
                'Brown', 'Beige', 'Black',
                'SET 2(Red+Pink)🔥50% OFF And Extra 10%🔥',
                'SET 2(Gray+Blue)🔥50% OFF And Extra 10%🔥',
                'SET 2(Navy Blue+Yellow)🔥50% OFF And Extra 10%🔥',
                'SET 2(Brown+Beige)🔥50% OFF And Extra 10%🔥',
                'SET 2(Red+Pink+Gray)🔥50% OFF And Extra 10%🔥',
                'SET 2(Blue+Navy Blue+Yellow)🔥50% OFF And Extra 10%🔥',
                'SET 2(Beige+Brown+Gray)🔥50% OFF And Extra 10%🔥'
            ])

            const optionIndex = ref(0)
            const count = ref(1)
            const show = ref(false)

            function frontImg() {
                const productBar = document.querySelector('.product-bar')
                productBar.scrollLeft -= 50;
            }
            function nextImg() {
                const productBar = document.querySelector('.product-bar')
                productBar.scrollLeft += 50;
            }
            function showMeun() {
                const sidebar = document.querySelector('#sidebar')
                sidebar.style.left = '0';
                show.value = true;
            }
            function closeMeun() {
                const sidebar = document.querySelector('#sidebar')
                sidebar.style.left = '-300px';
                show.value = false;
            }
            watch(optionIndex, newVal => {
                const productBar = document.querySelector('.product-bar')
                const image = document.querySelectorAll('.product-image')[newVal]
                productBar.scrollLeft = image.offsetLeft
            })
            function goTop() {
                window.scrollTo({
                    top: 0,
                    behavior: 'smooth' // 平滑滚动
                });
            }
            return {
                options, optionIndex,
                frontImg, nextImg, count,
                showMeun, closeMeun, show, goTop
            }
        }
    }).mount('#app')
</script>

</html>

CSS

.logo {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.meun-btn {
  cursor: pointer;
  width: 20px;
  height: 20px;
  position: absolute;
  top: 80px;
  left: 50px;
  background-image: url("img/menu.svg");
  background-size: 100% 100%;
}
#sidebar {
  z-index: 1001;
  margin: 0;
  height: 100%;
  width: 250px;
  position: fixed;
  left: -300px;
  background-color: #1b1b1b;
  color: white;
  transition: 0.3s;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
}
#sidebar .content {
  height: 90%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
#sidebar .content ul {
  list-style-type: none;
  padding-left: 20px;
}
#sidebar .content ul li {
  margin: 30px 0;
  cursor: pointer;
}
#sidebar .content ul:nth-child(1) {
  font-size: 20px;
}
#sidebar .content ul:nth-child(2) {
  font-size: 12px;
  color: #878787;
}
#sidebar .close-btn {
  color: white;
  font-size: 30px;
  cursor: pointer;
  width: 15px;
  margin-left: 20px;
  margin-top: 20px;
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
}
.content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding-bottom: 50px;
}
.content .left {
  width: 30%;
  min-width: 400px;
  margin-right: 20px;
}
.content .left .img {
  background-size: 100% 100%;
  height: 450px;
  border-radius: 10px;
}
.content .left .img-bar {
  display: flex;
  margin-top: 10px;
}
.content .left .img-bar .front,
.content .left .img-bar .next {
  width: 20px;
  height: 80px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.content .left .img-bar .product-bar {
  scroll-behavior: smooth;
  margin: 0 10px;
  height: 100px;
  width: 90%;
  overflow-x: hidden;
  white-space: nowrap;
  overflow-y: hidden;
  position: relative;
}
.content .left .img-bar .product-bar .product-image {
  cursor: pointer;
  display: inline-block;
  height: 80px;
  width: 80px;
  margin-right: 10px;
}
.content .left .img-bar .product-bar .product-image img {
  width: 100%;
  height: 100%;
}
.content .right {
  width: 30%;
  min-width: 300px;
}
.content .right .price .old {
  text-decoration: line-through;
  color: #717171;
}
.content .right .price .new {
  color: #008000;
  font-size: 20px;
}
.content .right .text p:nth-child(1) {
  font-size: 20px;
  margin-bottom: 0;
}
.content .right .text p:nth-child(2) {
  font-size: 18px;
  font-style: italic;
  margin: 5px 0;
}
.content .right .text p:nth-child(2) span {
  color: red;
  font-size: 20px;
  font-weight: bold;
}
.content .right .text p:nth-child(3) {
  font-size: 15px;
}
.content .right .text p:nth-child(3) span {
  font-size: 20px;
  font-weight: bold;
}
.content .right .bar {
  border-radius: 10px;
  height: 10px;
  background-color: #efefef;
}
.content .right .bar .value {
  width: 80px;
  border-radius: 10px;
  height: 10px;
  background-color: #cccccc;
}
.content .right .timer {
  color: #df4848;
  font-size: 25px;
}
.content .right h4 {
  margin: 0;
}
.content .right .options {
  display: flex;
  flex-wrap: wrap;
}
.content .right .options .item {
  cursor: pointer;
  margin: 5px;
  line-height: 30px;
  padding: 5px 8px;
  width: max-content;
  border: 1px solid #cccccc;
  border-radius: 5px;
  font-size: 13px;
}
.content .right .options .active {
  background-color: #ec7526;
  color: white;
}
.content .right .pay {
  margin-top: 50px;
}
.content .right .pay .top {
  display: flex;
  flex-wrap: wrap;
}
.content .right .pay .top .count {
  margin: 10px 0;
  border: 1px solid #cccccc;
  width: 90px;
  height: 50px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: white;
}
.content .right .pay .top .count input {
  text-align: center;
  width: 30px;
  height: 30px;
  border-width: 0;
  font-size: 15px;
}
.content .right .pay .top .count span {
  cursor: pointer;
}
.content .right .pay .top .block {
  margin: 10px 5px;
  cursor: pointer;
  width: 150px;
  height: 50px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}
.content .right .pay .top .block img {
  margin-right: 20px;
}
.content .right .pay .top .cart {
  background-color: black;
}
.content .right .pay .top .now {
  background-color: #ff4343;
}
.content .right .pay .center {
  cursor: pointer;
  border-radius: 5px;
  margin: 10px 0;
  height: 50px;
  background-color: #ffc439;
  display: flex;
  justify-content: center;
  align-items: center;
}
.content .right .pay .center:hover {
  background-color: #f2ba36;
}
.description {
  padding-top: 80px;
  padding-bottom: 50px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.description .left {
  width: 30%;
  font-size: 30px;
  font-weight: bold;
  text-align: center;
}
.description .right {
  width: 40%;
}
.description .right ul {
  padding: 0;
}
.description .right ul li {
  line-height: 30px;
  margin-bottom: 20px;
  font-size: 15px;
}
.description .right span {
  font-weight: bold;
}
.footer {
  margin: 0;
  height: 300px;
  background-color: #242424;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 40px;
}
.footer p {
  color: #929292;
  font-size: 12px;
}
.footer span {
  color: white;
  font-size: 15px;
}
.footer .left {
  width: 20%;
}
.footer .left .btn {
  text-align: center;
  line-height: 40px;
  border-radius: 5px;
  color: white;
  width: 120px;
  height: 40px;
  background-color: #ff4343;
}
.footer .center {
  width: 20%;
}
.footer .right {
  width: 30%;
}
.footer .right .btn {
  cursor: pointer;
  margin: 20px 0px;
  padding-left: 10px;
  width: 300px;
  height: 60px;
  color: white;
  font-size: 30px;
  font-weight: bold;
  line-height: 60px;
}
.footer .right .btn:hover {
  background-color: white;
  color: #485fc7;
}
.footer .right .email {
  display: flex;
  align-items: center;
}
.footer .right .email img {
  margin-right: 20px;
}
.info {
  border-top: 1px solid #333;
  background-color: #242424;
  height: 60px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
}
.info p {
  color: #929292;
  font-size: 12px;
  cursor: pointer;
}
@media screen and (max-width: 730px) {
  .logo {
    padding-left: 10px;
    height: 100px;
    justify-content: left;
  }
  .logo img {
    width: 60px;
  }
  .meun-btn {
    left: auto;
    right: 30px;
    top: 50px;
  }
  .content .left,
  .content .right {
    width: 95%;
  }
  .content .left .pay .top .count,
  .content .right .pay .top .count,
  .content .left .pay .top .block,
  .content .right .pay .top .block {
    width: 100%;
  }
  .description .left {
    display: none;
  }
  .description .right {
    width: 95%;
  }
  .description .right ul {
    padding-left: 20px;
  }
  .footer {
    height: auto;
    padding-bottom: 50px;
    padding-left: 30px;
  }
  .footer .left,
  .footer .center,
  .footer .right {
    width: 95%;
  }
  .info {
    height: 200px;
    flex-direction: column;
  }
}

效果图

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2259798.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

内网穿透讲解

什么是内网穿透 内网穿透是一种网络技术&#xff0c;它允许外网或者其他局域网的用户来访问这个局域网的服务器资源&#xff0c;让资源的利用率更高&#xff0c;更加灵活&#xff0c;但是也要确保网络安全。 工作原理 如果你在公司&#xff0c;但是你需要使用到你家里的那台电…

Harmonyos之深浅模式适配

Harmonyos之换肤功能 概述实现原理颜色适配颜色资源配置工具类编写界面代码编写适配效果 概述 深色模式&#xff08;Dark Mode&#xff09;又称之为暗色模式&#xff0c;是与日常应用使用过程中的浅色模式&#xff08;Light Mode&#xff09;相对应的一种UI主题。 换肤功能应…

蓝桥杯刷题——day4

蓝桥杯刷题——day4 题目一题干题目解析代码 题目二题干题目解析代码 题目一 题干 小蓝和朋友们在玩一个报数游戏。由于今年是2024 年&#xff0c;他们决定要从小到大轮流报出是20或24倍数的正整数。前10个被报出的数是&#xff1a;20,24,40,48,60,72,80,96,100,120。请问第2…

Git:常用命令

一、查看当前分支 git branch 二、查看所有分支 git branch -a 三、切换到远程分支 git checkout origin/分支名 示例&#xff1a;git checkout origin/dev 四、拉取远程分支代码 git pull origin 分支名 示例&#xff1a;git pull origin dev 五、常用指令 查看暂存区…

算法题(4):报数游戏

审题&#xff1a;首先这题本质上是数学题中的找规律问题&#xff0c;我们需要用到编程的地方也只是辅助计算 思路&#xff1a;首先先用枚举法多算几个数出来&#xff0c;然后观察规律 枚举之后我们发现从第一个位置开始每过十个数就会增加120&#xff0c;所以每十个数可以算一个…

短视频矩阵源码开发部署全流程解析

在当今的数字化时代&#xff0c;短视频已成为人们娱乐、学习和社交的重要方式。短视频矩阵系统的开发与部署&#xff0c;对于希望在这一领域脱颖而出的企业和个人而言&#xff0c;至关重要。本文将详细阐述短视频矩阵源码的开发与部署流程&#xff0c;并附上部分源代码示例&…

【FLASH、SRAM和DRAM、CISC和RISC、冯诺依曼和哈佛】单片机内存结构的了解

【FLASH、SRAM和DRAM、CISC和RISC、冯诺依曼和哈佛】单片机内存结构的了解 一、单片机概念 单片机&#xff1a;Single-Chip Microcomputer&#xff0c;单片微型计算机&#xff0c;是一种集成电路芯片 1.1RAM里的SRAM和DRAM SRAM&#xff08;Static Random Access Memory&…

STM32仿真——01创建工程

目录 1.需要用到的软件工具​编辑 2.第一步Proteus软件新建工程​编辑 3.第二步——stm32cubumx 4、MDK代码编写 #注意安装的过程或者使用过程使用英文&#xff0c;以防报错&#xff1b; 1.需要用到的软件工具 2.第一步Proteus软件新建工程 选中&#xff0c;默认 先布局&…

Spark3.2.0集群部署ON YARN

环境说明 准备三台服务器&#xff0c;分别为&#xff1a;bigdata141&#xff08;hadoop 主节点&#xff09;、bigdata142、bigdata143确保 hadoop 集群先启动好&#xff0c;我这边的 hadoop 版本为 3.2.0另准备一台服务器&#xff0c;bigdata144&#xff0c;作为 hadoop 客户端…

GLM-4-Plus初体验

引言&#xff1a;为什么高效的内容创作如此重要&#xff1f; 在当前竞争激烈的市场环境中&#xff0c;内容创作已成为品牌成功的重要支柱。无论是撰写营销文案、博客文章、社交媒体帖子&#xff0c;还是制作广告&#xff0c;优质的内容不仅能够帮助品牌吸引目标受众的注意力&a…

C++获取时间戳/计算运行时长

一、便于使用&#xff0c;使用chrono封装一个简单的类 #pragma once#include <chrono>using CTime_point std::chrono::high_resolution_clock::time_point;class CElapsedTime final { public:static CTime_point now() {return std::chrono::high_resolution_clock::…

IDEA方法注释模板设置

目录 创建模板 新建模板&#xff1a;命名为* 设置模板内容-IDEA格式模板 设置模板应用场景 设置参数 创建模板 /**Enter这里我们也按照这种习惯来设置IDEA的方法注释&#xff1a;File-->Settings-->Editor-->Live Templates 先新建模板组&#xff0c;然后在模板组中…

Xcode

info.plist Appearance Light 关闭黑暗模式 Bundle display name 设置app名称&#xff0c;默认为工程名 Location When In Use Usage Description 定位权限一共有3个key 1.Privacy - Location When In Use Usage Description 2.Privacy - Location Always and When In U…

探索 Cesium 的未来:3D Tiles Next 标准解析

探索 Cesium 的未来&#xff1a;3D Tiles Next 标准解析 随着地理信息系统&#xff08;GIS&#xff09;和 3D 空间数据的快速发展&#xff0c;Cesium 作为领先的开源 3D 地球可视化平台&#xff0c;已成为展示大规模三维数据和进行实时渲染的强大工具。近年来&#xff0c;随着…

掘金电影市场的新机遇:开发特惠电影票小程序api文档

随着电影市场的不断扩大&#xff0c;特惠电影票小程序成为创业者和企业争相布局的新蓝海。本文将带你深入了解特惠电影票小程序的开发要点&#xff0c;以及如何通过这个项目实现盈利。 项目背景及市场分析 电影市场规模的不断扩大为特惠电影票小程序提供了广阔的市场空间。 根…

JaxaFx学习(一)

目录&#xff1a; &#xff08;1&#xff09;基本结构 &#xff08;2&#xff09;Application &#xff08;3&#xff09;Stage窗口显示 &#xff08;4&#xff09;Scene场景切换 &#xff08;5&#xff09;UI控件通用属性 &#xff08;6&#xff09;UI控件属性绑定很属性…

java抽奖系统(七)

8. 抽奖活动 8.1 新建抽奖活动 创建的活动信息包含&#xff1a; i. 活动名称 ii. 活动描述 iii. 圈选奖品&#xff1a;勾选对应奖品&#xff0c;并设置奖品等级&#xff08;⼀⼆三等奖&#xff09;&#xff0c;及奖品数量 iv. 圈选⼈员&#xff1a;勾选参与抽奖⼈员 库表关联…

Unity学习笔记(一)如何实现物体之间碰撞

前言 本文为Udemy课程The Ultimate Guide to Creating an RPG Game in Unity学习笔记 如何实现物体之间碰撞 实现物体之间的碰撞关键组件&#xff1a;Rigidbody 2D(刚体)、Collider 2D(碰撞体)、Sprite Renderer&#xff08;Sprite渲染器&#xff09; 实现物体之间的碰撞 …

MATLAB 平面直线与直线求交(99)

MATLAB 平面直线与直线求交(99) 一、算法介绍二、算法实现1.代码2.结果一、算法介绍 平面上,给定两直线,直线由两个点确定,计算直线与直线的交点,理论上只要不平行就有交点,下面是计算代码和效果: 二、算法实现 1.代码 代码如下(示例): % 示例用法 % 定义两条线…

STM32单片机芯片与内部21 电源管理——低功耗 睡眠模式 停止模式 待机模式

目录 一、SMT32电源框图 1、ADC电源与参考电压VDDA 2、调压器供电电路VDD/1.8V 3、备份域电路 二、电源监控器 1、上电复位与掉电复位&#xff08;POR与PDR&#xff09; 2、可编程电压检测器 PVD 三、功耗模式 1、睡眠模式 2、停止模式 3、待机模式 电源对电子设备的…