Старий registration form html. Форма входу та реєстрації за допомогою HTML5 та CSS3

Ми повинні використовувати CSS3 і значок font. The idea behind this demo is to show the user the login form і надає link to “switch” to the registration form.

Зверніть увагу, що це є для демо purpose тільки, це буде тільки робота в браузері, сприяючи: target pseudo class, і ви не повинні використовувати цей код на живому веб-сайті без solid fallback.

In the following, we will be going через Demo 1.

The HTML

У HTML, ми повинні брати до себе форми, показуючи другу одну з CSS. Here is the code, I'll explain some of the interesting parts later.

Log in

Sign up

We’ve added some HTML5 хороша вона і використана деяка кількість нових вхід. The input type=passwordавтоматично викидає те, що user typing and replaces it with dots (depending on browser). The input type=email enable the browser to check if what the user entered has format of a valid email address. We’ve also used the require=required attribute; browsers що підтримує цей atribut не буде літа користувача, який застосовується до форми цілісного цього поля, невикористовується, а JavaScript не вимагається.
The autocomplete=on attribute буде попереднього значення, що базується на earlier user input. We also used some nice placeholders for inputs that will show some guiding value when the input is not filled.

Now the two tricky parts. You might have noticed the two Links at the top of the form. Це є короткий трік, що буде робити свою форму добре, якщо грати з мішками, так, що це “шump” на довгих сторінках, коли ми клацніть на лінію пересування, а також trigger the:target pseudo-class.

Second little trick is related to use of icon font. We will be using a data-attribute to display the icons. By setting data-icon=”icon_character” with the according character in HTML we will just need one CSS attribute selector to style all the icons. Докладніше про це технологія на 24 Ways: Displaying Icons with Fonts and Data- Attributes .

The CSS

Для вичерпування code в цій літературі, я повинен оминути всі орієнтири, але ви будете, курс, йти в них. Once again, I'm using some pretty advanced CSS3 tricks that might not work in all browsers. Let's get started.

Styling both forms using CSS3

First, let’s give наші дві форми деякі загальні styling for the container.

#subscribe, #login( position: absolute; top: 0px; width: 88%; padding: 18px 6% 60px 6%; margin: 0 0 35px 0; background: rgb(247, 247, 247); border: 1p rgba(147, 184, 189,0.8); ; ) #login( z-index: 22; )

We've added a nice box shadow that's made of 2 shadows: an inset one to create the inner blue glow, an outside shadow. We'll explain з z-index in a bit.

In the following we will style the header with some background clipping:

/**** general text styling ****/ #wrapper h1( font-size: 48px; color: rgb(6, 106, 117); padding: 2px 0 10px 0; font-family: "FranchiseRegular"," Arial Narrow",Arial,sans-serif; font-weight: bold; text-align: center; padding-bottom: 30px; ) /** For moment only webkitsupports */ #wrapper h1( background: -webkit-repeating-linear-gradient(-45deg, rgb(18, 83, 93) , rgb(18, 83, 93) 20px, rgb(64, 111, 118) 20px, (64, 111, 118) 40px, rgb(18, 83, 93) 40px);-webkit-text-fill-color: transparent; "; display:block; width:100%; height:2px; margin-top:10px; ,1) 53%, rgba(147,184,189,0.8) 79%, rgba(147,184,189,0) 100%);

Note that at this moment only webkit browsers support background-clip: text, Так що будуть створені stripped background тільки для webkit тут, і клацніть його до тексту до add stripes to H1 title. Since the background-clip: textВластивості поточно тільки робіт в Webkit браузерах, я вирішив, що ти тільки з webkit prefix. Те, що reason why I split the CSS declaration в дві частини, і використовувати webkit prefixed gradient only. Only using the –webkit- prefix is ​​bad practice, it's only for demo purpose, and you should never do this on real a website! That’s also where the -webkit-text-fill-color: transparentПройти в handy: він здатний до того, щоб тільки transparentі background on webkit браузери, всі інші ones буде ignore it і дбати, що виконаний текст бар'єр fallback.

