feGaussianBlur在Safari或IE上无法正常工作?

时间:2017-06-29 06:30:53

标签: html5 css3 svg css-animations svg-filters

我已经检查过Safari支持feGaussianBlur,但为什么它没有在浏览器上显示模糊效果?任何人都可以对此有所了解吗?

是否有遗漏或需要进行额外检查,尤其是Safari和IE?它在Google Chrome和Firefox上运行良好。



#container {
	margin: 0 auto
	border:1px solid #fff;
	width: 100%;
	min-height: 500px;
	position: relative;
	padding-top: 50%;
}

.cssload-dots {
	width: 100%;
	height: 100%;
	left: 50%;
	position: absolute;
	filter: url(#goo);
		-o-filter: url(#goo);
		-ms-filter: url(#goo);
		-webkit-filter: url(#goo);
		-moz-filter: url(#goo);
}

.cssload-dot {
	width: 0;
	height: 0;
	position: absolute;
	left: 0;
	top: 0;
}

.cssload-dot:before {
	content: "";
	width: 34px;
	height: 34px;
	-webkit-border-radius: 49px;
	-moz-border-radius: 49px;
	border-radius: 49px;
	background: rgb(251,211,1);
	position: absolute;
	left: 50%;
	transform: translateY(0);
		-o-transform: translateY(0);
		-ms-transform: translateY(0);
		-webkit-transform: translateY(0);
		-moz-transform: translateY(0);
	margin-left: -17.5px;
	margin-top: -17.5px;
}

.cssload-dot:nth-child(5):before {
	z-index: 100;
	width: 44.5px;
	height: 44.5px;
	margin-left: -21.75px;
	margin-top: -21.75px;
	animation: cssload-dot-colors 3s ease infinite;
		-o-animation: cssload-dot-colors 3s ease infinite;
		-ms-animation: cssload-dot-colors 3s ease infinite;
		-webkit-animation: cssload-dot-colors 3s ease infinite;
		-moz-animation: cssload-dot-colors 3s ease infinite;
}

.cssload-dot:nth-child(1) {
	animation: cssload-dot-rotate-1 3s 0s linear infinite;
		-o-animation: cssload-dot-rotate-1 3s 0s linear infinite;
		-ms-animation: cssload-dot-rotate-1 3s 0s linear infinite;
		-webkit-animation: cssload-dot-rotate-1 3s 0s linear infinite;
		-moz-animation: cssload-dot-rotate-1 3s 0s linear infinite;
}

.cssload-dot:nth-child(1):before {
	background-color: rgb(255,50,112);
	animation: cssload-dot-move 3s 0s ease infinite;
		-o-animation: cssload-dot-move 3s 0s ease infinite;
		-ms-animation: cssload-dot-move 3s 0s ease infinite;
		-webkit-animation: cssload-dot-move 3s 0s ease infinite;
		-moz-animation: cssload-dot-move 3s 0s ease infinite;
}

.cssload-dot:nth-child(2) {
	animation: cssload-dot-rotate-2 3s 0.75s linear infinite;
		-o-animation: cssload-dot-rotate-2 3s 0.75s linear infinite;
		-ms-animation: cssload-dot-rotate-2 3s 0.75s linear infinite;
		-webkit-animation: cssload-dot-rotate-2 3s 0.75s linear infinite;
		-moz-animation: cssload-dot-rotate-2 3s 0.75s linear infinite;
}

.cssload-dot:nth-child(2):before {
	background-color: rgb(32,139,241);
	animation: cssload-dot-move 3s 0.75s ease infinite;
		-o-animation: cssload-dot-move 3s 0.75s ease infinite;
		-ms-animation: cssload-dot-move 3s 0.75s ease infinite;
		-webkit-animation: cssload-dot-move 3s 0.75s ease infinite;
		-moz-animation: cssload-dot-move 3s 0.75s ease infinite;
}

.cssload-dot:nth-child(3) {
	animation: cssload-dot-rotate-3 3s 1.5s linear infinite;
		-o-animation: cssload-dot-rotate-3 3s 1.5s linear infinite;
		-ms-animation: cssload-dot-rotate-3 3s 1.5s linear infinite;
		-webkit-animation: cssload-dot-rotate-3 3s 1.5s linear infinite;
		-moz-animation: cssload-dot-rotate-3 3s 1.5s linear infinite;
}

.cssload-dot:nth-child(3):before {
	background-color: rgb(175,225,2);
	animation: cssload-dot-move 3s 1.5s ease infinite;
		-o-animation: cssload-dot-move 3s 1.5s ease infinite;
		-ms-animation: cssload-dot-move 3s 1.5s ease infinite;
		-webkit-animation: cssload-dot-move 3s 1.5s ease infinite;
		-moz-animation: cssload-dot-move 3s 1.5s ease infinite;
}

.cssload-dot:nth-child(4) {
	animation: cssload-dot-rotate-4 3s 2.25s linear infinite;
		-o-animation: cssload-dot-rotate-4 3s 2.25s linear infinite;
		-ms-animation: cssload-dot-rotate-4 3s 2.25s linear infinite;
		-webkit-animation: cssload-dot-rotate-4 3s 2.25s linear infinite;
		-moz-animation: cssload-dot-rotate-4 3s 2.25s linear infinite;
}

.cssload-dot:nth-child(4):before {
	background-color: rgb(251,211,1);
	animation: cssload-dot-move 3s 2.25s ease infinite;
		-o-animation: cssload-dot-move 3s 2.25s ease infinite;
		-ms-animation: cssload-dot-move 3s 2.25s ease infinite;
		-webkit-animation: cssload-dot-move 3s 2.25s ease infinite;
		-moz-animation: cssload-dot-move 3s 2.25s ease infinite;
}

@keyframes cssload-dot-move {
	0% {
		transform: translateY(0);
	}
	18%, 22% {
		transform: translateY(-68px);
	}
	40%, 100% {
		transform: translateY(0);
	}
}

@-o-keyframes cssload-dot-move {
	0% {
		-o-transform: translateY(0);
	}
	18%, 22% {
		-o-transform: translateY(-68px);
	}
	40%, 100% {
		-o-transform: translateY(0);
	}
}

@-ms-keyframes cssload-dot-move {
	0% {
		-ms-transform: translateY(0);
	}
	18%, 22% {
		-ms-transform: translateY(-68px);
	}
	40%, 100% {
		-ms-transform: translateY(0);
	}
}

@-webkit-keyframes cssload-dot-move {
	0% {
		-webkit-transform: translateY(0);
	}
	18%, 22% {
		-webkit-transform: translateY(-68px);
	}
	40%, 100% {
		-webkit-transform: translateY(0);
	}
}

@-moz-keyframes cssload-dot-move {
	0% {
		-moz-transform: translateY(0);
	}
	18%, 22% {
		-moz-transform: translateY(-68px);
	}
	40%, 100% {
		-moz-transform: translateY(0);
	}
}

@keyframes cssload-dot-colors {
	0% {
		background-color: rgb(251,211,1);
	}
	25% {
		background-color: rgb(255,50,112);
	}
	50% {
		background-color: rgb(32,139,241);
	}
	75% {
		background-color: rgb(175,225,2);
	}
	100% {
		background-color: rgb(251,211,1);
	}
}

@-o-keyframes cssload-dot-colors {
	0% {
		background-color: rgb(251,211,1);
	}
	25% {
		background-color: rgb(255,50,112);
	}
	50% {
		background-color: rgb(32,139,241);
	}
	75% {
		background-color: rgb(175,225,2);
	}
	100% {
		background-color: rgb(251,211,1);
	}
}

@-ms-keyframes cssload-dot-colors {
	0% {
		background-color: rgb(251,211,1);
	}
	25% {
		background-color: rgb(255,50,112);
	}
	50% {
		background-color: rgb(32,139,241);
	}
	75% {
		background-color: rgb(175,225,2);
	}
	100% {
		background-color: rgb(251,211,1);
	}
}

@-webkit-keyframes cssload-dot-colors {
	0% {
		background-color: rgb(251,211,1);
	}
	25% {
		background-color: rgb(255,50,112);
	}
	50% {
		background-color: rgb(32,139,241);
	}
	75% {
		background-color: rgb(175,225,2);
	}
	100% {
		background-color: rgb(251,211,1);
	}
}

@-moz-keyframes cssload-dot-colors {
	0% {
		background-color: rgb(251,211,1);
	}
	25% {
		background-color: rgb(255,50,112);
	}
	50% {
		background-color: rgb(32,139,241);
	}
	75% {
		background-color: rgb(175,225,2);
	}
	100% {
		background-color: rgb(251,211,1);
	}
}

@keyframes cssload-dot-rotate-1 {
	0% {
		transform: rotate(-105deg);
	}
	100% {
		transform: rotate(270deg);
	}
}

@-o-keyframes cssload-dot-rotate-1 {
	0% {
		-o-transform: rotate(-105deg);
	}
	100% {
		-o-transform: rotate(270deg);
	}
}

@-ms-keyframes cssload-dot-rotate-1 {
	0% {
		-ms-transform: rotate(-105deg);
	}
	100% {
		-ms-transform: rotate(270deg);
	}
}

@-webkit-keyframes cssload-dot-rotate-1 {
	0% {
		-webkit-transform: rotate(-105deg);
	}
	100% {
		-webkit-transform: rotate(270deg);
	}
}

@-moz-keyframes cssload-dot-rotate-1 {
	0% {
		-moz-transform: rotate(-105deg);
	}
	100% {
		-moz-transform: rotate(270deg);
	}
}

@keyframes cssload-dot-rotate-2 {
	0% {
		transform: rotate(165deg);
	}
	100% {
		transform: rotate(540deg);
	}
}

@-o-keyframes cssload-dot-rotate-2 {
	0% {
		-o-transform: rotate(165deg);
	}
	100% {
		-o-transform: rotate(540deg);
	}
}

@-ms-keyframes cssload-dot-rotate-2 {
	0% {
		-ms-transform: rotate(165deg);
	}
	100% {
		-ms-transform: rotate(540deg);
	}
}

@-webkit-keyframes cssload-dot-rotate-2 {
	0% {
		-webkit-transform: rotate(165deg);
	}
	100% {
		-webkit-transform: rotate(540deg);
	}
}

@-moz-keyframes cssload-dot-rotate-2 {
	0% {
		-moz-transform: rotate(165deg);
	}
	100% {
		-moz-transform: rotate(540deg);
	}
}

@keyframes cssload-dot-rotate-3 {
	0% {
		transform: rotate(435deg);
	}
	100% {
		transform: rotate(810deg);
	}
}

@-o-keyframes cssload-dot-rotate-3 {
	0% {
		-o-transform: rotate(435deg);
	}
	100% {
		-o-transform: rotate(810deg);
	}
}

@-ms-keyframes cssload-dot-rotate-3 {
	0% {
		-ms-transform: rotate(435deg);
	}
	100% {
		-ms-transform: rotate(810deg);
	}
}

@-webkit-keyframes cssload-dot-rotate-3 {
	0% {
		-webkit-transform: rotate(435deg);
	}
	100% {
		-webkit-transform: rotate(810deg);
	}
}

@-moz-keyframes cssload-dot-rotate-3 {
	0% {
		-moz-transform: rotate(435deg);
	}
	100% {
		-moz-transform: rotate(810deg);
	}
}

@keyframes cssload-dot-rotate-4 {
	0% {
		transform: rotate(705deg);
	}
	100% {
		transform: rotate(1080deg);
	}
}

@-o-keyframes cssload-dot-rotate-4 {
	0% {
		-o-transform: rotate(705deg);
	}
	100% {
		-o-transform: rotate(1080deg);
	}
}

@-ms-keyframes cssload-dot-rotate-4 {
	0% {
		-ms-transform: rotate(705deg);
	}
	100% {
		-ms-transform: rotate(1080deg);
	}
}

@-webkit-keyframes cssload-dot-rotate-4 {
	0% {
		-webkit-transform: rotate(705deg);
	}
	100% {
		-webkit-transform: rotate(1080deg);
	}
}

@-moz-keyframes cssload-dot-rotate-4 {
	0% {
		-moz-transform: rotate(705deg);
	}
	100% {
		-moz-transform: rotate(1080deg);
	}
}

<div id="container">
	<div class="cssload-dots">
		<div class="cssload-dot"></div>
		<div class="cssload-dot"></div>
		<div class="cssload-dot"></div>
		<div class="cssload-dot"></div>
		<div class="cssload-dot"></div>
	</div>
</div>

<svg>
	<defs>
		<filter id="goo">
			<feGaussianBlur in="SourceGraphic" result="blur" stdDeviation="12" />
			<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0	0 1 0 0 0	0 0 1 0 0	0 0 0 18 -7" result="goo" />
			<!-- <feBlend in2="goo" in="SourceGraphic" result="mix" ></feBlend> -->
		</filter>
	</defs>
</svg>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

三件事:

  1. feColorMatrix应该有{{1}}(模式适用于feBlend)
  2. Safari曾经有过你必须放置SVG的错误 文档前面的定义比使用类时的定义。一世 以为他们已经修好了 - 但是如果有的话就提到了 一直在回归。
  3. 你应该总是把一个没有前缀的版本 前缀版本末尾的前缀CSS属性。一世 不知道Safari是否有没有前缀的过滤器,但是如果他们有(和 EOL&#39; d -webkit)然后它不知道该怎么做。
  4. IE / Edge还不支持通过CSS使用SVG过滤器,因此不应该在MSFT浏览器中使用。