123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- $(function () {
-
- function placeholderPic() {
- w = document.documentElement.clientWidth / 80;
- document.documentElement.style.fontSize = w + 'px';
- }
- placeholderPic()
-
- function topColor() {
- var ele = $('.top5-content ul').children();
- var length = ele.length;
- var i = 1;
- setInterval(function () {
- $(ele[i]).find('.cicle').css({
- 'background': 'url(./images/orange.png) no-repeat center',
- 'backgroundSize': '100%'
- })
- $(ele[i]).find('.li-content').css({
- 'background': 'url(./images/border2.png) no-repeat center',
- 'backgroundSize': 'contain'
- })
- $(ele[i]).siblings().find('.cicle').css({
- 'background': 'url(./images/green.png) no-repeat center',
- 'backgroundSize': '100%'
- })
- $(ele[i]).siblings().find('.li-content').css({
- 'background': 'url(./images/border.png) no-repeat center',
- 'backgroundSize': 'contain'
- })
- i++
- if (i == length) {
- i = 0
- }
- }, 3000)
- }
- topColor()
-
- function waterChart(ele) {
- var myChart = echarts.init(document.querySelector(ele));
- option = {
- series: [{
- color:['#09828e','#09c2c8'],
- type: 'liquidFill',
- data: [0.78, 0.78],
- radius: '90%',
- outline: {
- show: false
- },
- backgroundStyle: {
- color:'transparent',
- borderColor: '#0ac1c7',
- borderWidth: 1,
- shadowColor: 'rgba(0, 0, 0, 0.4)',
- shadowBlur: 20
- },
- shape: 'path://"M61.3,2c6.2,0,12.1,1.1,17.5,3.4C84.3,7.7,89,10.8,93,14.6c4.1,4,7.3,8.6,9.7,13.8c2.4,5.2,3.5,10.9,3.5,16.9c0,8.1-2.4,16.9-7.1,26.4c-4.7,9.4-9.9,18.2-15.5,26.2c-5.6,8-13.1,17.4-22.4,28.1c-9.3-10.7-16.8-20-22.4-28.1c-5.6-8-10.8-16.8-15.5-26.2c-4.7-9.4-7.1-18.2-7.1-26.4c0-6,1.2-11.6,3.5-16.9c2.4-5.2,5.6-9.8,9.7-13.8c4-3.9,8.8-7,14.2-9.2C49.2,3.1,55,2,61.3,2L61.3,2z"',
- label: {
- normal: {
- position: ['50%', '50%'],
- formatter: function () {
- return '78%';
- },
- textStyle: {
- fontSize: 0.5 * w,
- color: '#D94854'
- }
- }
- }
- }]
- }
- myChart.setOption(option)
- }
- waterChart('.chart1')
- waterChart('.chart2')
- function draw(ele, val, con, max, color) {
- var chart = echarts.init(document.querySelector(ele))
- var value = val
- option = {
- grid: {
- left: '20%',
- top: '0',
- right: '20%',
- bottom: '0'
- },
- "xAxis": {
- type: 'value',
- "splitLine": {
- "show": false
- },
- "axisLine": {
- "show": false
- },
- "axisLabel": {
- "show": false
- },
- "axisTick": {
- "show": false
- }
- },
- "yAxis": [{
- "type": "category",
- "inverse": false,
- "data": [],
- "axisLine": {
- "show": false
- },
- "axisTick": {
- "show": false
- },
- "axisLabel": {
- show: false
- }
- }],
- "series": [
- {
- type: 'pictorialBar',
- data: [value],
- itemStyle: {
- normal: {
- color: color
- }
- },
- symbolRepeat: 'fixed',
- symbolClip: true,
- symbolSize: [0.5 * w, w],
- symbol: 'roundRect',
- label: {
- show: true,
- position: 'left',
- formatter: function () {
- return con
- },
- color: '#fff',
- fontSize: 0.7 * w,
- },
- z: 1000
- },
- {
- type: 'pictorialBar',
- itemStyle: {
- normal: {
- color: '#193040'
- }
- },
- data: [max],
- animationDuration: 0,
- symbolRepeat: 'fixed',
-
- symbol: 'roundRect',
- symbolSize: [0.5 * w, w],
- label: {
- show: true,
- position: 'right',
- formatter: function () {
- return Math.floor(val * 100 / max) + '%'
- },
- color: '#fff',
- fontSize: 0.7 * w,
- }
- }
- ]
- };
- chart.setOption(option)
- }
- draw('.shoeChart', 52563, '完成率', 65000, '#09c4ca')
- draw('.clothesChart', 32563, '完成率', 45000, '#09c4ca')
- draw('.mzChart', 12563, '完成率', 35000, '#09c4ca')
-
- function lineChart(ele) {
- var chart = echarts.init(document.querySelector(ele));
- var xdata = [];
- var dataArr = [];
- for (var i = 1; i < 30; i++) {
- xdata.push(i);
- dataArr.push(Math.floor(Math.random() * 20 + 5))
- }
- var max = Math.max.apply(null, dataArr);
- var seriesName = '';
- option = {
- grid: {
- left: "5%",
-
- bottom: "5%",
- top: "15%",
- containLabel: true
- },
- xAxis: {
- type: "category",
- data: xdata,
- axisLabel: {
- show: true,
- textStyle: {
- color: "#fff",
- fontSize: 0.5 * w
- }
- },
- axisLine: {
- lineStyle: {
- color: 'transparent',
- width: 2
- }
- }
- },
- tooltip: {
- show: true,
- trigger: 'item'
- },
- yAxis: [{
- type: 'value',
-
- min: 0,
- max: 25,
- axisLabel: {
- formatter: '{value}k',
- textStyle: {
- color: '#fff',
- fontSize: 0.5 * w
- }
- },
- axisLine: {
- lineStyle: {
- color: 'transparent',
- width: 2
- }
- },
- axisTick: {
- show: false,
- },
- splitLine: {
- show: false
- }
- }],
- series: [{
- name: seriesName,
- type: 'line',
- stack: '总量',
- symbol: 'none',
- smooth: false,
- symbol: "circle",
- itemStyle: {
- normal: {
- color: '#34a39a',
- lineStyle: {
- color: "#34a39a",
- width: 2
- },
- areaStyle: {
-
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: "#08808b"
- },
- {
- offset: 1,
- color: 'rgba(0,0,0,0.2)',
- }
- ])
- }
- }
- },
- data: dataArr
- },]
- };
- var index = 0;
- var mTime = setInterval(function () {
- chart.dispatchAction({
- type: 'showTip',
- seriesIndex: 0,
- dataIndex: index
- });
- index++;
- if (index > xdata.length) {
- index = 0;
- }
- }, 1500);
- chart.setOption(option)
- }
- lineChart('.lineChart')
-
- function rainBg() {
- var c = document.querySelector(".rain");
- var ctx = c.getContext("2d");
- var w = c.width = document.querySelector('.total').clientWidth;
- var h = c.height = document.querySelector('.total').clientHeight;
-
- function random(min, max) {
- return Math.random() * (max - min) + min;
- }
- function RainDrop() { }
-
- RainDrop.prototype = {
- init: function () {
- this.x = random(0, w);
- this.y = h;
- this.color = 'hsl(180, 100%, 50%)';
- this.vy = random(4, 5);
- this.hit = 0;
- this.size = 2;
- },
- draw: function () {
- if (this.y > this.hit) {
- var linearGradient = ctx.createLinearGradient(this.x, this.y, this.x, this.y + this.size * 30)
-
- linearGradient.addColorStop(0, '#14789c')
-
- linearGradient.addColorStop(1, '#090723')
-
- ctx.fillStyle = linearGradient
- ctx.fillRect(this.x, this.y, this.size, this.size * 50);
- }
- this.update();
- },
- update: function () {
- if (this.y > this.hit) {
- this.y -= this.vy;
- } else {
- this.init();
- }
- }
- };
- function resize() {
- w = c.width = window.innerWidth;
- h = c.height = window.innerHeight;
- }
-
- var rs = []
- for (var i = 0; i < 10; i++) {
- setTimeout(function () {
- var r = new RainDrop();
- r.init();
- rs.push(r);
- }, i * 300)
- }
- function anim() {
- ctx.clearRect(0, 0, w, h);
- for (var i = 0; i < rs.length; i++) {
- rs[i].draw();
- }
- requestAnimationFrame(anim);
- }
- window.addEventListener("resize", resize);
-
- anim()
- }
- rainBg()
-
- function dashed() {
- var canvas = document.querySelector('.dashed')
- var ctx = canvas.getContext('2d')
- var w = canvas.width = document.querySelector('.total').clientWidth
- var h = canvas.height = document.querySelector('.total').clientHeight / 3 * 2
- ctx.lineWidth = 3
- ctx.setLineDash([3, 3]);
- ctx.fillStyle = '#93f8fb'
- ctx.shadowOffsetX = 0;
-
- ctx.shadowOffsetY = 0;
-
- ctx.shadowColor = '#93f8fb';
-
- ctx.shadowBlur = 15;
- ctx.save()
-
- ctx.beginPath()
- var grd = ctx.createLinearGradient(w / 11 * 2, h / 3, w / 5 * 2, h);
- grd.addColorStop(0, "#54e2e6");
- grd.addColorStop(1, "#065261");
- ctx.strokeStyle = grd;
- ctx.moveTo(w / 5 * 2, h)
- ctx.quadraticCurveTo(w / 5, h / 6 * 5, w / 11 * 2, h / 3);
- ctx.stroke();
-
- ctx.beginPath()
- ctx.moveTo(w / 11 * 2, h / 3)
- ctx.arc(w / 11 * 2, h / 3, 5, 0, Math.PI * 2)
- ctx.fill()
- ctx.restore()
- ctx.save()
-
- ctx.beginPath()
- var grd = ctx.createLinearGradient(w / 11 * 3.3, h / 2, w / 3 * 1.1, h / 6 * 5);
- grd.addColorStop(0, "#e08d03");
- grd.addColorStop(1, "#2e6a5c");
- ctx.strokeStyle = grd;
- ctx.moveTo(w / 3 * 1.1, h / 6 * 5)
- ctx.quadraticCurveTo(w / 5 * 1.5, h / 6 * 4.2, w / 11 * 3.3, h / 2);
- ctx.stroke();
-
- ctx.beginPath()
- ctx.moveTo(w / 11 * 3.3, h / 2)
- ctx.arc(w / 11 * 3.3, h / 2, 5, 0, Math.PI * 2)
- ctx.fill()
- ctx.restore()
- ctx.save()
-
- ctx.beginPath()
- var grd = ctx.createLinearGradient(w / 3 * 1.4, h / 5, w / 5 * 2, h / 2);
- grd.addColorStop(0, "#e08d03");
- grd.addColorStop(1, "#2e6a5c");
- ctx.strokeStyle = grd;
- ctx.moveTo(w / 5 * 2, h / 2 )
- ctx.quadraticCurveTo(w / 3 * 1.2, h / 4 * 1.4, w / 3 * 1.4, h / 5);
- ctx.stroke();
-
- ctx.beginPath()
- ctx.moveTo(w / 3 * 1.4, h / 5)
- ctx.arc(w / 3 * 1.4, h / 5, 5, 0, Math.PI * 2)
- ctx.fill()
- ctx.restore()
- ctx.save()
-
- ctx.beginPath()
- var grd = ctx.createLinearGradient(w / 5 * 3.1, h / 3*1.2, w / 5 * 3.2, h / 2 * 1.5);
- grd.addColorStop(0, "#e08d03");
- grd.addColorStop(1, "#2e6a5c");
- ctx.strokeStyle = grd;
- ctx.moveTo(w / 5 * 3.2, h / 2 * 1.5)
- ctx.quadraticCurveTo(w / 5 * 3.35, h / 2 * 1.2, w / 5 * 3.1, h / 3*1.2);
- ctx.stroke();
-
- ctx.beginPath()
- ctx.moveTo( w / 5 * 3.1, h / 3*1.2)
- ctx.arc( w / 5 * 3.1, h / 3*1.2, 5, 0, Math.PI * 2)
- ctx.fill()
- ctx.restore()
- ctx.save()
-
- ctx.beginPath()
- var grd = ctx.createLinearGradient(w / 5 * 3.3, h / 4, w / 5 * 3.2, h / 2 * 1.9);
- grd.addColorStop(0, "#e08d03");
- grd.addColorStop(1, "#2e6a5c");
- ctx.strokeStyle = grd;
- ctx.moveTo(w / 5 * 3.03, h / 2 * 1.9)
- ctx.quadraticCurveTo(w / 5 * 3.8, h / 2 * 1.2, w / 5 * 3.3, h / 4);
- ctx.stroke();
-
- ctx.beginPath()
- ctx.moveTo(w / 5 * 3.3, h / 4)
- ctx.arc(w / 5 * 3.3, h / 4, 5, 0, Math.PI * 2)
- ctx.fill()
- ctx.restore()
- ctx.save()
-
- ctx.beginPath()
- var grd = ctx.createLinearGradient(w / 5 * 3.8, h / 2*1.2, w / 5 * 2.9, h);
- grd.addColorStop(0, "#e08d03");
- grd.addColorStop(1, "#2e6a5c");
- ctx.strokeStyle = grd;
- ctx.moveTo(w / 5 * 2.9, h)
- ctx.quadraticCurveTo(w / 5 * 3.7, h / 2 * 1.6, w / 5 * 3.8, h / 2*1.2);
- ctx.stroke();
-
- ctx.beginPath()
- ctx.moveTo(w / 5 * 3.8, h / 2*1.2)
- ctx.arc(w / 5 * 3.8, h / 2*1.2, 5, 0, Math.PI * 2)
- ctx.fill()
- }
- dashed()
- })
|