文本呈现意外地改变

时间:2015-11-19 10:48:24

标签: javascript html css

我有一个问题,我正在努力孤立,因为我的一些文字改变了它的外观,看起来比其他时候更加大胆。这与我引入的“脉冲”效应同步,但我很难理解为什么。

这是影响的一个例子。在这个动画GIF中寻找的东西:

  • 名称:注意上面带有灰色脉冲的感叹号
  • 服务器项目/项目类型/文件扩展名:仔细观察,您会看到文本变得更大胆
  • 请注意,其他更改(较大的感叹号和项目类型数据更改且不相关,我已经注释掉并仍然看到了影响)。

enter image description here

编辑我设法获得了一个复制品并更新了此片段的片段。

我应该注意到我只在Chrome中看过这个。 Firefox看起来很好,但遗憾的是IE还没有与代码库一起使用,所以在我进行复制工作之前我无法测试。

以下代码的作用是简单地在已添加的新animate上切换<span class="pulse">课程。这应该会触发CSS动画再次启动,这会改变灰色脉冲的大小。

    // Sets up a pulsing affect on any invalid icons within the Deck
    (function () {

        setInterval(function () {
            // Check for any invalid classes, if none were found then just return
            var cardErrors = $(".card.invalid");
            if (cardErrors.length === 0) return;

            function pulse(selection, size, position) {

                var missingPulses = selection.filter(function (index, element) {
                    return $(element).find(".pulse").length === 0;
                });

                missingPulses.prepend("<div class='pulse'></div>");

                // Find the pulse and remove the animation class
                var pulse = selection.find(".pulse");
                pulse.removeClass("animate");

                // Define the pulse size if it's not done already
                if (!pulse.filter(function (index, element) {
                    return !pulse.height() && !pulse.width();
                }).length !== 0) {
                    pulse.css(size);
                    pulse.css(position);
                }

                //set the position and add class .animate
                //pulse.css(position)
                pulse.addClass("animate");
            }

            pulse(cardErrors, {
                height: 12,
                width: 12
            }, {
                top: 11 + 'px',
                left: 316 + 'px'
            });

        }, 2500);
    })();
.pulse {
    display: block;
    position: absolute;
    background: #555;
    border-radius: 100%;
    -moz-transform: scale(0);
    -ms-transform: scale(0);
    -o-transform: scale(0);
    -webkit-transform: scale(0);
    transform: scale(0);
}
/*animation effect*/
 .pulse.animate {
    -moz-animation: pulse-ripple 0.65s linear;
    -o-animation: pulse-ripple 0.65s linear;
    -webkit-animation: pulse-ripple 0.65s linear;
    animation: pulse-ripple 0.65s linear;
}

@keyframes pulse-ripple {
    /*scale the element to 250% to safely cover the entire link and fade it out*/
    100% {
        opacity: 0;
        -moz-transform: scale(2.5);
        -ms-transform: scale(2.5);
        -o-transform: scale(2.5);
        -webkit-transform: scale(2.5);
        transform: scale(2.5);
    }
}
/* Mixins */

/* Comment here */
 html {
    height: 100%;
}
body {
    height: 100%;
}
body {
    scrollbar-base-color: #999;
    scrollbar-track-color: #EBEBEB;
    scrollbar-arrow-color: black;
    scrollbar-shadow-color: #C0C0C0;
    scrollbar-dark-shadow-color: #C0C0C0;
}
::-webkit-scrollbar {
    width: 10px;
    height: 30px;
}
::-webkit-scrollbar-button {
    height: 0px;
}
::-webkit-scrollbar-track-piece {
    background-color: #EBEBEB;
}
::-webkit-scrollbar-thumb {
    height: 20px;
    background-color: #999;
    border-radius: 5px;
}
::-webkit-scrollbar-corner {
    background-color: #999;
}
::-webkit-resizer {
    background-color: #999;
}
.deck {
    background: rgba(250, 250, 251, 0.88);
    position: absolute;
    top: 0;
    right: 0;
    width: 345px;
    padding: 10px 10px 10px 10px;
    opacity: 1;
    height: 100%;
    z-index: 10;
}
.deck .scrollable {
    overflow-y: scroll;
    width: 338px;
    height: 100%;
    padding-right: 7px;
}
.deck .non-scrollable {
    width: 338px;
    overflow: hidden;
}
.deck .non-scrollable .card {
    width: 338px !important;
}
.deck .card {
    margin-bottom: 11px;
    background: #FFFFFF;
    float: right;
    clear: both;
    font-family:'Open Sans', Arial, sans-serif;
    width: 318px;
    padding: 10px 12px 10px 12px;
    -moz-transition: box-shadow 0.5s ease;
    -webkit-transition: box-shadow 0.5s ease;
    -o-transition: box-shadow 0.5s ease;
    transition: box-shadow 0.5s ease;
    box-shadow: 0px 1px 5px 1px rgba(198, 198, 198, 0.75);
    /*relative positioning for list items along with overflow hidden to contain the overflowing ripple*/
    position: relative;
    overflow: hidden !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* remove padding added by bootstrap, but only within cards */
}
.deck .card[class*='col-'] {
    padding-right: 0;
    padding-left: 0;
}
.deck .card.summary-card {
    cursor: pointer;
    /* https://github.com/ConnorAtherton/loaders.css MIT */
}
.deck .card.summary-card:hover {
    box-shadow: 10px 10px 50px 0px #c6c6c6;
}
.deck .card.summary-card .title {
    color: #33BDDE;
    font-size: 14px;
    font-weight: normal;
    display: block;
    padding-bottom: 5px;
    padding-left: 10px;
}
.deck .card.summary-card .notification {
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    position: absolute;
}
.deck .card.summary-card.busy .notification {
    border-radius: 100%;
    -webkit-animation-fill-mode: both;
    -moz-animation-fill-mode: both;
    -o-animation-fill-mode: both;
    animation-fill-mode: both;
    border: 3px solid #33BDDE;
    border-bottom-color: transparent;
    height: 15px;
    width: 15px;
    background: transparent !important;
    display: inline-block;
    -webkit-animation: rotate 1.25s 0s linear infinite;
    -moz-animation: rotate 1.25s 0s linear infinite;
    -o-animation: rotate 1.25s 0s linear infinite;
    animation: rotate 1.25s 0s linear infinite;
}
.deck .card.summary-card.filtered .notification:before {
    position: relative;
    font-family: FontAwesome;
    top: 0px;
    left: 0px;
    color: #33BDDE;
    font-size: 18px;
    content:"\f0b0";
}
.deck .card.summary-card .content {
    padding: 0 0 0 0;
}
.deck .card.summary-card .content .label {
    color: #303E45;
    font-size: 12px;
    font-weight: normal;
    float: left;
}
.deck .card.summary-card .content .value {
    color: #8BC34A;
    font-size: 12px;
    font-weight: normal;
    float: right;
}
.deck .card.summary-card .content .ellipsis {
    white-space: nowrap;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    -ms-text-overflow: ellipsis;
    text-overflow: ellipsis;
}
@keyframes rotate {
    0% {
        -moz-transform: rotateZ(0deg);
        -ms-transform: rotateZ(0deg);
        -o-transform: rotateZ(0deg);
        -webkit-transform: rotateZ(0deg);
        transform: rotateZ(0deg);
    }
    100% {
        -moz-transform: rotateZ(360deg);
        -ms-transform: rotateZ(360deg);
        -o-transform: rotateZ(360deg);
        -webkit-transform: rotateZ(360deg);
        transform: rotateZ(360deg);
    }
}
/* ripple effect from http://thecodeplayer.com/walkthrough/ripple-click-effect-google-material-design */

