<div class="scaleable-wrapper" id="scaleable-wrapper">
  
  <div class="very-specific-design" id="very-specific-design">
  
    <div class="marvel-device iphone-x">
      <div class="notch">
          <div class="camera"></div>
          <div class="speaker"></div>
      </div>
      <div class="top-bar"></div>
      <div class="sleep"></div>
      <div class="bottom-bar"></div>
      <div class="volume"></div>
      <div class="overflow">
          <div class="shadow shadow--tr"></div>
          <div class="shadow shadow--tl"></div>
          <div class="shadow shadow--br"></div>
          <div class="shadow shadow--bl"></div>
      </div>
      <div class="inner-shadow"></div>
      <div class="screen">
          <!-- Content goes here -->
      </div>
    </div>
    
  </div>
  
</div>
body {
  background: #ccc;
  padding: 20px;
}

.very-specific-design {
  width: 600px;
  height: 900px;
  padding: 50px;
  text-align: center;
  position: relative;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}

.scaleable-wrapper {
  padding: 20px;
  resize: both;
  position: relative;
  background: #666;
  height: 400px;
}

.ui-resizable-se {
  width: 10px;
  height: 10px;
  background: orange;
  position: absolute;
  bottom: 0;
  right: 0;
}

.bigred {
  color: red;
  font-size: 5rem;
}
View Compiled
var $el = $("#very-specific-design");
var elHeight = $el.outerHeight();
var elWidth = $el.outerWidth();

var $wrapper = $("#scaleable-wrapper");

$wrapper.resizable({
  resize: doResize
});

function doResize(event, ui) {
  
  var scale, origin;
    
  scale = Math.min(
    ui.size.width / elWidth,    
    ui.size.height / elHeight
  );
  
  $el.css({
    transform: "translate(-50%, -50%) " + "scale(" + scale + ")"
  });
  
}

var starterData = { 
  size: {
    width: $wrapper.width(),
    height: $wrapper.height()
  }
}
doResize(null, starterData);

External CSS

  1. https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/devices.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js

Packages

This Pen doesn't use any packages.