Comments (5)
can do it on v2.0.0.
from canvas-nest.js.
@hustcc how to control it in v2.0.1?
from canvas-nest.js.
You can detect the env to decide whether load canvas nest or not.
from canvas-nest.js.
Thanks, can it do in swig? I want to add condition in Next theme, but don't know how to do it. Is there any examples I can look around,
from canvas-nest.js.
@sli1989
You can add a function in the script to return the type of the platform, and use it to branch in the drawing function. As a hack it's working fine for me.
function getBrowserType() {
var browserType = "Undefined";
var browserAgent = navigator.userAgent;
if (browserAgent != null) {
if ( browserAgent.indexOf("Mobile") >= 0
|| browserAgent.indexOf("Android") >= 0
|| browserAgent.indexOf("BlackBerry") >= 0
|| browserAgent.indexOf("iPhone") >= 0
|| browserAgent.indexOf("iPad") >= 0
|| browserAgent.indexOf("iPod") >= 0
|| browserAgent.indexOf("Opera Mini") >= 0
|| browserAgent.indexOf("IEMobile") >= 0
) {
browserType = "MOBILE";
}
else {
browserType = "DESKTOP";
}
}
return browserType;
}
In function draw_canvas() ,
function draw_canvas() {
if(getBrowserType() === "DESKTOP"){
// ...
}
}
from canvas-nest.js.
Related Issues (20)
- 在vue框架里面用的时候,线条不跟着鼠标移动 HOT 7
- Next主题中使用新版js 无法全屏动画 HOT 3
- 如何在hugo里面使用? HOT 4
- 使用了 es6 的 [].fill 方法,有浏览器兼容性问题
- Canvas consume Memory & GPU HOT 1
- 页面长时鼠标错位 HOT 1
- zIndex属性问题 HOT 1
- destroy()命令不能挨个删除动态建立的canvas元素。
- 考虑监测一下是否接通电源? HOT 2
- iframe 里面使用问题
- 可以把canvas-ribbon开发成vuepress的插件吗? HOT 1
- 可以把点变成半径大大小小随机的圆么 这样效果会更好 HOT 1
- 你好,请问怎么样可以动态传入count
- wordpress5.3.2版本安装后没效果,且不能打开settings HOT 1
- 能否禁用触屏的鼠标跟随效果 HOT 4
- 源码里看有index.d.ts文件,但yarn或者npm安装是缺少index.d.ts文件的
- 有关如何使用API的问题
- bindEvent里为什么要写 this.onmousemove && this.onmousemove(e); 这一句呢? HOT 1
- 想問一下顏色能不能改成這樣?
- Implementation in Flutter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canvas-nest.js.