{"id":711,"date":"2012-08-08T17:44:55","date_gmt":"2012-08-08T17:44:55","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=711"},"modified":"2012-08-08T17:46:56","modified_gmt":"2012-08-08T17:46:56","slug":"3d-book-covers","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/3d-book-covers\/","title":{"rendered":"3D book covers"},"content":{"rendered":"<p>I think just about everyone one of us has thumbnailed a PDF at some point, to provide a more visual representation of the PDF for download. You grab a screen shot of the first page, or extract it in photo shop, and you have a nifty little thumbnail that offers a preview of the PDF.<\/p>\n<p>What if we could make those preview thumbnails a bit more appealing? Say, for example to look a little bit more like a book. Or provide some pop by applying a 3d transformation?<\/p>\n<p>With the new CSS3 3D transforms module, we can! But, before you get too excited, I should forewarn that this module is, at time of posting, only in Working Draft status. Which means that it hasn&#39;t been finalized, and browser support is limited. The styles I&#39;m about to describe are currently only available in Webkit browsers (Safari, Chrome), but I think we can expect more widespread support in the near-future.<\/p>\n<p>The good news though, is that these styles will simply be ignored by non-supporting browsers.<\/p>\n<p>For our example, see the image below.<\/p>\n<p><a href=\"http:\/\/www.sitekickr.com\/blog\/wp-content\/uploads\/2012\/08\/word.png\"><img loading=\"lazy\" alt=\"\" class=\"alignnone size-full wp-image-712\" height=\"128\" src=\"http:\/\/www.sitekickr.com\/blog\/wp-content\/uploads\/2012\/08\/word.png\" title=\"word\" width=\"128\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Now, have a look at this image, which has some style applied to it with CSS only.<\/p>\n<p><a href=\"http:\/\/www.sitekickr.com\/blog\/wp-content\/uploads\/2012\/08\/3d-perspective-css.jpg\"><img loading=\"lazy\" alt=\"\" class=\"alignnone size-full wp-image-713\" height=\"178\" src=\"http:\/\/www.sitekickr.com\/blog\/wp-content\/uploads\/2012\/08\/3d-perspective-css.jpg\" title=\"3d-perspective-css\" width=\"155\" \/><\/a><\/p>\n<p>Does it look exactly like a book, no, but pretty cool right?!<\/p>\n<h3>The HTML<\/h3>\n<p><code>&nbsp;&nbsp;&nbsp; &lt;div&gt;<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;img src=&quot;word.png&quot; \/&gt;<br \/>\n\t&nbsp;&nbsp;&nbsp; &lt;\/div&gt;<br \/>\n\t<\/code><\/p>\n<h3>\n\tThe CSS<\/h3>\n<p><code>div { -webkit-perspective: 1200; <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -webkit-perspective-origin: 50% -50%; <br \/>\n\t&nbsp;&nbsp;&nbsp; }<br \/>\n\tdiv img { -webkit-transform-style: preserve-3d; <\/code><code><br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -webkit-transform: rotateY(55deg);<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -webkit-box-shadow: 0px -1px 4px 4px #333,<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; -2px -3px 4px 5px #555,<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; -4px -5px 4px 4px #777,<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; -6px -7px 4px 3px #999,<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; -8px -9px 4px 2px #bbb;<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br \/>\n\t<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think just about everyone one of us has thumbnailed a PDF at some point, to provide a more visual representation of the PDF for&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[12],"tags":[195],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/711"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=711"}],"version-history":[{"count":2,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/711\/revisions"}],"predecessor-version":[{"id":715,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/711\/revisions\/715"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}