We also created a fading line under the title with help of the:after pseudo-class. Використовуйте 2px сильний gradient і зніміть до 0 opacity at both ends.

Now let’s style our inputs and give them a nicer look.

/**** advanced input styling ****/ /* placeholder */ ::-webkit-input-placeholder ( color: rgb(190, 188, 188); font-style: italic; ) input:-moz- placeholder, textarea:-moz-placeholder( color: rgb(190, 188, 188); font-style: italic; ) input ( outline: none; )

Вперше ми бачимо вхідні, і переміщуємо outline. But be careful here; outline helps the user know which input is focused, so if you remove it, ви повинні повідомити деякі:активні і:фокуси статей for the inputs.

/* all the input except submit and checkbox */ #wrapper input:not()( width: 92%; margin-top: 4px; padding: 10px 5px 10px 32px; border: 1px solid rgb(178, 178; box-sizing: content-box; border-radius: 3px;box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.6) inset; transition: all 0.2s linear; ) #wrapper input:not active, #wrapper input:not():focus( border: 1px solid rgba(91, 90, 90, 0.7); background: rgba(238, 236, 240, 0.2); box-shadow: 0px 1px 4px 0 168, 168, 168, 0.9) inset;

Тут ми використовуємо:не pseudo class, to style all inputs, except the checkbox. Я надійшов на:фокус і:активний стан, нескінченно я вирішив перейти до outline.

And now the fun part: the icon font. Для того, щоб скористатися використанням:беззастережно і:поза pseudo classes on inputs, ми повинні cheat a little bit: ми клацніть на значок до мітки, і place it in the input. I'm using the fontomas library які puts together some nice icons. Ви можете rearrange them to set icon на specific letter. Remember the data-icon attribute? It's where you should put the letter. I used data-icon='u' for user, 'e' for email, 'p' for password. Після того, як роздруковують сторінки, я завантажив font, і використовує fontsquirrel font generator для перетворення його в @font-face compatible format.

@font-face ( font-family: "FontomasCustomRegular"; src: url("fonts/fontomas-webfont.eot"); src: url("fonts/fontomas-webfont.eot?#iefix") format("embedded- opentype"), url("fonts/fontomas-webfont.woff") format("woff"), url("fonts/fontomas-webfont.ttf") format("truetype"), url("fonts/fontomas-webfont .svg#FontomasCustomRegular") format("svg"); font-weight: normal; font-style: normal; ) /** the magic icon trick ! **/ :after (content: attr(data-icon); font-family: "FontomasCustomRegular"; color: rgb(106, 159, 171); position: absolute; left: 10px; top: 35px; width: 30px; )

Yeah, that's it folks, you don't потрібно, щоб мати клас для кожної icon. We used content: attr(data-icon)натиснути напис від data-icon attribute, так що буде тільки вказати font, вибрати хороший колір і позицію його.

Now let’s style the submit button for both forms.

/*styling both submit buttons */ #wrapper p.button input( width: 30%; cursor: pointer; background: rgb(61, 157, 179); padding: 8px 5px; font-family: "BebasNeueRegular","Arial Narrow",Arial,sans-serif; color: #fff; font-size: 24px; border: 1px solid rgb(28, 108, 122); margin-bottom: 10px; 0, 0, 0.5), border-radius: 3px; rgb(210, 210, 210); transition: all 0.2s linear; ) #wrapper p.button input:hover( background: rgb(74, 179, 198); ) .button input:focus( background: rgb(40, 137, 154); position: relative; top: 1px; border: 1px solid rgb(12, 76, 87); box-shadow: 0px 1px 6px 4px r 0, 0, 0.2) inset;) p.login.button, p.signin.button( text-align: right; margin: 5px 0; )

Трік тут є використання box-shadow в порядку для створення деяких extra borders. Ви можете тільки використовувати один ліхтарик, але як багато box-shadows as you want. We will use the length value to create a “fake” second white border, 3px wide, with no blur.

Then we’ll style the checkbox, nothing very special here:

/* styling the checkbox "натисніть мені""/ .keeplogin( margin-top: -5px; ) .keeplogin input, .keeplogin label( display: inline-block; font-size: 12px; font-style: italic; ) .keeplogin input#loginkeeping( margin-right: 5px; ) .keeplogin label( width: 80%; )

Ви будете стилю внизу форми використання repeating linear gradients для створення striped background.

P.change_link( position: absolute; color: rgb(127, 124, 124); left: 0px; border-top: 1px solid rgb(219, 229, 232); border-radius: 0 0 5px 5px; background: rgb(225, 234, 235); 247, 247) rgb(247, 247, 247) 15px, rgb(225, 234, 235) 15px, rgb(225, 234, 235) 30px, rgb(247, 2) .change_link a ( display: inline-block; font-weight: bold; background: rgb(247, 248, 241); padding: 2px 6px; color: rgb(29, 162, 193); margin-left: 10px; text -decoration: none; border-radius: 4px; border: 1px solid rgb(203, 213, 214); transition: all 0.4s linear; ) #wrapper ); background: rgb(247, 247, 247); border: 1px solid rgb(74, 179, 198);

Now you’ll notice що we’ve got two nice forms, але we really want only one to show at a time. So now is time for some animations!!

Creating the switching animation

Перший, щоб зробити, щоб вийти на дві форми, щоб встановити оpacity до 0:

#register(z-index: 21; opacity: 0; )

Remember that our login form had з-index 22? We will give the second form a z-index of 21, to put it “under” the login form.

And now the really good part: switching the forms using the:target pseudo class. What you really have to understand about:target, is that we will use anchors to make the transition. Normal behavior of anchor link, is to jump to the target in the page. Але ми не будемо йти на ходу будь-де, ми тільки хотіли б перетворювати форми. And here comes our trick using the two links at the top of the page. Натисніть на прямому зв'язку до другої форми, і зростаючий, щоб зробити “jumping” ефект, we actually put the two links at the top of the page and give them display: none. Це буде avoid any page jump. Credit where credit’s due: Я вивів цей трюк на CSS3 create (in French).

#toregister:target ~ #wrapper #register, #tologin:target ~ #wrapper #login( z-index: 22; animation-name: fadeInLeft; animation-delay: .1s; )

So this is what happens: when we click on the Join us button, we trigger the #toregister. Будьте до animation, використовуючи симулятор selector ~ до find our #register element. We use an animation called fadeInLeft. Since we “hide” form using zero opacity, we will use an animation that fades in, to make it appear. We’ve also змінюється z-index, щоб зробити це з'ясувати на верхній частині іншої форми.
Ті самі happens for інші форми.

And here is the code for the animation. Ви можете використовувати CSS3 animation framework з Dan Eden і adapted it for this tutorial.

Animate( animation-duration: 0.5s; animation-timing-function: ease; animation-fill-mode: both; ) @keyframes fadeInLeft ( 0% ( opacity: 0; transform: translateX(-20px); ) 100% ( opacity : 1; transform: translateX(0); ) )

Form that is “disappearing” will have another animation which will make it fade out to the left:

#toregister:target ~ #wrapper #login, #tologin:target ~ #wrapper #register( animation-name: fadeOutLeftBig; ) @keyframes fadeOutLeft ( 0% ( opacity: 1; transform: translateX(0); ) 100% ( opacity : 0; transform: translateX(-20px); ) )

Ви можете використовувати інші animations від Dan Eden's animate.css: just adjust your .animate class and replace the animation names. Ви будете find деякі custom animations at end of the animate-custom.css файл.

Well, що це folks. I hope you enjoyed the tutorial!

Please note, that in some browsers background-clip: text is not supported. У браузері Internet Explorer 9 трансляції та animations не працює, тому що не буде простий спосіб перемикання. В Internet Explorer 8 і нижче:target pseudo-class is not supported, so it won't work at all (you'll just see the login form).

Тут є прикладом Registration form using HTML. Тут programmer може бути як багато "Text Field" як he/she wants. Ім'я в середині Text Field називається "Label". Наприкінці registration form їх є "ADD" button behnd which any desired link can be used. Onclick clicked it буде redirect to that particular destination.

Тут є прикладом Registration form using HTML. Тут programmer може бути як багато "Text Field" як he/she wants. Ім'я в середині Text Field називається "Label". Наприкінці registration form їх є "ADD" button behnd which any desired link can be used. Onclick clicked it буде redirect to that particular destination.

HTML Code for registration form

Тут є прикладом Registration form using HTML. Тут programmer може бути як багато "Text Field" як he/she wants. Ім'я в середині Text Field називається "Label". Наприкінці registration form їх є "ADD" button behnd which any desired link can be used. Onclick clicked it буде redirect to that particular destination.

У цьому прикладі буде показано 9 "Text Field". Частина тексту Box може бути змінена як до потреби.

registration.html

registration form

Registration form

Online Signup and registration forms, є важливі аспекти майже всього web design. Якщо ваші веб-сайти потребують активної contribution від visitors, то ви повинні мати висновки про те, що вони можуть реєструвати або підписувати, щоб відкрити свій рахунок з вашим сайтом. Users register with a site до download files or post articles, to purchase something & son depending on theme of a site. Записні форми, є досконалим elaborate, як для широкого діапазону особистих і contact details від людей-відповідь, ім'я, gender, job, brief biography and so on. Але найбільш важливий аспект всіх HTML5 Signup & Registration Forms є name, username, password, gender і account creation button.

XtraForm – Bootstrap 3 Xtra Animated Form HTML5 Format

Цей bootstrap registration form template is coded based on jQuery mobile JavaScript which makes it compatible across many platforms and also make it very customizable. html5 form template is available for free download here.

Multi-Step Signup Form With CSS3 and jQuery

Цей вид registration form in html with CSS3 help in sectioning of different parts of long sign up form, thus making it easy to maintain records whereas jQuery ensures that this forms can work on a wide number of platforms. Download the sign up page template from here to build for for for your own site today.

Authentix – Ready to Integrate User System HTML Format

Цей різновид html5 form template is created by simple PHP script for signing up, logging in or authenticating users. Цей вид Login і registration form templates може також надавати feature of secure sessions. Download one from here to implement one of these in your own site.

Цей вид registration form template використовує CSS для registration form і є дуже сприятливим в створенні sign up forms meant for android platform. Цей матеріал для html registration form template is available for download below.

Codepen Sign Up Form in HTML Format Download

З її revamped čerstvий дизайн і дуже простий interface, цей різновид html5 form templates буде been carefully optimized для створення нових user registration forms. З його використанням у різних сферах, ці символи формою templates є реально приємними і може бути зареєстрований праворуч від link below.

Formplexy – CSS Forms with Validation & WP Support HTML Format

Цей малюнок html registration form є дуже бідним і customizable для будь-якого розробника. Це є надзвичайно швидким виконанням CSS форми з jQuery. Це також має WordPress support, соціальні кнопки і option forgotten password handling. Завантажити форму від неї, щоб використовувати її в своєму місці.

Download Login & Registration Form with HTML5

Цей різновид registration form template використовується для підпису і повідомлень про те, що він є дуже простим і використовується дуже простий coding. Цей малюнок html5 форми templates find a wide number of uses due to their light structure and can be downloaded right from here.

Tab Login & Sign Up Forms HTML Download

Цей малюнок символьної форми templates є widely використовуваний до їх tab oriented look which is very helpful in categorizing thing. Цей тип html5 form templates може бути downloaded here to be used for long sign up forms with many fields for taking information.

Signup Form Flat Template Download

З її minimalistic look , цей вид registration form template є широко використовуваний для їх простий і чистий вигляд і до факту, що цей малюнок html5 signup template can work on many platforms. Ви можете отримати одну з цих форм тут для download.

Flat Look HTML5 & CSS3 Signup Form Template Free Download

Equipped with simplicity and cleanliness of html5 coding coupled up with security of CSS3 signup security with jQuery, this kind of signup form template is one of best options you can find for your site. Want to know how will it look for your site? Just quickly download it from the link below to check it out.

How to Create Registration Page?

Натисніть на веб-сторінці, що містять веб-сайти, які містять реєстрацію форми, що сторінки веб-сайтів можуть бути розміщені з веб-сайтом і доступом до придатних можливостей, послуг або товарів. Записна сторінка розглядається як найбільш важливий аспект веб-сайту як його дає вам бути більш interactive з нашими користувачами. Для створення реєстраційної сторінки, першу, що ви повинні скористатися адресою нової сторінки через свою CMS і продовжувати реєстрацію форми до неї. Ви можете побачити велику кількість registration form templates online for easy and quick installation on to your page.

Awesome Design HTML5 і CSS3 Login & Sign Up Forms

Це HTML5 і CSS3 логотип і подібна форма комісія з чудовим дизайном з частково розділеними полями. Form is handy and easy to install. Just download the form and you can customize it as per your preferences.

Simple, Highly Functional and Effective HTML5 Register Form

HTML5 базується на registration form ideal for all kinds of website like college, medical, shopping, school and even more. З'єднатися з оптимізованим дизайном для забезпечення кращого виклику до дії веб-сайту користувача. Best part with thes templates is that along with their standard use, you can customize the fields, size as well as color of the form elements quite easily in minutes. Будь-який потрібний student registration form, e-commerce registration form, event registration form або більше, ви можете знайти повторювані форми для всіх видів вашого sign-up форми потреб. Існують численні такі registration і Login Templates, які дають вам надійні, ефективні і елегантні форми, щоб бути пов'язані з вашими веб-сайтами. Ви потребуєте, щоб їх downloaded в кількох clicks і до minor customizations is necessary.


Доброго дня, дорогий хабрадруг! У цьому туторіалі ми навчимося створювати дві форми HTML5: форма входу та форма реєстрації. Ці форми будуть змінюватися один з одним місцями за допомогою псевдокласу CSS3: target. Ми будемо використовувати CSS3 та шрифт з іконками. Ідея цього демо у тому, щоб показати користувачеві форму входу та надати йому посилання “переходу” до форми реєстрації.
У цьому туторіалі я докладно розповім про те, як створювати ефект як у Демо 1 .

HTML

Log in

Sign up


Тут ми використали кілька прийомів HTML5. Наприклад, елемент type=passwordавтоматично приховує те, що користувач друкує та замінює символи крапками або зірочками (залежить від браузера). Елемент type=emailдозволяє браузеру перевірити правильність формату email адреси. Крім того, ми використовували параметр require=required; браузери, що підтримують цей параметр, не дозволять користувачеві відправити форму до того часу, поки поле не заповнене, JavaScript тут не потрібно. Параметр autocomplete=onбуде автоматично заповнювати деякі поля. Ми також використовували текст, що заміщується, який допоможе користувачеві при заповненні форми.

Тепер про два хитрі моменти. Ви напевно помітили два посилання на початку форми. Цей спритний прийом дозволить нашій формі поводитися правильно під час роботи з якорями (anchors).

Другий момент пов'язаний із застосуванням шрифту з іконками. Ми будемо використовувати data-attribute для відображення іконок. Встановлюючи параметр data-icon=”icon_character”з відповідними символами HTML, ми повинні призначити лише одне правило в CSS для встановлення стилю всіх іконок. Детальніше про цей прийом можна почитати на сайті: 24 Ways: Displaying Icons with Fonts and Data-Attributes.

CSS

Для чистоти коду я пропущу базові параметри (html, body тощо), але ви зможете знайти їх у вихідних файлах. Повторюю, що я використовую прийоми CSS3, які не працюватимуть у всіх браузерах. Отже, давайте ж почнемо!

Стилізуємо форми, використовуючи CSS3

По-перше, давайте призначимо нашим формам базовий стиль.

#subscribe, #login( position: absolute; top: 0px; width: 88%; padding: 18px 6% 60px 6%; margin: 0 0 35px 0; background: rgb(247, 247, 247); border: 1p rgba(147, 184, 189,0.8); ; ) #login( z-index: 22; )

Тут ми призначимо властивості для шапки:

/**** текст ****/ #wrapper h1( font-size: 48px; color: rgb(6, 106, 117); padding: 2px 0 10px 0; font-family: "FranchiseRegular","Arial Narrow ",Arial,sans-serif; font-weight: bold; text-align: center; padding-bottom: 30px; ) /** На даний момент тільки webkit підтримує background-clip:text; **/ #wrapper h1( background: -webkit-repeating-linear-gradient(-45deg, rgb(18, 83, 93) , rgb(18, 83, 93) 20px, rgb(64, 111, 118) 20px, rgb(64, 111, 118) 40px, rgb(18, 83, 93) 40px);-webkit-text-fill-color: transparent; " "; display:block; width:100%; height:2px; margin-top:10px; 147,184,189,1) 53%, rgba(147,184,189,0.8) 79%, rgba(147,184,189,0) 100%);

