Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- body{
- font-family: "Helvetica";
- color: white;
- background: red;
- background: linear-gradient(to bottom right, hsl(150, 60%, 50%) 10%, hsl(180, 100%, 50%) 90%) no-repeat;
- background-size: 100%;
- margin: 0;
- padding: 20px;
- padding-bottom: 100%;
- }
- h1, p{
- text-align: center;
- }
- div{
- margin-left: auto;
- margin-right: auto;
- }
- .triangle{
- width: 0;
- height: 0;
- border-top: 0px solid transparent;
- border-left: 50px solid transparent;
- border-right: 50px solid transparent;
- border-bottom: 70px solid black;
- }
- .container{
- width: 210px;
- height: 140px;
- position: relative;
- perspective: 1000;
- }
- #pyramid{
- opacity: 50%;
- width: 100%;
- height: 100%;
- position: absolute;
- transform-style: preserve-3d;
- transform: translateZ( -100px );
- animation: spinPyramid 3s infinite linear;
- }
- #pyramid figure{
- display: block;
- position: absolute;
- backface-visibility: none;
- }
- #pyramid figure.base{
- backface-visibility: 100%;
- background-color: lightgrey;
- transform: rotateX(90deg) translateZ(-10px);
- width: 100px;
- height: 100px;
- }
- #pyramid figure:nth-child(1){
- transform: rotateY(0deg) translateZ(25px) rotateX(45deg);
- border-bottom-color: red;
- }
- #pyramid figure:nth-child(2){
- transform: rotateY(90deg) translateZ(25px) rotateX(45deg);
- border-bottom-color: green;
- }
- #pyramid figure:nth-child(3){
- transform: rotateY(180deg) translateZ(25px) rotateX(45deg);
- border-bottom-color: blue;
- }
- #pyramid figure:nth-child(4) {
- transform: rotateY(-90deg) translateZ(25px) rotateX(45deg);
- }
- @keyframes spinPyramid{
- 0% {transform: translateZ(-100px) rotateX( 0deg ) rotateY( 0deg );}
- 100% {transform: translateZ( -100px ) rotateX( 360deg ) rotateY( 360deg ); }
- }
- #cia{
- max-width: 100%;
- max-height: 100%;
- }
- </style>
- </head>
- <body>
- <h1>Pyramid Test</h1>
- <div class="container">
- <div id="pyramid">
- <figure class="triangle"></figure>
- <figure class="triangle"></figure>
- <figure class="triangle"></figure>
- <figure class="triangle"></figure>
- <figure class="base"><img id="cia" src="http://logonoid.com/images/cia-logo.png" alt="CIA"></figure>
- </div>
- </div>
- <p>Gotta go fast!</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment