Skip to content

Instantly share code, notes, and snippets.

body input:focus:required:invalid,
body textarea:focus:required:invalid {
color: red;
box-shadow: 0 0 10px #ff6347;
border: 3px solid #ff6347}
body input:required:valid,
body textarea:required:valid {
color: green;
box-shadow: 0 0 10px green;
h1 { font-size: 24px;}
h2 { font-size: 22px;}
h3 { font-size: 18px;}
h4 { font-size: 16px;}
h5 { font-size: 12px;}
h6 { font-size: 10px;}
git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
###### 1 ######
<header id="page_header" class="page_header">
<div class="header_inner clearfix">
<div class="container">
<div class="container_inner clearfix">
<div class="header_inner_left">
<div class="mobile_menu_button"></div>
<div class="logo_wrapper"></div>
</div>
<div class="header_inner_right">
/*
## 1741 to 1902
## 1681 to 1740
## 1537 to 1680
## 1367 to 1536
## 1367 to 1550
## 1201 to 1550
## 1201 to 1366
## 992 to 1200
<!-- begin Back to Top button -->
<a href="#" id="back-to-top" title="Back to top">&uarr;</a>
<!-- end Back to Top button -->
################################################################################
/* begin Back to Top Button */
#back-to-top {
position: fixed;
bottom: 40px;
function pow(x,n) {
if (n != 1) {
return x *= pow(x,n - 1);
} else {
return x;
}
}
alert( pow(2,2,5)); // 8
@alexandr-kazakov
alexandr-kazakov / block centering JS
Last active April 10, 2017 18:24
relative modal block centering Vanilla JS
function modalCentering(modal_arg) {
var modal = modal_arg;
modal.style.top = document.documentElement.clientHeight / 2 - modal.offsetHeight / 2 + 'px';
modal.style.left = document.documentElement.clientWidth / 2 - modal.offsetWidth / 2 + 'px';
if (modal.getBoundingClientRect().top < 0) modal.style.top = 0;
window.addEventListener('resize', function() {
modal.style.top = document.documentElement.clientHeight / 2 - modal.offsetHeight / 2 + 'px';
modal.style.left = document.documentElement.clientWidth / 2 - modal.offsetWidth / 2 + 'px';
if (modal.getBoundingClientRect().top < 0) modal.style.top = 0;
body {
overflow-x: hidden;
}
a {
text-decoration: none;
}
input,
select,
<button data-modal="call_back" class="modalPopUp">заказать звонок</button>
<div id="modal_overlay" class="hidden" role="dialog" aria-labelledby="modal_title">
<div class="modal_content" role="document">
<h1 class="modal_title">Заказать обратный звонок</h1>
<form action="contact.php" method="post" class="modal_form" data-modal="call_back_form">
<input type="text" id="f-name" class="modal_form-input" name="contact-name" required placeholder="Ваше имя">
<input type="tel" id="f-tel" class="modal_form-input" name="contact-phone" required placeholder="Номер телефона">
<input type="submit" value="Отправить" class="send">
<input type="button" name="cancel" value="X" aria-label="Close">
</form>