JSFiddle - React, Tailwind, and code Playground
HTML
<div id="panel">
<div id="panel-content">Форма логина и пароля.</div>
<div id="panel-sticker"> <span>Регистрация</span>
</div>
</div>
CSS
#panel {
position: fixed;
top: -108px;
left: 340px;
}
#panel-content {
width: 145px;
height: 85px;
padding: 23px 5px 0px 5px;
background: #AAA;
text-align: center;
}
#panel-sticker {
width: 145px;
padding: 3px 5px;
text-align: center;
border-top: none !important;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
background: #AAA;
cursor: pointer;
}
#panel-sticker span {
display: block;
width: 135px;
margin: 0 auto;
color: #FFF;
}
JavaScript
(function ($) {
$(document).ready(function () {
var $panel = $('#panel');
if ($panel.length) {
var $sticker = $panel.children('#panel-sticker');
var showPanel = function () {
$panel.animate({
top: '+=107',
}, 300, function () {
$(this).addClass('visible');
});
};
var hidePanel = function () {
$panel.animate({
top: '-=107',
}, 500, function () {
$(this).removeClass('visible');
});
};
$sticker.children('span').click(function () {
if ($panel.hasClass('visible')) {
hidePanel();
} else {
showPanel();
}
})
}
});
})(jQuery);