Skip to content

Instantly share code, notes, and snippets.

@AntonLitvin
AntonLitvin / Modal bounce.html
Last active March 16, 2018 21:35
Bounce and shake animation on Modal form
<button class="login">login</button>
<div class="modal-content">
<h2>Личный кабинет</h2>
<p>Введите пожалуйста свой логин и пароль</p>
<form action="action">
<input class="login-field" type="text" name="login" placeholder="Login">
<input class="password-field" type="password" name="password" placeholder="Password" >
<input type="checkbox" name="remember" id="remember">
<label for="remember"><span></span>Remember me</label>
@AntonLitvin
AntonLitvin / hover-state.js
Last active March 16, 2018 21:27
Блокировка событий hover при прокрутке страницы
//css
.disable-hover,
.disable-hover * {
pointer-events: none !important;
}
//js
var body = document.body,
timer;
@AntonLitvin
AntonLitvin / Cool links.html
Last active March 16, 2018 21:31
by HTML Academy
(function(){
var timerId;
var mytimer;
function countdown() {
var minutes = Math.floor((mytimer % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((mytimer % (1000 * 60)) / 1000);
@AntonLitvin
AntonLitvin / Timer.html
Last active March 16, 2018 21:17
Рабочий таймер обратного отсчета
//Каждый раз отсчет показывает одно и то же время
<div class="timer timer-showed" data-time="324494">
<div class="timer-d">
<span>3</span>
<span>дня</span>
</div>
<div class="timer-h">
<span>18</span>
<span>часов</span>
// Необходимые плагины
Advanced Custom Fields
Custom Post Types UI (можно делать вручную через register_post_type())
Contact Form 7
Jquery Validation For Contact Form 7
Yoast SEO
WP Super Cache
1.
header и footer перемещаем в отдельные файлы header.php и footer.php
<div class="mouse-icon"><div class="wheel"></div></div>
<style>
/* ---------------------------------------------- /*
* Mouse animate icon
/* ---------------------------------------------- */
.mouse-icon {
border: 2px solid #000;
border-radius: 16px;
//Easy Form Validator
//Example: $("form").evalid("Error message");
(function($) {
$.fn.evalid = function(req_text) {
$(this).find("input[type], textarea").each(function() {
$(this).after("<p class='form_error_message'>" + req_text + "").next().hide();
});
<?php
// Only process POST reqeusts.
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Get the form fields and remove whitespace.
$name = strip_tags(trim($_POST["name"]));
$name = str_replace(array("\r","\n"),array(" "," "),$name);
$email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL);
$message = trim($_POST["message"]);