/*.ink styles - the elements which will create the ripple effect. The size and position of these elements will be set by the JS code. Initially these elements will be scaled down to 0% and later animated to large fading circles on user click.*/
 .ink {
    display: block;
    position: absolute;
    background: rgba(198, 198, 198, 0.5);
    border-radius: 100%;
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    -o-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0);
}
/* animation effect */
 .ink.animate {
    -webkit-animation: ripple 0.65s linear;
    -moz-animation: ripple 0.65s linear;
    -o-animation: ripple 0.65s linear;
    animation: ripple 0.65s linear;
}
@-webkit-keyframes ripple {
    /*scale the element to 250% to safely cover the entire link and fade it out*/
    100% {
        opacity: 0;
        -moz-transform: scale(2.5);
        -ms-transform: scale(2.5);
        -o-transform: scale(2.5);
        -webkit-transform: scale(2.5);
        transform: scale(2.5);
    }
}
@-moz-keyframes ripple {
    /*scale the element to 250% to safely cover the entire link and fade it out*/
    100% {
        opacity: 0;
        -moz-transform: scale(2.5);
        -ms-transform: scale(2.5);
        -o-transform: scale(2.5);
        -webkit-transform: scale(2.5);
        transform: scale(2.5);
    }
}
@keyframes ripple {
    /*scale the element to 250% to safely cover the entire link and fade it out*/
    100% {
        opacity: 0;
        -moz-transform: scale(2.5);
        -ms-transform: scale(2.5);
        -o-transform: scale(2.5);
        -webkit-transform: scale(2.5);
        transform: scale(2.5);
    }
}
@-webkit-keyframes rotate {
    0% {
        -moz-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        -ms-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    50% {
        -moz-transform: rotate(180deg);
        -o-transform: rotate(180deg);
        -webkit-transform: rotate(180deg);
        -ms-transform: rotate(180deg);
        transform: rotate(180deg);
    }
    100% {
        -moz-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}
@keyframes rotate {
    0% {
        -moz-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        -ms-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    50% {
        -moz-transform: rotate(180deg);
        -o-transform: rotate(180deg);
        -webkit-transform: rotate(180deg);
        -ms-transform: rotate(180deg);
        transform: rotate(180deg);
    }
    100% {
        -moz-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}
/* end of cards menu */

/* tooltips */
 .dxc-tooltip {
    z-index: 20;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="deck">
    <div class="scrollable">
        <div>
            <div class="card summary-card string-card aggregate-card clickable filtered invalid" id="FI.NAM">
                <div class="notification"></div> <span class="title" data-bind="text: name">Name</span>

            </div>
        </div>
        <div>
            <div class="card summary-card string-card aggregate-card clickable" id="FI.SER">
                <div class="notification"></div> <span class="title" data-bind="text: name">Server Item</span>

            </div>
        </div>
        <div>
            <div class="card summary-card string-card aggregate-card clickable" id="FI.FIL">
                <div class="notification"></div> <span class="title" data-bind="text: name">File Extension</span>

            </div>
        </div>
    </div>
</div>

0 个答案:

没有答案