路径:D:\ireport365\ireport365.war\js\enduser\designer\vs-component-basic.js
在designer.css里添加五种动画css
路径:D:\ireport365\ireport365.war\js\enduser\designer\designer.css
```
/* 五种时间文字特效 start*/
body .particletext {
position: relative;
}
body .particletext.bubbles > .particle {
opacity: 0;
position: absolute;
background-color: rgba(33, 150, 243, 0.5);
-webkit-animation: bubbles 3s ease-in infinite;
animation: bubbles 3s ease-in infinite;
border-radius: 100%;
}
body .particletext.hearts > .particle {
opacity: 0;
position: absolute;
background-color: #cc2a5d;
-webkit-animation: hearts 3s ease-in infinite;
animation: hearts 3s ease-in infinite;
}
body .particletext.hearts > .particle:before, body .particletext.hearts > .particle:after {
position: absolute;
content: '';
border-radius: 100px;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-color: #cc2a5d;
}
body .particletext.hearts > .particle:before {
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
body .particletext.hearts > .particle:after {
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
body .particletext.lines > .particle {
position: absolute;
background-color: rgba(244, 67, 54, 0.5);
-webkit-animation: lines 3s linear infinite;
animation: lines 3s linear infinite;
}
body .particletext.confetti > .particle {
opacity: 0;
position: absolute;
-webkit-animation: confetti 3s ease-in infinite;
animation: confetti 3s ease-in infinite;
}
body .particletext.confetti > .particle.c1 {
background-color: rgba(76, 175, 80, 0.5);
}
body .particletext.confetti > .particle.c2 {
background-color: rgba(156, 39, 176, 0.5);
}
body .particletext.fire > .particle {
position: absolute;
background-color: rgba(255, 193, 7, 0.5);
border-radius: 40px;
border-top-right-radius: 0px;
-webkit-animation: fires 0.8s linear infinite;
animation: fires 0.8s linear infinite;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
opacity: 0;
}
body .particletext.fire > .particle:before {
position: absolute;
content: '';
top: 60%;
left: 40%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 50%;
height: 50%;
border-radius: 40px;
border-top-right-radius: 0px;
background-color: rgba(251, 140, 0, 0.5);
}
body .particletext.sunbeams > .particle {
position: absolute;
background-color: rgba(253, 216, 53, 0.5);
-webkit-animation: sunbeams 3s linear infinite;
animation: sunbeams 3s linear infinite;
}
@-webkit-keyframes bubbles {
0% {
opacity: 0;
}
20% {
opacity: 1;
-webkit-transform: translate(0, -20%);
transform: translate(0, -20%);
}
100% {
opacity: 0;
-webkit-transform: translate(0, -1000%);
transform: translate(0, -1000%);
}
}
@keyframes bubbles {
0% {
opacity: 0;
}
20% {
opacity: 1;
-webkit-transform: translate(0, -20%);
transform: translate(0, -20%);
}
100% {
opacity: 0;
-webkit-transform: translate(0, -1000%);
transform: translate(0, -1000%);
}
}
@-webkit-keyframes hearts {
0% {
opacity: 0;
-webkit-transform: translate(0, 0%) rotate(45deg);
transform: translate(0, 0%) rotate(45deg);
}
20% {
opacity: 0.8;
-webkit-transform: translate(0, -20%) rotate(45deg);
transform: translate(0, -20%) rotate(45deg);
}
100% {
opacity: 0;
-webkit-transform: translate(0, -1000%) rotate(45deg);
transform: translate(0, -1000%) rotate(45deg);
}
}
@keyframes hearts {
0% {
opacity: 0;
-webkit-transform: translate(0, 0%) rotate(45deg);
transform: translate(0, 0%) rotate(45deg);
}
20% {
opacity: 0.8;
-webkit-transform: translate(0, -20%) rotate(45deg);
transform: translate(0, -20%) rotate(45deg);
}
100% {
opacity: 0;
-webkit-transform: translate(0, -1000%) rotate(45deg);
transform: translate(0, -1000%) rotate(45deg);
}
}
@-webkit-keyframes lines {
0%, 50%, 100% {
-webkit-transform: translateY(0%);
transform: translateY(0%);
}
25% {
-webkit-transform: translateY(100%);
transform: translateY(100%);
}
75% {
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
}
}
@keyframes lines {
0%, 50%, 100% {
-webkit-transform: translateY(0%);
transform: translateY(0%);
}
25% {
-webkit-transform: translateY(100%);
transform: translateY(100%);
}
75% {
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
}
}
@-webkit-keyframes confetti {
0% {
opacity: 0;
-webkit-transform: translateY(0%) rotate(0deg);
transform: translateY(0%) rotate(0deg);
}
10% {
opacity: 1;
}
35% {
-webkit-transform: translateY(-800%) rotate(270deg);
transform: translateY(-800%) rotate(270deg);
}
80% {
opacity: 1;
}
100% {
opacity: 0;
-webkit-transform: translateY(2000%) rotate(1440deg);
transform: translateY(2000%) rotate(1440deg);
}
}
@keyframes confetti {
0% {
opacity: 0;
-webkit-transform: translateY(0%) rotate(0deg);
transform: translateY(0%) rotate(0deg);
}
10% {
opacity: 1;
}
35% {
-webkit-transform: translateY(-800%) rotate(270deg);
transform: translateY(-800%) rotate(270deg);
}
80% {
opacity: 1;
}
100% {
opacity: 0;
-webkit-transform: translateY(2000%) rotate(1440deg);
transform: translateY(2000%) rotate(1440deg);
}
}
@-webkit-keyframes fires {
0% {
-webkit-transform: rotate(-70deg) translateY(0%);
transform: rotate(-70deg) translateY(0%);
}
25% {
-webkit-transform: rotate(-20deg) translateY(-5%);
transform: rotate(-20deg) translateY(-5%);
opacity: 1;
}
50% {
-webkit-transform: rotate(-70deg) translateY(-10%);
transform: rotate(-70deg) translateY(-10%);
}
75% {
-webkit-transform: rotate(-20deg) translateY(-20%);
transform: rotate(-20deg) translateY(-20%);
}
100% {
-webkit-transform: rotate(-70deg) translateY(-40%);
transform: rotate(-70deg) translateY(-40%);
opacity: 1;
}
}
@keyframes fires {
0% {
-webkit-transform: rotate(-70deg) translateY(0%);
transform: rotate(-70deg) translateY(0%);
}
25% {
-webkit-transform: rotate(-20deg) translateY(-5%);
transform: rotate(-20deg) translateY(-5%);
opacity: 1;
}
50% {
-webkit-transform: rotate(-70deg) translateY(-10%);
transform: rotate(-70deg) translateY(-10%);
}
75% {
-webkit-transform: rotate(-20deg) translateY(-20%);
transform: rotate(-20deg) translateY(-20%);
}
100% {
-webkit-transform: rotate(-70deg) translateY(-40%);
transform: rotate(-70deg) translateY(-40%);
opacity: 1;
}
}
@-webkit-keyframes sunbeams {
0% {
-webkit-transform: translateY(40%) rotate(0deg);
transform: translateY(40%) rotate(0deg);
}
50% {
-webkit-transform: translateY(-40%) rotate(180deg);
transform: translateY(-40%) rotate(180deg);
}
100% {
-webkit-transform: translateY(40%) rotate(360deg);
transform: translateY(40%) rotate(360deg);
}
0%,14%,17%,43%,53%,71%,80%,94%,100% {
opacity: 0;
}
6%,15%,24%,28%,48%,55%,78%,82%,99% {
opacity: 1;
}
}
@keyframes sunbeams {
0% {
-webkit-transform: translateY(40%) rotate(0deg);
transform: translateY(40%) rotate(0deg);
}
50% {
-webkit-transform: translateY(-40%) rotate(180deg);
transform: translateY(-40%) rotate(180deg);
}
100% {
-webkit-transform: translateY(40%) rotate(360deg);
transform: translateY(40%) rotate(360deg);
}
0%,14%,17%,43%,53%,71%,80%,94%,100% {
opacity: 0;
}
6%,15%,24%,28%,48%,55%,78%,82%,99% {
opacity: 1;
}
}
/* 时间特效end */
```
第一步加组件
```
{
name: "",
type: "timeData",
coverImage: contextPath + "/images/componenttypes/" + locale + "/basic/zh_b1000.png",
coverImageWidth: "50%",
tip: "时间"
}
```
第二步添加核心代码
```
vsPluginComponentModule.factory("$vcPlugin_basic_timeData", ["$vsPluginRegister", "$timeout",
function (a, c) {
var b = {
showDataCategory: false,
showBorderCategory: true,
showBasicCategory: true,
showFixedCategory: true,
showEventCategory: false,
showTitleCategory: false,
buildDataDescription: function (e, h, g, d, f) {
h.$on(event_refreshBindingData,
function (k, l) {
d.context.orgData = d.context.data;
var i = d.config.datasourceConfig.dimensions;
var j = d.config.datasourceConfig.measures;
if (i && i.length > 0) {
if (!j) {
j = []
}
h.queryModelData({
eventParam: l,
dimensions: i,
measures: j,
tableKey: d.config.datasourceConfig.metadataConfig.metadataTable.key,
onQuerySuccess: function (m) {
if (m.data.success) {
if (d.context.data == null || d.context.data.length == 0) {
return
}
var o = {};
if (d.context.data != null && d.context.data.length > 0) {
for (var n = 0; n < i.length; n++) {
o[i[n].name] = d.context.data[0][i[n].name]
}
for (var n = 0; n < j.length; n++) {
o[j[n].name] = d.context.data[0][j[n].name]
}
}
c(function () {
h.valueMap = o
})
} else {
toaster.error({
body: m.data.message
})
}
},
onError: function () {
toaster.error({
body: vsLang.connection_failed
})
}
})
}
})
},
buildChartDescription: function (j, h, e, g) {
var d = {
name: "text",
title: vsLang.text,
groups: []
};
e.description.categories.push(d);
if (!e.config.is) {
e.config.is = true;
e.config.fontClass = "";
e.config.color = "#333333";
e.config.backgroundColor = "#FFFFFF";
e.config.textAlign = "left";
e.config.fontSize = 12
}
if (j.component.config.showTitle == null) {
j.component.config.showTitle = false
}
j.component = e;
var f = [];
f.push("<div id='fontclass' class='' style='height:100%;overflow:hidden;'><div ng-style=\"{'height':'100%', 'width':'100%', 'display': 'table'}\"><div id='content' ng-style=\"{'display': 'table-cell', 'vertical-align': 'middle', 'color':component.config.color, 'text-align':component.config.textAlign, 'font-size':component.config.fontSize+'px', 'font-weight':component.config.fontStyle.bold?'bold':'normal', 'font-style':component.config.fontStyle.italic?'italic':'normal', 'text-decoration':component.config.fontStyle.underline?'underline':'normal', 'font-family': component.config.tFontFamily.value, 'text-shadow': component.config.textShadowColor ? component.config.textShadowOffsetX+'px '+component.config.textShadowOffsetY+'px '+component.config.textShadowBlur+'px '+component.config.textShadowColor : 'none'}\" ></div></div></div>");
var i = g(f.join(""))(j);
h.append(i);
setInterval(function () {
dt = new Date();
var show_day = new Array('星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日');
year = dt.getFullYear();
month = dt.getMonth() + 1;
date = dt.getDate();
day = dt.getDay() - 1;
hours = dt.getHours();
hours = hours < 10 ? "0" + hours : hours;
minutes = dt.getMinutes();
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = dt.getSeconds();
seconds = seconds < 10 ? "0" + seconds : seconds;
dtime = year + "-" + month + "-" + date + " <br>" + hours + ":" + minutes + ":" + seconds + " " + show_day[day];
$('#' + e.id + ' #content').html(dtime);
// console.log(dtime)
}, 1000)
console.log(e.config)
// 时间特效
// ng-class 动态class 获取不到 没办法只能用替换class属性来实现
$('#' + e.id + ' #fontclass').attr('class', e.config.fontClass.value);
function initparticles() {
bubbles();
hearts();
lines();
confetti();
fire();
sunbeams();
}
/*The measurements are ... whack (so to say), for more general text usage I would generate different sized particles for the size of text; consider this pen a POC*/
console.log($("#" + e.id + " .particletext>.bubbles"))
function bubbles() {
$.each($(".particletext.bubbles"), function () {
$(this).remove(".particle");
var bubblecount = ($(this).width() / 50) * 10;
console.log(bubblecount)
for (var i = 0; i <= bubblecount; i++) {
var size = ($.rnd(40, 80) / 10);
console.log($(this))
$(this).append('<span class="particle" style="top:' + $.rnd(20, 80) + '%; left:' + $.rnd(0, 95) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + ($.rnd(0, 30) / 10) + 's;"></span>');
}
});
}
function hearts() {
$.each($(".particletext.hearts"), function () {
$(this).remove(".particle");
var heartcount = ($(this).width() / 50) * 5;
for (var i = 0; i <= heartcount; i++) {
var size = ($.rnd(60, 120) / 10);
$(this).append('<span class="particle" style="top:' + $.rnd(20, 80) + '%; left:' + $.rnd(0, 95) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + ($.rnd(0, 30) / 10) + 's;"></span>');
}
});
}
function lines() {
$.each($(".particletext.lines"), function () {
$(this).remove(".particle");
var linecount = ($(this).width() / 50) * 10;
for (var i = 0; i <= linecount; i++) {
$(this).append('<span class="particle" style="top:' + $.rnd(-30, 30) + '%; left:' + $.rnd(-10, 110) + '%;width:' + $.rnd(1, 3) + 'px; height:' + $.rnd(20, 80) + '%;animation-delay: -' + ($.rnd(0, 30) / 10) + 's;"></span>');
}
});
}
function confetti() {
$.each($(".particletext.confetti"), function () {
$(this).remove(".particle");
$(this).remove(".c");
var confetticount = ($(this).width() / 50) * 10;
for (var i = 0; i <= confetticount; i++) {
$(this).append('<span class="particle c' + $.rnd(1, 2) + '" style="top:' + $.rnd(10, 50) + '%; left:' + $.rnd(0, 100) + '%;width:' + $.rnd(6, 8) + 'px; height:' + $.rnd(3, 4) + 'px;animation-delay: ' + ($.rnd(0, 30) / 10) + 's;"></span>');
}
});
}
function fire() {
$.each($(".particletext.fire"), function () {
$(this).remove(".particle");
var firecount = ($(this).width() / 50) * 20;
for (var i = 0; i <= firecount; i++) {
var size = $.rnd(8, 12);
$(this).append('<span class="particle" style="top:' + $.rnd(40, 70) + '%; left:' + $.rnd(-10, 100) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + ($.rnd(0, 20) / 10) + 's;"></span>');
}
});
}
function sunbeams() {
$.each($(".particletext.sunbeams"), function () {
$(this).remove(".particle");
var linecount = ($(this).width() / 50) * 10;
for (var i = 0; i <= linecount; i++) {
$(this).append('<span class="particle" style="top:' + $.rnd(-50, 00) + '%; left:' + $.rnd(0, 100) + '%;width:' + $.rnd(1, 3) + 'px; height:' + $.rnd(80, 160) + '%;animation-delay: -' + ($.rnd(0, 30) / 10) + 's;"></span>');
}
});
}
jQuery.rnd = function (m, n) {
m = parseInt(m);
n = parseInt(n);
return Math.floor(Math.random() * (n - m + 1)) + m;
}
initparticles();
// 特效end
d.groups.push({
name: "text",
title: {
text: "效果"
},
elements: [{
title: "效果",
type: "select-s",
bind: "fontClass",
items: [{
name: "无效果",
value: ""
}, {
name: "泡沫",
value: "particletext bubbles"
}, {
name: "心形",
value: "particletext hearts"
}, {
name: "线形",
value: "particletext lines"
}, {
name: "五彩纸屑",
value: "particletext confetti"
}, {
name: "火行",
value: "particletext fire"
}, {
name: "阳光",
value: "particletext sunbeams"
}]
}]
});
d.groups.push({
name: "font",
title: {
text: vsLang.font
},
elements: [{
title: vsLang.font_family,
type: "fontFamily",
bind: "tFontFamily"
},
{
title: vsLang.size,
type: "configSlide",
bind: "fontSize",
config: {
slideEnd: 100
}
},
{
title: vsLang.alignment,
type: "horizontal-align",
bind: "textAlign"
},
{
title: vsLang.font_color,
type: "colorpicker",
bind: "color"
},
{
title: vsLang.font_style,
type: "font-style",
bind: "fontStyle"
}
]
});
d.groups.push({
name: "text-shadow",
title: {
text: vsLang.text_shadow
},
elements: [{
title: vsLang.color,
type: "colorpicker",
bind: "textShadowColor"
},
{
title: vsLang.width,
type: "configSlide",
bind: "textShadowBlur",
config: {
slideEnd: 20
}
},
{
title: vsLang.offset_x,
type: "configSlide",
bind: "textShadowOffsetX",
config: {
slideEnd: 20
}
},
{
title: vsLang.offset_y,
type: "configSlide",
bind: "textShadowOffsetY",
config: {
slideEnd: 20
}
}
]
})
j.$watch("component.config.fontClass", function (w, u) {
var p = e.config;
// console.log(w)
p.fontClass = w;
// ng-class 动态class 获取不到 没办法只能用替换class属性来实现
$('#' + e.id + ' #fontclass').attr('class', e.config.fontClass.value);
initparticles();
});
}
};
a.register("basic", "timeData", b);
return null
}
]);
```
分享页
design.css
路径D:\ireport365\ireport365.war\WEB-INF\classes\report-resource\design.css
```
/* 五种时间文字特效 start*/
body .particletext {
position: relative;
}
body .particletext.bubbles > .particle {
opacity: 0;
position: absolute;
background-color: rgba(33, 150, 243, 0.5);
-webkit-animation: bubbles 3s ease-in infinite;
animation: bubbles 3s ease-in infinite;
border-radius: 100%;
}
body .particletext.hearts > .particle {
opacity: 0;
position: absolute;
background-color: #cc2a5d;
-webkit-animation: hearts 3s ease-in infinite;
animation: hearts 3s ease-in infinite;
}
body .particletext.hearts > .particle:before, body .particletext.hearts > .particle:after {
position: absolute;
content: '';
border-radius: 100px;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-color: #cc2a5d;
}
body .particletext.hearts > .particle:before {
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
body .particletext.hearts > .particle:after {
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
body .particletext.lines > .particle {
position: absolute;
background-color: rgba(244, 67, 54, 0.5);
-webkit-animation: lines 3s linear infinite;
animation: lines 3s linear infinite;
}
body .particletext.confetti > .particle {
opacity: 0;
position: absolute;
-webkit-animation: confetti 3s ease-in infinite;
animation: confetti 3s ease-in infinite;
}
body .particletext.confetti > .particle.c1 {
background-color: rgba(76, 175, 80, 0.5);
}
body .particletext.confetti > .particle.c2 {
background-color: rgba(156, 39, 176, 0.5);
}
body .particletext.fire > .particle {
position: absolute;
background-color: rgba(255, 193, 7, 0.5);
border-radius: 40px;
border-top-right-radius: 0px;
-webkit-animation: fires 0.8s linear infinite;
animation: fires 0.8s linear infinite;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
opacity: 0;
}
body .particletext.fire > .particle:before {
position: absolute;
content: '';
top: 60%;
left: 40%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 50%;
height: 50%;
border-radius: 40px;
border-top-right-radius: 0px;
background-color: rgba(251, 140, 0, 0.5);
}
body .particletext.sunbeams > .particle {
position: absolute;
background-color: rgba(253, 216, 53, 0.5);
-webkit-animation: sunbeams 3s linear infinite;
animation: sunbeams 3s linear infinite;
}
@-webkit-keyframes bubbles {
0% {
opacity: 0;
}
20% {
opacity: 1;
-webkit-transform: translate(0, -20%);
transform: translate(0, -20%);
}
100% {
opacity: 0;
-webkit-transform: translate(0, -1000%);
transform: translate(0, -1000%);
}
}
@keyframes bubbles {
0% {
opacity: 0;
}
20% {
opacity: 1;
-webkit-transform: translate(0, -20%);
transform: translate(0, -20%);
}
100% {
opacity: 0;
-webkit-transform: translate(0, -1000%);
transform: translate(0, -1000%);
}
}
@-webkit-keyframes hearts {
0% {
opacity: 0;
-webkit-transform: translate(0, 0%) rotate(45deg);
transform: translate(0, 0%) rotate(45deg);
}
20% {
opacity: 0.8;
-webkit-transform: translate(0, -20%) rotate(45deg);
transform: translate(0, -20%) rotate(45deg);
}
100% {
opacity: 0;
-webkit-transform: translate(0, -1000%) rotate(45deg);
transform: translate(0, -1000%) rotate(45deg);
}
}
@keyframes hearts {
0% {
opacity: 0;
-webkit-transform: translate(0, 0%) rotate(45deg);
transform: translate(0, 0%) rotate(45deg);
}
20% {
opacity: 0.8;
-webkit-transform: translate(0, -20%) rotate(45deg);
transform: translate(0, -20%) rotate(45deg);
}
100% {
opacity: 0;
-webkit-transform: translate(0, -1000%) rotate(45deg);
transform: translate(0, -1000%) rotate(45deg);
}
}
@-webkit-keyframes lines {
0%, 50%, 100% {
-webkit-transform: translateY(0%);
transform: translateY(0%);
}
25% {
-webkit-transform: translateY(100%);
transform: translateY(100%);
}
75% {
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
}
}
@keyframes lines {
0%, 50%, 100% {
-webkit-transform: translateY(0%);
transform: translateY(0%);
}
25% {
-webkit-transform: translateY(100%);
transform: translateY(100%);
}
75% {
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
}
}
@-webkit-keyframes confetti {
0% {
opacity: 0;
-webkit-transform: translateY(0%) rotate(0deg);
transform: translateY(0%) rotate(0deg);
}
10% {
opacity: 1;
}
35% {
-webkit-transform: translateY(-800%) rotate(270deg);
transform: translateY(-800%) rotate(270deg);
}
80% {
opacity: 1;
}
100% {
opacity: 0;
-webkit-transform: translateY(2000%) rotate(1440deg);
transform: translateY(2000%) rotate(1440deg);
}
}
@keyframes confetti {
0% {
opacity: 0;
-webkit-transform: translateY(0%) rotate(0deg);
transform: translateY(0%) rotate(0deg);
}
10% {
opacity: 1;
}
35% {
-webkit-transform: translateY(-800%) rotate(270deg);
transform: translateY(-800%) rotate(270deg);
}
80% {
opacity: 1;
}
100% {
opacity: 0;
-webkit-transform: translateY(2000%) rotate(1440deg);
transform: translateY(2000%) rotate(1440deg);
}
}
@-webkit-keyframes fires {
0% {
-webkit-transform: rotate(-70deg) translateY(0%);
transform: rotate(-70deg) translateY(0%);
}
25% {
-webkit-transform: rotate(-20deg) translateY(-5%);
transform: rotate(-20deg) translateY(-5%);
opacity: 1;
}
50% {
-webkit-transform: rotate(-70deg) translateY(-10%);
transform: rotate(-70deg) translateY(-10%);
}
75% {
-webkit-transform: rotate(-20deg) translateY(-20%);
transform: rotate(-20deg) translateY(-20%);
}
100% {
-webkit-transform: rotate(-70deg) translateY(-40%);
transform: rotate(-70deg) translateY(-40%);
opacity: 1;
}
}
@keyframes fires {
0% {
-webkit-transform: rotate(-70deg) translateY(0%);
transform: rotate(-70deg) translateY(0%);
}
25% {
-webkit-transform: rotate(-20deg) translateY(-5%);
transform: rotate(-20deg) translateY(-5%);
opacity: 1;
}
50% {
-webkit-transform: rotate(-70deg) translateY(-10%);
transform: rotate(-70deg) translateY(-10%);
}
75% {
-webkit-transform: rotate(-20deg) translateY(-20%);
transform: rotate(-20deg) translateY(-20%);
}
100% {
-webkit-transform: rotate(-70deg) translateY(-40%);
transform: rotate(-70deg) translateY(-40%);
opacity: 1;
}
}
@-webkit-keyframes sunbeams {
0% {
-webkit-transform: translateY(40%) rotate(0deg);
transform: translateY(40%) rotate(0deg);
}
50% {
-webkit-transform: translateY(-40%) rotate(180deg);
transform: translateY(-40%) rotate(180deg);
}
100% {
-webkit-transform: translateY(40%) rotate(360deg);
transform: translateY(40%) rotate(360deg);
}
0%,14%,17%,43%,53%,71%,80%,94%,100% {
opacity: 0;
}
6%,15%,24%,28%,48%,55%,78%,82%,99% {
opacity: 1;
}
}
@keyframes sunbeams {
0% {
-webkit-transform: translateY(40%) rotate(0deg);
transform: translateY(40%) rotate(0deg);
}
50% {
-webkit-transform: translateY(-40%) rotate(180deg);
transform: translateY(-40%) rotate(180deg);
}
100% {
-webkit-transform: translateY(40%) rotate(360deg);
transform: translateY(40%) rotate(360deg);
}
0%,14%,17%,43%,53%,71%,80%,94%,100% {
opacity: 0;
}
6%,15%,24%,28%,48%,55%,78%,82%,99% {
opacity: 1;
}
}
/* 时间特效end */
```
路径:D:\ireport365\ireport365.war\WEB-INF\classes\report-resource\design.js
添加到text基本文字组件下面
```
// 时间组件
case "timeData":
var html = [];
html.push("<div id='fontclass' class='particletext lines' style='height:100%;overflow:hidden;'><div ng-style=\"{'height':'100%', 'width':'100%', 'display': 'table'}\"><div id='content' ng-style=\"{'display': 'table-cell', 'vertical-align': 'middle', 'color':component.config.color, 'text-align':component.config.textAlign, 'font-size':component.config.fontSize+'px', 'font-weight':component.config.fontStyle.bold?'bold':'normal', 'font-style':component.config.fontStyle.italic?'italic':'normal', 'text-decoration':component.config.fontStyle.underline?'underline':'normal', 'font-family': component.config.tFontFamily.value, 'text-shadow': component.config.textShadowColor ? component.config.textShadowOffsetX+'px '+component.config.textShadowOffsetY+'px '+component.config.textShadowBlur+'px '+component.config.textShadowColor : 'none'}\" > </div></div></div>");
var el = $compile(html.join(""))(scope);
element.append(el);
// console.log(scope.component.id)
setInterval(function(){
dt = new Date();
var show_day=new Array('星期一','星期二','星期三','星期四','星期五','星期六','星期日');
year=dt.getFullYear();
month=dt.getMonth()+1;
date=dt.getDate();
day=dt.getDay()-1;
hours=dt.getHours();
hours=hours<10?"0"+hours:hours;
minutes=dt.getMinutes();
minutes=minutes<10?"0"+minutes:minutes;
seconds=dt.getSeconds();
seconds=seconds<10?"0"+seconds:seconds;
dtime = year+"-"+month+"-"+date+" <br>"+hours+":"+minutes+":"+seconds+" "+show_day[day];
$('#'+scope.component.id+' #content').html(dtime);
// console.log(dtime)
},1000)
// 时间特效
// 只能用jq的方式动态添加class ng-class不支持
element.find('#fontclass').attr('class',scope.component.config.fontClass.value)
var rnd = function(m,n) {
m = parseInt(m);
n = parseInt(n);
return Math.floor( Math.random() * (n - m + 1) ) + m;
}
function initparticles() {
bubbles();
hearts();
lines();
confetti();
fire();
sunbeams();
}
initparticles();
/*The measurements are ... whack (so to say), for more general text usage I would generate different sized particles for the size of text; consider this pen a POC*/
function bubbles() {
$.each($(".particletext.bubbles"), function(){
$(this).remove(".particle");
var bubblecount = ($(this).width()/50)*10;
for(var i = 0; i <= bubblecount; i++) {
var size = (rnd(40,80)/10);
console.log($(this))
$(this).append('<span class="particle" style="top:' + rnd(20,80) + '%; left:' + rnd(0,95) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + (rnd(0,30)/10) + 's;"></span>');
}
});
}
function hearts() {
$.each($(".particletext.hearts"), function(){
$(this).remove(".particle");
var heartcount = ($(this).width()/50)*5;
for(var i = 0; i <= heartcount; i++) {
var size = (rnd(60,120)/10);
$(this).append('<span class="particle" style="top:' + rnd(20,80) + '%; left:' + rnd(0,95) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + (rnd(0,30)/10) + 's;"></span>');
}
});
}
function lines() {
$.each($(".particletext.lines"), function(){
$(this).remove(".particle");
var linecount = ($(this).width()/50)*10;
for(var i = 0; i <= linecount; i++) {
$(this).append('<span class="particle" style="top:' + rnd(-30,30) + '%; left:' + rnd(-10,110) + '%;width:' + rnd(1,3) + 'px; height:' + rnd(20,80) + '%;animation-delay: -' + (rnd(0,30)/10) + 's;"></span>');
}
});
}
function confetti() {
$.each($(".particletext.confetti"), function(){
$(this).remove(".particle");
$(this).remove(".c");
var confetticount = ($(this).width()/50)*10;
for(var i = 0; i <= confetticount; i++) {
$(this).append('<span class="particle c' + rnd(1,2) + '" style="top:' + rnd(10,50) + '%; left:' + rnd(0,100) + '%;width:' + rnd(6,8) + 'px; height:' + rnd(3,4) + 'px;animation-delay: ' + (rnd(0,30)/10) + 's;"></span>');
}
});
}
function fire() {
$.each($(".particletext.fire"), function(){
$(this).remove(".particle");
var firecount = ($(this).width()/50)*20;
for(var i = 0; i <= firecount; i++) {
var size = rnd(8,12);
$(this).append('<span class="particle" style="top:' + rnd(40,70) + '%; left:' + rnd(-10,100) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + (rnd(0,20)/10) + 's;"></span>');
}
});
}
function sunbeams() {
$.each($(".particletext.sunbeams"), function(){
$(this).remove(".particle");
var linecount = ($(this).width()/50)*10;
for(var i = 0; i <= linecount; i++) {
$(this).append('<span class="particle" style="top:' + rnd(-50,00) + '%; left:' + rnd(0,100) + '%;width:' + rnd(1,3) + 'px; height:' + rnd(80,160) + '%;animation-delay: -' + (rnd(0,30)/10) + 's;"></span>');
}
});
}
// 效果end
scope.$on(event_refreshBindingData,
function(target, param) {
var dimensions = component.config.datasourceConfig.dimensions;
var measures = component.config.datasourceConfig.measures;
if (!measures) {
measures = []
}
if (dimensions && dimensions.length > 0) {
scope.queryModelData({
eventParam: param,
dimensions: dimensions,
measures: measures,
tableKey: component.config.datasourceConfig.metadataConfig.metadataTable.key,
onQuerySuccess: function(response) {
if (response.data.success) {
var valueMap = {};
if (component.context.data != null && component.context.data.length > 0 && component.context.data[0] != null) {
for (var i = 0; i < dimensions.length; i++) {
valueMap[dimensions[i].name] = component.context.data[0][dimensions[i].name]
}
for (var i = 0; i < measures.length; i++) {
valueMap[measures[i].name] = component.context.data[0][measures[i].name]
}
}
$timeout(function() {
scope.valueMap = valueMap
})
} else {
console.log({
body: response.data.message
})
}
},
onError: function() {
console.log({
body: vsLang.connection_failed
})
}
})
}
});
break;
// 时钟 start
```
- video
- treemap
- mian.html文件注释
- 配置项tab
- 配置项属性
- internalRefreshAxisMdelData函数梳理
- 函数配置项-engine文件
- 替换数据源流程
- design.js
- 树图
- 下钻 废弃
- 人体图
- 下钻地图
- 行列互转
- 预览样式
- logo旁边的报表名
- echarts 组件生成图片
- 数据集样式
- 头部 黑色head
- 手机 ipad 图片
- k线图部分
- 平台管理css样式
- 目录css和平板的边距
- 设计页-数据源-目录
- 数据集 - 查看数据表 -按钮和目录样式
- 报表列表页按钮css
- 角色管理页按钮css
- 推送通知按钮css
- 子账号按钮css
- 数据连接
- openlayers地图线路图
- openlayers4_map_designer.js
- openlayers4_map_view.js
- 说明
- 常用图标小bug
- echarts 气泡地图
- echarts 线路轨迹图
- 导出pdf
- 可视化sql--css
- 表格滚动
- 主题色
- 时间轴
- 分享弹框
- 管理平台header和菜单
- 报表平台和菜单
- 初始化组件颜色
- 其他弹框
- olap分析样式-废弃
- 3d地图柱状图
- 关系图
- olap分析
- 地区地图
- k线图相关属性设置
- 世界地图
- 时间轴(new)
- 选择省份下转地图
- 选择省市飞线地图
- 面积预警地图默认颜色
- 组件覆层开关组件
- 汽车仪表盘bug
- 雷达图bug修复不能分享的问题
- 饼状 条形图 自动播放
- 临时用
- 自动轮播
- 方形元素 按钮浮动报错
- 面积预警地图整合可选择省市区
- 下钻地图添加返回按钮
- 下钻地图修复预警bug
- 基本时间组件
- 添加时钟组件
- 3d地球组件
- 盒须图
- 组件加载动画
- 报表背景渐变色
- 主题模板
- 没用
- 3机房第三方组件
- 设计
- 分享
- 3d机房需要的静态资源
- cesium地球需要的文件以及样式
- cesium地球
- 设计页
- 分享页
- 图标条形图
- 世豪-前端代码整理
- component.css 文件新添加
- 杂项
- index.jsp
- designer.css 样式暂时不整理 里面比较杂
- vs-common.js 新加生成html2canvas pdf
- vs-component-basic.js 完
- vs-component-datasource.js 完
- vs-component-engine.js 完
- vs-component-widget-grid.js 完
- vs-component-widget-square.js 完
- vs-designer.js 完
- vs-designer-component.js 完
- vs-designer-report.js 完
- vs-designer-reportpage.js 完
- vs-component-echarts.js 完
- main.html 完
- component.html 新加组件设置页模板
- 以前的报表页设置控制器---做个记录
- 大概修改过的代码
- 2019-5-8 修改皮肤控制器
- 选择模板
- 桑基图2019-11-20
- bug 修正 2019-11-21
- 插图柱状图
- cesiumchart组件
- gis 地图 联动 弹框 图标
- 动态面积图添加按钮类配置项
- 玫瑰图形组件
- cesium 图形 和three.js 冲突的bug
- gis 地图 默认图层
- 网格标签
- gis 点图 值域
- gis 面图 值域
- 按钮图标添加提示框
- 百度地图
- 剩余的组件
- gulp说明文档
- 色斑图加透明