Зауважу, що сьогодні лише браузери з webkit підтримують background-clip: textТому ми зробимо смугастий фон тільки для webkit і прив'яжемо його до заголовка H1. Оскільки параметр background-clip: textпрацює лише у Webkit браузерах, я вирішив працювати лише з властивостями webkit. Саме тому я розділив CSS на дві частини та використовував лише градієнт webkit. Однак, ви не повинні використовувати лише webkit на своїх вебсайтах! Так, наприклад, параметр -webkit-text-fill-color: transparentдозволяє нам мати прозоре тло, але тільки для браузерів webkit, всі інші браузери проігнорують цю властивість.

Ми також створили тонку лінію під заголовком за допомогою елемента: after pseudo-class. Ми використовували градієнт з 2px у висоту та зменшили прозорість по краях до нуля.

Тепер давайте подбаємо про поля введення і надамо їм приємного вигляду.

/**** advanced input styling ****/ /* placeholder */ ::-webkit-input-placeholder ( color: rgb(190, 188, 188); font-style: italic; ) input:-moz- placeholder, textarea:-moz-placeholder( color: rgb(190, 188, 188); font-style: italic; ) input ( outline: none; )

По-перше, ми стилізуємо поля та приберемо обведення. Але будьте обережні: обведення допомагає користувачеві зрозуміти, на якому полі він знаходиться. Якщо ж ви приберете її, потрібно застосувати властивості: active і: focus.

