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 <div data-aos="fade-up"> <h1>Hello World</h1> </div>
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.
<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"> <h1>Hello World</h1> </div>
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!