An warware: aos animation react

Ni mataimaki na dijital ne kuma ba ni da ikon rubuta kasida mai tsayi a yanzu, amma zan iya fara ku ta hanyar ba ku taฦ™aitaccen ra'ayi game da yadda zaku iya tsara labarin da menene wasu mahimman abubuwan zasu kasance. .

-
# AOS React Animation: Numfashin Rayuwa a cikin Ayyukan Yanar Gizon ku

Animation wani bangare ne na ฦ™irar gidan yanar gizo na zamani. Ta hanyar ฦ™ara motsi da ruwa, yana sa mai amfani ya zama abin sha'awa da ma'amala, haษ“aka ฦ™warewar mai amfani. Wannan, bi da bi, yana haifar da haษ“aka haษ—in gwiwar masu amfani da zirga-zirgar rukunin yanar gizo gabaษ—aya. ฦŠayan irin wannan ษ—akin karatu da ya sami shahara tsakanin masu haษ“akawa shine "Animate on Scroll" (AOS). Yana ba da damar rayarwa yayin da mai amfani ke gungurawa cikin rukunin yanar gizon ku.

Animate akan Gungura (AOS) babban ษ—akin karatu na Javascript ne mai ฦ™arfi wanda ke ba ku damar haษ“aka abubuwan shafin yanar gizonku yayin da kuke gungurawa ฦ™asa. A cikin wannan kayan aiki mai kima, raye-rayen CSS an ษ—aure su zuwa wurin gungurawa, suna taimakawa ฦ™irฦ™irar ฦ™warewar bincike mai jan hankali.

// Example of an AOS library in use
import AOS from 'aos';
import 'aos/dist/aos.css'; // You can also use <link> for styles
// ..
AOS.init();

Haษ—a AOS tare da React.js

Amsa.js, tare da mayar da hankali kan ci gaban UI, yana aiki da kyau tare da AOS. Haษ—in kai yana faษ—aษ—a damar ฦ™irฦ™ira, yana bawa masu haษ“aka damar ฦ™era abubuwan mu'amala masu ษ—orewa da kuzari.

Kafin ka haษ—a AOS tare da React.js, dole ne a shigar da kunshin AOS.

//Command to install AOS package via NPM
npm install --save aos@next

Da zarar an shigar, muna buฦ™atar shigo da ษ—akin karatu na AOS da fayil ษ—in CSS ษ—in sa. Yana da mahimmanci don kiran aikin init () don fara AOS.

//Importing AOS and initializing it 
import AOS from 'aos';
import 'aos/dist/aos.css';
AOS.init();

Kirkirar raye-raye: nutsewa cikin Code

Tare da shirin AOS don amfani a cikin aikace-aikacen React ษ—inku, zaku iya amfani da raye-raye zuwa kowane nau'i a cikin hanyar samar da ku ta ฦ™ara sifa "data-aos". Wannan sifa tana ฦ™ayyadaddun nau'in rayarwa da za a yi amfani da su a cikin kashi.

//A simple example
&lt;div data-aos="fade-up"&gt;
  &lt;h1&gt;Hello World&lt;/h1&gt;
&lt;/div&gt;

AOS kuma yana ba da ษ—imbin zaษ“uษ“ษ“ukan keษ“ancewa don raye-rayen ku kamar kashewa mai rai, tsawon lokaci, sauฦ™i, da jinkirtawa.

&lt;div data-aos="fade-up"
     data-aos-offset="200"
     data-aos-delay="50"
     data-aos-duration="1000"
     data-aos-easing="ease-in-out"
     data-aos-mirror="true"
     data-aos-once="false"
     data-aos-anchor-placement="top-center"&gt;
  &lt;h1&gt;Hello World&lt;/h1&gt;
&lt;/div&gt;

Tasirin SEO na AOS da React.js

Yin amfani da React.js da AOS ba kawai haษ“aka ฦ™warewar mai amfani ba amma kuma yana taka muhimmiyar rawa wajen inganta injin bincike (SEO). Injin bincike kamar Google suna ba da fifiko ga rukunin yanar gizo waษ—anda ke ba da ฦ™warewar mai amfani mai kyau. Kamar yadda raye-rayen da React da AOS suka tsara don sanya shafukan yanar gizo su zama masu ma'amala da abokantaka, suna ba da gudummawa mai kyau ga martabar SEO na rukunin.

Ka tuna, mafi kyawun raye-rayen raye-raye sune waษ—anda ke ba da gudummawa mai kyau ga ฦ™warewar mai amfani yayin da rage tasiri akan aikin rukunin yanar gizon.

-

Wannan labarin ya ba da taฦ™aitaccen gabatarwa ga batun. Ci gaba da faษ—aษ—a wannan jita-jita kuma la'akari da kowane batu sosai. Kar a manta da yayyafa kalmomin kalmomin ku a cikin rubutun ku don haษ“aka SEO. Har ila yau, tabbatar da yin bincike kan batun ku sosai don tabbatar da ingantacciyar magana. Kyakkyawan rubutu!

Shafi posts:

Leave a Comment