Выдвижные контакты

Шпаргалки для себя

На каждой!!! странице, где нужен вывод контактов, разместить код(заменив данные на нужные):

<div class="contact-container">
    <div class="contact">
        <div>Пишите или звоните</div>
        <span class="close-btn"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></span>
        <ul  class="blabla">
            <li>
                <a href="https://t.me/WPmasterRS" aria-label="Напишите мне в телеграмм" rel="nofollow" target="_blank">
                    <i class="social-button social-button--telegram"></i>
                </a>
            </li>
            <li>
                <a href="https://vk.com/id801659509" aria-label="Я доступен в ВК" rel="nofollow" target="_blank">
                    <i class="social-button social-button--vkontakte"></i>
                </a>
            </li>
            <li>
                <a href="https://wa.me/79244841758" aria-label="Напишите мне в ватсап">
                    <i class="social-button social-button--whatsapp"></i>
                </a>
            </li>            
            <li>
                <a href="mailto:info@wprunet.ru" aria-label="Напишите мне на почту">
                    <i class="fa fa-envelope"></i>
                </a>
            </li>
            <li>
                <a href="tel:+79244841758" aria-label="Позвоните мне">
                    <i class="fa fa-phone"></i>
                </a>
            </li> 
        </ul>
    </div>
</div>
<button class="contact-btn">Связаться</button>
<script>
const contact_btn = document.querySelector('.contact-btn');
const close_btn = document.querySelector('.close-btn');
const contact_container = document.querySelector('.contact-container');
contact_btn.addEventListener('click', () => {
    contact_container.classList.toggle('visible')
});
close_btn.addEventListener('click', () => {
    contact_container.classList.remove('visible')
});
</script>
Выдвижные контакты

С фронтенда, в дополнительные стили, добавить следующие css:


/*всплывающая форма контактов*/
.contact-container * {
    box-sizing: content-box;
}    
.contact-container {
    position: fixed;
    right: 0;
    z-index: 99999999;
    bottom: 80px;
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
}
.contact-container.visible {
    transform: translateX(-10px);
}
.contact {    
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 16px 20px rgba(0,0,0,0.2);
    border: 5px solid #337AB7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: Verdana, sans-serif;  
    position: relative;
    height: 110px;    
    width: 340px;
    max-width: calc(100% - 10px);
}
.contact span.close-btn {
    width: 20px;
    height: 20px;
    border: 0;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
}
.contact span.close-btn svg {
    stroke: #337AB7;
    width: 20px;
    height: 20px;
}
.contact span.close-btn:focus {
    outline: none;
}
.contact div {
    background-color: #337AB7;
    border-radius: 0 0 10px 10px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 18px;
    padding: 2px 0 6px;
    position: absolute;
    top: 0;
    left: 50%;
    margin: 0;
    transform: translateX(-50%);
    text-align: center;
    width: 280px;
}
.contact ul {
    display: flex;
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.contact ul li {
    margin: 24px 6px 0 6px;
}
.contact ul li a {
    border: 4px solid #BFE2FF;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    font-size: 24px;
    color: #337AB7;
    width: 48px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}
.contact ul li a:hover {
    border-color: #337AB7;
    color: #000;
    box-shadow: 0 9px 12px -9px #337AB7;
}
.contact-btn {
    border-radius: 30px;
    background-color: #337AB7;
    border: 2px solid #337AB7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 16px 20px rgba(0,0,0,0.2);
    color: #fff;
    cursor: pointer;
    padding: 12px 20px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999999;
    font-size: 15px;
    font-weight: bold;
    line-height: 20px;
    font-family: Verdana, sans-serif;      
    text-transform: uppercase;
    transition: all 0.4s ease-in-out;
}
.contact-btn:hover {
    background-color: #ffffff;
    color: #337AB7;
}
.contact-btn:focus {
    outline: none;
}
@media screen and (max-width: 480px) {
    .contact-container.visible {
        transform: translateX(0px);
    }
    .contact-btn {
        right: 10px;
    }
}
/*and*/ 
/*всплывающая форма контактов*/
/*Убрать маркеры и прочее*/
.entry-content ul:not([class])>li:before{
    top: 0;
    font-size: 16px;
    color: #4d3bfe;
    border: none;
	content:none;/*Убрать маркеры*/
}
 .entry-content ul:not([class]) li{
    position: relative;
    padding-left: 0;/*Убрать отступ полей иконок друг от друга*/
    margin-top: .7em;
    margin-bottom: .7em;
}
.entry-content ul:not([class])
 {
    padding: 0;
    margin: 0;
    list-style: none;
    max-width: 100%;
    margin-top: 1.5em;
    margin-bottom: 0.1em;/*Убрать белое поле внизу скрывающее часть иконок*/
    overflow: hidden;
}
/*Конец формы*/
Пишите или звоните

WordPress для начинающих
ЭКСКЛЮЗИВ!
test

Получи свой сайт за 0 ₽

Иногда я делаю кому-то из читателей WPrunet сайт бесплатно. Таких набирается несколько в год.

Возможно, следующим будет твой!


А также: