<p>Вибери потрібне значення для <code>transform-origin</code>(у відсотках):</p>

<label>X: <input type="number" value="0" step="10" id="field"></input></label>
<br><br>
<label>Y: <input type="number" value="0" step="10" id="field2"></input></label>

<div id="block">
  <code>transform: rotate(60deg);</code>
</div>
body {
	padding: 36px;
  text-align: center;
  line-height: 1.45;
  font-size: 17px;
  font-family: sans-serif;
}

#field,
#field2{
  padding: 8px;
}

#block {
  width: 175px;
  padding: 30px;
  text-align: center;
  background: gold;
  margin: 106px auto 0 auto;
  transform: rotate(20deg);
}
var block = document.getElementById('block');
var field = document.getElementById('field');
var field2 = document.getElementById('field2')

field.onchange = field2.onchange = function change() {
  var newVal = getNewValue();  
  block.style.transformOrigin = newVal[0] + '% ' + newVal[1] + '%'; 
}

function getNewValue() {
  var result = [];
  result[0] = field.value;
  result[1] = field2.value;  
  return result;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.