| | Shader responsive | |
| | Author | Message |
---|
phaidonas
Posts : 24 Points : 32 Reputation : 0 Join date : 2017-02-07
| Subject: Shader responsive Mon Feb 20, 2017 12:11 pm | |
| Hello is there any way to disable shader scripts when tha device is on mobiles?and in what format i save shader scripts if i make them external?Here is the site,in desktop works well but on mobile, it slows the page, it is not seen from inspect but in mobiles.Some of the elements is running and mnake it slow http://www.pcai.gr/1rstPhase_PP/PP_Main.html | |
| | | Khappa MJ
Posts : 8 Points : 14 Reputation : 0 Join date : 2017-02-10
| Subject: Re: Shader responsive Tue Feb 21, 2017 12:23 pm | |
| Hi man, you can just activate or deactivate a potion of code based on CSS: - Code:
-
@media screen and (min-width: 480px) { body { background-color: @ff0000; } }
CSS media screen are the best way to make a website or web app responsive. You can also run CSS via Javascript. | |
| | | phaidonas
Posts : 24 Points : 32 Reputation : 0 Join date : 2017-02-07
| Subject: Re: Shader responsive Tue Feb 21, 2017 1:53 pm | |
| i used: - Code:
-
@media screen and (min-width: 480px) { #myScript { display:none; } } but it didnt work.in mobile version of the site i have hidden the canvas element,and worked only with css and html,because some mobiles where heating,when loading the page. | |
| | | WebForce
Posts : 22 Points : 30 Reputation : 0 Join date : 2017-02-07
| Subject: Re: Shader responsive Tue Feb 21, 2017 2:11 pm | |
| you cant use " #myScript" in CSS. CSS cant recognize it. You should use Javascript and the property "innerHTML" like: javscript: divFile.innerHTML = divFile.innerHTML + '<div class="container"></div>'
css: @media screen and (min-width: 480px) { .container { display:none; } }
This should works | |
| | | phaidonas
Posts : 24 Points : 32 Reputation : 0 Join date : 2017-02-07
| Subject: Re: Shader responsive Tue Feb 21, 2017 2:30 pm | |
| I have a thought that maybe its the custom font,not the scripts,and what do you mean by adding container class?Where?to the script? | |
| | | WebForce
Posts : 22 Points : 30 Reputation : 0 Join date : 2017-02-07
| Subject: Re: Shader responsive Tue Feb 21, 2017 2:55 pm | |
| oh yes, sorry! You can call 'container' class as you wish just like 'yourelement'. Its a simpe div which contains the code you want to hide so do that:
javascript: divFile.innerHTML = divFile.innerHTML + '<div class="shader_script_container">here you put your shader javascript</div>'
css: @media screen and (min-width: 480px) { .shader_script_container { display:none; } }
| |
| | | phaidonas
Posts : 24 Points : 32 Reputation : 0 Join date : 2017-02-07
| Subject: Re: Shader responsive Tue Feb 21, 2017 3:30 pm | |
| i can put also manually.Without js?or not | |
| | | Khappa MJ
Posts : 8 Points : 14 Reputation : 0 Join date : 2017-02-10
| Subject: Re: Shader responsive Tue Feb 21, 2017 4:25 pm | |
| Hi Phaidonas, sorry for my late answer. The example of WebForce is cool and answering to your question i say yes, you can write the HTML code manually without javascript if you prefer.
| |
| | | Sponsored content
| Subject: Re: Shader responsive | |
| |
| | | | Shader responsive | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Our first goal | Mon Feb 27, 2017 10:12 am by Admin | More than 20 users,
almost 150 posts,
a new big project is coming,
about …
| Comments: 0 |
Forum changements | Tue Feb 21, 2017 6:10 pm by Admin | Dear members,
I have personally made some changements into the forum, now …
| Comments: 2 |
A new revision of the forum rules | Tue Feb 07, 2017 9:40 pm by Admin | Dear Members,
it is my pleasure to tell you below all the new functions I …
| Comments: 0 |
Top posting users this week | |
|