今天给大家秀一款带有发光动画的HTML5表单,挺酷的,效果图如下:
当表单获取焦点时,表单四周就会呈现出发光动画的效果,并不断地进行颜色渐变;当表单失去焦点时,停止发光。其中颜色渐变的动画只有基于webkit的浏览器才有效果,比如chrome和safari。下面简单贴一下实现这个发光HTML5表单的CSS代码和HTML代码,如果你喜欢可以将它分享给你的朋友。
HTML代码如下:
<div class="rain"> <div class="border start"> <form> <label for="email">Email</label> <input name="email" type="text" placeholder="Email"/> <label for="pass">Password</label> <input name="pass" type="password" placeholder="Password"/> <input type="submit" value="LOG IN"/> </form> </div> </div>
CSS代码如下:
<style> body{ background: #000; color: #DDD; font-family: 'Helvetica', 'Lucida Grande', 'Arial', sans-serif; } .border, .rain{ height: 170px; width: 320px; } /* Layout with mask */ .rain{ padding: 10px 12px 12px 10px; -moz-box-shadow: 10px 10px 10px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset; -webkit-box-shadow: 8px 8px 8px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset; box-shadow: 8px 8px 8px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset; margin: 100px auto; } /* Artifical "border" to clear border to bypass mask */ .border{ padding: 1px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } .border, .rain, .border.start, .rain.start{ background-repeat: repeat-x, repeat-x, repeat-x, repeat-x; background-position: 0 0, 0 0, 0 0, 0 0; /* Blue-ish Green Fallback for Mozilla */ background-image: -moz-linear-gradient(left, #09BA5E 0%, #00C7CE 15%, #3472CF 26%, #00C7CE 48%, #0CCF91 91%, #09BA5E 100%); /* Add "Highlight" Texture to the Animation */ background-image: -webkit-gradient(linear, left top, right top, color-stop(1%,rgba(0,0,0,.3)), color-stop(23%,rgba(0,0,0,.1)), color-stop(40%,rgba(255,231,87,.1)), color-stop(61%,rgba(255,231,87,.2)), color-stop(70%,rgba(255,231,87,.1)), color-stop(80%,rgba(0,0,0,.1)), color-stop(100%,rgba(0,0,0,.25))); /* Starting Color */ background-color: #39f; /* Just do something for IE-suck */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00BA1B', endColorstr='#00BA1B',GradientType=1 ); } /* Non-keyframe fallback animation */ .border.end, .rain.end{ -moz-transition-property: background-position; -moz-transition-duration: 30s; -moz-transition-timing-function: linear; -webkit-transition-property: background-position; -webkit-transition-duration: 30s; -webkit-transition-timing-function: linear; -o-transition-property: background-position; -o-transition-duration: 30s; -o-transition-timing-function: linear; transition-property: background-position; transition-duration: 30s; transition-timing-function: linear; background-position: -5400px 0, -4600px 0, -3800px 0, -3000px 0; } /* Keyfram-licious animation */ @-webkit-keyframes colors { 0% {background-color: #39f;} 15% {background-color: #F246C9;} 30% {background-color: #4453F2;} 45% {background-color: #44F262;} 60% {background-color: #F257D4;} 75% {background-color: #EDF255;} 90% {background-color: #F20006;} 100% {background-color: #39f;} } .border,.rain{ -webkit-animation-direction: normal; -webkit-animation-duration: 20s; -webkit-animation-iteration-count: infinite; -webkit-animation-name: colors; -webkit-animation-timing-function: ease; } /* In-Active State Style */ .border.unfocus{ background: #333 !important; -moz-box-shadow: 0px 0px 15px rgba(255,255,255,.2); -webkit-box-shadow: 0px 0px 15px rgba(255,255,255,.2); box-shadow: 0px 0px 15px rgba(255,255,255,.2); -webkit-animation-name: none; } .rain.unfocus{ background: #000 !important; -webkit-animation-name: none; } /* Regular Form Styles */ form{ background: #212121; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; height: 100%; width: 100%; background: -moz-radial-gradient(50% 46% 90deg,circle closest-corner, #242424, #090909); background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 150, from(#242424), to(#090909)); } form label{ display: block; padding: 10px 10px 5px 15px; font-size: 11px; color: #777; } form input{ display: block; margin: 5px 10px 10px 15px; width: 85%; background: #111; -moz-box-shadow: 0px 0px 4px #000 inset; -webkit-box-shadow: 0px 0px 4px #000 inset; box-shadow: 0px 0px 4px #000 inset; outline: 1px solid #333; border: 1px solid #000; padding: 5px; color: #444; font-size: 16px; } form input:focus{ outline: 1px solid #555; color: #FFF; } input[type="submit"]{ color: #999; padding: 5px 10px; float: right; margin: 40px 0; border: 1px solid #000; font-weight: lighter; -moz-border-radius: 15px; -webkit-border-radius: 15px; border-radius: 15px; background: #45484d; background: -moz-linear-gradient(top, #222 0%, #111 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222), color-stop(100%,#111)); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22222', endColorstr='#11111',GradientType=0 ); -moz-box-shadow: 0px 1px 1px #000, 0px 1px 0px rgba(255,255,255,.3) inset; -webkit-box-shadow: 0px 1px 1px #000, 0px 1px 0px rgba(255,255,255,.3) inset; box-shadow: 0px 1px 1px #000,0px 1px 0px rgba(255,255,255,.3) inset; text-shadow: 0 1px 1px #000; outline: none; width:80px; } </style>
其中,表单焦点切换需要jquery支持,js代码如下:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script> $(function(){ var $form_inputs = $('form input'); var $rainbow_and_border = $('.rain, .border'); /* Used to provide loping animations in fallback mode */ $form_inputs.bind('focus', function(){ $rainbow_and_border.addClass('end').removeClass('unfocus start'); }); $form_inputs.bind('blur', function(){ $rainbow_and_border.addClass('unfocus start').removeClass('end'); }); $form_inputs.first().delay(800).queue(function() { $(this).focus(); }); }); </script>
以上就是一款带有发光动画的HTML5表单的内容,更多相关内容请关注PHP中文网(www.php.cn)!

HTML5 코드는 태그, 요소 및 속성으로 구성됩니다. 1. 태그는 컨텐츠 유형을 정의하고 다음과 같은 각도 브래킷으로 둘러싸여 있습니다. 2. 요소는 컨텐츠와 같은 시작 태그, 내용 및 엔드 태그로 구성됩니다. 3. 속성 시작 태그에서 키 값 쌍을 정의하고 기능을 향상시킵니다. 웹 구조를 구축하기위한 기본 단위입니다.

HTML5는 현대적인 웹 페이지를 구축하는 핵심 기술로 많은 새로운 요소와 기능을 제공합니다. 1. HTML5는 웹 페이지 구조 및 SEO를 향상시키는 의미 론적 요소를 소개합니다. 2. 멀티미디어 요소를 지원하고 플러그인없이 미디어를 포함시킵니다. 3. 양식은 새로운 입력 유형 및 검증 속성을 향상시켜 검증 프로세스를 단순화합니다. 4. 웹 페이지 성능 및 사용자 경험을 향상시키기 위해 오프라인 및 로컬 스토리지 기능을 제공합니다.

H5 코드에 대한 모범 사례는 다음과 같습니다. 1. 올바른 문서 선언 및 문자 인코딩 사용; 2. 시맨틱 태그를 사용하십시오. 3. HTTP 요청을 줄입니다. 4. 비동기 부하 사용; 5. 이미지 최적화. 이러한 관행은 웹 페이지의 효율성, 유지 관리 및 사용자 경험을 향상시킬 수 있습니다.

웹 표준과 기술은 현재까지 HTML4, CSS2 및 간단한 JavaScript에서 발전했으며 중대한 개발을 거쳤습니다. 1) HTML5는 캔버스 및 웹 스토리지와 같은 API를 도입하여 웹 응용 프로그램의 복잡성과 상호 작용을 향상시킵니다. 2) CSS3은 애니메이션 및 전환 기능을 추가하여 페이지를보다 효과적으로 만듭니다. 3) JavaScript는 화살표 기능 및 클래스와 같은 Node.js 및 ES6의 최신 구문을 통해 개발 효율 및 코드 가독성을 향상시킵니다. 이러한 변경으로 인해 웹 애플리케이션의 성능 최적화 및 모범 사례의 개발이 촉진되었습니다.

H5는 HTML5의 약어 일뿐 만 아니라 더 넓은 현대 웹 개발 기술 생태계를 나타냅니다. 1. H5는 HTML5, CSS3, JavaScript 및 관련 API 및 기술을 포함합니다. 2. 그것은 더 풍부하고 대화식이며 부드러운 사용자 경험을 제공하며 여러 장치에서 원활하게 실행할 수 있습니다. 3. H5 기술 스택을 사용하여 반응 형 웹 페이지와 복잡한 대화식 기능을 만들 수 있습니다.

H5 및 HTML5는 동일한 것을, 즉 html5를 나타냅니다. HTML5는 HTML의 다섯 번째 버전으로 시맨틱 태그, 멀티미디어 지원, 캔버스 및 그래픽, 오프라인 스토리지 및 로컬 스토리지와 같은 새로운 기능을 제공하여 웹 페이지의 표현성 및 상호 작용성을 향상시킵니다.

h5referstohtml5, apivotaltechnologyinwebdevelopment.1) html5introducesnewelements 및 dynamicwebapplications.2) itsupp ortsmultimediawithoutplugins, enovannangeserexperienceacrossdevices.3) SemanticLementsImproveContentsTructUreAndSeo.4) H5'Srespo

H5 개발에서 마스터 해야하는 도구 및 프레임 워크에는 vue.js, React 및 Webpack이 포함됩니다. 1.vue.js는 사용자 인터페이스를 구축하고 구성 요소 개발을 지원하는 데 적합합니다. 2. 복잡한 응용 프로그램에 적합한 가상 DOM을 통해 페이지 렌더링을 최적화합니다. 3. Webpack은 모듈 포장에 사용되며 리소스로드를 최적화합니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

SublimeText3 Linux 새 버전
SublimeText3 Linux 최신 버전

에디트플러스 중국어 크랙 버전
작은 크기, 구문 강조, 코드 프롬프트 기능을 지원하지 않음

PhpStorm 맥 버전
최신(2018.2.1) 전문 PHP 통합 개발 도구

MinGW - Windows용 미니멀리스트 GNU
이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.

ZendStudio 13.5.1 맥
강력한 PHP 통합 개발 환경
