JSFiddle - React, Tailwind, and code Playground

HTML

<body>
        <a href="#example-1" name="modal">Пример 1</a>
        <a href="#example-2" name="modal">Пример 2</a>
        <a href="#example-3" name="modal">Пример 3</a>
        <a href="#example-4" name="modal">Пример 4</a>
        <a href="#example-5" name="modal">Пример 5</a>

        <div id="example-1" class="modal preview">
            <a href="#order" name="modal">Заказать</a>
            <p>1Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
            <a href="#example-2" name="modal">
                <span>Пример 2</span>
            </a>
            <a href="#example-3" name="modal">
                <span>Пример 3</span>
            </a>
            <a href="#example-4" name="modal">
                <span>Пример 4</span>
            </a>
            <a href="#example-5" name="modal">
                <span>Пример 5</span>
            </a>
        </div>

        <div id="example-2" class="modal preview">
            <a href="#order" name="modal">Заказать</a>
            <p>1Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,...

CSS

*{margin:0px;padding:0px;vertical-align:top;border-collapse:collapse;border-spacing:0px;outline:0px;border:none}
html,body{width:100%;height:100%}

body{width:1000px;font:normal 12px Arial,sans-serif;overflow-x:hidden;margin:0 auto}

.modal{display:none;position:absolute}
.preview{width:440px;height:200px;background:#ff0}
.order{width:240px;height:200px;overflow:hidden;background:#f00;margin:0 0 0 200px}

JavaScript

$(function() {
	$.fn.extend({
		center: function () {
			return this.each(function() {
				var $this = $(this);
				var $window = $(window);
				clearTimeout($this.timerHandle);
				var top = ($window.height() - $this.height())/2+$window.scrollTop();
				var left = ($window.width() - $this.width())/2+$window.scrollLeft();
				clearTimeout(this.timerHandle);
				this.timerHandle = setTimeout(function () {
					$this.animate({
						"top": top,
						"left": left
					}, 300);
					$(window).bind('scroll', function() {
						$($this).center();
					});
					$(window).bind('resize', function() {
						$($this).center();
					});
				}, 200);
			});
		}
	});

	var overlayHeight = $(document).height();
	var overlayWidth = $(window).width();
	$('body').prepend('<div id="shadow"></div>');
	$('#shadow').css({'display':'none','background':'#000','position':'absolute','top':'0','left':'0','z-index':'999','cursor':'pointer'});
	$(window).bind('resize', function() {
		$('#shadow').css({'width':($(document).width()), 'height':($(document).height())});
	});
	$('a[name=modal]').click(function(e) {
		e.preventDefault();
		var id = $(this).attr('href');
		$('#shadow').css({'width':overlayWidth,'height':overlayHeight});
		$('#shadow').fadeTo("slow",0.7);
		$(id).css({'z-index':'1000','position':'absolute','display':'none'});
		$(id).fadeIn(500);
		$(document).keyup(function(d) {
			if (d.keyCode == 27) {
				$('#shadow').fadeOut();
				$(id).fadeOut();
			}
		});
		$('#shadow').click(function () {
			$(this).fadeOut();
			$(id).fadeOut();
			
		});
		$(".close").click(function () {
			$("#order").hide();
			return false;
		});
	});
});