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. 01_1JAVA简介

    01_1JAVA简介 1. Java基础 语法基础.OO.Exception.Array.基础类.I/O Stream.Collection /Generic.Thread.TCP/UDP.GUI.M ...

  2. python class 巩固

    class 类定义 语法格式如下: class ClassName: <statement-1> ... <statement-N> 类属性与方法 属性 操作属性 getatt ...

  3. Boo who-freecodecamp算法题目

    Boo who 1.要求 检查一个值是否是基本布尔类型,并返回 true 或 false. 基本布尔类型即 true 和 false 2.思路 利用switch语句判断输入的数据是true/false ...

  4. CentOS7系统引导顺序以及排障

    引导顺序 UEFi或BIOS初始化,运行POST开机自检 选择启动设备 引导装载程序, centos7是grub2 加载装载程序的配置文件:/etc/grub.d/  /etc/default/gru ...

  5. zabbix3.2安装手册

    Alexei Vladishev创建了Zabbix项目,当前处于活跃开发状态,Zabbix SIA提供支持. Zabbix是一个企业级的.开源的.分布式的监控套件 Zabbix可以监控网络和服务的监控 ...

  6. destoon 后台入口文件分析

    <?php/* [Destoon B2B System] Copyright (c) 2008-2015 www.destoon.com This is NOT a freeware, use ...

  7. 欧拉函数:HDU3501-Calculation 2

    Calculation 2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Probl ...

  8. huu 1251

    #include <iostream> #include <cstdio> #include <cstring> #include <string> # ...

  9. linux用户和用户组管理详解

    Linux 用户和用户组管理 Linux系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申请一个账号,然后以这个账号的身份进入系统. 用户的账号一方面可以帮助 ...

  10. golang连接orcale

    使用glang有一段时间了,最开始其实并不太喜欢他的语法,但是后来熟悉之后发现用起来还挺爽的.之前数据库一直使用mysql,连接起来没有什么问题,github上有很多完善的驱动,所以以为连接其他数据库 ...