html

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<title>侧边栏</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="toolbar">
<a href="javascript:;" class="toobar-item toolbar-item-weixin">
<span class="toolbar-layer">

</span>
</a>
<a href="javascript:;" class="toobar-item toolbar-item-feedback"></a>
<a href="javascript:;" class="toobar-item toolbar-item-app">
<span class="toolbar-layer">

</span>
</a>
<a href="javascript:;" class="toobar-item toolbar-item-top"></a>
</div>
</body>
</html>

style.scss

@import "mixin";
@import "toolbar";

mixin.scss

@mixin transition ($transition) {
-webkit-transition:$transition;
-moz-transition:$transition;
-ms-transition:$transition;
-o-transition: $transition;
transition: $transition;
}

@mixin transform-origin ($origin){
-webkit-transform-origin: $origin;
-moz-transform-origin: $origin;
-ms-transform-origin: $origin;
-o-transform-origin: $origin;
transform-origin: $origin;
}
@mixin scale($scale){
-webkit-transform: scale($scale);
-moz-transform: scale($scale);
-ms-transform: scale($scale);
-o-transform: scale($scale);
transform: scale($scale);
}

@mixin opacity($opacity){
opacity: $opacity;
filter: alpha(opacity=$opacity * 100);
}

toolbar.scss

@mixin toobar-item($pos, $hoverPos){
background-position:0 $pos;
&:hover{
background-position:0 $hoverPos;
}
}

$toolbar-size:52px;
.toobar-item,.toolbar-layer{
background-image:url(../images/toolbar.png);
background-repeat:no-repeat;
}
.toolbar{
position:fixed;
left:50%;
margin-left:-$toolbar-size / 2;
bottom:50px;
}
.toobar-item{
position:relative;
display:block;
width:$toolbar-size;
height:$toolbar-size;
margin-top:1px;
@include transition(background-position 1s);
&:hover{
.toolbar-layer{
@include scale(1);
@include opacity(1);
}
}
}
.toolbar-item-weixin{
@include toobar-item(-798px, -860px);
.toolbar-layer{
height:212px;
background-position:0 0;
}
}

.toolbar-item-feedback{
@include toobar-item(-426px, -488px);
}
.toolbar-item-app{
@include toobar-item(-550px, -612px);
.toolbar-layer{
height:194px;
background-position:0 -222px;
}
}
.toolbar-item-top{
@include toobar-item(-674px, -736px);
}
.toolbar-layer{
position:absolute;
right: $toolbar-size - 6;
bottom:-10px;
width: 172px;
@include opacity(0);
@include scale(0.01);
@include transition(all 1s);
@include transform-origin (95% 95%);
}

 编译后的css

.toobar-item, .toolbar-layer {
background-image: url(../images/toolbar.png);
background-repeat: no-repeat; }

.toolbar {
position: fixed;
left: 50%;
margin-left: -26px;
bottom: 50px; }

.toobar-item {
position: relative;
display: block;
width: 52px;
height: 52px;
margin-top: 1px;
-webkit-transition: background-position 1s;
-moz-transition: background-position 1s;
-ms-transition: background-position 1s;
-o-transition: background-position 1s;
transition: background-position 1s; }
.toobar-item:hover .toolbar-layer {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
opacity: 1;
filter: alpha(opacity=100); }

.toolbar-item-weixin {
background-position: 0 -798px; }
.toolbar-item-weixin:hover {
background-position: 0 -860px; }
.toolbar-item-weixin .toolbar-layer {
height: 212px;
background-position: 0 0; }

.toolbar-item-feedback {
background-position: 0 -426px; }
.toolbar-item-feedback:hover {
background-position: 0 -488px; }

.toolbar-item-app {
background-position: 0 -550px; }
.toolbar-item-app:hover {
background-position: 0 -612px; }
.toolbar-item-app .toolbar-layer {
height: 194px;
background-position: 0 -222px; }

.toolbar-item-top {
background-position: 0 -674px; }
.toolbar-item-top:hover {
background-position: 0 -736px; }

.toolbar-layer {
position: absolute;
right: 46px;
bottom: -10px;
width: 172px;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transform: scale(0.01);
-moz-transform: scale(0.01);
-ms-transform: scale(0.01);
-o-transform: scale(0.01);
transform: scale(0.01);
-webkit-transition: all 1s;
-moz-transition: all 1s;
-ms-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;
-webkit-transform-origin: 95% 95%;
-moz-transform-origin: 95% 95%;
-ms-transform-origin: 95% 95%;
-o-transform-origin: 95% 95%;
transform-origin: 95% 95%; }

/*# sourceMappingURL=style.css.map */

