Template:2DSpinCube/style.css: Difference between revisions
From SNCApedia, the shit nobody cares about encyclopedia
Jump to navigationJump to search
SomebodyRum (talk | contribs) Created page with "→Template:2DSpinCube/style.css: .scene { width: 200px; height: 200px; margin: 100px auto; position: relative; } .cube { width: 100%; height: 100%; position: relative; } .cube-face { position: absolute; width: 200px; height: 200px; top: 0; left: 0; →This animation mathematically projects 3D rotation into 2D space: animation: fake3D 8s linear infinite; } →Offsetting the start times creates the 4 sides of the 3D box: .face-front { animation-dela..." |
SomebodyRum (talk | contribs) No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
/* Template:2DSpinCube/style.css */ | /* Template:2DSpinCube/style.css */ | ||
/* Rewritten to use whitelisted 2D transforms so MediaWiki accepts it */ | |||
.scene { | .scene { | ||
width: 200px; | width: 200px; | ||
height: 200px; | height: 200px; | ||
margin: 100px auto; | margin: 100px auto; | ||
} | } | ||
| Line 11: | Line 12: | ||
height: 100%; | height: 100%; | ||
position: relative; | position: relative; | ||
/* transform-style: preserve-3d is banned by MW, using a 2D animation instead */ | |||
animation: spin-and-pulse 6s linear infinite; | |||
} | } | ||
| Line 19: | Line 22: | ||
top: 0; | top: 0; | ||
left: 0; | left: 0; | ||
} | } | ||
/* | /* We hide all faces except the front one since it's flattened to 2D */ | ||
.face- | .face-back, .face-right, .face-left, .face-top, .face-bottom { | ||
.face-right | display: none; | ||
.face- | |||
.face- | |||
} | } | ||
/* | /* Whitelisted keyframes for animation */ | ||
@keyframes spin-and-pulse { | |||
0% { transform: rotate(0deg) scale(1); } | |||
50% { transform: rotate(180deg) scale(0.8); } | |||
100% { transform: rotate(360deg) scale(1); } | |||
} | } | ||
Revision as of 18:07, 11 April 2026
/* Template:2DSpinCube/style.css */
/* Rewritten to use whitelisted 2D transforms so MediaWiki accepts it */
.scene {
width: 200px;
height: 200px;
margin: 100px auto;
}
.cube {
width: 100%;
height: 100%;
position: relative;
/* transform-style: preserve-3d is banned by MW, using a 2D animation instead */
animation: spin-and-pulse 6s linear infinite;
}
.cube-face {
position: absolute;
width: 200px;
height: 200px;
top: 0;
left: 0;
}
/* We hide all faces except the front one since it's flattened to 2D */
.face-back, .face-right, .face-left, .face-top, .face-bottom {
display: none;
}
/* Whitelisted keyframes for animation */
@keyframes spin-and-pulse {
0% { transform: rotate(0deg) scale(1); }
50% { transform: rotate(180deg) scale(0.8); }
100% { transform: rotate(360deg) scale(1); }
}