發(fā)文章
發(fā)文工具
撰寫
網(wǎng)文摘手
文檔
視頻
思維導(dǎo)圖
隨筆
相冊
原創(chuàng)同步助手
其他工具
圖片轉(zhuǎn)文字
文件清理
AI助手
留言交流
之前分享了很多css3實現(xiàn)的按鈕。今天要給大家?guī)硪豢罨趈query和css3實現(xiàn)的摩天輪式分享按鈕。這款分享按鈕頁面底部有一個toggle按鈕,,單擊該按鈕,摩天輪按鈕以動畫的形式出現(xiàn),各個分享按鈕掛在摩天輪上。效果圖如下:
在線預(yù)覽 源碼下載
實現(xiàn)的代碼,。
部分html代碼:
<div class="ferris-base"> <div class="ferris-base--center"> <div id="" title="" class="icon "> <svg viewbox="0 0 32 32"> <use xlink:href="#twitter-icon"> </use></svg></div> </div> <div class="ferris-base--top"> </div> <div class="ferris-base--main"> </div> <div class="ferris-base--spike is-1"> </div> <div class="ferris-base--spike is-2"> </div> <div class="ferris-base--handle"> </div> </div>
部分css3代碼:
* { -moz-box-sizing: border-box; box-sizing: border-box; } /* ENVIROMENT */ /* grid size = 10px in rem equivalent */ html { font-size: 16px; } body { background: #6ed2d2 repeat top left; position: relative; } html, body { height: 100%; } .button { background: #dd5754; border-radius: 0.1875rem; text-transform: uppercase; color: #fff; height: 3.125rem; line-height: 3.125rem; width: 12.5rem; text-align: center; letter-spacing: 0.125rem; } .button:hover { background-color: #e06461; cursor: pointer; } .button:active { background-color: #dd5754; } .ground { position: absolute; left: 0; bottom: 0; height: 7.5rem; width: 100%; background: #493442 repeat bottom right; } .ground .button { margin-left: auto; margin-right: auto; margin-top: 2.1875rem; position: relative; z-index: 2; } /* FERRIS WHEEL */ .human { background-color: #6e6e6e; border-radius: 50%; height: 1.625rem; width: 0.625rem; position: relative; } .human:after { content: ''; position: absolute; width: 0.4375rem; height: 0.4375rem; background-color: inherit; top: -0.3125rem; border-radius: 50%; left: 50%; margin-left: -0.1875rem; } .ferris-base { margin-left: 50px; position: relative; width: 14.875rem; height: 2.4375rem; } .ferris-base .ferris-base--main { background-color: #ce5250; width: 100%; height: 100%; position: relative; z-index: 1; height: 0%; top: 100%; } .is-open .ferris-base .ferris-base--main { height: 100%; top: 0; -webkit-transition: all 0.3s linear; transition: all 0.3s linear; } .ferris-base top-height, .ferris-base .ferris-base--top { position: absolute; height: 0.75rem; background-color: #9b2e2e; z-index: 2; width: 0; margin-left: 50%; overflow: hidden; opacity: 0; } .is-open .ferris-base top-height, .is-open .ferris-base .ferris-base--top { width: 108%; margin-left: -4%; overflow: visible; opacity: 1; -webkit-transition: all 0.3s linear; transition: all 0.3s linear; -webkit-transition-delay: 0.3s; transition-delay: 0.3s; } .ferris-base top-height:before, .ferris-base .ferris-base--top:before, .ferris-base top-height:after, .ferris-base .ferris-base--top:after { content: ''; position: absolute; border: 0.75rem solid rgba(155,46,46,0); border-left-width: 0.5rem; border-right-width: 0.5rem; border-top-color: #9b2e2e; top: 0; } .ferris-base top-height:before, .ferris-base .ferris-base--top:before { left: -0.5rem; } .ferris-base top-height:after, .ferris-base .ferris-base--top:after { right: -0.5rem; } .ferris-base .ferris-base--spike { height: 9.6875rem; width: 0.9375rem; background-color: #b33333; position: absolute; top: -10.125rem; left: 50%; margin-left: -0.46875rem; -webkit-transform-origin: 50% top; -ms-transform-origin: 50% top; transform-origin: 50% top; z-index: 0; height: 5.78125rem; opacity: 0; }
注:本文愛編程原創(chuàng)文章,轉(zhuǎn)載請注明原文地址:http://www./Article/8022
來自: 昵稱10504424 > 《工作》
0條評論
發(fā)表
請遵守用戶 評論公約
FE(0x01)--前端嗎?我需要一個按鈕
我需要一個按鈕,。box-shadow: 0 1px 2px #b9ecc4 inset, 0 -1px 0 #6c9f76 inset, 0 -2px 3px #b9ecc4 inset;<button type="but...
圖片自適應(yīng)大小的通用JS代碼
圖片自適應(yīng)大小的通用JS代碼前幾天群里碰到好幾個在調(diào)整內(nèi)容頁圖片尺寸太大時自動縮小的問題,,今天我在做一個別墅設(shè)計相關(guān)網(wǎng)站時,,也碰到了這個問題,所以考慮了個通用的解決方案,。那最好的解決辦法,...
jQuery 動態(tài)調(diào)整圖片大小
轉(zhuǎn)發(fā)
jQuery中添加自定義或函數(shù)方法
方法一: jQuery.fn.setApDiv=function () { //apDiv浮動層顯示位置居中控制 var wheight=$(window).height(); var wwidth=$(window).width(); var apHeight=wheight-$(...
jQuery簡單實現(xiàn)導(dǎo)航欄根據(jù)滑動自動懸浮效果
今天在網(wǎng)上看一些別人的一些網(wǎng)站,,都覺得很厲害,,寫插件什么的,無意間看到一款基于插件為導(dǎo)航欄自動懸浮插件,,當(dāng)時看到之后覺得挺簡單,,然后便自己也開始試著寫了一下。 主要用處就是一個導(dǎo)航欄本來...
jQuery元素樣式設(shè)置的方式
基于jquery的bootstrap在線文本編輯器插件Summernote
基于jquery的bootstrap在線文本編輯器插件Summernote.//取值var sHTML = $(''.summernote'').code();//同一頁面多個sum...
通過HTML和CSS隱藏和顯示元素的4種方法
通過HTML和CSS隱藏和顯示元素的4種方法,。這篇文章中,,我們要介紹4種更為高級的顯示和隱藏元素的方法,這些方法只工作在最新版本的現(xiàn)代瀏...
css中單位em和rem的區(qū)別
css中單位em和rem的區(qū)別,。上代碼:(html代碼如上,,只是把css代碼的元素長度單位變了)html { font-size: 10px; }div { font-size: 4rem...
微信掃碼,,在手機上查看選中內(nèi)容