ianwith / musicapp Goto Github PK
View Code? Open in Web Editor NEWWith this app you see music presented visually
Home Page: http://ianwith.github.io/MusicApp
With this app you see music presented visually
Home Page: http://ianwith.github.io/MusicApp
初步分析如下:
前提:canvas的width/height
为画布能渲染像素的宽高,而style.width/height
才是canvas元素本身的宽高。
canvas.width = window.innerWidth
,没有设置style
,此时Retina屏下浏览器自动缩放,使得canvas充满浏览器窗口,但是显然这是模糊的。renderer.setSize(window.innerWidth, window.innerHeight)
,这时候实际上就是设置了canvas的style.width/height
,而canvas的width/height
变成了2倍(估计是threejs识别devicePixelRatio自动设置的)。renderer.setSize
,同上面一段代码。width/height
都扩大了,而柱状的宽度barW等等变量是写死的像素,所以整体看上去变小了,变清晰了。A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.