Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39227

Re: Great animation, that you all may like.

Path csiph.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost2.xs4all.net!not-for-mail
Newsgroups comp.lang.javascript
Subject Re: Great animation, that you all may like.
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <f9689b96-2a84-42e3-9d26-cb687c41b4d0n@googlegroups.com> <XnsAC8AA3940F6BFeejj99@194.109.6.166>
Date Sat, 05 Dec 2020 16:56:08 +0100
Message-ID <XnsAC8AAC47ABC89eejj99@194.109.6.166> (permalink)
User-Agent Xnews/2009.05.01
Lines 157
NNTP-Posting-Host e8b254d0.newszilla.xs4all.nl
X-Trace G=1vBtOG95,C=U2FsdGVkX1+jOl3IaK0dWmbQ3R8CatHKQtzv1dqHlHhZV0enFuZ76I5LIHD/LUSDYR0pH56oxMu2vyhd2xjcYKBB3KYRPGaFH7Q/OrqAS/ASc/ChS3CG25jemYZALScy
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.javascript:39227

Show key headers only | View raw


"Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote on 05 Dec 2020 in 
comp.lang.javascript:

> Chrictjan Robam <he12457@hotmail.com> wrote on 05 Dec 2020 in
> comp.lang.javascript: 
> 
>> <html>
>> <head>
>> <style>
>> body {
>>    height: 100%;
>>    color:green;
>>    background-color: black;
>>}
>>#a1 {
>>    width: 100vw;
>>    height: 100%;
>>    font-size: 6vw;
>>    font-weight: bold; 
>>    overflow-y:hidden;
>>    line-height:5vw;
>> 
>>}
>>#aaa1 {
>>    line-height:5vw;
>>}
>> </style>
>> </head>
>> <body>
>> 
>> <div id="a1">
>> </div>
>> <script>
>> var next=0;
>> var next01="";
>> function a2() {
>>     setInterval(function(){
>>        var a=Math.round(Math.random()*99999);
>>        var aa=document.getElementById("a1").innerHTML;
>>        var aa1=document.body.clientWidth;
>>        var aa2=Math.round(aa1/64);
>>        if(aa.length>2100000) aa="";
>>        if(next<aa2) {
>>          next01=a+" "+next01;
>>          next++;
>>        }
>>        if(next==aa2) {
>>            document.getElementById("a1").innerHTML="<div
>>            id='aaa1'>"+next01+"</div>"+aa; next=0;
>>            next01="";
>>        }
>> 
>>     }, 1);
>>}
>> 
>> a2();
>> </script>
>> </body>
>> </html>
> 
> There is a lot of unnecessary code like the looping,
> making the interval dependent on the size.
> 
> Try this:
> 
> =========================
> <html>
> 
> <head>
> 
> <style>
> body {
>      color:white;
>      background-color: black;
>      font-size: 3vw;
>      font-weight: bold; 
>      line-height:5vw;
>}
> </style>
> 
> <script>
> 
> const f = () => {
>      let inner = '';
>      let count = 0;
>      while (count < 6 * 6) {
>           inner += ' ' + Math.floor(Math.random()*99999);
>           count++;
>           if (count % 6 == 0) inner += '<br>';
>     };
>      document.body.innerHTML = inner;
>};
> 
> window.onload = setInterval(f, 100);
> 
> </script>
> 
> </head>
> 
> <body></body>
> 
> </html>
> 
> =========================

Or using a table:

=====================
<html>

<head>

<style>
body {
	color:white;
	background-color: black;
	font-size: 3vw;
	font-weight: bold; 
	line-height:5vw;
}
td {
	text-align:right;
	border:dotted gray 1px;
	padding:2px 20px;
}
</style>

<script>

const f = () => {
	let inner = '<table><tr>';
	let count = 0;
	while (count < 6 * 6) {
		inner += '<td>' + Math.floor(Math.random()*99999);
		count++;
		if (count % 6 == 0) inner += '<tr>';
	};
	document.body.innerHTML = inner + '</table>';
};

window.onload = setInterval(f,100);

</script>

</head>

<body></body>

</html>

=====================


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Great animation, that you all may like. Chrictjan Robam <he12457@hotmail.com> - 2020-12-05 03:37 -0800
  Re: Great animation, that you all may like. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-12-05 16:04 +0100
    Re: Great animation, that you all may like. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-12-05 16:54 +0100
    Re: Great animation, that you all may like. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-12-05 16:56 +0100
      Re: Great animation, that you all may like. Chrictjan Robam <he12457@hotmail.com> - 2020-12-06 02:19 -0800
        Re: Great animation, that you all may like. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-12-06 16:16 +0100
          Re: Great animation, that you all may like. Chrictjan Robam <he12457@hotmail.com> - 2020-12-06 09:55 -0800
            Re: Great animation, that you all may like. I I <he12457@hotmail.com> - 2021-01-09 08:56 -0800
              Re: Great animation, that you all may like. I I <kpuctjanpobam@mail.com> - 2021-01-09 13:03 -0800
                Re: Great animation, that you all may like. I I <kpuctjanpobam@mail.com> - 2021-01-09 13:11 -0800

csiph-web