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. Spring中使用事务搭建转账环境 转账操作,

    演示不使用事务出现异常情况 Dao层两个方法lessMoney()和moreMoney() package com.swift; import org.springframework.jdbc.cor ...

  2. 重装vs2008遇到的问题

    由于前几天办公室电脑dhcp服务挂了,wifi网线都上不了网,很无奈只能重装了系统.于是VS2008也要重装,之前一直用的都是前一个同事留下来的软件,没自己装过,自己装的时候踩了坑,记录一下. 重装了 ...

  3. React支持装饰器

    在用mobx时用到了装饰器,无奈环境不支持装饰器,搜索了半天,网上教程乱七八糟,最后想到了babel官网上肯定有,一搜果然有,安装教程 见Babel官网. 最快捷的教程是官网文档

  4. C语言中的32个关键字

    C语言中的32个关键字 数据类型关键字(12个) (1)     char:声明字符型变量或函数 (2)     double:声明双精度变量或函数 (3)     enum:声明美剧类型 (4)   ...

  5. Linux系统修改网卡名(eth0-3)

    一.命名规则策略 规则1: 对于板载设备命名合并固件或 BIOS 提供的索引号,如果来自固件或 BIOS 的信息可读就命名,比如eno1,这种命名是比较常见的,否则使用规则2. 规则2: 命名合并固件 ...

  6. python中字典的‘增、删、改、查’

    python 字典的'增.删.改.查' 用 ipython 运行情况如下: #新建字典 In [1]: infos = {'name':'dongge','age':18} In [2]: infos ...

  7. LeetCode(166) Fraction to Recurring Decimal

    题目 Given two integers representing the numerator and denominator of a fraction, return the fraction ...

  8. LeetCode(134) Gas Station

    题目 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. ...

  9. rocketmq源码分析1-benchmark学习

    benchmark 分析 组成部分 三个java类,都含有main方法,可选的传递一些参数,诸如测试线程数量,消息体积大小.三个类分别用于测试普通生产者,事务生产者,消费者.生产者 默认64个测试线程 ...

  10. Clickonce - Change deployment URL after publish

    mage.exe -Update C:\inetpub\wwwroot\aspnet40\AminoScience\Uploads\Application Files\AccUFeed_1_0_0_5 ...