简体   繁体   English

如何使JavaScript动画响应?

[英]How to make a JavaScript animation responsive?

I am trying to make this java script animation responsive: https://codepen.io/lateek35/pen/QbZdEB . 我正在尝试使这个java脚本动画响应: https//codepen.io/lateek35/pen/QbZdEB This is my website http://gerydi.com/sincera/ . 这是我的网站http://gerydi.com/sincera/

and I used this, but it only fits the box size, not the whole text. 我用它,但它只适合盒子大小,而不是整个文本。 Do you have any ideas how can I fix it? 您有什么想法我该如何解决? Font size doesn't affect my text. 字体大小不会影响我的文字。

@media only screen and (max-width: 480px) {
    #canvas{
        width: 360px!important;
        font-size: 7px!important;
        margin-top:50px;
    }
}   

In the codepen example you provided, you can change the text size in the writeText function: 在您提供的codepen示例中,您可以更改writeText函数中的文本大小:

var textSample = new PIXI.Text(text, { font: '50px Calibri, sans-serif', fill: 'black', align: 'left' });

CodePen Example . CodePen示例 Do you have access to that function? 你有权使用这个功能吗? If not, you'll have to figure out a way to pass in the font settings. 如果没有,你将不得不想办法传递字体设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM