$('.form__modal').submit(function (e) {
var errorsForm = false;
var nameVal = $('input[name="userNameOneClick"]').val();
if (nameVal.length < 3) {
errorsForm = true;
$('[name=userNameOneClick]').css('border', 'red 1px solid');
} else {
$('[name=userNameOneClick]').css('border', 'rgba(0,0,0,0.15) 1px solid');
}
var phoneVal = $('[name=phone]').val().replace(/[^\d.]/ig, '');
if (phoneVal.length < 11) {
errorsForm = true;
$('[name=phone]').css('border', 'red 1px solid');
} else {
$('[name=phone]').css('border', 'rgba(0,0,0,0.15) 1px solid');
}
return !errorsForm;
});
.account__file {
width: 230px;
padding: 0 20px;
padding-top: 75px;
border: 2px dashed #8eb9f5;
border-radius: 15px;
}
<div class="account__file">
<svg xmlns="http://www.w3.org/2000/svg" with="100%" height="100%" class="border">
<rect x="0" y="0" rx="30" width="100%" height="100%" class="border-rect" />
</svg>
<input type="file" name="file" id="file" />
<label for="file">
<span class="account__subtitle">drag & drop</span>
<div class="account__text">
<p>Upload only png, jpg, jpeg</p>
</div>
</label>
</div>
.border {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.border-rect {
stroke: #8eb9f5;
fill: #fff;
stroke-width: 1;
stroke-dasharray: 20;
}
var lines = $('.content.html_format').html().replace(/<br\/?>/g, "\n").split(/\n+/);
var new_text = $.map(lines, function(line) { if (line) return '<p>' + line + '</p>'; });
$('.content.html_format').html(new_text);
$('.content.html_format').html($('.content.html_format').html().replace(/<br\/?>\n/g, "\n").replace(/(.+)\n+/g, '<p>$1</p>\n');
<div class="b-blocks">
<div class="b-blocks__item">
<div class="b-blocks__item-inner"></div>
</div>
<div class="b-blocks__item">
<div class="b-blocks__item-inner"></div>
</div>
<div class="b-blocks__item">
<div class="b-blocks__item-inner"></div>
</div>
<div class="b-blocks__item">
<div class="b-blocks__item-inner"></div>
</div>
</div>
.b-blocks {
background: #fff;
padding: 20px;
width: 800px;
&::after {
content: '';
display: table;
clear: both;
}
&__item {
float: left;
box-sizing: border-box;
width: 48%;
height: 300px;
padding: 10px;
margin: 1%;
background-color: gray;
background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.5) 35px, rgba(255,255,255,.5) 70px);
&-inner {
width: 100%;
height: 100%;
background: #fff;
}
}
}
function getTimeRemaining(endtime) {
var t = Date.parse(endtime) - Date.parse(new Date());
var seconds = Math.floor((t / 1000) % 60);
var minutes = Math.floor((t / 1000 / 60) % 60);
var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
var days = Math.floor(t / (1000 * 60 * 60 * 24));
return {
'total': t,
'days': days,
'hours': hours,
'minutes': minutes,
'seconds': seconds
};
}
function initializeClock(id, endtime) {
var clock = document.getElementById(id);
var daysSpan = clock.querySelector('.days');
var hoursSpan = clock.querySelector('.hours');
var minutesSpan = clock.querySelector('.minutes');
var secondsSpan = clock.querySelector('.seconds');
function updateClock() {
var t = getTimeRemaining(endtime);
daysSpan.innerHTML = t.days;
hoursSpan.innerHTML = ('0' + t.hours).slice(-2);
minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);
secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);
if (t.total <= 0) {
var currentTime = endtime.getTime();
endtime.setTime(currentTime + 11000);
}
}
updateClock();
var timeinterval = setInterval(updateClock, 1000);
}
var deadline = new Date(Date.parse(new Date()) + 10000);
initializeClock('clockdiv', deadline);
::-webkit-scrollbar { width: 3px; height: 3px;}
::-webkit-scrollbar-button { background-color: #666; }
::-webkit-scrollbar-track { background-color: #999;}
::-webkit-scrollbar-track-piece { background-color: #ffffff;}
::-webkit-scrollbar-thumb { height: 50px; background-color: #666; border-radius: 3px;}
::-webkit-scrollbar-corner { background-color: #999;}}
::-webkit-resizer { background-color: #666;}
var slideNum = 0;
var tmp = document.location.pathname.match(/^\/(\d+)/);
if (tmp && tmp[1]) slideNum = tmp[1];
var slideNum = 0;
var tmp = document.location.search.match(/slide=(\d+)/);
if (tmp && tmp[1]) slideNum = tmp[1];