首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >shopify/Dashing研讨会coffeescript语法问题

shopify/Dashing研讨会coffeescript语法问题
EN

Stack Overflow用户
提问于 2013-10-29 22:29:48
回答 1查看 713关注 0票数 1

我目前正在从事一个项目,该项目正在采取积极的检查饲料从纳吉奥斯Check_mk,并显示在一个文本小工具。我正在尝试让小工具改变颜色,通过研讨会页面,我被咖啡脚本卡住了,当值改变时,它似乎没有任何影响。这是我所拥有的

alert.coffee

代码语言:javascript
复制
class Dashing.Alert extends Dashing.Widget

ready: ->
# This is fired when the widget is done being rendered

onData: (data) ->
# Handle incoming data
# You can access the html node of this widget with @node
# Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.

@accessor 'value', Dashing.AnimatedValue

@accessor 'isTooHigh', ->
@get('value') > 200

警报scss

代码语言:javascript
复制
 .widget-alert {
background: #00ff99; 
font-size: 65px; 
font-weight: bold; 
}

.danger {
background: #ff1a00;
}

所有其他文件都与研讨会页面中的详细信息完全相同:如有任何帮助,非常感谢。

EN

回答 1

Stack Overflow用户

发布于 2014-10-09 14:44:18

基本上,颜色的改变或颜色的动画闪烁是由scss @keyframe规则处理的,您必须将其绑定到选择器,否则动画将不起作用

下面是一些例子

代码语言:javascript
复制
    $background-alert-color-1: #FFFF66;
    $background-alert-color-2: #FF9618;
    $text-alert-color: #fff;


    @-webkit-keyframes status-alert-background {
      0%   { background-color: $background-alert-color-1; }
      50%  { background-color: $background-alert-color-2; }
      100% { background-color: $background-alert-color-1; }
    }

    .widget.status-alert {
      color: $text-alert-color;
      background-color: $background-alert-color-1;
      @include animation(status-alert-background, 2s, ease, infinite);

      .icon-alert-sign {
        display: inline-block;
      }

     .title, .more-info {
      color: $text-alert-color;
    }

对于一些示例和参考(也适用于咖啡脚本),您可以查看以下dashing_zabbix

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19661083

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档