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

news/2024/12/16 9:26:13/
htmledit_views">

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

HTML

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 usedaily and gifts for their belovedone</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 fiberheatingsystem. 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 softcotton withdecent 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-infraredrays aid bloodcirculation and help relax tense neck muscles. The position of the heated pad can be adjustedfor targeted therapy.</li><li>⭐<span>Human-friendly</span>: The output current is 5V, which is a weak current withintheacceptable rangeof 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 isrequired. Please besure 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 } = VuecreateApp({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

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.ppmy.cn/news/1555549.html

相关文章

qlu数据结构测试

12.15测试 编程题 1、【问题描述】 已知非空线性链表第1个链结点指针为list&#xff0c;链结点构造为 struct node{ datatype data; node *link; }; 请写一算法&#xff0c;将该链表中数据域值最大的那个点移到链表的最后面。&#xff08;假设链表中数据域值最大的链…

python爬虫--小白篇【爬虫实践】

一、前言 1.1、王者荣耀皮肤爬虫 根据王者荣耀链接&#xff0c;将王者荣耀的全部英雄的全部皮肤图片爬取保存到本地。经过分析得到任务的三个步骤&#xff1a; 根据首页全部英雄列表连接获取全部英雄的名称hero_name以及对应的hero_id&#xff1b;根据单个英雄的hero_name和h…

右玉200MW光伏电站项目 微气象、安全警卫、视频监控系统

一、项目名称 山西右玉200MW光伏电站项目 微气象、安全警卫、视频监控系统 二、项目背景&#xff1a; 山西右玉光伏发电项目位于右玉县境内&#xff0c;总装机容量为200MW&#xff0c;即太阳能电池阵列共由200个1MW多晶硅电池阵列子方阵组成&#xff0c;每个子方阵包含太阳能…

Vue Web开发(七)

1. echarts介绍 echarts官方文档 首先我们先完成每个页面的路由&#xff0c;之前已经有home页面和user页面&#xff0c;缺少mail页面和其它选项下的page1和page2页面。在view文件夹下新建mail文件夹&#xff0c;新建index.vue&#xff0c;填充user页面的内容即可。在view下新建…

数据采集:各地区动态IP数据质量差异分析

“在当今信息化社会&#xff0c;数据采集已成为各行各业不可或缺的一部分&#xff0c;它为企业决策、市场分析、学术研究等提供了重要的数据支持。而在数据采集过程中&#xff0c;动态IP作为一种频繁更换IP地址的代理服务&#xff0c;因其能够模拟不同地理位置的用户访问、突破…

【C++游记】Vector的使用和模拟实现

枫の个人主页 你不能改变过去&#xff0c;但你可以改变未来 算法/C/数据结构/C Hello&#xff0c;这里是小枫。C语言与数据结构和算法初阶两个板块都更新完毕&#xff0c;我们继续来学习C的内容呀。C是接近底层有比较经典的语言&#xff0c;因此学习起来注定枯燥无味&#xf…

【C++】sophus : test_macros.hpp 用于单元测试的宏和辅助函数 (四)

这段代码定义了一组用于单元测试的宏和辅助函数&#xff0c;主要目的是方便地进行各种类型的断言&#xff0c;并提供清晰的错误信息输出。 1. details::pretty(T) 函数: 这是一个模板函数&#xff0c;用于将各种类型的值转换为易于阅读的字符串表示形式。它使用模板特化来处理不…

【故障处理--修改CI流水线】

背景&#xff1a;研发同事反映CI流水线卡顿严重&#xff0c;判断是移动云镜像仓库的带宽太小&#xff0c;故在公有云搭建一个harbor仓库&#xff0c;这就意味着CI流水线有些配置需要改动 1、CI流水线的介绍 helm-chart/pcas-appstore-hy存放的是chart包需要的文件 Dockerfile…