1. <!DOCTYPE html>
  2. <html>
  3. <head lang="en">
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <style>
  7. *{
  8. margin: 0;
  9. padding: 0;
  10. }
  11. html,body{
  12. height: 100%;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <canvas id="canvas" style="height: 99%"></canvas>
  18. </body>
  19. <script src="digit.js"></script>
  20. <script src="countdown.js"></script>
  21. <script></script>
  22. </html>
  1. var digit=
  2. [
  3. [
  4. [0,0,1,1,1,0,0],
  5. [0,1,1,0,1,1,0],
  6. [1,1,0,0,0,1,1],
  7. [1,1,0,0,0,1,1],
  8. [1,1,0,0,0,1,1],
  9. [1,1,0,0,0,1,1],
  10. [1,1,0,0,0,1,1],
  11. [1,1,0,0,0,1,1],
  12. [0,1,1,0,1,1,0],
  13. [0,0,1,1,1,0,0]
  14. ],//
  15. [
  16. [0,0,0,1,1,0,0],
  17. [0,1,1,1,1,0,0],
  18. [0,0,0,1,1,0,0],
  19. [0,0,0,1,1,0,0],
  20. [0,0,0,1,1,0,0],
  21. [0,0,0,1,1,0,0],
  22. [0,0,0,1,1,0,0],
  23. [0,0,0,1,1,0,0],
  24. [0,0,0,1,1,0,0],
  25. [1,1,1,1,1,1,1]
  26. ],//
  27. [
  28. [0,1,1,1,1,1,0],
  29. [1,1,0,0,0,1,1],
  30. [0,0,0,0,0,1,1],
  31. [0,0,0,0,1,1,0],
  32. [0,0,0,1,1,0,0],
  33. [0,0,1,1,0,0,0],
  34. [0,1,1,0,0,0,0],
  35. [1,1,0,0,0,0,0],
  36. [1,1,0,0,0,1,1],
  37. [1,1,1,1,1,1,1]
  38. ],//
  39. [
  40. [1,1,1,1,1,1,1],
  41. [0,0,0,0,0,1,1],
  42. [0,0,0,0,1,1,0],
  43. [0,0,0,1,1,0,0],
  44. [0,0,1,1,1,0,0],
  45. [0,0,0,0,1,1,0],
  46. [0,0,0,0,0,1,1],
  47. [0,0,0,0,0,1,1],
  48. [1,1,0,0,0,1,1],
  49. [0,1,1,1,1,1,0]
  50. ],//
  51. [
  52. [0,0,0,0,1,1,0],
  53. [0,0,0,1,1,1,0],
  54. [0,0,1,1,1,1,0],
  55. [0,1,1,0,1,1,0],
  56. [1,1,0,0,1,1,0],
  57. [1,1,1,1,1,1,1],
  58. [0,0,0,0,1,1,0],
  59. [0,0,0,0,1,1,0],
  60. [0,0,0,0,1,1,0],
  61. [0,0,0,1,1,1,1]
  62. ],//
  63. [
  64. [1,1,1,1,1,1,1],
  65. [1,1,0,0,0,0,0],
  66. [1,1,0,0,0,0,0],
  67. [1,1,1,1,1,1,0],
  68. [0,0,0,0,0,1,1],
  69. [0,0,0,0,0,1,1],
  70. [0,0,0,0,0,1,1],
  71. [0,0,0,0,0,1,1],
  72. [1,1,0,0,0,1,1],
  73. [0,1,1,1,1,1,0]
  74. ],//
  75. [
  76. [0,0,0,0,1,1,0],
  77. [0,0,1,1,0,0,0],
  78. [0,1,1,0,0,0,0],
  79. [1,1,0,0,0,0,0],
  80. [1,1,0,1,1,1,0],
  81. [1,1,0,0,0,1,1],
  82. [1,1,0,0,0,1,1],
  83. [1,1,0,0,0,1,1],
  84. [1,1,0,0,0,1,1],
  85. [0,1,1,1,1,1,0]
  86. ],//
  87. [
  88. [1,1,1,1,1,1,1],
  89. [1,1,0,0,0,1,1],
  90. [0,0,0,0,1,1,0],
  91. [0,0,0,0,1,1,0],
  92. [0,0,0,1,1,0,0],
  93. [0,0,0,1,1,0,0],
  94. [0,0,1,1,0,0,0],
  95. [0,0,1,1,0,0,0],
  96. [0,0,1,1,0,0,0],
  97. [0,0,1,1,0,0,0]
  98. ],//
  99. [
  100. [0,1,1,1,1,1,0],
  101. [1,1,0,0,0,1,1],
  102. [1,1,0,0,0,1,1],
  103. [1,1,0,0,0,1,1],
  104. [0,1,1,1,1,1,0],
  105. [1,1,0,0,0,1,1],
  106. [1,1,0,0,0,1,1],
  107. [1,1,0,0,0,1,1],
  108. [1,1,0,0,0,1,1],
  109. [0,1,1,1,1,1,0]
  110. ],//
  111. [
  112. [0,1,1,1,1,1,0],
  113. [1,1,0,0,0,1,1],
  114. [1,1,0,0,0,1,1],
  115. [1,1,0,0,0,1,1],
  116. [0,1,1,1,0,1,1],
  117. [0,0,0,0,0,1,1],
  118. [0,0,0,0,0,1,1],
  119. [0,0,0,0,1,1,0],
  120. [0,0,0,1,1,0,0],
  121. [0,1,1,0,0,0,0]
  122. ],//
  123. [
  124. [0,0,0,0,0,0,0],
  125. [0,0,1,1,1,0,0],
  126. [0,0,1,1,1,0,0],
  127. [0,0,1,1,1,0,0],
  128. [0,0,0,0,0,0,0],
  129. [0,0,0,0,0,0,0],
  130. [0,0,1,1,1,0,0],
  131. [0,0,1,1,1,0,0],
  132. [0,0,1,1,1,0,0],
  133. [0,0,0,0,0,0,0]
  134. ]//:
  135. ];

digit.js

  1. var window_width=1024,
  2. window_height=768,
  3. RADIUS= 8,
  4. MARGIN_TOP=60,
  5. MARGIN_LEFT=30,
  6. //endTime=new Date(2017,5,10,12,47,52),//第二个参数是月份,值为0-11,表示1月 11表示12月
  7. endTime=new Date();
  8. endTime.setTime(endTime.getTime()+3*24*3600*1000);//设置为距离当前时间还有3天
  9. curShowTimeSeconds=0;
  10. var balls=[],
  11. colors=["#33B5E5","#0099CC","#AA66CC","#9933CC","#99CC00","#669900","#FFBB33","#FF8800","#FF6666","#C01110"];
  12.  
  13. window.onload=function(){
  14. window_width=document.body.clientWidth;
  15. window_height=document.body.clientHeight;
  16. MARGIN_LEFT=Math.round(window_width/10);
  17. RADIUS=Math.round(window_width*4/5/108)-1;
  18. var canvas=document.getElementById("canvas");
  19. var context=canvas.getContext("2d");
  20. canvas.width=window_width;
  21. canvas.height=window_height;
  22. curShowTimeSeconds=getCurrentShowTimeSeconds();
  23. setInterval(function(){
  24. render(context);
  25. update();
  26. },50);
  27. };
  28. function getCurrentShowTimeSeconds(){
  29. var curTime=new Date(),ret=endTime.getTime()-curTime.getTime();
  30. ret=Math.round(ret/1000);
  31. return ret >=0?ret:0;
  32. }
  33. function update(){
  34. var nextShowTimeSeconds=getCurrentShowTimeSeconds(),
  35. nextHours=parseInt(nextShowTimeSeconds/3600),
  36. nextMinutes=parseInt((nextShowTimeSeconds-nextHours*3600)/60),
  37. nextSeconds=parseInt(nextShowTimeSeconds%60),
  38. curHours=parseInt(curShowTimeSeconds/3600),
  39. curMinutes=parseInt((curShowTimeSeconds-curHours*3600)/60),
  40. curSeconds=parseInt(curShowTimeSeconds%60);
  41. if(nextSeconds != curSeconds){
  42. if(parseInt(curHours/10) != parseInt(nextHours/10)){
  43. addBalls(MARGIN_LEFT+0,MARGIN_TOP,parseInt(curHours/10));
  44. }
  45. if(parseInt(curHours%10) != parseInt(nextHours%10)){
  46. addBalls(MARGIN_LEFT+15*(RADIUS+1),MARGIN_TOP,parseInt(curHours/10));
  47. }
  48.  
  49. if(parseInt(curMinutes/10) != parseInt(nextMinutes/10)){
  50. addBalls(MARGIN_LEFT+39*(RADIUS+1),MARGIN_TOP,parseInt(curMinutes/10));
  51. }
  52. if(parseInt(curMinutes%10) != parseInt(nextMinutes%10)){
  53. addBalls(MARGIN_LEFT+54*(RADIUS+1),MARGIN_TOP,parseInt(curMinutes%10));
  54. }
  55. if(parseInt(curSeconds/10) != parseInt(nextSeconds/10)){
  56. addBalls(MARGIN_LEFT+78*(RADIUS+1),MARGIN_TOP,parseInt(curSeconds/10));
  57. }
  58. if(parseInt(curSeconds%10) != parseInt(nextSeconds%10)){
  59. addBalls(MARGIN_LEFT+93*(RADIUS+1),MARGIN_TOP,parseInt(nextSeconds%10));
  60. }
  61.  
  62. curShowTimeSeconds=nextShowTimeSeconds;
  63. }
  64. updateBalls();
  65. }
  66. function updateBalls(){
  67. for(var i=0;i<balls.length;i++){
  68. balls[i].x+=balls[i].vx;
  69. balls[i].y+=balls[i].vy;
  70. balls[i].vy+=balls[i].g;
  71. if(balls[i].y>=window_height-RADIUS){
  72. balls[i].y=window_height-RADIUS;
  73. balls[i].vy=-balls[i].vy*0.75;
  74. }
  75. }
  76. var cnt=0;
  77. for(var i=0;i<balls.length;i++){
  78. if(balls[i].x+RADIUS>0 && balls[i].x - RADIUS<window_width){
  79. balls[cnt++]=balls[i];
  80. }
  81. }
  82. while(balls.length>Math.min(300,cnt)){
  83. balls.pop();
  84. }
  85.  
  86. }
  87. function addBalls(x,y,num){
  88. for(var i=0;i<digit[num].length;i++){
  89. for(var j=0;j<digit[num][i].length;j++){
  90. if(digit[num][i][j] == 1){
  91. var aBall={
  92. x:x+j*2*(RADIUS+1)+(RADIUS+1),
  93. y:y+i*2*(RADIUS+1)+(RADIUS+1),
  94. g:1.5+Math.random(),
  95. vx:Math.pow(-1,Math.ceil(Math.random()*1000))*4,//取-4或者正4
  96. vy:-5,
  97. color:colors[Math.floor(Math.random()*colors.length)]
  98. };
  99. balls.push(aBall);
  100. }
  101. }
  102. }
  103. }
  104. function render(ctx){
  105. ctx.clearRect(0,0,window_width,window_height);
  106. var hours=parseInt(curShowTimeSeconds/3600),minutes=parseInt((curShowTimeSeconds-hours*3600)/60),seconds=parseInt(curShowTimeSeconds%60);
  107. renderDigit(MARGIN_LEFT,MARGIN_TOP,parseInt(hours/10),ctx);
  108. renderDigit(MARGIN_LEFT+15*(RADIUS+1),MARGIN_TOP,parseInt(hours%10),ctx);
  109. renderDigit(MARGIN_LEFT+28*(RADIUS+1),MARGIN_TOP,10,ctx);
  110. renderDigit(MARGIN_LEFT+39*(RADIUS+1),MARGIN_TOP,parseInt(minutes/10),ctx);
  111. renderDigit(MARGIN_LEFT+54*(RADIUS+1),MARGIN_TOP,parseInt(minutes%10),ctx);
  112. renderDigit(MARGIN_LEFT+67*(RADIUS+1),MARGIN_TOP,10,ctx);
  113. renderDigit(MARGIN_LEFT+78*(RADIUS+1),MARGIN_TOP,parseInt(seconds/10),ctx);
  114. renderDigit(MARGIN_LEFT+93*(RADIUS+1),MARGIN_TOP,parseInt(seconds%10),ctx);
  115. for(var i=0;i<balls.length;i++){
  116. ctx.fillStyle=balls[i].color;
  117. ctx.beginPath();
  118. ctx.arc(balls[i].x,balls[i].y,RADIUS,0,2*Math.PI,true);
  119. ctx.closePath();
  120. ctx.fill();
  121. }
  122. }
  123. function renderDigit(x,y,num,ctx){//绘制数字
  124. ctx.fillStyle="rgb(0,102,153)";
  125. for(var i=0;i<digit[num].length;i++){//i是行数 j是列数
  126. for(var j=0;j<digit[num][i].length;j++){
  127. if(digit[num][i][j] == 1){
  128. ctx.beginPath();//圆心的位置centerX:x+j*2*(R+1)+(R+1) centerY:y+i*2*(R+1)+(R+1)
  129. ctx.arc(x+j*2*(RADIUS+1)+(RADIUS+1),y+i*2*(RADIUS+1)+(RADIUS+1),RADIUS,0,2*Math.PI);
  130. ctx.closePath();
  131. ctx.fill()
  132. }
  133. }
  134. }
  135. }

countdown.js

  1. var window_width=1024,
  2. window_height=768,
  3. RADIUS= 8,
  4. MARGIN_TOP=60,
  5. MARGIN_LEFT=30,
  6. //endTime=new Date(2017,5,10,12,47,52),//第二个参数是月份,值为0-11,表示1月 11表示12月
  7. /* endTime=new Date();
  8. endTime.setTime(endTime.getTime()+3*24*3600*1000);//设置为距离当前时间还有3天*/
  9. curShowTimeSeconds=0;
  10. var balls=[],
  11. colors=["#33B5E5","#0099CC","#AA66CC","#9933CC","#99CC00","#669900","#FFBB33","#FF8800","#FF6666","#C01110"];
  12.  
  13. window.onload=function(){
  14. window_width=document.body.clientWidth;
  15. window_height=document.body.clientHeight;
  16. MARGIN_LEFT=Math.round(window_width/10);
  17. RADIUS=Math.round(window_width*4/5/108)-1;
  18. var canvas=document.getElementById("canvas");
  19. var context=canvas.getContext("2d");
  20. canvas.width=window_width;
  21. canvas.height=window_height;
  22. curShowTimeSeconds=getCurrentShowTimeSeconds();
  23. setInterval(function(){
  24. render(context);
  25. update();
  26. },50);
  27. };
  28. function getCurrentShowTimeSeconds(){
  29. var curTime=new Date(),
  30. //ret=endTime.getTime()-curTime.getTime();
  31. ret=curTime.getHours()*3600*1000+curTime.getMinutes()*60*1000+curTime.getSeconds()*1000;
  32. ret=Math.round(ret/1000);
  33. return ret >=0?ret:0;
  34. }
  35. function update(){
  36. var nextShowTimeSeconds=getCurrentShowTimeSeconds(),
  37. nextHours=parseInt(nextShowTimeSeconds/3600),
  38. nextMinutes=parseInt((nextShowTimeSeconds-nextHours*3600)/60),
  39. nextSeconds=parseInt(nextShowTimeSeconds%60),
  40. curHours=parseInt(curShowTimeSeconds/3600),
  41. curMinutes=parseInt((curShowTimeSeconds-curHours*3600)/60),
  42. curSeconds=parseInt(curShowTimeSeconds%60);
  43. if(nextSeconds != curSeconds){
  44. if(parseInt(curHours/10) != parseInt(nextHours/10)){
  45. addBalls(MARGIN_LEFT+0,MARGIN_TOP,parseInt(curHours/10));
  46. }
  47. if(parseInt(curHours%10) != parseInt(nextHours%10)){
  48. addBalls(MARGIN_LEFT+15*(RADIUS+1),MARGIN_TOP,parseInt(curHours/10));
  49. }
  50.  
  51. if(parseInt(curMinutes/10) != parseInt(nextMinutes/10)){
  52. addBalls(MARGIN_LEFT+39*(RADIUS+1),MARGIN_TOP,parseInt(curMinutes/10));
  53. }
  54. if(parseInt(curMinutes%10) != parseInt(nextMinutes%10)){
  55. addBalls(MARGIN_LEFT+54*(RADIUS+1),MARGIN_TOP,parseInt(curMinutes%10));
  56. }
  57. if(parseInt(curSeconds/10) != parseInt(nextSeconds/10)){
  58. addBalls(MARGIN_LEFT+78*(RADIUS+1),MARGIN_TOP,parseInt(curSeconds/10));
  59. }
  60. if(parseInt(curSeconds%10) != parseInt(nextSeconds%10)){
  61. addBalls(MARGIN_LEFT+93*(RADIUS+1),MARGIN_TOP,parseInt(nextSeconds%10));
  62. }
  63.  
  64. curShowTimeSeconds=nextShowTimeSeconds;
  65. }
  66. updateBalls();
  67. }
  68. function updateBalls(){
  69. for(var i=0;i<balls.length;i++){
  70. balls[i].x+=balls[i].vx;
  71. balls[i].y+=balls[i].vy;
  72. balls[i].vy+=balls[i].g;
  73. if(balls[i].y>=window_height-RADIUS){
  74. balls[i].y=window_height-RADIUS;
  75. balls[i].vy=-balls[i].vy*0.75;
  76. }
  77. }
  78. var cnt=0;
  79. for(var i=0;i<balls.length;i++){
  80. if(balls[i].x+RADIUS>0 && balls[i].x - RADIUS<window_width){
  81. balls[cnt++]=balls[i];
  82. }
  83. }
  84. while(balls.length>Math.min(300,cnt)){
  85. balls.pop();
  86. }
  87.  
  88. }
  89. function addBalls(x,y,num){
  90. for(var i=0;i<digit[num].length;i++){
  91. for(var j=0;j<digit[num][i].length;j++){
  92. if(digit[num][i][j] == 1){
  93. var aBall={
  94. x:x+j*2*(RADIUS+1)+(RADIUS+1),
  95. y:y+i*2*(RADIUS+1)+(RADIUS+1),
  96. g:1.5+Math.random(),
  97. vx:Math.pow(-1,Math.ceil(Math.random()*1000))*4,//取-4或者正4
  98. vy:-5,
  99. color:colors[Math.floor(Math.random()*colors.length)]
  100. };
  101. balls.push(aBall);
  102. }
  103. }
  104. }
  105. }
  106. function render(ctx){
  107. ctx.clearRect(0,0,window_width,window_height);
  108. var hours=parseInt(curShowTimeSeconds/3600),minutes=parseInt((curShowTimeSeconds-hours*3600)/60),seconds=parseInt(curShowTimeSeconds%60);
  109. renderDigit(MARGIN_LEFT,MARGIN_TOP,parseInt(hours/10),ctx);
  110. renderDigit(MARGIN_LEFT+15*(RADIUS+1),MARGIN_TOP,parseInt(hours%10),ctx);
  111. renderDigit(MARGIN_LEFT+28*(RADIUS+1),MARGIN_TOP,10,ctx);
  112. renderDigit(MARGIN_LEFT+39*(RADIUS+1),MARGIN_TOP,parseInt(minutes/10),ctx);
  113. renderDigit(MARGIN_LEFT+54*(RADIUS+1),MARGIN_TOP,parseInt(minutes%10),ctx);
  114. renderDigit(MARGIN_LEFT+67*(RADIUS+1),MARGIN_TOP,10,ctx);
  115. renderDigit(MARGIN_LEFT+78*(RADIUS+1),MARGIN_TOP,parseInt(seconds/10),ctx);
  116. renderDigit(MARGIN_LEFT+93*(RADIUS+1),MARGIN_TOP,parseInt(seconds%10),ctx);
  117. for(var i=0;i<balls.length;i++){
  118. ctx.fillStyle=balls[i].color;
  119. ctx.beginPath();
  120. ctx.arc(balls[i].x,balls[i].y,RADIUS,0,2*Math.PI,true);
  121. ctx.closePath();
  122. ctx.fill();
  123. }
  124. }
  125. function renderDigit(x,y,num,ctx){//绘制数字
  126. ctx.fillStyle="rgb(0,102,153)";
  127. for(var i=0;i<digit[num].length;i++){//i是行数 j是列数
  128. for(var j=0;j<digit[num][i].length;j++){
  129. if(digit[num][i][j] == 1){
  130. ctx.beginPath();//圆心的位置centerX:x+j*2*(R+1)+(R+1) centerY:y+i*2*(R+1)+(R+1)
  131. ctx.arc(x+j*2*(RADIUS+1)+(RADIUS+1),y+i*2*(RADIUS+1)+(RADIUS+1),RADIUS,0,2*Math.PI);
  132. ctx.closePath();
  133. ctx.fill()
  134. }
  135. }
  136. }
  137. }

countdown.js显示当前时间版

canvas小球 时间倒计时demo-优化的更多相关文章

  1. canvas小球 时间demo

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  2. 使用canvas编写时间轴插件

    使用canvas编写时间轴插件 背景 项目中有一个视频广场的功能,需要一个时间轴类似视频播放中进度条功能一样显示录像情况,并且可以点击.拖动.放大缩小展示时间轴,获取到时间轴的某个时间.原来的时间轴是 ...

  3. js时间倒计时

    看了网上的其他的例子,觉得写的都有点复杂,不好理解,于是自己动手写了个. 本来想封装成jquery插件,但是觉得因为功能很简单,没有必要做成jquery插件,引用的时候不需要引入jqery库,这里直接 ...

  4. h5 canvas 小球移动

    h5 canvas 小球移动 <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...

  5. 原生js 当前时间 倒计时代码

    源:https://www.oschina.net/code/snippet_2318153_54763 <!DOCTYPE html> <html> <head> ...

  6. Vue的实时时间转换Demo

    Vue的实时时间转换Demo time.html: <!DOCTYPE html> <html lang="en"> <head> <me ...

  7. Java 获取当前时间及实现时间倒计时功能

    引言 在一些项目中或是一些特殊的业务场景中,需要用到显示系统的当前时间,以及一些固定的时间倒计时,时间到后做一些什么事情的业务 .接下来咱们就具体看看代码是怎么实现的: <%@ page lan ...

  8. js+canvas(H5)实现小球移动小demo

    *canvas提供画布,大小自定义,js得到画布,从画布对象通过getContext('2d')来得到画笔,然后就可以开始画了 代码: <!DOCTYPE html> <html l ...

  9. canvas小球动画原理

    随着html5发展,canvas标签作为h5革命性的发展标志也越来越流行.canvas标签的强大之处,不仅在于它可以作为一个独立的画布,也可以利用canvas做一些动画而不用导入flash文件.同时, ...

随机推荐

  1. android系统权限的管理

    被权限搞了好久,决定好好的研究一下: 参考资料 http://blog.csdn.net/xieyan0811/article/details/6083019?reload http://blog.c ...

  2. [译]用R语言做挖掘数据《三》

    决策树和随机森林 一.实验说明 1. 环境登录 无需密码自动登录,系统用户名shiyanlou,密码shiyanlou 2. 环境介绍 本实验环境采用带桌面的Ubuntu Linux环境,实验中会用到 ...

  3. Python——第一个python程序helloworld

    安装了Python的环境之后,就是编写Python的代码了. 首先,我们来写一个简单的“hello world” 新建一个空白的txt文本,将后缀改为.py 改了后缀之后即变为Python程序的图标 ...

  4. iOS开发笔记18:一些编译、开发调试、打包的细节整理

    1.以链库的方式引用第三方库 一些特殊场景可能会要求使用链库的方式使用第三方库,大体设置如下: ①Other Linker Flags里进行设置,格式为-l+库名称 ②Libray Search Pa ...

  5. docker 安装ElasticSearch 6.x

    首先是拉去镜像(或者直接创建容器自然会拉去) docker pull elasticsearch:6.5.4 创建容器 docker run --name elasticsearch --net ho ...

  6. Servlet学习系列1

    一.引言: 1.什么是Servlet? JavaWeb 开发规范中的一个组成部分. 服务器端的一段小程序(代码)   2.什么是服务器?→ 安装了服务器软件的计算机. 硬件:电脑 --->高性能 ...

  7. spss C# 二次开发 学习笔记(五)——Spss系统集成模式

    Spss官方不支持Server2008R2等Server系列,但做Spss的二次开发,调用Spss的Web系统,一般部署在Server系列上,例如Server2008R2. 起初,在Server上安装 ...

  8. <Android 应用 之路> MPAndroidChart~ScatterChart

    简介 MPAndroidChart是PhilJay大神给Android开发者带来的福利.MPAndroidChart是一个功能强大并且使用灵活的图表开源库,支持Android和IOS两种,这里我们暂时 ...

  9. 【vue入门】日志demo,增删改查的练习(无vuex版本)

    安装 1. 确定电脑已装node和npm 出现版本号则说明电脑已经安装好node和npm2. 创建一个基于webpack的项目   3. 在项目里安装依赖 4. 运行 配置路由为了动态渲染各个页面的组 ...

  10. Android学习笔记(5)----启动 Theme.Dialog 主题的Activity时程序崩溃的解决办法

    新建了一个Android Studio工程,在MainActivity的主界面中添加了两个按钮,点击其中一个按钮用来启动 NormalActivity,点击另一按钮用来启动DialogActivity ...