Compass Ceaser CSS Easing Transitions 使用与技术文档
1. 安装指南
要使用Compass Ceaser CSS Easing Transitions扩展,您首先需要通过命令行安装gem:
gem install ceaser-easing
如果您想要将Ceaser Easing添加到现有项目中,需要编辑项目配置文件并添加以下代码:
require 'ceaser-easing'
然后在您的Sass/SCSS文件中导入Ceaser Easing:
@import "ceaser-easing";
创建一个使用Ceaser Easing的新项目,可以按照以下步骤操作:
compass create project_name -r ceaser-easing -u ceaser-easing
接着,在您的Sass/SCSS文件中导入Ceaser Easing:
@import "ceaser-easing";
2. 项目的使用说明
Ceaser Easing扩展为Sass提供了一个名为ceaser的函数,您可以将该函数用作过渡(transition)或动画(animation)的timing-function属性的值。您需要传递所需的缓动类型给该函数,它会为您应用正确的cubic-bezier过渡定时函数。
以下是ceaser函数的使用示例:
#transition {
transition-property: all;
transition-duration: 1.2s;
transition-timing-function: ceaser($ease-in);
}
#transition-shorthand {
transition: all 1.2s ceaser($ease-in);
}
#animation {
animation-name: animateMe;
animation-iteration-count: infinite;
animation-duration: 10s;
animation-timing-function: ceaser($easeInSine);
}
#animation-shorthand {
animation: animateMe 10s ceaser($easeInSine) infinite;
}
3. 项目API使用文档
Ceaser Easing扩展提供了以下缓动类型供您选择:
-
$linear -
$ease(默认值) -
$ease-in -
$ease-out -
$ease-in-out -
$easeInQuad -
$easeInCubic -
$easeInQuart -
$easeInQuint -
$easeInSine -
$easeInExpo -
$easeInCirc -
$easeInBack -
$easeOutQuad -
$easeOutCubic -
$easeOutQuart -
$easeOutQuint -
$easeOutSine -
$easeOutExpo -
$easeOutCirc -
$easeOutBack -
$easeInOutQuad -
$easeInOutCubic -
$easeInOutQuart -
$easeInOutQuint -
$easeInOutSine -
$easeInOutExpo -
$easeInOutCirc -
$easeInOutBack
此外,Ceaser Easing扩展还提供了一个名为ceaser的mixin,允许您传递所需的缓动类型给mixin,它会应用正确的cubic-bezier过渡定时函数。您还可以传递过渡属性、持续时间和延迟时间(默认分别为all、500ms和0)。
@mixin ceaser-transition($transition-property, $duration, $ease-type, $delay: 0) {
// mixin内容
}
@include ceaser-transition(all, 3s, $ease-in);
@include ceaser-transition(width, 500ms, $easeInOutExpo, 1s);
以下是如何为具有box ID的HTML元素创建上述过渡的示例:
#box {
width: 500px;
@include ceaser-transition(width, 500ms, $easeInOutExpo, 1s);
}
#box:hover {
width: 700px;
}
4. 项目安装方式
请遵循上述“安装指南”中的步骤进行安装。
atomcodeClaude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed. Get StartedRust099- DDeepSeek-V4-ProDeepSeek-V4-Pro(总参数 1.6 万亿,激活 49B)面向复杂推理和高级编程任务,在代码竞赛、数学推理、Agent 工作流等场景表现优异,性能接近国际前沿闭源模型。Python00
MiMo-V2.5-ProMiMo-V2.5-Pro作为旗舰模型,擅⻓处理复杂Agent任务,单次任务可完成近千次⼯具调⽤与⼗余轮上 下⽂压缩。Python00
GLM-5.1GLM-5.1是智谱迄今最智能的旗舰模型,也是目前全球最强的开源模型。GLM-5.1大大提高了代码能力,在完成长程任务方面提升尤为显著。和此前分钟级交互的模型不同,它能够在一次任务中独立、持续工作超过8小时,期间自主规划、执行、自我进化,最终交付完整的工程级成果。Jinja00
Kimi-K2.6Kimi K2.6 是一款开源的原生多模态智能体模型,在长程编码、编码驱动设计、主动自主执行以及群体任务编排等实用能力方面实现了显著提升。Python00
MiniMax-M2.7MiniMax-M2.7 是我们首个深度参与自身进化过程的模型。M2.7 具备构建复杂智能体应用框架的能力,能够借助智能体团队、复杂技能以及动态工具搜索,完成高度精细的生产力任务。Python00