scss 侧边栏_图片的更多相关文章

  1. java画图程序_图片用字母画出来_源码发布_版本二

    在上一个版本:java画图程序_图片用字母画出来_源码发布 基础上,增加了图片同比例缩放,使得大像素图片可以很好地显示画在Notepad++中. 项目结构: 运行效果1: 原图:http://imag ...

  2. java画图程序_图片用字母画出来_源码发布

    在之前写了一篇blog:java画图程序_图片用字母画出来 主要是把一些调试的截图发布出来,现在程序调试我认为可以了(当然,你如果还想调试的话,也可以下载源码自己调试). 就把源码发布出来. 项目结构 ...

  3. java画图程序_图片用字母画出来

    最近在研究怎样将图片用字母在文本编辑工具中“画”出来. 你看了这个可能还不知道我想说什么? 我想直接上图,大家一定就知道了 第一张:小猫 原图:http://www.cnblogs.com/hongt ...

  4. [原创]html5_PC游戏_图片俄罗斯方块

    PC游戏_图片俄罗斯方块 以前的了,快一年了... 使用了离线canvas复制的方法,启动预览效果需要服务器支持 另外,AC娘图片可以自己做加载功能,这样游戏图片显示更顺畅 效果: --- 代码: h ...

  5. WPF_界面_图片/界面/文字模糊解决之道整理

    原文:WPF_界面_图片/界面/文字模糊解决之道整理 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/u010265681/article/detai ...

  6. AJ学IOS(09)UI之UIScrollView代理触摸实现_图片缩放

    AJ分享,必须精品 先看效果 代码 // // NYViewController.m // 05-放大缩小图片UIScrollView // // Created by apple on 15-3-2 ...

  7. PHP图片裁剪_图片缩放_PHP生成缩略图

    在制作网页过程中,为了排版整齐美观,对网页中的图片处理成固定大小尺寸的图片,或是要截去图片边角中含有水印的图片,对于图片量多,每天更新大量图,靠人工PS处理是不现实的,那么有没有自动处理图片的程序了! ...

  8. UI-UIImageView的图片填充方式(contentMode)_图片作为控件背景图的拉伸方式(stretch)介绍

    常用图片填充方式 这里只介绍三个最常用的图片填充方式 UIViewContentModeScaleToFill模式会导致图片变形.例如: UIViewContentModeScaleAspectFit ...

  9. bug_ _图片_android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>

    =========== 1   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zgan.communit ...

随机推荐

  1. 2d游戏中求出一个向量的两个垂直向量

    function cc.exports.VerticalVector(vec)--求出两个垂直向量 local result = {} result[1] = cc.p(vec.y/vec.x,-1) ...

  2. Django项目SECRET_KEY等敏感信息保存

    在我们做完django项目后,向生产环境部署时,为了避免一些敏感信息被有心人利用,我们应该将其保护起来,比如说在settings配置中的一些密码等内容存在操作系统内,通过调用来使用,比如下面这种做法: ...

  3. Linux - 链接概念详解

    1> Linux链接概念Linux链接分两种,一种被称为硬链接(Hard Link),另一种被称为符号链接(Symbolic Link).默认情况下,ln命令产生硬链接. [硬连接]硬连接指通过 ...

  4. 【Git版本控制】Git的merge合并分支命令

    1.实例 git checkout master git merge dev merge合并分支只对当前分支master产生影响,被合并的分支dev不受影响. 假设你有两个分支,“stable” 和 ...

  5. 第一本C语言笔记(上)

    1. 一般地源程序文件到可执行程序文件经过如下四步: 预处理 -- 头文件内容插入.宏替换.删注释(#include.#define) 编译 -- 把预处理过的源文件编程汇编文件 .c -> . ...

  6. 【laravel】Disabling CSRF for Specific Routes - Laravel 5

    原文 http://www.camroncade.com/disable-csrf-for-specific-routes-laravel-5/ Disabling CSRF for Specific ...

  7. build_mem_type_table

    该函数设置mem_types结构体数组,结构体定义如下: struct mem_type { unsigned int prot_pte;     //二级页表属性 unsigned int prot ...

  8. Centos7 install Openstack Juno (RDO) (转载)

    原文地址:http://www.hdume.com/centos-7-0%E5%AE%89%E8%A3%85openstack/ 1.安装系统,Centos7镜像采用CentOS-7.0-1406-x ...

  9. POJ 3281 网络流 拆点 Dining

    题意: 有F种食物和D种饮料,每头牛有各自喜欢的食物和饮料,而且每种食物或者饮料只能给一头牛. 求最多能有多少头牛能同时得到它喜欢的食物或者饮料. 分析: 把每个牛拆点,中间连一条容量为1的边,保证一 ...

  10. Service 回顾

    绑定本地service需要实现onBind()方法