All language subtitles for 005 CSS Transition & Animations Limitations_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian Download
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:02,180 --> 00:00:06,700 Now over the last lectures we saw how to use css transitions and animations 2 00:00:06,710 --> 00:00:11,070 and as I mentioned, using them is absolutely fine. 3 00:00:11,090 --> 00:00:17,360 Now what's one limitation of using these animations though? We can see it if we use the developer tools 4 00:00:17,630 --> 00:00:19,610 to inspect our dom, if 5 00:00:19,670 --> 00:00:21,370 we do this here, 6 00:00:21,500 --> 00:00:28,180 we see that our modal div and the backdrop div are always present, 7 00:00:28,190 --> 00:00:35,850 they're just not visible because we're actually animating this here. 8 00:00:35,850 --> 00:00:44,370 Now that of course means that all our code, all our html code is always in the dom and just not displayed 9 00:00:44,400 --> 00:00:46,240 because the opacity is 0, 10 00:00:46,260 --> 00:00:53,490 this might not be what we want, it populates our dom with a lot of elements which slows it down a little 11 00:00:53,490 --> 00:01:01,650 bit and which also might not be the best case or the best way to do for accessibility and it is not 12 00:01:01,650 --> 00:01:03,150 very react-ish 13 00:01:03,330 --> 00:01:12,120 if we in the end are back to having to control the display of things with just css, it's also not super bad, 14 00:01:12,150 --> 00:01:18,320 we do it like this in our burger builder in the end and especially for this modal or some side drawer 15 00:01:18,320 --> 00:01:19,220 menu, 16 00:01:19,380 --> 00:01:27,090 this might be perfectly fine but let's say we really want to ensure that we show and hide this differently 17 00:01:27,780 --> 00:01:37,380 by not passing the show in higher property like that but instead by using our ModalIsOpen state to 18 00:01:37,380 --> 00:01:44,490 really show or hide the backdrop in modal elements. I can of course do this by using a ternary expression 19 00:01:44,520 --> 00:01:47,630 where I check if this.state.ModalIsOpen is true, 20 00:01:47,700 --> 00:01:55,140 if it is, I want to render to modal otherwise I render null and I use the exact same logic for the backdrop 21 00:01:55,230 --> 00:02:00,900 to either show the backdrop or render nothing, this is rendering conditional content as we 22 00:02:00,910 --> 00:02:05,010 learned it throughout the course. If we go back and I click open modal, 23 00:02:05,310 --> 00:02:12,120 we just see it move away here actually, well the reason for this is that inside the modal we're still using 24 00:02:12,120 --> 00:02:19,160 the show prop to have the open or closed classes and since we don't pass the show prop anymore here 25 00:02:19,170 --> 00:02:21,910 on the modal and also not on the backdrop, 26 00:02:22,140 --> 00:02:28,320 well it is always considered to be false and therefore inside the modal, always the modal close classes 27 00:02:28,320 --> 00:02:31,740 attached and I place the out animation. 28 00:02:32,130 --> 00:02:39,780 We could of course fix this by still passing show on both, so we could set show on both to this.state. 29 00:02:39,990 --> 00:02:41,670 ModalIsOpen, if 30 00:02:41,880 --> 00:02:43,180 we do it like this, 31 00:02:43,260 --> 00:02:44,380 we go back 32 00:02:44,610 --> 00:02:52,530 We still have an in animation and we now see of course that the element is added to the dom but if I click dismiss, 33 00:02:52,620 --> 00:02:58,010 we don't get an out animation because the element is instantly removed. 34 00:02:58,080 --> 00:03:06,870 The reason for this is that react in our app.js file doesn't wait for re-rendering this jsx and 35 00:03:06,870 --> 00:03:13,770 therefore removing the modal and the backdrop when the state changes, for our animation to finish because 36 00:03:13,770 --> 00:03:19,830 it's not aware of that animation and it's good that it doesn't scan our elements which are to be removed 37 00:03:20,040 --> 00:03:23,040 for possibly running css animations, 38 00:03:23,040 --> 00:03:25,410 that would be a performance nightmare. 39 00:03:25,830 --> 00:03:34,170 So here, we now see a limitation we have with css animations and transitions, animating in showing it 40 00:03:34,470 --> 00:03:41,430 did actually still work because adding the element to the modal simply now also adds css class and the 41 00:03:41,430 --> 00:03:48,930 animation therefore plays but removing happens instantly and that of course means that we get kind of 42 00:03:48,930 --> 00:03:57,040 a bad behavior or look here. Now for that we need other tools to manage this, 43 00:03:57,060 --> 00:04:02,480 now let's have a look at which tools that would be over the next lectures. 4809

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.