图片/图形

CSS3带动画特效的创意用户帮助界面

阿里云


这是一款创意十足的纯 CSS3 带动画效果的用户帮助界面特效。这个用户帮助界面中,每个问题选项都被制作为一个飘带,鼠标上下移动时飘带跟着移动,并且最上方还有每个问题选项的缩略图动画,非常炫酷和人性化。

HTML 结构

这个用户帮助界面使用嵌套

也想出现在这里?联系我们
创客主机
的 HTML 结构。各种动画效果都在 CSS 代码中完成,HTML 中只给出了相应的结构和 class 类。

  1. <div class="demo">
  2.   <div class="demo__content">
  3.       <h2 class="demo__heading">What do you need help with?</h2>
  4.       <div class="demo__elems">
  5.         <div class="demo__elem demo__elem-1">With advertising online</div>
  6.         ...
  7.         <span class="demo__hover demo__hover-1"></span>
  8.         ...
  9.         <div class="demo__highlighter">
  10.           <div class="demo__elems">
  11.             <div class="demo__elem">With advertising online</div>
  12.             ...
  13.           </div>
  14.         </div>
  15.         <div class="demo__examples">
  16.           <div class="demo__examples-nb">
  17.             <div class="nb-inner">
  18.               <div class="example example-adv">
  19.                 <div class="example-adv">
  20.                   <div class="example-adv__top">
  21.                     <div class="example-adv__top-search"></div>
  22.                   </div>
  23.                   <div class="example-adv__mid"></div>
  24.                   <div class="example-adv__line"></div>
  25.                   <div class="example-adv__line long"></div>
  26.                 </div>
  27.               </div>
  28.               ...
  29.             </div>
  30.           </div>
  31.         </div>
  32.       </div>
  33.     </div>
  34.   </div>
  35. </div>

CSS 样式

滑动飘带是使用空来制作。

  1. .demo__highlighter {
  2.   z-index: 1;
  3.   position: absolute;
  4.   top: 0;
  5.   left: -1rem;
  6.   width: 38rem;
  7.   height: 7rem;
  8.   background: #39A5F7;
  9.   overflow: hidden;
  10.   box-shadow: 0 0.3rem 0.2rem rgba(0, 0, 0, 0.3);
  11.   -webkit-transition: -webkit-transform 0.5s cubic-bezier(0.59, 0.04, 0.3, 1.43);
  12.           transition: transform 0.5s cubic-bezier(0.59, 0.04, 0.3, 1.43);
  13. }

飘带会跟谁鼠标一起移动,这是通过在.demo__hover-n 上使用:hover 伪元素来实现的。

  1. .demo__hover-1 {
  2.   top: 0;
  3. }
  4. .demo__hover-1:hover ~ .demo__highlighter {
  5.   -webkit-transform: translateY(0);
  6.       -ms-transform: translateY(0);
  7.           transform: translateY(0);
  8. }
  9. .demo__hover-1:hover ~ .demo__highlighter .demo__elems {
  10.   -webkit-transform: translateY(0);
  11.       -ms-transform: translateY(0);
  12.           transform: translateY(0);
  13. }

然后在鼠标滑过相应的选项的时候,上方的演示动画也会同时进行,以第二个选项为例,它的代码如下:

  1. .demo__hover-2 {
  2.   top: 7rem;
  3. }
  4. .demo__hover-2:hover ~ .demo__highlighter {
  5.   -webkit-transform: translateY(7rem);
  6.       -ms-transform: translateY(7rem);
  7.           transform: translateY(7rem);
  8. }
  9. .demo__hover-2:hover ~ .demo__highlighter .demo__elems {
  10.   -webkit-transform: translateY(-7rem);
  11.       -ms-transform: translateY(-7rem);
  12.           transform: translateY(-7rem);
  13. }
  14. .demo__hover-2:hover ~ .demo__examples .example-adv__top,
  15. .demo__hover-2:hover ~ .demo__examples .example-adv__mid,
  16. .demo__hover-2:hover ~ .demo__examples .example-adv__line {
  17.   -webkit-transform: translateY(100%);
  18.       -ms-transform: translateY(100%);
  19.           transform: translateY(100%);
  20.   opacity: 0;
  21.   -webkit-transition: -webkit-transform 0.2s, opacity 0.2s;
  22.           transition: transform 0.2s, opacity 0.2s;
  23. }
  24. .demo__hover-2:hover ~ .demo__examples .example-web__top,
  25. .demo__hover-2:hover ~ .demo__examples .example-web__left {
  26.   -webkit-transform: scale(1);
  27.       -ms-transform: scale(1);
  28.           transform: scale(1);
  29.   opacity: 1;
  30.   -webkit-transition: -webkit-transform 0.4s 0.2s, opacity 0.4s 0.2s;
  31.           transition: transform 0.4s 0.2s, opacity 0.4s 0.2s;
  32. }
  33. .demo__hover-2:hover ~ .demo__examples .example-web__right-line {
  34.   -webkit-transform: scale(1);
  35.       -ms-transform: scale(1);
  36.           transform: scale(1);
  37. }
  38. .demo__hover-2:hover ~ .demo__examples .example-web__right-line:nth-child(1) {
  39.   -webkit-transition: -webkit-transform 0.4s 0s;
  40.           transition: transform 0.4s 0s;
  41. }
  42. .demo__hover-2:hover ~ .demo__examples .example-web__right-line:nth-child(2) {
  43.   -webkit-transition: -webkit-transform 0.4s 0.06s;
  44.           transition: transform 0.4s 0.06s;
  45. }
  46. .demo__hover-2:hover ~ .demo__examples .example-web__right-line:nth-child(3) {
  47.   -webkit-transition: -webkit-transform 0.4s 0.12s;
  48.           transition: transform 0.4s 0.12s;
  49. }
  50. .demo__hover-2:hover ~ .demo__examples .example-web__right-line:nth-child(4) {
  51.   -webkit-transition: -webkit-transform 0.4s 0.18s;
  52.           transition: transform 0.4s 0.18s;
  53. }
  54. .demo__hover-2:hover ~ .demo__examples .example-web__right-line:nth-child(5) {
  55.   -webkit-transition: -webkit-transform 0.4s 0.24s;
  56.           transition: transform 0.4s 0.24s;
  57. }
  58. .demo__hover-2:hover ~ .demo__examples .example-web__right-line:nth-child(6) {
  59.   -webkit-transition: -webkit-transform 0.4s 0.3s;
  60.           transition: transform 0.4s 0.3s;
  61. }

其它的 CSS 代码请参考下载文件。

CSS3 带动画特效的创意用户帮助界面

已有 316 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!