只做文字效果
TO BE CSS
Ls
关闭
全选
function a() {
//盒子阴影
if ($("#backgroundColor").val() == "") {
var q = "333333"
} else {
var q = $("#backgroundColor").val()
}
$("#result").css("background-color", q);
if ($("#shadowSize").val() == "") {
var f = 100
} else {
var f = $("#shadowSize").val()
} if ($("#fadeStart").val() == "") {
var p = 60 / 100
} else {
var p = $("#fadeStart").val() / 100
} if ($("#shadowAlpha").val() == "") {
var n = 10 / 100
} else {
var n = $("#shadowAlpha").val() / 100
}
var o = $.xcolor.opacity("#" + q, "black", n);
var h = [];
var g = Math.ceil(f * p);
if (n < 0.01) {
f = 0
}
for (var j = 0; j < f; j++) {
var m = f - j;
var l = f - j;
var r = m + "px " + l + "px ";
if (j <= g && p > 0.01) {
var k = $.xcolor.gradientlevel(o, q, g - j, g);
r += k
} else {
r += o
}
h.push(r)
}
var d = h.reverse().join();
$("#shape").css({
"box-shadow": d
})
}
//文字阴影
function c() {
if ($("#shapeColor").val() == "") {
var q = "00ccff"
} else {
var q = $("#shapeColor").val()
}
$("#shape").css("background-color", q);
if ($("#textShadowSize").val() == "") {
var f = 30
} else {
var f = $("#textShadowSize").val()
} if ($("#fadeTextStart").val() == "") {
var d = 60 / 100
} else {
var d = $("#fadeTextStart").val() / 100
} if ($("#textAlpha").val() == "") {
var r = 10 / 100
} else {
var r = $("#textAlpha").val() / 100
}
var o = $.xcolor.opacity("#" + q, "black", r);
var g = [];
var m = Math.ceil(f * d);
if (r < 0.01) {
f = 0
}
for (var j = 0; j < f; j++) {
var l = f - j;
var h = f - j;
var p = l + "px " + h + "px ";
if (j <= m && d > 0.01) {
var k = $.xcolor.gradientlevel(o, q, m - j, m);
p += k
} else {
p += o
}
g.push(p)
}
var n = g.reverse().join();
$("#shape").css({
"text-shadow": n
})
}