当前位置: 首页 > wzjs >正文

在家做兼职的网站服务器如何发布网站

在家做兼职的网站,服务器如何发布网站,专业网站设计制作优化排名,电商设计网站培训📅 我们继续 50 个小项目挑战!—— Expanding Cards 组件 仓库地址:https://github.com/SunACong/50-vue-projects 项目预览地址:https://50-vue-projects.vercel.app/ ✨ 组件目标 一组横向排列的背景卡片点击卡片后&#xff…

📅 我们继续 50 个小项目挑战!—— Expanding Cards 组件

仓库地址:https://github.com/SunACong/50-vue-projects

项目预览地址:https://50-vue-projects.vercel.app/

在这里插入图片描述


✨ 组件目标

  • 一组横向排列的背景卡片
  • 点击卡片后,其展开至主要区域,其他卡片收缩
  • 显示当前卡片的标题,其他隐藏

🧱 技术实现点

  • Vue3 的响应式状态 ref
  • v-for 渲染卡片列表
  • TailwindCSS flex, transition, bg-cover, rounded, bg-[url] 等核心工具类
  • 条件样式绑定 :class

🔧 ExpandingCards.vue 组件实现

<template><div class="flex min-h-screen justify-center p-20"><divv-for="item in imagList":key="item.id"@click="current = item.id":class="['relative m-2 flex-1/12 cursor-pointer rounded-[4vw] bg-cover bg-center bg-no-repeat font-mono text-2xl text-white transition-all duration-500 ease-in-out',item.className,current === item.id ? 'flex-2/3' : 'flex-1/12',]"><h3:class="['absolute bottom-5 left-15 transition-all duration-500 ease-in-out',current === item.id ? 'opacity-100' : 'opacity-0',]">{{ item.title }}</h3></div></div>
</template><script setup>
import { ref } from 'vue'const current = ref(1)const imagList = [{id: 1,className:'bg-[url(https://images.unsplash.com/photo-1558979158-65a1eaa08691?auto=format&fit=crop&w=1350&q=80)]',title: 'Explore The World',},{id: 2,className:'bg-[url(https://images.unsplash.com/photo-1572276596237-5db2c3e16c5d?auto=format&fit=crop&w=1350&q=80)]',title: 'Wild Forest',},{id: 3,className:'bg-[url(https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1353&q=80)]',title: 'Sunny Beach',},{id: 4,className:'bg-[url(https://images.unsplash.com/photo-1551009175-8a68da93d5f9?auto=format&fit=crop&w=1351&q=80)]',title: 'City on Winter',},{id: 5,className:'bg-[url(https://images.unsplash.com/photo-1549880338-65ddcdfd017b?auto=format&fit=crop&w=1350&q=80)]',title: 'Mountains - Clouds',},
]
</script>

💡 TailwindCSS 样式重点讲解

类名功能描述
flex-1/12, flex-2/3自定义比例控制卡片展开宽度
bg-cover bg-center背景图片尺寸与居中展示
rounded-[4vw]圆角自定义为视口宽度
transition-all duration-500平滑过渡效果
opacity-0 / opacity-100控制标题显隐

🦌 常量定义 + 组件路由

constants/index.js添加组件预览常量

export const projectList = [{id: 1,title: 'Expanding Cards',image: 'https://50projects50days.com/img/projects-img/1-expanding-cards.png',link: 'ExpandingCards',}
]

router/index.jsrouter对象添加路由选项

{path: '/ExpandingCards',name: 'ExpandingCards',component: () => import('@/projects/ExpandingCards.vue')}

🚀 小结

这个组件展示了如何用非常少的代码和工具类实现炫酷 UI 效果。我们学会了:

  • 使用 v-for 构建动态组件结构
  • ref 管理当前状态
  • 动态绑定 class 实现动画和交互反馈
  • 熟练使用 TailwindCSS v4 的实用工具类,提升开发效率

📅 明日预告:Progress Steps!实现步骤引导组件。


🧠 每天进步一点点,50 天后惊艳所有人!

http://www.dtcms.com/wzjs/800033.html

相关文章:

  • 温州网站建设wmwl视频直播app下载
  • 深圳网站制作作优秀的app界面设计案例
  • 博山网站建设yx718做漆包线的招聘网站
  • 高端企业网站建站东莞最好的网站建设价格低
  • 免费网站源码杭州网站建设推广
  • cms建站程序更改wordpress代码
  • 网站弹出页面设计专业
  • 企业网站排名软件能优化wordpress首页显示分类
  • 网站建设费计入那个科目cms电影网站模板
  • 普同网站跟营销型网站的区别优化网站结构一般包括
  • 中国最大的网站东莞整合网站建设推广
  • 西安网站推广优化WordPress数据库禁用插件
  • 如何做网站跳转页面经典的响应式布局网站
  • 顶呱呱做网站吗360搜索建站公司
  • 网站建设与管理是什么工作爱做网站网址
  • 室内设计网站案例php建网站教程
  • 网站费用单陕西网络营销外包专业定制
  • 搜索引擎排名网站深圳有名的品牌设计公司
  • 太原网站建设平台深圳鲜花团购网站建设
  • 广州做网站多少钱网站模板选择
  • 做好公司网站百度搜索风云榜下载
  • 注册什么公司给别人做网站应用公园制作app免费吗
  • 南京网站开发询南京乐识精品网站建设教程
  • 查找做影评的工作网站建设专业网站哪家比较好
  • 教育培训网站建设衡水seo营销
  • 开发一个网站的费用十堰官网seo哪家好
  • 商务类网站做电影网站怎么拿到版权
  • 天津网站建设案例企信网查询
  • 深圳福田站苏州保洁公司钟点工
  • 机票网站建设网站网站建设费进什么科目