1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/lhammer-You-need-to-know-css

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
elastic.md 4.6 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Отправлено 10.03.2025 04:31 b50c8d4

Эластичное сглаживание

?> Обзор: :point_right: анимация, переход

Все переходы должны выполняться анимацией

Анимационный подход :thumbsup:

<script v-pre type="text/x-template" id="elastic-animation"> <style> main { width: 100%; height: 229px; display: flex; } label { margin: auto; } input { display: block; width: 229px; padding: .8em; outline: none; border: 1px solid #e3e3e3; border-radius: 2px; } input:hover { border: 1px solid #b4a078; } input:focus { border: 1px solid #b4a078; box-shadow: 0 0 0 2px rgba(180, 160, 120, 0.2); } .poptip { display: inline-block; width: 236px; font-size: 13px; padding: .6em; background: #fafafa; position: relative; margin-left: -3px; margin-top: 3px; border-radius: 2px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .23456)); transform-origin: 15px -6px; } .poptip::before { content: ""; position: absolute; top: -6px; left: 10px; border: 9px solid transparent; border-bottom-color: #fafafa; border-top-width: 0; } input:not(:focus) + .poptip{ transform: scale(0); animation: elastic-dec .25s; } input:focus + .poptip{ transform: scale(1); animation: elastic-grow .45s; } @keyframes elastic-grow{ from { transform: scale(0); } 70% { transform: scale(1.1); animation-timing-function: cubic-bezier(.1, .25, .1, .25); } } @keyframes elastic-dec{ from { transform: scale(1); } to { transform: scale(0); animation-timing-function: cubic-bezier(.25, .1, .25, .1); } } </style> Имя пользователя: Поддерживает только буквы, цифры и нижнее подчеркивание! <script> </script> </script>> Три кубических биэлемента `cubic-bezier` + `transition` подход

<script v-pre type="text/x-template" id="elastic-transtion">

<style> main { width: 100%; height: 229px; display: flex; } label { margin: auto; } input { display: block; width: 229px; padding: .8em; outline: none; border: 1px solid #e3e3e3; border-radius: 2px; } input:hover { border: 1px solid #b4a078; } input:focus { border: 1px solid #b4a078; box-shadow: 0 0 0 2px rgba(180, 160, 120, 0.2); } input:not(:focus) + .poptip { transform: scale(0); transition: transform .25s cubic-bezier(.25, .1, .25, .1); } input:focus + .poptip { transform: scale(1); transition: transform .4s cubic-bezier(.29, .15, .5, 1.46); } .poptip { display: inline-block; width: 236px; font-size: 13px; padding: .6em; background: #fafafa; position: relative; margin-left: -3px; margin-top: 3px; border-radius: 2px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .23456)); transform-origin: 15px -6px; } .poptip::before { content: ""; position: absolute; top: -6px; left: 10px; border: 9px solid transparent; border-bottom-color: #fafafa; border-top-width: 0; } </style> Имя пользователя: Поддерживается только сочетание букв, цифр и нижнего подчеркивания! <script> </script> </script>Трижды кубическая Безье `cubic-bezier`主要用于生成动画的速度曲线函数,其语法为 `cubic-bezier(, , , )`。更多信息,请参阅 [Lea Verou](http://lea.verou.me/about/) 的可视化工具 [cubic-bezier](http://cubic-bezier.com/)

Поддержка браузерами

<iframe src="https://caniuse.bitsofco.de/embed/index.html?feat=transforms2d&periods=future_1,current,past_1,past_2,past_3&accessible-colours=false" frameborder="0" width="100%" height="458px"></iframe> <iframe src="https://caniuse.bitsofco.de/embed/index.html?feat=css-animation&periods=future_1,current,past_1,past_2,past_3&accessible-colours=false" frameborder="0" width="100%" height="436px"></iframe>

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/lhammer-You-need-to-know-css.git
git@api.gitlife.ru:oschina-mirror/lhammer-You-need-to-know-css.git
oschina-mirror
lhammer-You-need-to-know-css
lhammer-You-need-to-know-css
master