当前位置: 首页 > wzjs >正文

成都需要网站制作武汉seo关键字优化

成都需要网站制作,武汉seo关键字优化,建设信用卡申请进度查询官方网站,简述网站设计的原则巧妇难为无米之炊,想写功能但是没有好看的设计,边写边设计效率又不够高。mastergoAi生成的页面又不够好看,而且每月给的免费积分用得又超快,so决定自给自足。能有多难,先做,做了再改。 于是决定踏足设计&a…

巧妇难为无米之炊,想写功能但是没有好看的设计,边写边设计效率又不够高。mastergoAi生成的页面又不够好看,而且每月给的免费积分用得又超快,so决定自给自足。能有多难,先做,做了再改。

于是决定踏足设计,本期话题新手如何用mastergo设计小程序页面。

先去小红书上找找模子,看能否复原。摸了一晚上,感觉效果还行,比ai生成的要好看那么一点。只是想画个时钟出来不知道怎么画好,还的看怎么用canvas实现时钟动画。

附上mastergo网址:MasterGo 莫高设计 - AI 时代的数字界面生产平台

有了UI页面画起来就是快多了

今天用canvas绘制了时钟,然后调整了下整体的布局更简洁直观了

另外再附上canvas绘制时钟代码,canvas越写越有意思了

// components/stars/stars.ts
let timer = null
Component({lifetimes: {attached() {this.createSelectorQuery().select("#myCanvas2").fields({node: true,size: true}).exec(res => this.init(res));},detached() {if (timer) {clearInterval(timer)}}},/*** 组件的方法列表*/methods: {init(res) {const width = res[0].widthconst height = res[0].height// 设置画布宽高const canvas = res[0].nodeconst ctx = canvas.getContext('2d')canvas.width = widthcanvas.height = heightconst r = width / 2const hourNeedle = r * 1 / 2const minuteNeedle = r * 2.5 / 4const secondNeedle = r * 4 / 5// 帧渲染回调const draw = () => {const now = new Date();const hour = now.getHours();const minute = now.getMinutes();const second = now.getSeconds();const secondDeg = (second / 60) * Math.PI * 2;const minuteDeg = ((second / 60 + minute) / 60) * Math.PI * 2;const hourDeg = ((((second / 60 + minute) / 60) + hour) / 12) * Math.PI * 2;this.render(ctx, width, height, secondDeg, secondNeedle, minuteDeg, minuteNeedle, hourDeg, hourNeedle)// 注册下一帧渲染// canvas.requestAnimationFrame(draw)}timer = setInterval(() => {draw()}, 1000)},//画背景框renderCircle(ctx, width) {ctx.beginPath()ctx.lineWidth = '1'ctx.arc(width / 2, width / 2, width / 2 - 2, 2, 4 * Math.PI);ctx.strokeStyle = '#000'ctx.stroke()ctx.beginPath()ctx.arc(width / 2, width / 2, width / 2 - 6, 2, 4 * Math.PI);ctx.strokeStyle = '#000'ctx.stroke()ctx.beginPath()ctx.arc(width / 2, width / 2, 3, 2, 4 * Math.PI);ctx.strokeStyle = '#000'ctx.stroke()ctx.fillStyle = '#000'ctx.fill()let count = 0while (count < 60) {const deg = (Math.PI / 30) * countconst r = width / 2 - 6const r1 = r - 4const r2 = r - 8const r3 = r - 18let R = r1if (count % 5 == 0) {R = r2let word = count / 5 == 0 ? 12 : count / 5let w = ctx.measureText(word).width;ctx.fillText(word, width / 2 + r3 * Math.sin(deg) - w / 2, width / 2 - r3 * Math.cos(deg) + w / 2)}ctx.beginPath()ctx.moveTo(width / 2 + r * Math.sin(deg), width / 2 - r * Math.cos(deg))ctx.lineTo(width / 2 + R * Math.sin(deg), width / 2 - R * Math.cos(deg))ctx.strokeStyle = '#000'ctx.stroke()count++}ctx.font = '12px bold'},// 画时针render(ctx, width, height, secondDeg, secondNeedle, minuteDeg, minuteNeedle, hourDeg, hourNeedle) {ctx.clearRect(0, 0, width, height)this.renderCircle(ctx, width)ctx.beginPath()ctx.moveTo(width / 2 + (-10) * Math.sin(minuteDeg), width / 2 - (-10) * Math.cos(minuteDeg));ctx.lineTo(width / 2 + minuteNeedle * Math.sin(minuteDeg), width / 2 - minuteNeedle * Math.cos(minuteDeg));ctx.lineCap = 'round'ctx.lineWidth = '2'ctx.stroke();ctx.beginPath()ctx.moveTo(width / 2 + (-10) * Math.sin(hourDeg), width / 2 - (-10) * Math.cos(hourDeg));ctx.lineTo(width / 2 + hourNeedle * Math.sin(hourDeg), width / 2 - hourNeedle * Math.cos(hourDeg));ctx.lineCap = 'round'ctx.lineWidth = '3'ctx.stroke();ctx.beginPath()ctx.moveTo(width / 2 + (-10) * Math.sin(secondDeg), width / 2 - (-10) * Math.cos(secondDeg));ctx.lineTo(width / 2 + secondNeedle * Math.sin(secondDeg), width / 2 - secondNeedle * Math.cos(secondDeg));ctx.lineCap = 'round'ctx.lineWidth = '1'ctx.strokeStyle = 'red'ctx.stroke();},}
})

时钟效果可查看微信小程序“哆喵口袋”

http://www.dtcms.com/wzjs/55245.html

相关文章:

  • 网站建设怎么选择MySQL数据库大小2022百度seo优化工具
  • 建设银行积分兑换商城网站网站优化联系
  • wordpress 多个分类查找郑州百度seo排名公司
  • 免费申请地图定位湖南seo服务
  • c 做网站网站优化网站关键词的技巧
  • 手机网站建设教程网络推广的方法有哪些
  • 迁西网站定制保定网站seo
  • 云南建设厅查证网站职业培训机构需要什么资质
  • 学工系统网站建设的意义创意营销
  • 天津市网站制作公司网络营销和电子商务区别
  • php企业网站开发实验总结网站客服系统
  • 上海网站建设浦东今日头条搜索优化
  • 哈尔滨网站定制公司北京正规seo搜索引擎优化价格
  • 株洲网站优化域名解析ip地址查询
  • 广告推广代理海外seo推广公司
  • seo职位描述seo优化是做什么的
  • 创业做b2b行业网站_正确划分行业_别被建站公司忽悠常宁seo外包
  • 苏州网站开发公司排名软件外包公司好不好
  • ip地址做网站百度手机网页版入口
  • 厦门市思明区建设局网站营销网点机构号
  • 昆山教育平台网站建设aso优化吧
  • 网站建设专业可行性分析首码项目推广平台
  • 做网站的算什么行业哈尔滨百度推广公司
  • 一个好的网站内页大概做多少佛山网络营销推广
  • 规划设计公司资质要求做seo需要用到什么软件
  • 深圳住房和城乡建设厅网站怎么创建一个网页
  • 柳州网站建设33线上营销方式主要有哪些
  • 还有哪些网站可以做H5潍坊网站开发公司
  • 电脑课做网站的作业网络营销案例ppt
  • 什么专业学做网站软件开发工资一般多少