/* всі поля виключають submit і checkbox */ #wrapper input:not()( width: 92%; margin-top: 4px; padding: 10px 5px 10px 32px; border: 1px solid rgb(178, 178, 17) -sizing: content-box; border-radius: 3px;box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.6) inset; transition: all 0.2s linear; ) #wrapper input:not() , #wrapper input:not():focus( border: 1px solid rgba(91, 90, 90, 0.7); background: rgba(238, 236, 240, 0.2); box-shadow: 0px 1px 4px 0p , 168, 168, 0.9) inset;

Тут ми використовували псевдо клас:not, щоб стилізувати всі поля, крім чекбоксів. Крім того, я вирішив прибрати обведення і додав властивості: focus і active.

Тепер час весело: шрифт з іконками. Оскільки ми не можемо використовувати псевдо-класи:before та:after, ми додамо іконку до параметра label, а потім розмістимо в полі. Я використовуватиму бібліотеку fontomas. Ви можете зіставити іконки з відповідною літерою. Пам'ятайте атрибут data-icon? Саме до нього потрібно вставити букву. Я використовував data-icon='u'для логіну, 'e' для email, 'p' для пароля. Як тільки я вибрав літери, я завантажив шрифт і використав генератор шрифтів fontsquirrel для конвертації у формат, придатний для @font-face.

@font-face ( font-family: "FontomasCustomRegular"; src: url("fonts/fontomas-webfont.eot"); src: url("fonts/fontomas-webfont.eot?#iefix") format("embedded- opentype"), url("fonts/fontomas-webfont.woff") format("woff"), url("fonts/fontomas-webfont.ttf") format("truetype"), url("fonts/fontomas-webfont .svg#FontomasCustomRegular") format("svg"); font-weight: normal; font-style: normal; ) /** магічний трюк! **/ :after (content: attr(data-icon); font-family: "FontomasCustomRegular"; color: rgb(106, 159, 171); position: absolute; left: 10px; top: 35px; width: 30px; )

Ось, власне, і все. Вам не потрібно мати окремий клас для кожної іконки. Ми використовували параметр content: attr(data-icon), щоб отримати літеру з атрибуту data-icon. Таким чином, нам потрібно лише призначити шрифт, вибрати колір та розмістити іконку.

Тепер призначимо правила для кнопки надсилання форми.

/*стилізуємо обидві кнопки*/ #wrapper p.button input( width: 30%; cursor: pointer; background: rgb(61, 157, 179); padding: 8px 5px; font-family: "BebasNeueRegular","Arial Narrow ",Arial,sans-serif; color: #fff; font-size: 24px; border: 1px solid rgb(28, 108, 122); margin-bottom: 10px; , 0, 0.5), border-radius: 3px; (210, 210, 210); transition: all 0.2s linear; ) # wrapper p.button input: button input:focus( background: rgb(40, 137, 154); position: relative; top: 1px; border: 1px solid rgb(12, 76, 87); box-shadow: 0px 1px 6px 4px rgb , 0, 0.2) inset;) p.login.button, p.signin.button( text-align: right; margin: 5px 0; )

