Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Found <a href="http://forrst.com/posts/CSS3_only_3D_Animated_Atom-4Dr">this</a> online.</p> <p>It utilizes the <code>transform-style: preserve-3d</code> property and rotates the electrons on the x, y and z axis to achieve this 3D effect.</p> <p><strong>HTML Structure</strong></p> <pre><code>&lt;div id="main"&gt; &lt;div id="atom"&gt; &lt;div class="orbit"&gt; &lt;div class="path"&gt; &lt;div class="electron"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="orbit"&gt; &lt;div class="path"&gt; &lt;div class="electron"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="orbit"&gt; &lt;div class="path"&gt; &lt;div class="electron"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="orbit"&gt; &lt;div class="path"&gt; &lt;div class="electron"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="nucleus"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>.orbit { -webkit-transform-style: preserve-3d; -webkit-transform: rotateX(80deg) rotateY(20deg); } #atom .orbit:nth-child(2) { -webkit-transform: rotateX(80deg) rotateY(70deg) } #atom .orbit:nth-child(3) { -webkit-transform: rotateX(80deg) rotateY(-20deg) } #atom .orbit:nth-child(4) { -webkit-transform: rotateX(80deg) rotateY(-50deg) } .path { -webkit-transform-style: preserve-3d; -webkit-animation-name: pathRotate; -webkit-animation-duration: 2s; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: linear; } .electron { -webkit-animation-name: electronFix; -webkit-animation-duration: 2s; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: linear; } @-webkit-keyframes pathRotate { from { -webkit-transform: rotateZ(0deg); } to { -webkit-transform: rotateZ(360deg); } } @-webkit-keyframes electronFix { from { -webkit-transform: rotateX(90deg) rotateY(0deg); } to { -webkit-transform: rotateX(90deg) rotateY(-360deg); } } </code></pre> <p><a href="http://jsfiddle.net/bgreater/kfgVr/">Fiddle</a></p> <p><a href="http://forrst.com/posts/CSS3_only_3D_Animated_Atom-4Dr">Blog Post</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload