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


Groups > comp.lang.javascript > #36582 > unrolled thread

TWO lines of code for transforms?

Started bygroovee@cyberdude.com
First post2019-05-10 03:52 -0700
Last post2019-05-15 22:06 +0100
Articles 20 on this page of 25 — 9 participants

Back to article view | Back to comp.lang.javascript


Contents

  TWO lines of code for transforms? groovee@cyberdude.com - 2019-05-10 03:52 -0700
    Re: TWO lines of code for transforms? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-05-10 13:38 +0200
    Re: TWO lines of code for transforms? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-05-10 14:27 +0200
      Re: TWO lines of code for transforms? "Mark-" <nospam@mapson.xyz> - 2019-05-10 14:13 +0000
        Re: TWO lines of code for transforms? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-05-11 11:26 +0100
          Re: TWO lines of code for transforms? Julio Di Egidio <julio@diegidio.name> - 2019-05-11 04:20 -0700
            Re: TWO lines of code for transforms? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-05-11 14:31 +0100
              Re: TWO lines of code for transforms? Julio Di Egidio <julio@diegidio.name> - 2019-05-11 08:29 -0700
                Re: TWO lines of code for transforms? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-05-11 16:59 +0100
                  Re: TWO lines of code for transforms? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-05-11 17:55 +0200
                Re: TWO lines of code for transforms? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-05-11 18:31 +0100
                  Re: TWO lines of code for transforms? Gene Wirchenko <genew@telus.net> - 2019-05-11 22:01 -0700
            Re: TWO lines of code for transforms? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-05-11 18:18 +0100
              Re: TWO lines of code for transforms? Gene Wirchenko <genew@telus.net> - 2019-05-11 22:04 -0700
                Re: TWO lines of code for transforms? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-05-12 10:27 +0100
                  Re: TWO lines of code for transforms? Gene Wirchenko <genew@telus.net> - 2019-05-14 10:44 -0700
    Re: TWO lines of code for transforms? Ram Tobolski <ramtob@gmail.com> - 2019-05-11 07:06 -0700
      Re: TWO lines of code for transforms? groovee@cyberdude.com - 2019-05-13 04:28 -0700
        Re: TWO lines of code for transforms? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-05-13 13:38 +0100
          Re: TWO lines of code for transforms? groovee@cyberdude.com - 2019-05-13 07:31 -0700
            Re: TWO lines of code for transforms? Ram Tobolski <ramtob@gmail.com> - 2019-05-13 09:11 -0700
            Re: TWO lines of code for transforms? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-05-13 17:14 +0100
              Re: TWO lines of code for transforms? groovee@cyberdude.com - 2019-05-14 23:56 -0700
                Re: TWO lines of code for transforms? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-05-15 09:43 +0200
                Re: TWO lines of code for transforms? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-05-15 22:06 +0100

Page 1 of 2  [1] 2  Next page →


#36582 — TWO lines of code for transforms?

Fromgroovee@cyberdude.com
Date2019-05-10 03:52 -0700
SubjectTWO lines of code for transforms?
Message-ID<de0b77b1-4e91-4d2f-b449-8f554ad3bd6f@googlegroups.com>
OK I know, from DOING, that the following will make something spin 45 degrees:

            blah.style.transition = "transform 1s";
            blah.style.transform = "rotate(45deg)";

...but I have no idea WHY this works. Why are TWO lines of code necessary for this, and indeed what is the exact difference between a transition and a transform?? What could the first line have had on the RHS *besides* "transform 1s", since, it seems to me, that "transform" is all it can have??

Could somebody please explain?


Thanks for your help.

[toc] | [next] | [standalone]


#36583

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2019-05-10 13:38 +0200
Message-ID<XnsAA4B8AB345C05eejj99@194.109.6.166>
In reply to#36582
groovee@cyberdude.com wrote on 10 May 2019 in comp.lang.javascript:

> OK I know, from DOING, that the following will make something spin 45
> degrees: 
> 
>             blah.style.transition = "transform 1s";
>             blah.style.transform = "rotate(45deg)";
> 
> ...but I have no idea WHY this works. Why are TWO lines of code
> necessary for this, and indeed what is the exact difference between a
> transition and a transform?? What could the first line have had on the
> RHS *besides* "transform 1s", since, it seems to me, that "transform" is
> all it can have?? 
> 
> Could somebody please explain?

This has to do with CSS styles,
so please read the specs there.

The how to do it with javascript, where you change ciberworld,
does not mean the whole world should be explained on this NG.

CSS has its own NG.

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

[toc] | [prev] | [next] | [standalone]


#36584

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-05-10 14:27 +0200
Message-ID<7fdff281-9436-e4a8-c2a6-c019042f329d@PointedEars.de>
In reply to#36582
groovee@cyberdude.com wrote:
> OK I know, from DOING, that the following will make something spin 45 degrees:
> 
>             blah.style.transition = "transform 1s";
>             blah.style.transform = "rotate(45deg)";
> 
> ...but I have no idea WHY this works. Why are TWO lines of code necessary for this,

The first statement defines that the “transform” style property should be
used for transitions with a duration of 1 second.

The second statement might start the transition by changing the value of the
watched style property.  Whether it starts a transition or merely prepares a
future transition depends on the previous value of the watched style property.

Note that due to the single-threadedness of the code a transition will
usually not start before control is returned to the calling execution
context.  It will start immediately if executed in the global context,
unless it has a defined delay, there is a process that takes precedence,
or CSS transitions are not supported (rare nowadays).

See also <https://developer.mozilla.org/CSS> or something to that effect.

> and indeed what is the exact difference between a transition and a transform?? 

Google is your friend. [psf 6.1]

And get a real name.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36585

From"Mark-" <nospam@mapson.xyz>
Date2019-05-10 14:13 +0000
Message-ID<qb40tr$135n$1@gioia.aioe.org>
In reply to#36584
Thomas 'PointedEars' Lahn wrote:

> And get a real name.

Mr. Lahn simply can not help himself. Always a dick.


[toc] | [prev] | [next] | [standalone]


#36587

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2019-05-11 11:26 +0100
Message-ID<rm8ddet980ko7uab12211t34838pk3oae7@4ax.com>
In reply to#36585
On Fri, 10 May 2019 14:13:16 +0000 (UTC), "Mark-" <nospam@mapson.xyz>
wrote:

>Thomas 'PointedEars' Lahn wrote:
>
>> And get a real name.
>
>Mr. Lahn simply can not help himself. Always a dick.

Thomas hasn't thought it through. Articles appear here labelled with
the character string "Thomas Lahn". People are familiar with the 
style of those articles and presumably have an opinion on their 
worth. 

Do we know which of several people who use the name Thomas 
Lahn has written those articles? No, and we don't care. Do we know 
if his parents or his work colleagues know him as Thomas Lahn? No, 
and we don't care. Do we know if the author of those articles is a 
man, or a woman, or an AI? No, and we don't care.

The same applies to the character string "groovee".

So, Thomas believes that some character strings are better than 
others. He has disapproved of "groovee", "VK", and "Man-wai Chang" 
among others. It would be interesting to know what he thinks of 
"Hongbo Yang", "Llyr Gruffydd", and "Archie Mountbatten-Windsor".

  John

[toc] | [prev] | [next] | [standalone]


#36588

FromJulio Di Egidio <julio@diegidio.name>
Date2019-05-11 04:20 -0700
Message-ID<960fe8b0-169c-4adf-930d-8ebd81f3eab3@googlegroups.com>
In reply to#36587
On Saturday, 11 May 2019 12:26:51 UTC+2, John G Harris  wrote:
> On Fri, 10 May 2019 14:13:16 +0000 (UTC), "Mark-" <nospam@mapson.xyz>
> wrote:
> 
> >Thomas 'PointedEars' Lahn wrote:
> >
> >> And get a real name.
> >
> >Mr. Lahn simply can not help himself. Always a dick.
> 
> Thomas hasn't thought it through.

Are you terminally stupid or what?  For the umpteenth time:

Using a real name and email is essential Usenet etiquette.

Stop spamming the Usenet.

Julio

[toc] | [prev] | [next] | [standalone]


#36589

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2019-05-11 14:31 +0100
Message-ID<87h8a1yv6a.fsf@bsb.me.uk>
In reply to#36588
Julio Di Egidio <julio@diegidio.name> writes:
<cut>
> Using a real name and email is essential Usenet etiquette.

Curious.  Do you have a citation?  I've used Usenet for decades and was
unaware of this essential piece of etiquette.  None of the usual sources
mention it (for example the RFC about "netiquette").

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#36591

FromJulio Di Egidio <julio@diegidio.name>
Date2019-05-11 08:29 -0700
Message-ID<80603aed-84db-4f6a-bd9d-f577c047c46b@googlegroups.com>
In reply to#36589
On Saturday, 11 May 2019 15:31:31 UTC+2, Ben Bacarisse  wrote:
> Julio Di Egidio <julio@diegidio.name> writes:
> <cut>
> > Using a real name and email is essential Usenet etiquette.
> 
> Curious.  Do you have a citation?

  "It violates RFCs, the rules upon which Usenet is built."

<http://www.faqs.org/faqs/net-abuse-faq/munging-address/>

That's the best I could quickly google up under the tons of crap that
have flooded the Internet in the meantime.  But note: RFCs, *plural*:
this is not and has never been written in one single place, it belongs
to practices that you are supposed to learn from RFCs, FAQs, as well
as the advice coming from more senior members...  I.e. nothing you
would understand, you other piece of stupid brainwashed spamming crap.

Indeed not even address munging is anymore relevant: spammers proper
have long gone for greener pastures than Usenet, where only few veterans
are left and the rest is just you agents of the enemy making sure this
place and the very idea of uncensored channels remains unusable for all...

> I've used Usenet for decades 

Liar.

> and was unaware of this essential piece of etiquette.

There is no worse deaf... moron.

> None of the usual sources
> mention it (for example the RFC about "netiquette").

"Usual" my ass, you other piece of crap...

HTH and go fuck yourself,

Julio

[toc] | [prev] | [next] | [standalone]


#36592

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2019-05-11 16:59 +0100
Message-ID<87bm09yobt.fsf@bsb.me.uk>
In reply to#36591
Julio Di Egidio <julio@diegidio.name> writes:

> On Saturday, 11 May 2019 15:31:31 UTC+2, Ben Bacarisse  wrote:
>> Julio Di Egidio <julio@diegidio.name> writes:
>> <cut>
>> > Using a real name and email is essential Usenet etiquette.
>> 
>> Curious.  Do you have a citation?
>
>   "It violates RFCs, the rules upon which Usenet is built."
>
> <http://www.faqs.org/faqs/net-abuse-faq/munging-address/>

I was talking about what you replied to, and what Thomas Lhan and John
Harris were talking about: using a real name.  Maybe I cut too much.
Did you not mean to include using a real name as essential etiquette?

(Using a valid email address is a good idea, but not essential
etiquette.  If it were, FAQs like the one you cite would not spend so
much time explaining the right way to do it.)

<cut>
>> I've used Usenet for decades 
>
> Liar.

Eh?  How can you possibly know?

>> and was unaware of this essential piece of etiquette.
>
> There is no worse deaf... moron.
>
>> None of the usual sources
>> mention it (for example the RFC about "netiquette").
>
> "Usual" my ass, you other piece of crap...

The usual sources include the RFC on netiquette and people like Jukka
Korpela who was a widely respected writer on such topics.  But can you
get more "usual" than an RFC?  Why would the RFC omit an mention of this
essential piece of netiquette.

> HTH and go fuck yourself,

Charming as ever!

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#36593

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-05-11 17:55 +0200
Message-ID<7699d441-5450-546c-3e9d-18dc9da6c009@PointedEars.de>
In reply to#36592
Ben Bacarisse wrote:
> The usual sources include the RFC on netiquette and people like Jukka
> Korpela who was a widely respected writer on such topics.

LOL

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36595

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2019-05-11 18:31 +0100
Message-ID<em1edeh3en18tjmi2v8adm5uu4njd0gho1@4ax.com>
In reply to#36591
On Sat, 11 May 2019 08:29:41 -0700 (PDT), Julio Di Egidio
<julio@diegidio.name> wrote:

>On Saturday, 11 May 2019 15:31:31 UTC+2, Ben Bacarisse  wrote:
>> Julio Di Egidio <julio@diegidio.name> writes:
>> <cut>
>> > Using a real name and email is essential Usenet etiquette.
>> 
>> Curious.  Do you have a citation?
>
>  "It violates RFCs, the rules upon which Usenet is built."
>
><http://www.faqs.org/faqs/net-abuse-faq/munging-address/>
  <snip>

Which says, among other things, :

  "Many people on the Internet have a consistent name or handle by
   which they become known."

So what's this mythical "real name" then? And what's the objection to
a consistent name or handle?

  John

[toc] | [prev] | [next] | [standalone]


#36596

FromGene Wirchenko <genew@telus.net>
Date2019-05-11 22:01 -0700
Message-ID<01afdedougkvhdkmdi9tjdu3k9tl493mio@4ax.com>
In reply to#36595
On Sat, 11 May 2019 18:31:11 +0100, John G Harris
<niam@jghnorth.org.uk.invalid> wrote:

>On Sat, 11 May 2019 08:29:41 -0700 (PDT), Julio Di Egidio
><julio@diegidio.name> wrote:
>
>>On Saturday, 11 May 2019 15:31:31 UTC+2, Ben Bacarisse  wrote:
>>> Julio Di Egidio <julio@diegidio.name> writes:
>>> <cut>
>>> > Using a real name and email is essential Usenet etiquette.
>>> 
>>> Curious.  Do you have a citation?
>>
>>  "It violates RFCs, the rules upon which Usenet is built."
>>
>><http://www.faqs.org/faqs/net-abuse-faq/munging-address/>
>  <snip>
>
>Which says, among other things, :
>
>  "Many people on the Internet have a consistent name or handle by
>   which they become known."
>
>So what's this mythical "real name" then? And what's the objection to
>a consistent name or handle?

     A consistent name or handle is real enough for me.  I took a
Chinese name when I was over there.  When I applying for a U.S. SSN
while down there on a TN work visa, I put it down as another name I am
known by.

Sincerely,

Gene Wirchenko
(or Chen2 Jin1 Bai2)

[toc] | [prev] | [next] | [standalone]


#36594

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2019-05-11 18:18 +0100
Message-ID<9u0ede5jd9650mchddjtalugl2k63lajkd@4ax.com>
In reply to#36588
On Sat, 11 May 2019 04:20:20 -0700 (PDT), Julio Di Egidio
<julio@diegidio.name> wrote:

>On Saturday, 11 May 2019 12:26:51 UTC+2, John G Harris  wrote:
>> On Fri, 10 May 2019 14:13:16 +0000 (UTC), "Mark-" <nospam@mapson.xyz>
>> wrote:
>> 
>> >Thomas 'PointedEars' Lahn wrote:
>> >
>> >> And get a real name.
>> >
>> >Mr. Lahn simply can not help himself. Always a dick.
>> 
>> Thomas hasn't thought it through.
>
>Are you terminally stupid or what?  For the umpteenth time:
>
>Using a real name and email is essential Usenet etiquette.
  <snip>

Mark Twain didn't think it was essential etiquette.

Cordwainer Smith didn't think it was essential etiquette.

Student didn't think it was essential etiquette.

Yet masses of people still respect their publications. No sensible
perston would say that Usenet is different.

  John

[toc] | [prev] | [next] | [standalone]


#36597

FromGene Wirchenko <genew@telus.net>
Date2019-05-11 22:04 -0700
Message-ID<06afde1guu9oqqq1ou9bs290dgp6c69cap@4ax.com>
In reply to#36594
On Sat, 11 May 2019 18:18:19 +0100, John G Harris
<niam@jghnorth.org.uk.invalid> wrote:

[snip]

>Mark Twain didn't think it was essential etiquette.

     Not the best choice to follow for etiquette standards.  For
pithiness though, oh yeah!

>Cordwainer Smith didn't think it was essential etiquette.
>
>Student didn't think it was essential etiquette.

      Who is Student?  That is an unusual name.

>Yet masses of people still respect their publications. No sensible
>perston would say that Usenet is different.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#36598

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2019-05-12 10:27 +0100
Message-ID<7jpfdepttuimjrue4v50migfk8s5qpiqq2@4ax.com>
In reply to#36597
On Sat, 11 May 2019 22:04:50 -0700, Gene Wirchenko <genew@telus.net>
wrote:

  <snip>
>      Who is Student?  That is an unusual name.
  <snip>

See the History section in this Wikipedia entry :
  <https://en.wikipedia.org/wiki/Student's_t-test>

  John

[toc] | [prev] | [next] | [standalone]


#36609

FromGene Wirchenko <genew@telus.net>
Date2019-05-14 10:44 -0700
Message-ID<2jvldet8fqd7l55oa58dab3pqb1qf9o0ih@4ax.com>
In reply to#36598
On Sun, 12 May 2019 10:27:21 +0100, John G Harris
<niam@jghnorth.org.uk.invalid> wrote:

>On Sat, 11 May 2019 22:04:50 -0700, Gene Wirchenko <genew@telus.net>
>wrote:
>
>  <snip>
>>      Who is Student?  That is an unusual name.
>  <snip>
>
>See the History section in this Wikipedia entry :
>  <https://en.wikipedia.org/wiki/Student's_t-test>

     Thank you.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#36590

FromRam Tobolski <ramtob@gmail.com>
Date2019-05-11 07:06 -0700
Message-ID<317348f2-34c1-4a75-bafe-1e4072aedb9c@googlegroups.com>
In reply to#36582
On Friday, May 10, 2019 at 1:52:17 PM UTC+3, gro...@cyberdude.com wrote:
> OK I know, from DOING, that the following will make something spin 45 degrees:
> 
>             blah.style.transition = "transform 1s";
>             blah.style.transform = "rotate(45deg)";
> 
> ...but I have no idea WHY this works. Why are TWO lines of code necessary for this, and indeed what is the exact difference between a transition and a transform?? What could the first line have had on the RHS *besides* "transform 1s", since, it seems to me, that "transform" is all it can have??
> 
> Could somebody please explain?
> 
> 
> Thanks for your help.

Transform without transition implies a merely static change.
An element with e.g. the property

transform: rotate(45 deg)

will be displayed rotated. But without a transition there will be no process of rotating, no spinning, no gradual movement, just a static and instantaneous change of orientation.

When you add a transition property, you will get animation, gradual change, visible process.

[toc] | [prev] | [next] | [standalone]


#36601

Fromgroovee@cyberdude.com
Date2019-05-13 04:28 -0700
Message-ID<a6aa0673-cce7-47c7-a97a-635cd0c22fbc@googlegroups.com>
In reply to#36590
On Saturday, 11 May 2019 19:37:06 UTC+5:30, Ram Tobolski  wrote:
> On Friday, May 10, 2019 at 1:52:17 PM UTC+3, gro...@cyberdude.com wrote:
> > OK I know, from DOING, that the following will make something spin 45 degrees:
> > 
> >             blah.style.transition = "transform 1s";
> >             blah.style.transform = "rotate(45deg)";
> > 
> > ...but I have no idea WHY this works. Why are TWO lines of code necessary for this, and indeed what is the exact difference between a transition and a transform?? What could the first line have had on the RHS *besides* "transform 1s", since, it seems to me, that "transform" is all it can have??
> > 
> > Could somebody please explain?
> > 
> > 
> > Thanks for your help.
> 
> Transform without transition implies a merely static change.
> An element with e.g. the property
> 
> transform: rotate(45 deg)
> 
> will be displayed rotated. But without a transition there will be no process of rotating, no spinning, no gradual movement, just a static and instantaneous change of orientation.
> 
> When you add a transition property, you will get animation, gradual change, visible process.

Hey Ram! (nice to meet you again! :) ),....I was thinking pretty much the same thing too, but.... what about my question: "What can the first line have on the RHS *excepting* "transform 1s" "? ie. what ELSE can "transition" be equal to?

[toc] | [prev] | [next] | [standalone]


#36602

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2019-05-13 13:38 +0100
Message-ID<877eauo7g0.fsf@bsb.me.uk>
In reply to#36601
groovee@cyberdude.com writes:
>> On Friday, May 10, 2019 at 1:52:17 PM UTC+3, gro...@cyberdude.com wrote:
>> > OK I know, from DOING, that the following will make something spin 45 degrees:
>> > 
>> >             blah.style.transition = "transform 1s";
>> >             blah.style.transform = "rotate(45deg)";

>  what about my question: "What can the first line have on the RHS
>  *excepting* "transform 1s" "? ie. what ELSE can "transition" be equal
>  to?

Lots of things.  There's good documentation available on the web if you
know where to look.  For example
https://developer.mozilla.org/en-US/docs/Web/CSS/transition

Did you try asking in a CSS group?  You posted two assignments, but the
question was not really about scripting at all.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#36605

Fromgroovee@cyberdude.com
Date2019-05-13 07:31 -0700
Message-ID<ef5f0cce-7f0a-4efb-9367-1848456865b1@googlegroups.com>
In reply to#36602
On Monday, 13 May 2019 18:08:44 UTC+5:30, Ben Bacarisse  wrote:

> 
> Lots of things.  There's good documentation available on the web if you
> know where to look.  For example
> https://developer.mozilla.org/en-US/docs/Web/CSS/transition
> 
> Did you try asking in a CSS group?  You posted two assignments, but the
> question was not really about scripting at all.
> 
> -- 
> Ben.

OK, I don't get it. This is an example from that page:
       
         transition: margin-right 2s;

Margin here is a "thing" that's part of the page, it's visible and tangible. How can THAT go on the right hand side, AS WELL AS "transform 1s"? "Margin" is a NOUN, "Transform" is a VERB, isn't it??

I'm quite thoroughly confused :(

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.javascript


csiph-web