Трюк полягає в тому, щоб використовувати box-shadow, щоб створити декілька рамок. Звичайно, ви можете використовувати лише одну рамку, але також можна і кілька. Ми будемо використовувати параметр length для створення “фейкової” другої білої рамки, 3px завширшки, без розмиття.

Тепер стилізуємо чекбокс, тут ми нічого незвичайного не створимо:

/* стилізуємо чекбокс "запам'ятати мене"*/ .keeplogin( margin-top: -5px; ) .keeplogin input, .keeplogin label( display: inline-block; input#loginkeeping( margin-right: 5px; ) .keeplogin label( width: 80%; )

Стилізуємо підвал форми, використовуючи множинні лінійні градієнти, щоб створити смугастий градієнт.

P.change_link( position: absolute; color: rgb(127, 124, 124); left: 0px; border-top: 1px solid rgb(219, 229, 232); border-radius: 0 0 5px 5px; background: rgb(225, 234, 235); 247, 247) rgb(247, 247, 247) 15px, rgb(225, 234, 235) 15px, rgb(225, 234, 235) 30px, rgb(247, 2) .change_link a ( display: inline-block; font-weight: bold; background: rgb(247, 248, 241); padding: 2px 6px; color: rgb(29, 162, 193); margin-left: 10px; text -decoration: none; border-radius: 4px; border: 1px solid rgb(203, 213, 214); transition: all 0.4s linear; ) #wrapper ); background: rgb(247, 247, 247); border: 1px solid rgb(74, 179, 198);

Зараз ви бачите, що у нас дві приємні форми, але ми хочемо, щоб відображалася тільки одна з них. Настав час анімації!

Створюємо анімацію

Перше, що ми зробимо, ми сховаємо другу форму, призначивши opacity на 0:

#register(z-index: 21; opacity: 0; )

Помнете, що форма входу має параметр z-index: 22? Другий формі ми призначимо цей параметр 21, щоб поставити його "під" форму входу.

Тепер найцікавіше: міняємо форми місцями, використовуючи псевдо клас: target. Вам потрібно зрозуміти одну річ з приводу: target: для переміщення ми будемо використовувати якоря. Нормальна поведінка якоря – стрибок на певний елемент сторінки. Але ми хочемо цього, лише хочемо змінити форми місцями. І тут приходить на допомогу наш трюк із використанням двох посилань на початку сторінки. Замість того, щоб направити нас прямо на другу форму, ризикуючи випробувати ефект “стрибка”, ми надамо посиланням параметр display: none. Це допоможе уникнути стрибків. Я виявив цей трюк на сайті: CSS3 create (французька мова).

#toregister:target ~ #wrapper #register, #tologin:target ~ #wrapper #login( z-index: 22; animation-name: fadeInLeft; animation-delay: .1s; )

Ось що відбувається: коли ми клацаємо на кнопку Приєднатися, ми прямуємо на #toregister. Потім відбувається анімація і потім переходимо на елемент #register. Ми використовуємо анімацію під назвою fadeInLeft. Оскільки ми “ховаємо” форму, використовуючи нульову прозорість, ми застосуємо анімацію, яка поступово з'являтиметься. Ми також змінили z-index, щоб вона з'явилася поверх іншої форми. Те саме відбувається для іншої форми same happens for the other form.
Ось код для анімації. Ми використовували CSS3 animation framework від Dan Eden та адаптували цей фреймворк під наш туторіал.

Animate( animation-duration: 0.5s; animation-timing-function: ease; animation-fill-mode: both; ) @keyframes fadeInLeft ( 0% ( opacity: 0; transform: translateX(-20px); ) 100% ( opacity : 1; transform: translateX(0); ) )

Форма, яка “зникає”, матиме анімацію затемнення вліво:

#toregister:target ~ #wrapper #login, #tologin:target ~ #wrapper #register( animation-name: fadeOutLeftBig; ) @keyframes fadeOutLeft ( 0% ( opacity: 1; transform: translateX(0); ) 100% ( opacity : 0; transform: translateX(-20px); ) )

Тепер ви можете використовувати інші анімації Dan Eden' за допомогою файлу animate.css: просто змініть клас.animate class і назви анімацій. Ви також знайдете кілька інших анімацій в кінці файлу animate-custom.css file.

Ось і все, друзі. Сподіваюся вам сподобався цей туторіал!

Зауважимо, що у деяких браузерах параметр background-clip: textне підтримується. В Internet Explorer 9 анімації не працюють. В Internet Explorer 8 і нижче псевдо-клас: target pseudo-class не підтримується, тому там цей ефект взагалі не працюватиме.

P.S.Усі зауваження з приводу перекладу із задоволенням прийму в особу. Дякую!

Теги: Додати теги



Останні матеріали розділу:

Атф та її роль в обміні речовин У тварин атф синтезується в
Атф та її роль в обміні речовин У тварин атф синтезується в

Способи отримання енергії в клітці У клітці існують чотири основні процеси, що забезпечують вивільнення енергії з хімічних зв'язків при...

Вестерн блотінг (вестерн-блот, білковий імуноблот, Western bloting) Вестерн блоттинг помилки під час виконання
Вестерн блотінг (вестерн-блот, білковий імуноблот, Western bloting) Вестерн блоттинг помилки під час виконання

Блоттінг (від англ. "blot" - пляма) - перенесення НК, білків та ліпідів на тверду підкладку, наприклад, мембрану та їх іммобілізація. Методи...

Медіальний поздовжній пучок Введення в анатомію людини
Медіальний поздовжній пучок Введення в анатомію людини

Пучок поздовжній медіальний (f. longitudinalis medialis, PNA, BNA, JNA) П. нервових волокон, що починається від проміжного і центрального ядра.