4. 文字效果/2D-3D转换 - 3D翻转卡片

4. 文字效果/2D-3D转换 - 3D翻转卡片

案例:3D产品展示卡片

html 复制代码
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style type="text/css">
		.scene {
		    width: 300px;
		    height: 400px;
		    perspective: 1000px;
		    margin: 50px auto;
		  }
		  
		  .card {
		    width: 100%;
		    height: 100%;
		    position: relative;
		    transition: transform 1s;
		    transform-style: preserve-3d;
		  }
		  
		  .scene:hover .card {
		    transform: rotateY(180deg);
		  }
		  
		  .card-face {
		    position: absolute;
		    width: 100%;
		    height: 100%;
		    backface-visibility: hidden;
		    border-radius: 10px;
		    overflow: hidden;
		    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
		  }
		  
		  .card-front {
		    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
		    display: flex;
		    flex-direction: column;
		    align-items: center;
		    justify-content: center;
		  }
		  
		  .card-back {
		    background: linear-gradient(45deg, #a18cd1, #fbc2eb);
		    transform: rotateY(180deg);
		    padding: 20px;
		    box-sizing: border-box;
		  }
		  
		  .product-title {
		    font-size: 24px;
		    margin-bottom: 10px;
		    color: white;
		    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
		  }
		  
		  .product-image {
		    width: 80%;
		    filter: drop-shadow(5px 5px 10px rgba(0,0,0,0.2));
		  }
		  
		  .product-description {
		    color: white;
		    line-height: 1.6;
		  }
	</style>
	<body>
		<div class="scene">
		  <div class="card">
		    <div class="card-face card-front">
		      <h2 class="product-title">智能手表</h2>
		      <img src="smartwatch.png" class="product-image">
		    </div>
		    <div class="card-face card-back">
		      <h3>产品特性</h3>
		      <p class="product-description">
		        心率监测 | 运动追踪 | 50米防水<br>
		        14天续航 | 通知提醒 | 多种表盘
		      </p>
		      <div class="price">¥899</div>
		    </div>
		  </div>
		</div>
	</body>
</html>

相关推荐
zhangfeng11332 小时前
计算机视觉vc 3D 希尔伯特曲线 基础介绍,人工智能
人工智能·计算机视觉·3d
川冰ICE4 小时前
JavaScript实战④|天气查询应用,调用API与异步处理
javascript·css·css3
程序员极光5 小时前
第六篇,如何用高德地图获取定位!
3d·高德
Rauser Mack8 小时前
不懂编程,但是vibe coding一个扫雷游戏
人工智能·python·游戏·html·prompt
放下华子我只抽RuiKe58 小时前
FastAPI 全栈后端(二):路由与数据模型
前端·人工智能·react.js·前端框架·html·fastapi
Thomas_YXQ8 小时前
Unity3D Addressable 深度优化热更性能消耗
开发语言·3d·unity·微信
七77.9 小时前
【3D 场景生成】NuiScene: Exploring Efficient Generation of Unbounded Outdoor Scenes
3d·世界模型
dotnet9010 小时前
PDF 页面尺寸上限是 14400。iText 直接加载成功的大图可能超过这个限制,需要在 setPageSize 之前等比缩放。
前端·javascript·html
threelab10 小时前
Three.js 几何图形变换 | 三维可视化 / AI 提示词
开发语言·前端·javascript·人工智能·3d·着色器
xian_wwq10 小时前
【学习笔记】倾斜摄影、高斯泼溅(3DGS)、点云与数字孪生“族谱”全盘点
笔记·学习·3d