cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              	<div id="main">
		<div>
			<div>
				<input id="reset" type="button" value="   RESET   "/>
			</div>
			<div>
				<label>Rotate Image</label>
				<input id="rotate" type="range" min="-1080" max="1080" value="0" />
			</div>
			<div>
				<label>Scale Image</label>
				<input id="scale" type="range" min="0" max="5" value="1" />
			</div>
			<div>
				<label>Skew X-Axis</label>
				<input id="sx" type="range" min="0" max="180" value="0" />
			</div>
			<div>
				<label>Skew Y-Axis</label>
				<input id="sy" type="range" min="0" max="180" value="0" />
			</div>
			<div id="applied">
				<h3>Transformation Applied</h3>
			</div>
		</div>
		<div>
			<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Home_Icon.svg/512px-Home_Icon.svg.png" />
		</div>

	</div>
            
          
!
            
              * {
  box-sizing: border-box;
}

div#main {
  width: 100%;
  margin: 0px auto;
}

div#main > div {
 float:left;
}

div#main > div: nth-child(1) {
  width: 30%;
}
div#main > div:nth-child(2) {
  text-align: center;
  width: 70%;
}

img {
  width: 20%;
  z-index: -10;
}

h1,h3 {
  text-align: center;
}

            
          
!
            
              //Get the main image for future references
			var _image = $("div > div:nth-child(2) img");
			var _text = "<h3>Transformation Applied</h3>";



			//Rotate Button Click Handler
			$("#rotate").change(function() {

				//Get the value of the slider
				var value = $(this).val();
        //Rotate the oirginal image to the current value of the slider
				_image.css("transform","rotate(" + value + "deg)");
				//Show the text of the transformation applied
				$("#applied").html(_text+"<p>"+"transform:"+"rotate("+value+"deg)</p>");

			});

			//Scale Button Click Handler
			$("#scale").change(function() {
				//Get the value of the slider
				var value = $(this).val();
				//Scale the original image to the current value of the slider
				_image.css("transform", "scale(" + value + ")");
				//Show the text of the transformation applied
				$("#applied").html(_text+"<p>"+"transform:"+"scale("+value+")</p>");
			});

			//SkewX Button Click Handler
			$("#sx").change(function() {
				//Get the value of the slider
				var value = $(this).val();
				//SkewX the original image with the current value of the slider
				_image.css("transform", "skewX(" + value + "deg)");
				//Show the text of the transformation applied
				$("#applied").html(_text+"<p>"+"transform:"+"skewX("+value+"deg)</p>");
			});

			//SkewY Button Click Handler
			$("#sy").change(function() {
				//Get the value of the slider
				var value = $(this).val();
				//SkewY the original image with the current value of the slider
				_image.css("transform", "skewY(" + value + "deg)");
				//Show the text of the transformation applied
				$("#applied").html(_text+"<p>"+"transform:"+"skewY("+value+"deg)</p>");
			});

			//Reset everything to the original value
			$("#reset").click(function(event) {
				$("input[type='range']").val(0);
				$("#scale").val(1);
				$("img").css({ "transform": "rotate(0deg) scale(1) skewX(0deg) skewY(0deg)"});
				$("#applied").html("<h3>Transformations Applied</h3>");
			});

            
          
!
999px
Loading ..................

Console