* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
min-height: 100vh;
padding: 60px 20px;
color: white;
}
.container {
max-width: 1400px;
margin: 0 auto;
}
.header {
text-align: center;
margin-bottom: 60px;
}
h1 {
font-size: 48px;
margin-bottom: 16px;
background: linear-gradient(135deg, #60a5fa, #a78bfa);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.subtitle {
font-size: 18px;
color: #94a3b8;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 40px;
margin-bottom: 40px;
}
.demo-card {
background: rgba(30, 41, 59, 0.5);
border-radius: 20px;
padding: 30px;
border: 1px solid rgba(148, 163, 184, 0.2);
}
.demo-title {
font-size: 20px;
margin-bottom: 20px;
color: #e2e8f0;
display: flex;
align-items: center;
gap: 10px;
}
.demo-title ion-icon {
color: #60a5fa;
font-size: 24px;
}
.demo-container {
width: 100%;
height: 300px;
display: flex;
align-items: center;
justify-content: center;
perspective: 1000px;
background: rgba(15, 23, 42, 0.5);
border-radius: 12px;
}
/* 1. 3D Rotating Cube */
.cube-container {
width: 200px;
height: 200px;
position: relative;
transform-style: preserve-3d;
animation: rotateCube 20s infinite linear;
}
.cube-face {
position: absolute;
width: 200px;
height: 200px;
background: linear-gradient(135deg, #60a5fa, #a78bfa);
border: 2px solid rgba(255, 255, 255, 0.2);
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
font-weight: 700;
opacity: 0.9;
}
.cube-face.front {
transform: translateZ(100px);
}
.cube-face.back {
transform: translateZ(-100px) rotateY(180deg);
}
.cube-face.right {
transform: rotateY(90deg) translateZ(100px);
}
.cube-face.left {
transform: rotateY(-90deg) translateZ(100px);
}
.cube-face.top {
transform: rotateX(90deg) translateZ(100px);
}
.cube-face.bottom {
transform: rotateX(-90deg) translateZ(100px);
}
@keyframes rotateCube {
from {
transform: rotateX(0) rotateY(0);
}
to {
transform: rotateX(360deg) rotateY(360deg);
}
}
/* 2. 3D Flip Card */
.flip-card {
width: 250px;
height: 200px;
position: relative;
transform-style: preserve-3d;
transition: transform 0.8s;
cursor: pointer;
}
.flip-card:hover {
transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 16px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
padding: 20px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.flip-card-front {
background: linear-gradient(135deg, #ec4899, #f43f5e);
}
.flip-card-back {
background: linear-gradient(135deg, #8b5cf6, #6366f1);
transform: rotateY(180deg);
}
.flip-card ion-icon {
font-size: 48px;
}
/* 3. 3D Perspective Text */
.text-3d {
font-size: 64px;
font-weight: 900;
background: linear-gradient(135deg, #fbbf24, #f59e0b);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
transform: perspective(500px) rotateX(20deg);
text-shadow:
0 1px 0 #d97706,
0 2px 0 #b45309,
0 3px 0 #92400e,
0 4px 0 #78350f,
0 5px 0 #78350f,
0 6px 1px rgba(0,0,0,.1),
0 0 5px rgba(0,0,0,.1),
0 1px 3px rgba(0,0,0,.3),
0 3px 5px rgba(0,0,0,.2),
0 5px 10px rgba(0,0,0,.25);
}
/* 4. 3D Button */
.button-3d {
padding: 20px 40px;
font-size: 18px;
font-weight: 700;
color: white;
background: linear-gradient(135deg, #10b981, #059669);
border: none;
border-radius: 12px;
cursor: pointer;
transform-style: preserve-3d;
transition: all 0.3s;
box-shadow:
0 5px 0 #047857,
0 8px 15px rgba(0, 0, 0, 0.4);
}
.button-3d:hover {
transform: translateY(-2px);
box-shadow:
0 7px 0 #047857,
0 10px 20px rgba(0, 0, 0, 0.5);
}
.button-3d:active {
transform: translateY(3px);
box-shadow:
0 2px 0 #047857,
0 4px 10px rgba(0, 0, 0, 0.3);
}
/* 5. 3D Card Tilt */
.tilt-card {
width: 250px;
height: 200px;
background: linear-gradient(135deg, #3b82f6, #2563eb);
border-radius: 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
transition: transform 0.3s;
cursor: pointer;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.tilt-card:hover {
transform: rotateX(10deg) rotateY(10deg) scale(1.05);
}
.tilt-card ion-icon {
font-size: 48px;
}
/* 6. 3D Layers */
.layers-3d {
position: relative;
width: 200px;
height: 200px;
transform-style: preserve-3d;
animation: rotateLayer 10s infinite ease-in-out;
}
.layer {
position: absolute;
width: 200px;
height: 200px;
background: linear-gradient(135deg, #f472b6, #ec4899);
border-radius: 20px;
opacity: 0.7;
border: 2px solid rgba(255, 255, 255, 0.3);
}
.layer:nth-child(1) {
transform: translateZ(0px);
}
.layer:nth-child(2) {
transform: translateZ(-20px);
background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}
.layer:nth-child(3) {
transform: translateZ(-40px);
background: linear-gradient(135deg, #60a5fa, #3b82f6);
}
@keyframes rotateLayer {
0%, 100% {
transform: rotateX(0) rotateY(0);
}
50% {
transform: rotateX(30deg) rotateY(30deg);
}
}
/* 7. 3D Floating Card */
.floating-card {
width: 250px;
height: 200px;
background: linear-gradient(135deg, #06b6d4, #0891b2);
border-radius: 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
animation: float 3s ease-in-out infinite;
}
.floating-card ion-icon {
font-size: 48px;
}
@keyframes float {
0%, 100% {
transform: translateY(0) rotateX(0) rotateY(0);
}
50% {
transform: translateY(-20px) rotateX(5deg) rotateY(5deg);
}
}
/* 8. 3D Pyramid */
.pyramid {
width: 0;
height: 0;
border-left: 100px solid transparent;
border-right: 100px solid transparent;
border-bottom: 150px solid #f59e0b;
position: relative;
transform-style: preserve-3d;
animation: rotatePyramid 8s infinite linear;
}
@keyframes rotatePyramid {
from {
transform: rotateY(0);
}
to {
transform: rotateY(360deg);
}
}
/* 9. 3D Sphere */
.sphere {
width: 150px;
height: 150px;
border-radius: 50%;
background: radial-gradient(circle at 30% 30%, #fbbf24, #f59e0b, #d97706);
box-shadow:
inset -25px -25px 40px rgba(0, 0, 0, 0.5),
0 20px 60px rgba(0, 0, 0, 0.4);
animation: rotateSphere 6s infinite linear;
}
@keyframes rotateSphere {
from {
transform: rotateY(0);
}
to {
transform: rotateY(360deg);
}
}
@media (max-width: 768px) {
h1 {
font-size: 36px;
}
.grid {
grid-template-columns: 1fr;
gap: 30px;
}
.demo-container {
height: 250px;
}
.text-3d {
font-size: 48px;
}
}
No comments yet. Be the first!