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>

相关推荐
向宇it7 分钟前
【unity小技巧】封装unity适合2D3D进行鼠标射线检测,获取鼠标位置信息检测工具类
游戏·3d·unity·游戏引擎
鹦鹉0079 小时前
SpringMVC的基本使用
java·spring·html·jsp
中科米堆10 小时前
中科米堆CASAIM金属件自动3d测量外观尺寸三维检测解决方案
人工智能·3d·视觉检测
山楂树の10 小时前
模型优化——在MacOS 上使用 Python 脚本批量大幅度精简 GLB 模型(通过 Blender 处理)
python·macos·3d·图形渲染·blender
朴shu17 小时前
Luckysheet 打印终极指南(预览视图+打印功能) : 2025 最新实现
前端·javascript·html
Blossom.11818 小时前
基于深度学习的医学图像分析:使用BERT实现医学文本分类
人工智能·深度学习·机器学习·3d·分类·cnn·bert
暮星20 小时前
这次一定要讲清 ASCII & Unicode!!!
前端·javascript·html
dllmayday20 小时前
3D空间中的变换矩阵
线性代数·3d·矩阵
渲吧-云渲染21 小时前
材质:3D渲染的隐形支柱
3d·材质
杨超越luckly1 天前
HTML应用指南:利用GET请求获取全国小米之家门店位置信息
前端·arcgis·html·数据可视化·shp