javascript - Create rotated rectangle out of an image -


is there way slice image pieces (45deg rotated rectangles).

here's code found on internet has animation , creates rectangles of image. (version:5) http://plnkr.co/edit/8tcvpyweskirfengntd6?p=preview

i tried create rotated rectangles prob when use transform:rotate(45deg) out of piece first applies background rotates it.

edit1: trying sth creating div rotated contains div who's rotated other way

<div style="overflow:hidden;transform:rotate(45deg)">  <div class="tilepiece" style="transform:rotate(-45deg);background-image:url('img.jpg');background-position:xx xx"></div> ... </div> 

(version:6) http://plnkr.co/edit/8tcvpyweskirfengntd6?p=preview

maybe hint css using background image , tiles on . http://codepen.io/gc-nomade/pen/fahme/ preview in ie11

idea set white background rotated tiles giving each different delay in transition. in codepen , used sass generate associate css in loop

$n : 24 ; div:hover span{@for $i 0 through $n {   @if $i > 0 {     &:nth-child(#{$i})    {     background:white;     transition: 0s #{$i/3}s;   }  } } } 

wich gives 24 rules bth-child incremented , transition delay incremented . firt 3 looks :

div:hover span:nth-child(1) {   background: white;   transition: 0s 0.33333s; } div:hover span:nth-child(2) {   background: white;   transition: 0s 0.66667s; } div:hover span:nth-child(3) {   background: white;   transition: 0s 1s; } /* , on untill 24*/ 

to switch image another, need imbricate 2 elements reverse initial rotation. can set transition on both state , last tiles fade on hover , first show on mouse out : http://codepen.io/gc-nomade/pen/zrond/ 2 images

you can add scissor or slide effect http://codepen.io/gc-nomade/pen/vtzle/


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -