整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          HTML+CSS+JS發光開關按鈕

          果如圖:

          index.html

          <!DOCTYPE html>
          <html>
          <head>
          <meta charset="UTF-8">
          <title>純CSS3實現發光開關切換按鈕DEMO演示</title>
          <link rel="stylesheet" href="style.css" media="screen" type="text/css" />
          </head>
          <body style="background-color: #1c1d1f;">
          <div style="text-align:center;clear:both">
          <script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
          <script src="/follow.js" type="text/javascript"></script>
          </div>
          <iframe frameborder="0" scrolling="no" src="index2.html" width="100%" height="500px"></iframe>
          </body>
          </html>

          index2.html

          <!DOCTYPE html>
          <html>
          <head>
          <meta charset="UTF-8">
          <title>Switch Button #3 - CodePen</title>
          <link rel="stylesheet" href="style.css" media="screen" type="text/css" />
          </head>
          <body>
          <label class="button"><input type="checkbox"><span></span><span></span></input></label>
          <script src="js/index.js"></script>
          </body>
          </html>

          style.css

          *,
          *:before,
          *:after {
          -moz-box-sizing: border-box;
          box-sizing: border-box;
          }
          body {
          background-color: #1c1d1f;
          }
          .button {
          display: block;
          width: 400px;
          height: 120px;
          position: absolute;
          top: 50%;
          left: 50%;
          -webkit-transform: translate(-50%, -50%);
          -ms-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
          background-color: #000000;
          box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.2) inset;
          border-radius: 20px;
          overflow: hidden;
          cursor: pointer;
          -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
          }
          .button span {
          display: block;
          position: absolute;
          top: 6px;
          width: 194px;
          height: 108px;
          background-color: #1c1d1f;
          -webkit-transition: -webkit-transform 300ms ease, box-shadow 300ms ease;
          transition: transform 300ms ease, box-shadow 300ms ease;
          }
          .button span:before {
          position: absolute;
          top: 50%;
          left: 50%;
          -webkit-transform: translate(-50%, -50%);
          -ms-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
          font-family: "Open Sans";
          font-weight: 800;
          font-size: 48px;
          -webkit-transition: text-shadow 800ms ease 100ms, color 800ms ease 100ms;
          transition: text-shadow 800ms ease 100ms, color 800ms ease 100ms;
          }
          .button span:after {
          content: "";
          width: 4px;
          height: 108px;
          position: absolute;
          top: 0;
          background: -webkit-radial-gradient(center, ellipse, rgba(255, 255, 255, 0.5) 0%, transparent 50%);
          background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5) 0%, transparent 50%);
          -webkit-transition: opacity 300ms ease;
          transition: opacity 300ms ease;
          }
          .button span:first-of-type {
          left: 6px;
          border-top-left-radius: 18px;
          border-bottom-left-radius: 18px;
          -webkit-transform-style: preserve3d;
          transform-style: preserve3d;
          -webkit-transform-origin: right center;
          -ms-transform-origin: right center;
          transform-origin: right center;
          -webkit-transform: perspective(2000px) rotateY(40deg);
          transform: perspective(2000px) rotateY(40deg);
          box-shadow: -1px 0 1px rgba(255, 255, 255, 0.1) inset, 4px 0 8px rgba(255, 255, 255, 0.1) inset, 1px 0 0 rgba(255, 255, 255, 0.1) inset, -10px 0 8px rgba(40, 42, 44, 0.9), -20px 0 8px rgba(28, 29, 31, 0.7), -30px 0 8px rgba(28, 29, 31, 0.4);
          }
          .button span:first-of-type:before {
          content: "ON";
          color: rgba(0, 0, 0, 0.5);
          text-shadow: 1px 4px 6px #1c1d1f, 0 0 0 #000000, 1px 4px 6px #1c1d1f;
          }
          .button span:first-of-type:after {
          left: -1px;
          }
          .button span:last-of-type {
          right: 6px;
          border-top-right-radius: 18px;
          border-bottom-right-radius: 18px;
          -webkit-transform-origin: left center;
          -ms-transform-origin: left center;
          transform-origin: left center;
          box-shadow: -1px 1px 1px rgba(255, 255, 255, 0.1) inset, 2px 0 2px rgba(255, 255, 255, 0.05) inset;
          }
          .button span:last-of-type:before {
          content: "OFF";
          color: #ff4847;
          text-shadow: 0 0 24px rgba(255, 72, 71, 0.6);
          }
          .button span:last-of-type:after {
          right: -1px;
          opacity: 0;
          }
          .button input[type="checkbox"] {
          display: none;
          }
          .button input[type="checkbox"]:checked ~ span:first-of-type {
          -webkit-transform: none;
          -ms-transform: none;
          transform: none;
          box-shadow: 1px 1px 1px rgba(255, 255, 255, 0.1) inset, -2px 0 2px rgba(255, 255, 255, 0.05) inset;
          }
          .button input[type="checkbox"]:checked ~ span:first-of-type:before {
          color: #93c913;
          text-shadow: 0 0 24px rgba(147, 201, 19, 0.6);
          }
          .button input[type="checkbox"]:checked ~ span:first-of-type:after {
          opacity: 0;
          }
          .button input[type="checkbox"]:checked ~ span:last-of-type {
          -webkit-transform: perspective(2000px) rotateY(-40deg);
          transform: perspective(2000px) rotateY(-40deg);
          box-shadow: 1px 0 1px rgba(255, 255, 255, 0.1) inset, -4px 0 8px rgba(255, 255, 255, 0.1) inset, -1px 0 0 rgba(255, 255, 255, 0.1) inset, 10px 0 8px rgba(40, 42, 44, 0.9), 20px 0 8px rgba(28, 29, 31, 0.7), 30px 0 8px rgba(28, 29, 31, 0.4);
          }
          .button input[type="checkbox"]:checked ~ span:last-of-type:before {
          color: rgba(0, 0, 0, 0.5);
          text-shadow: 1px 4px 6px #1c1d1f, 0 0 0 #000000, 1px 4px 6px #1c1d1f;
          }
          .button input[type="checkbox"]:checked ~ span:last-of-type:after {
          opacity: 1;
          }

          style.less

          @background: #1C1D1F;
          @button: #1C1D1F;
          @light-on: #93C913;
          @light-off: #FF4847;
          @import url(http://fonts.googleapis.com/css?family=Open+Sans:800);
          *,
          *:before,
          *:after {
          box-sizing: border-box
          }
          body {
          background-color: @background;
          }
          .button {
          display: block;
          width: 400px;
          height: 120px;
          position: absolute;
          top: 50%;
          left: 50%; 
          transform: translate(-50%, -50%);
          background-color: darken(@button, 50%);
          box-shadow: 0 -1px 0 fade(white, 20%) inset;
          border-radius: 20px;
          overflow: hidden;
          cursor: pointer; 
          -webkit-tap-highlight-color: fade(black, 0%);
          span {
          display: block;
          position: absolute;
          top: 6px;
          width: 194px;
          height: 108px;
          background-color: @button;
          transition:
          transform 300ms ease,
          box-shadow 300ms ease;
          &:before {
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          font-family: "Open Sans";
          font-weight: 800;
          font-size: 48px;
          transition:
          text-shadow 800ms ease 100ms,
          color 800ms ease 100ms;
          }
          &:after {
          content: "";
          width: 4px;
          height: 108px;
          position: absolute;
          top: 0; 
          background: radial-gradient(ellipse at center, fade(white, 50%) 0%, transparent 50%);
          transition: opacity 300ms ease;
          } 
          &:first-of-type {
          left: 6px;
          border-top-left-radius: 18px;
          border-bottom-left-radius: 18px;
          transform-style: preserve3d;
          transform-origin: right center;
          transform:
          perspective(2000px)
          rotateY(40deg);
          box-shadow:
          -1px 0 1px fade(white, 10%) inset,
          4px 0 8px fade(white, 10%) inset,
          1px 0 0 fade(white, 10%) inset,
          -10px 0 8px fade(lighten(@button, 5%), 90%),
          -20px 0 8px fade(@button, 70%),
          -30px 0 8px fade(@button, 40%);
          &:before {
          content: "ON";
          color: fade(black, 50%);
          text-shadow:
          1px 4px 6px @button,
          0 0 0 black,
          1px 4px 6px @button;
          }
          &:after {
          left: -1px;
          }
          }
          &:last-of-type {
          right: 6px;
          border-top-right-radius: 18px;
          border-bottom-right-radius: 18px;
          transform-origin: left center;
          box-shadow:
          -1px 1px 1px fade(white, 10%) inset,
          2px 0 2px fade(white, 5%) inset;
          &:before {
          content: "OFF";
          color: @light-off;
          text-shadow: 0 0 24px fade(@light-off, 60%);
          }
          &:after {
          right: -1px;
          opacity: 0;
          }
          }
          }
          input[type="checkbox"] {
          display: none;
          &:checked ~ span {
          &:first-of-type {
          transform: none;
          box-shadow:
          1px 1px 1px fade(white, 10%) inset,
          -2px 0 2px fade(white, 5%) inset;
          &:before {
          color: @light-on;
          text-shadow: 0 0 24px fade(@light-on, 60%);
          }
          &:after {
          opacity: 0;
          } 
          }
          &:last-of-type {
          transform:
          perspective(2000px)
          rotateY(-40deg);
          box-shadow:
          1px 0 1px fade(white, 10%) inset,
          -4px 0 8px fade(white, 10%) inset,
          -1px 0 0 fade(white, 10%) inset,
          10px 0 8px fade(lighten(@button, 5%), 90%),
          20px 0 8px fade(@button, 70%),
          30px 0 8px fade(@button, 40%);
          &:before {
          color: fade(black, 50%);
          text-shadow:
          1px 4px 6px @button,
          0 0 0 #000,
          1px 4px 6px @button;
          }
          &:after {
          opacity: 1;
          }
          }
          }
          }
          }

          內容轉至網絡,若侵權,聯系刪除

          網頁設計工作中,我們可以給很多元素添加發光的動畫效果,舉幾個例子,“輸入框”、“文字”、“進度條”等。給這些元素加上的發光特效會讓整個網頁變得更加炫酷。今天陜西優就業小編就為大家搜集整理了8款炫酷的HTML發光動畫,這些都可以用作Web前端開發工作中,可以為你節省很多開發時間。

          1.HTML5 Canvas五彩繽紛的3D發光水晶球動畫

          這是一款基于HTML5 Canvas的超絢麗發光水晶球動畫,就像是酒吧里的那種水晶球射燈一樣,不停地隨機變換射出光線的顏色,給人一種非常動感的視覺效果。整個水晶球是在Canvas畫布上繪制而成,利用CSS3的相關特性使其能夠出現五彩繽紛的發光動畫,而且可以通過鼠標滾輪來放大縮小這個水晶球,不得不說HTML5真的是非常強大。

          2.jQuery/CSS3實現漂亮字體發光特效

          今天我們要來分享一款很酷的jQuery/CSS3文字發光特效,首先是加載了谷歌的公共字體庫,因此字體非常特別和漂亮,另外利用了jQuery和CSS3的相關特性,當鼠標滑過文字時,文字將會出現發光的動畫特效,非常漂亮。

          3.超絢麗CSS3多色彩發光立方體旋轉動畫

          之前我們分享過幾個不錯的CSS3立方體動畫,比如這款HTML5 3D立方體旋轉動畫和HTML5 3D立方體圖片切換動畫。今天要分享的也是一款基于CSS3的3D立方體旋轉動畫,不同的是,這款立方體的每一個面都有不同的色彩,并且會帶有絢麗的發光特效。

          4.純CSS3實現發光開關切換按鈕

          前段時間我們向大家分享過一款牛奶般剔透的CSS3 3D開關按鈕,效果相當贊。今天我們要來分享一款類似的純CSS3發光開關切換按鈕,它的外觀就像一個電燈的開關,可以左右切換。另外開關上的文字還有發光的特效,整體看上去很有立體感。

          5.純CSS3和SVG鼠標滑過燈泡發光特效

          這次要分享一款利用純CSS3和SVG實現的燈泡發光效果,我們只需要將鼠標滑過燈泡,整個燈泡就會出現發光發亮的動畫特效,效果相當逼真。CSS3的運用,讓燈泡外圍有一層淡淡的光暈。并且在燈光點亮和熄滅的時候有淡入淡出的效果。

          6.HTML5 Canvas發光Loading動畫

          之前我們分享過很多基于CSS3的Loading動畫效果,相信大家都很喜歡。今天我們要來分享一款基于HTML5 Canvas的發光Loading加載動畫特效。Loading旋轉圖標是在canvas畫布上繪制的,整個loading動畫是發光3D的視覺效果,HTML5非常強大。

          7.CSS3發光Loading加載動畫

          今天我們要分享一款與眾不同的CSS3 Loading動畫效果,它是由幾個不同的動畫效果組合而成的,像文字打印效果、發光效果、飛入飛出效果,這幾種效果都非常酷。另外我們可以再回顧一下其他的CSS3 Loading效果:HTML5 Canvas實現超酷Loading動畫、很有個性的CSS3彈跳Loading動畫。

          8.純CSS3實現發光動畫按鈕特效

          這是一款基于純CSS3的發光按鈕,按鈕發光的顏色是隨機的,這樣一排按鈕就顯得五彩繽紛,非常絢麗。之前我們也介紹過不少樣式很獨特的CSS3按鈕,比如純CSS3 3D開關按鈕、純CSS3實現動感彈性按鈕等,都非常不錯,也有HTML5動畫按鈕,大家可以自己看看。

          陜西優就業:http://www.ujiuye.com/shaanxi/

          IT學習交流:468910291

          132個特效,是我歷時10個多月在油管一個一個跟著敲出來的,為了加強記憶,每個練習,我都錄制了視頻,在這里分享出來給大家。大家可能又會調侃了,你是工作不飽和吧,有時間做這些。其實,我目前工作還是挺飽和的,都是擠出來的。我們是9點上班,我基本7點半就到公司自學了,這樣我就有一個半小時的時間來做這些了。

          對于 CSS 評價,無論是在論壇還是身邊的人,我聽到最多的是學 CSS 這些花里胡哨沒啥用,實際項目中又用不到。聽到這些心里還是挺實受挫的,有時候會懷疑自己,我學習的方向是不是錯了。但在幾次的項目需要用到一些特效,我都能很快的找到思路并做出來,我想這是得益于,我平時所學的這些特效積累出來的。

          現在我不在困惑我所學的東西,因為學習成長是你自己事情,而不是別人在意的眼光。

          對應的所有視頻可以到 【B站查看】,或者在 B 站搜索 前端小智 即可看到,源碼都在視頻簡介里面,大家進行查看。

          67.信號故障特效

          效果:

          視頻地址:https://www.bilibili.com/video/BV17V411r74q/

          68.自定義動態復選框

          效果:

          頻地址:https://www.bilibili.com/video/BV16Z4y1u7NY/

          69.創意div盒設計

          效果:

          視頻地址:https://www.bilibili.com/video/BV1dK411J7p2/

          70.SVG彈性線條動畫特效

          效果:

          視頻地址:https://www.bilibili.com/video/BV1bA411Y7UY/

          71.類似望花筒特效

          演示視頻:https://www.bilibili.com/video/BV1Mh411Z7Ze/

          72.刮刮樂特效

          演示視頻:https://www.bilibili.com/video/BV16f4y1X7Yr/

          73.使用HTML CSS和jQuery進行水平頁面滾動

          視頻地址:https://www.bilibili.com/video/BV14A411Y7Gd/

          74.CSS Clip-path 鼠標移動特效

          視頻地址:https://www.bilibili.com/video/BV1oD4y1U7C8/

          75. 讓面部表情跟著鼠標光標變化

          視頻地址:https://www.bilibili.com/video/BV1vT4y157Up/

          76.星星閃爍特效

          視頻地址:https://www.bilibili.com/video/BV1tf4y1979Z/

          77.CSS漸變按鈕懸停效果

          視頻地址:https://www.bilibili.com/video/BV1EV411U7fD/

          78.聚光燈特效(JQuery鼠標移動特效)


          視頻地址:https://www.bilibili.com/video/BV1sA411n7us/


          79.3D視頻立方體特效


          視頻地址:https://www.bilibili.com/video/BV1eZ4y1K7o3/


          80.3D背景動畫效果


          視頻地址:https://www.bilibili.com/video/BV1tK4y1Y771/


          81.滑塊百分比的有趣應用

          視頻地址:https://www.bilibili.com/video/BV1V5411h7iZ/

          82.純CSS液體加載特效

          視頻地址:https://www.bilibili.com/video/BV1Dh41197Lf/

          83.CSS懸停效果(只是為了好玩)

          視頻地址:https://www.bilibili.com/video/BV145411b7RJ/

          84.CSS 3D波浪加載特效

          視頻播放地址:https://www.bilibili.com/video/BV15D4y1m7JG/

          85.CSS水波背景動畫特效

          視頻演示地址:https://www.bilibili.com/video/BV1Lf4y1X7Bm/

          86.CSS加載文本動畫特效

          視頻地址:https://www.bilibili.com/video/BV1YA411n7xu/

          87.服務條款的一種展示特效

          視頻地址:https://www.bilibili.com/video/BV1vA411E77W/

          88.幽靈文字特效

          視頻地址:https://www.bilibili.com/video/BV17T4y1A7Vg/

          89.破碎的玻璃橫幅


          視頻地址:https://www.bilibili.com/video/BV1s5411b78Q/

          90.CSS列表項懸停特效

          視頻地址:https://www.bilibili.com/video/BV1KZ4y1N7nr/

          91.方向感應卡懸停效果

          視頻地址:https://www.bilibili.com/video/BV1Jf4y1D7Lm/

          92.發光文字加載特效

          視頻地址:https://www.bilibili.com/video/BV17A411J7RL/

          93.磚石旋轉背景動畫特效

          視頻地址:https://www.bilibili.com/video/BV1yv411C7NJ/

          94.文字懸停分割特效

          視頻地址:https://www.bilibili.com/video/BV1RV411m7LQ/

          95.按鈕漣漪特效

          視頻地址:https://member.bilibili.com/v2#/upload-manager/article

          96.魔幻的滾動視差特效

          視頻地址:https://www.bilibili.com/video/BV1LK411A7X2/

          97.炫酷加載特效(模擬手機信號)

          視頻地址:https://www.ixigua.com/6882247186009031181/

          98.炫酷發光特效

          視頻地址:https://www.ixigua.com/6882247186009031181/

          99.仙境特效

          視頻地址:https://www.ixigua.com/6883784380632793611/


          100.模擬播放暫時特效

          視頻地址:https://www.ixigua.com/6885309534483513859/

          101.新擬物漸變加載特效

          視頻地址:https://www.ixigua.com/6886389124811457032/

          102.使用Vanilla lift.js實現3D視差傾斜效果

          視頻地址:https://www.ixigua.com/6887878632572715532/

          103.3D書籍模型

          視頻地址:https://www.ixigua.com/6888608009556230667/

          104.打工人的撕裂方式

          視頻地址:https://www.ixigua.com/6890835336868397572/

          105.液體流加載特效

          視頻地址:https://www.ixigua.com/6891580915374359043/

          106.創意視頻球特效


          視頻地址:https://www.ixigua.com/6893066211257483784/


          107.CSS響應卡片懸停特效

          視頻地址:https://www.ixigua.com/6893808422605554183/

          108.使用Grade.Js自動生成漸變背景顏色


          視頻地址:https://www.ixigua.com/6894533882432094728/

          109.現代CSS按鈕懸停效果

          視頻地址:https://www.ixigua.com/6897449872975200780/

          110.無限疊卡特效

          視頻地址:https://www.ixigua.com/6897450763094753800/

          111.使用CSS進行彩色煙霧視頻和文本處理

          視頻地址:https://www.ixigua.com/6898262151455048199/

          112.使用 sketch.js 實現彗星特效

          視頻地址:https://www.ixigua.com/6899588911862022660/

          113.文字肖像特效

          視頻地址:https://www.ixigua.com/6901230535520027143/

          114.使用SVG filter創建粘糊糊效果

          視頻地址:https://www.ixigua.com/6902344348986262024/

          115.滑動菜單指示器特效

          視頻地址:https://www.ixigua.com/6903449899006689804/

          117.純CSS 和 JS 實現泡泡特效

          視頻地址:https://www.ixigua.com/6904504548409213454/

          118.CSS3按鈕懸停閃亮特效

          視頻地址:https://www.ixigua.com/6906066035506414084/

          119.css按鈕邊框漸變發光特效

          視頻地址:https://www.ixigua.com/6906796258489270788/

          120.如何使用 JS 動態更新CSS變量

          視頻地址:https://www.ixigua.com/6907873173098889731/?&wid_try=1

          121.使用gsap scrollTrigger滾動觸發CSS動畫

          視頻地址: https://www.bilibili.com/video/BV1964y1f7CK/

          122.為你的博客和網站設計一個簡單的日歷

          123.火箭發射特效

          視頻地址:https://www.ixigua.com/6910132650648797699/

          124.酷炫box-shadow 懸停特效

          視頻地址:https://www.ixigua.com/6911265897659400708/

          125.如何使用 JS 實現背景視差特效

          視頻地址:https://www.ixigua.com/6911983867603878407/

          126.如何使用CSS和 JS 創建簡單圖片切換

          視頻地址:https://www.ixigua.com/6914222592170263053/

          127.CSS 圖標魔法線懸停特效

          視頻地址:https://www.ixigua.com/6914589524660224526/

          128.落葉飄舞動畫特效

          視頻地址:https://www.ixigua.com/6915324225184072200/

          129.好家伙,女朋友讓我用前端人的方式,描述一下一幅畫被墨水灑的到樣子

          視頻地址:https://www.ixigua.com/6916439319217603085/

          130. HTML+CSS完成蘋果logo加載效果,好家伙,還不收藏一波!

          視頻地址:https://www.ixigua.com/6917189337700368907/

          131.手擼一個跑馬燈加載特效送給前端女朋友

          視頻地址:https://www.ixigua.com/6917930699139842563

          132.前端人,來,給沾滿霧氣的玻璃刮一刮,好家伙,這工具超好用!

          視頻地址:https://www.ixigua.com/6919046116382081540

          完~,我是小智,我要去刷碗了,我們下期再見!


          主站蜘蛛池模板: 一区二区三区在线看| 国产一区在线电影| 黑巨人与欧美精品一区| 中文字幕AV无码一区二区三区| 一区二区三区视频在线| 无码人妻精一区二区三区| 中文字幕一区二区三区四区| 在线视频精品一区| 国产91大片精品一区在线观看| 中文字幕精品亚洲无线码一区 | 国产亚洲综合一区柠檬导航| 国产精品污WWW一区二区三区| 视频在线一区二区| 国产精品区一区二区三| 台湾无码AV一区二区三区| 免费高清av一区二区三区| 亚洲国产精品一区二区久久| 蜜桃视频一区二区三区| 日本免费一区尤物| 无码国产精品一区二区免费式影视| 国产福利一区二区在线视频| 无码一区二区三区在线| 久久亚洲一区二区| 美女啪啪一区二区三区| 久久精品视频一区二区三区| 久久综合精品不卡一区二区| 香蕉久久AⅤ一区二区三区| 免费观看日本污污ww网站一区| 日韩人妻无码免费视频一区二区三区| 国产吧一区在线视频| 亚洲视频一区网站| 成人精品视频一区二区| 国产成人无码精品一区不卡| 国产成人av一区二区三区在线观看| 无码中文人妻在线一区二区三区| 国模私拍福利一区二区| 国产激情一区二区三区在线观看| 亚洲AV网一区二区三区| 日韩少妇无码一区二区三区| 中文国产成人精品久久一区| 久久精品一区二区三区四区|