scss 侧边栏_图片
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 侧边栏_图片的更多相关文章
- java画图程序_图片用字母画出来_源码发布_版本二
在上一个版本:java画图程序_图片用字母画出来_源码发布 基础上,增加了图片同比例缩放,使得大像素图片可以很好地显示画在Notepad++中. 项目结构: 运行效果1: 原图:http://imag ...
- java画图程序_图片用字母画出来_源码发布
在之前写了一篇blog:java画图程序_图片用字母画出来 主要是把一些调试的截图发布出来,现在程序调试我认为可以了(当然,你如果还想调试的话,也可以下载源码自己调试). 就把源码发布出来. 项目结构 ...
- java画图程序_图片用字母画出来
最近在研究怎样将图片用字母在文本编辑工具中“画”出来. 你看了这个可能还不知道我想说什么? 我想直接上图,大家一定就知道了 第一张:小猫 原图:http://www.cnblogs.com/hongt ...
- [原创]html5_PC游戏_图片俄罗斯方块
PC游戏_图片俄罗斯方块 以前的了,快一年了... 使用了离线canvas复制的方法,启动预览效果需要服务器支持 另外,AC娘图片可以自己做加载功能,这样游戏图片显示更顺畅 效果: --- 代码: h ...
- WPF_界面_图片/界面/文字模糊解决之道整理
原文:WPF_界面_图片/界面/文字模糊解决之道整理 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/u010265681/article/detai ...
- AJ学IOS(09)UI之UIScrollView代理触摸实现_图片缩放
AJ分享,必须精品 先看效果 代码 // // NYViewController.m // 05-放大缩小图片UIScrollView // // Created by apple on 15-3-2 ...
- PHP图片裁剪_图片缩放_PHP生成缩略图
在制作网页过程中,为了排版整齐美观,对网页中的图片处理成固定大小尺寸的图片,或是要截去图片边角中含有水印的图片,对于图片量多,每天更新大量图,靠人工PS处理是不现实的,那么有没有自动处理图片的程序了! ...
- UI-UIImageView的图片填充方式(contentMode)_图片作为控件背景图的拉伸方式(stretch)介绍
常用图片填充方式 这里只介绍三个最常用的图片填充方式 UIViewContentModeScaleToFill模式会导致图片变形.例如: UIViewContentModeScaleAspectFit ...
- 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 ...
随机推荐
- java基础——冒泡排序
最近开始准备面试,所以将Java基础复习一遍,又学习了冒泡排序 冒泡排序的基本思想是,对相邻的元素进行两两比较,顺序相反则进行交换,这样,每一趟会将最小或最大的元素“浮”到顶端,最终达到完全有序 ja ...
- Flask-蓝图、模型与CodeFirst
一.应用.蓝图与视图函数 结构,如图: Flask最上层是app核心对象 ,在这个核心对象上可以插入很多蓝图,这个蓝图是不能单独存在的,必须将app作为插板插入app ,在每一个蓝图上,可以注册很多静 ...
- centos7.4进入单用户模式
centos7.4进入单用户模式 1 - 在启动grub菜单,选择编辑选项启动 2 - 按键盘e键,来进入编辑界面 3 - 找到Linux 16的那一行,将ro改为rw init=/sysroot/b ...
- 优酷项目之 ORM(数据库对象关系映射)代码重写
前言: 我们在操作数据库时候一般都是通过sql代码来操作mysql数据库中相关数据,这就需要懂得sql语句,那么怎么样才能在不懂sql语句的情况下通过我们所学的python代码来实现对mysql数据库 ...
- python-函数的对象、函数嵌套、名称空间和作用域
目录 函数的对象 函数对象的四大功能 引用 当做参数传给一个函数 可以当做函数的返回值 可以当做容器类型的元素 函数的嵌套 函数的嵌套定义 函数的嵌套调用 名称空间与作用域 名称空间 内置名称空间 全 ...
- Python之简单Socket编程
Socket编程这块儿还是比较重要的,记录一下:实现服务器端和客户端通信(客户端发送系统指令,如ipconfig等,服务器端执行该指令,然后将指令返回结果给客户端再传过去,设置一次最多直接收1024字 ...
- Android内核编译步骤
android_4.0.4_tq210$ source build/envsetup.shandroid_4.0.4_tq210$ lunch 5/android_4.0.4_tq210$ make ...
- Developing for nRF52810(转载)
Table of Contents Introduction Hardware emulation of nRF52810 Limitations Software emulation of nRF5 ...
- Artwork Gym - 101550A 离线并查集
题目:题目链接 思路:每个空白区域当作一个并查集,因为正着使用并查集分割的话dfs会爆栈,判断过于复杂也会导致超时,我们采用离线反向操作,先全部涂好,然后把黑格子逐步涂白,我们把每个空白区域当作一个并 ...
- poj 2376 选择工作区间问题 贪心算法
题意:给一些工作区间,如何选取最小的工作数量,覆盖[1,T]的工作时长 一开始的思路,当然也是错误的思路: 我想着,最小工作数量是吧?那肯定就是选择结束时间最晚的,给结束时间来一个排序.哎这个思路错误 ...