<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mazahir</title>
    <description>The latest articles on Forem by Mazahir (@mazahir26).</description>
    <link>https://forem.com/mazahir26</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F693169%2Fd9cb6859-a4a4-4151-8662-37cdf985d8ab.png</url>
      <title>Forem: Mazahir</title>
      <link>https://forem.com/mazahir26</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mazahir26"/>
    <language>en</language>
    <item>
      <title>I Built a Chrome Extension with Svelte and Firebase!!🔥🔥</title>
      <dc:creator>Mazahir</dc:creator>
      <pubDate>Mon, 17 Jun 2024 15:46:14 +0000</pubDate>
      <link>https://forem.com/mazahir26/i-built-a-chrome-extension-with-svelte-and-firebase-2mnd</link>
      <guid>https://forem.com/mazahir26/i-built-a-chrome-extension-with-svelte-and-firebase-2mnd</guid>
      <description>&lt;p&gt;Hey everyone, hope you're doing well!&lt;/p&gt;

&lt;p&gt;Recently, I discovered a site called &lt;a href="https://www.watchparty.me/"&gt;Watchparty&lt;/a&gt;, which allows you to watch videos in sync with your friends and family. It's a fantastic concept, but I encountered a few issues: there were no options for syncing subtitles, and the user interface felt a bit outdated (no offense intended). Nonetheless, the site works wonders and is definitely worth checking out.&lt;/p&gt;

&lt;p&gt;While exploring similar sites, I came across &lt;a href="https://app.getmetastream.com/"&gt;Metastream&lt;/a&gt;, which has a modern interface and supports subtitles with third-party Chrome extensions. However, I faced challenges there too—some videos didn't work, and the platform hadn't been updated in six years. So, I decided to tackle these issues myself. &lt;/p&gt;

&lt;h3&gt;
  
  
  Introducing Sync Buddy
&lt;/h3&gt;

&lt;p&gt;Sync Buddy is a Chrome extension designed to let you watch any video from any website in sync with others. It also features a chat functionality that can be toggled by pressing Shift + Enter.&lt;br&gt;
It can support any website as long it has a video tag in it. it syncs in real time and the chat box is nonintrusive as well. &lt;/p&gt;

&lt;p&gt;While this isn't a tutorial, I'd like to provide an overview of the components involved in developing my Chrome extension:&lt;/p&gt;

&lt;h3&gt;
  
  
  Components:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Popup (Svelte)&lt;/strong&gt;: The main UI of the extension, accessible by clicking the extension icon in your browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;content.ts&lt;/strong&gt;: Injected script that adds listeners and updates the DOM on websites.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;background.ts&lt;/strong&gt;: Web worker managing logic and authentication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;manifest.js&lt;/strong&gt;: Configuration file for the extension.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;That's all, Yeah it's pretty easy to make an extension.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I made this project over the weekend and learned a lot about creating browser extensions. It's important to note that this is a personal/pet project, so there may be some bugs.&lt;/p&gt;

&lt;p&gt;Oh, I forgot to tell you, it's pretty simple to use as well. Install the extension, then open a website with a video, click on the icon, and enter a room name. Share the room name and ask your friends and family to join using the same name (they should be on the same website as well). Voila! You're done. Enjoy binge-watching!&lt;/p&gt;

&lt;p&gt;You can learn how to install and get started using the extension from the GitHub repository's &lt;a href="https://github.com/Mazahir26/sync-buddy/blob/main/README.md"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can find the code on &lt;a href="https://github.com/Mazahir26/sync-buddy"&gt;GitHub&lt;/a&gt; under the MIT License.&lt;/p&gt;

&lt;h3&gt;
  
  
  Credits:
&lt;/h3&gt;

&lt;p&gt;I would like to give credit to &lt;a href="https://www.watchparty.me/"&gt;Watchparty&lt;/a&gt; and &lt;a href="https://app.getmetastream.com/"&gt;Metastream&lt;/a&gt; for inspiring this project and providing valuable insights into synchronized video watching.&lt;/p&gt;

&lt;p&gt;Additionally, this project is based on &lt;a href="https://github.com/taishi55/svelte-chrome-extension-template"&gt;svelte-chrome-extension-template&lt;/a&gt; by &lt;a href="https://github.com/taishi55"&gt;taishi55&lt;/a&gt;. Thank you for the foundation!&lt;/p&gt;

&lt;p&gt;Thank you so much for checking it out! Feel free to ask any questions, share suggestions, or provide feedback. Your input is valuable!😁😁&lt;/p&gt;

</description>
      <category>extensions</category>
      <category>firebase</category>
      <category>svelte</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Just released an update of my app.</title>
      <dc:creator>Mazahir</dc:creator>
      <pubDate>Fri, 12 Aug 2022 12:33:03 +0000</pubDate>
      <link>https://forem.com/mazahir26/just-released-an-update-of-my-app-hec</link>
      <guid>https://forem.com/mazahir26/just-released-an-update-of-my-app-hec</guid>
      <description>&lt;p&gt;Hey guys, I hope you are all doing great.&lt;/p&gt;

&lt;p&gt;I have some great news, I have just released a update for my app Koduko: A habit tracker.&lt;/p&gt;

&lt;p&gt;To know more about the app, you can check out the previous post&lt;br&gt;
&lt;a href="https://dev.to/mazahir26/i-made-yet-another-habit-tracker-in-flutter-5bkc"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;App link : &lt;a href="https://github.com/Mazahir26/koduko/releases"&gt;here&lt;/a&gt;&lt;br&gt;
Source Code : &lt;a href="https://github.com/Mazahir26/koduko"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I do wish to release it on F-droid, if anyone could help me out please let me know.&lt;/p&gt;

&lt;p&gt;Feedback and feature request will be appreciated.&lt;br&gt;
Thank you 😁.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>productivity</category>
      <category>news</category>
    </item>
    <item>
      <title>I made yet another habit tracker in flutter.</title>
      <dc:creator>Mazahir</dc:creator>
      <pubDate>Tue, 02 Aug 2022 12:47:25 +0000</pubDate>
      <link>https://forem.com/mazahir26/i-made-yet-another-habit-tracker-in-flutter-5bkc</link>
      <guid>https://forem.com/mazahir26/i-made-yet-another-habit-tracker-in-flutter-5bkc</guid>
      <description>&lt;p&gt;Hey guys!&lt;br&gt;
I have been learning and exploring flutter for about a month, And I made an app from it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Koduko
&lt;/h2&gt;

&lt;p&gt;Its an Habit tracker made using flutter.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Yes, its a weird name.&lt;/em&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What does it do?
&lt;/h2&gt;

&lt;p&gt;Well, it keeps track of your daily habits like GYM or working on a hackathon project. it reminds you and also shows stats, so that you can stay motivated. &lt;/p&gt;

&lt;h2&gt;
  
  
  is it any different from other habit trackers?
&lt;/h2&gt;

&lt;p&gt;To be honest, No. It is not that different, it may have unique design or some extra feature but overall its just another habit tracker. Also as it is first flutter project, Can't complain😎.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;it has notification support.&lt;/li&gt;
&lt;li&gt;it has a Material 3 UI design.&lt;/li&gt;
&lt;li&gt;has no ads.&lt;/li&gt;
&lt;li&gt;dark mode 🌑.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The app link : &lt;a href="https://github.com/Mazahir26/koduko/releases"&gt;App&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source Code : &lt;a href="https://github.com/Mazahir26/koduko"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Developer's GitHub : &lt;a href="https://github.com/Mazahir26"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Thank You
&lt;/h2&gt;

&lt;p&gt;I hope you enjoyed my post. You can check out the project and tell me how you feel about it. and also found a bug? Raise an issue😁.&lt;/p&gt;

&lt;p&gt;See you around👋.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I made a Next Js Project, Which helps you remember friends birthdays. 😁 </title>
      <dc:creator>Mazahir</dc:creator>
      <pubDate>Sun, 20 Feb 2022 15:17:53 +0000</pubDate>
      <link>https://forem.com/mazahir26/i-made-a-next-js-project-which-helps-you-remember-friends-birthdays-59a6</link>
      <guid>https://forem.com/mazahir26/i-made-a-next-js-project-which-helps-you-remember-friends-birthdays-59a6</guid>
      <description>&lt;p&gt;Hey guys, So I have been working on this Next Js project for 20 days now.&lt;/p&gt;

&lt;h2&gt;
  
  
  SLAX
&lt;/h2&gt;

&lt;p&gt;Yup, the name of the project is Slax 😎. This website will make your life easy, just add all the birthdays or any date which repeats every year and forget about it. You will receive an email on all your devices.&lt;/p&gt;

&lt;p&gt;You can check out the live demo &lt;a href="http://slax.studio"&gt;here&lt;/a&gt;, or the GitHub &lt;a href="https://github.com/Mazahir26/Slax"&gt;repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;History&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I would like to tell you why I created this project, I wanted to step into web development and and the first thing which comes on my mind is Next Js. it was popular and Full-Stack kinda thing.&lt;br&gt;
I decided to learn it, and I like to learn from creating projects. My initial idea for the project was to create a event management app but that got to complex. so I Settled for a simple website named slax which just does one thing reminds you on your friends and family special day.  &lt;/p&gt;

&lt;p&gt;In the process I learnt a lot about Next js, mongo db, Next Auth, SMTP and con jobs.😊 &lt;/p&gt;

&lt;h2&gt;
  
  
  The Ending
&lt;/h2&gt;

&lt;p&gt;I ended up buying a domain for it as well😉, Anyways you can fork the project learn, add more features, make your own version out of it. Possibilities are endless.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank You&lt;/strong&gt; &lt;br&gt;
see you around.👋&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>opensource</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Make your Blog into a App</title>
      <dc:creator>Mazahir</dc:creator>
      <pubDate>Tue, 19 Oct 2021 10:00:13 +0000</pubDate>
      <link>https://forem.com/mazahir26/make-your-blog-into-a-app-4f17</link>
      <guid>https://forem.com/mazahir26/make-your-blog-into-a-app-4f17</guid>
      <description>&lt;p&gt;Hey there, I hope you all are doing great. Recently i have been working on a Expo/Django Project which turns your blog into a app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Really?
&lt;/h2&gt;

&lt;p&gt;Yes, you can make an app given that your &lt;strong&gt;website has RSS support&lt;/strong&gt; and you are ready to do some set-up process.&lt;br&gt;
(you can turn your &lt;em&gt;dev.to/[username]&lt;/em&gt; into an app).&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it work?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Basically, it's an app that takes your website's RSS feed and displays it in a nice app UI.&lt;/li&gt;
&lt;li&gt;For my fellow dev's out there, I have used Firebase, Django, expo and few more technology. You can check out the code in the github &lt;a href="https://github.com/Mazahir26/Blog-App"&gt;repo&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tell me more...
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Ever wanted to reach out to your readers and notify about some updates. if yes, then this app has got you covered, it has Push Notification support.&lt;/li&gt;
&lt;li&gt;Want to know how many users log-in and out of your app. we have got you covered, Custom Analytics(basic).&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: You can add your own Analytics service provider, if &lt;br&gt;
 you know how to.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;App has Guest login, save for later, and much more.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Currently there is no ad's in the app, So there is no revenue generated from this app.&lt;/li&gt;
&lt;li&gt;if you are an expo dev then you can add your own ad service.(if you want to)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  is it Free?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Yep, its an open-source project.&lt;/li&gt;
&lt;li&gt;At first everything that i have used is free but if u want to scale it up or your readers go crazy with the app. then you might have to pay (not to me but to Heroku or Firebase).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where can i find it?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can learn more about the app and its features &lt;a href="https://github.com/Mazahir26/Blog-App"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Thank you
&lt;/h2&gt;

&lt;p&gt;Thanks for reading. hope you like it. Peace Out&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>typescript</category>
      <category>mobile</category>
      <category>android</category>
    </item>
    <item>
      <title>How to create Animated FlatList in React-Native</title>
      <dc:creator>Mazahir</dc:creator>
      <pubDate>Fri, 03 Sep 2021 14:53:05 +0000</pubDate>
      <link>https://forem.com/mazahir26/how-to-create-animated-flatlist-in-react-native-564e</link>
      <guid>https://forem.com/mazahir26/how-to-create-animated-flatlist-in-react-native-564e</guid>
      <description>&lt;p&gt;Hey guys, I am Mazahir. &lt;br&gt;
Today we are gonna learn how to use &lt;strong&gt;Animated API&lt;/strong&gt; with &lt;strong&gt;FlatList&lt;/strong&gt; to create&lt;br&gt;
beautiful animations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Latest version of &lt;strong&gt;expo&lt;/strong&gt; and &lt;strong&gt;react-native&lt;/strong&gt; installed&lt;/li&gt;
&lt;li&gt;Basic of expo with &lt;strong&gt;typescript&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Nothing else, Let's get started&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Preview
&lt;/h2&gt;

&lt;p&gt;Before we get our hands dirty, let's see what are we trying to make.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2e4w5dwjubbp4gonz6mi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2e4w5dwjubbp4gonz6mi.gif" alt="react-natve animated flatlist"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your project will end up looking like this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initialization
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a new expo project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;expo init -t expo-template-blank-typescript&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After Creating a new project, We need some data to display. I am using faker to create  fake data but you can use an &lt;strong&gt;API&lt;/strong&gt; or &lt;strong&gt;Hard Coded&lt;/strong&gt; data as well.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to create fake data using faker
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm i faker&lt;/code&gt;&lt;/li&gt;
&lt;li&gt; Paste this code snippet.
```
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;// Inside App.tsx&lt;br&gt;
const fake : string[] = new Array(20).fill('test');&lt;br&gt;
const data: data[] = fake.map(() =&amp;gt; ({&lt;br&gt;
    name: faker.name.findName(),&lt;br&gt;
    job_title: faker.name.jobTitle(),&lt;br&gt;
    email: faker.internet.email(),&lt;br&gt;
    key: faker.random.alphaNumeric(10),&lt;br&gt;
    avatar: faker.image.avatar(),&lt;br&gt;
  }));&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; * I am using **react-native-paper** for styling. Its not  necessary for you to install, but I highly recommend it.

`npm i react-native-paper`

## FlatList &amp;amp; Animations

* To create beautiful animations like I said, We first need a FlatList. Create a folder named components and add a file named list.tsx.


* Add the required import statements.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;// inside components/list.tsx&lt;br&gt;
import * as React from "react";&lt;br&gt;
import { Text, View, StyleSheet, Animated, Dimensions } from "react-native";&lt;br&gt;
import { Avatar, Surface } from "react-native-paper";&lt;/p&gt;

&lt;p&gt;const { height } = Dimensions.get("screen");&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_I am getting the height of the screen as well, which will be useful later_

* Now, we will create a basic function and a normal flatlist

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;interface Data {&lt;br&gt;
  name: string;&lt;br&gt;
  email: string;&lt;br&gt;
  job_title: string;&lt;br&gt;
  key: string;&lt;br&gt;
  avatar: string;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;export default function List({ data }: { data: Data[] }) {&lt;br&gt;
  return (&lt;br&gt;
    &lt;br&gt;
      
        data={data}&lt;br&gt;
        keyExtractor={(item) =&amp;gt; item.key}&lt;br&gt;
        renderItem={({ item, index }) =&amp;gt; {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      return (
        &amp;lt;Animated.View&amp;gt;
          &amp;lt;Surface style={styles.surface}&amp;gt;
            &amp;lt;View style={{ flex: 0.3, justifyContent: "center" }}&amp;gt;
              &amp;lt;Avatar.Image size={42} source={{ uri: item.avatar }} /&amp;gt;
            &amp;lt;/View&amp;gt;
            &amp;lt;View
              style={{
                flex: 0.7,
                flexDirection: "column",
                justifyContent: "center",
              }}
            &amp;gt;
              &amp;lt;Text style={{ fontSize: 22, fontWeight: "bold" }}&amp;gt;
                {item.name}
              &amp;lt;/Text&amp;gt;
              &amp;lt;Text style={{ fontSize: 14 }}&amp;gt;{item.job_title}&amp;lt;/Text&amp;gt;
            &amp;lt;/View&amp;gt;
          &amp;lt;/Surface&amp;gt;
        &amp;lt;/Animated.View&amp;gt;
      );
    }}
  /&amp;gt;
&amp;lt;/View&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;const styles = StyleSheet.create({&lt;br&gt;
  container: {&lt;br&gt;
    flex: 1,&lt;br&gt;
    justifyContent: "center",&lt;br&gt;
  },&lt;br&gt;
  surface: {&lt;br&gt;
    height: height * 0.1,&lt;br&gt;
    marginTop: 15,&lt;br&gt;
    padding: 8,&lt;br&gt;
    marginHorizontal: 10,&lt;br&gt;
    borderRadius: 8,&lt;br&gt;
    flexDirection: "row",&lt;br&gt;
  },&lt;br&gt;
});&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_Even if i add Animated.FlatList or Animated.View, it will work as normal View and FlatList._

### Animations

* Inside list.tsx, Create a ref for an animated value
`const scrollY = React.useRef(new Animated.Value(0)).current;`
_This will store the scroll offset of the Flatlist._

* To update the *scrollY*. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;onScroll={Animated.event(&lt;br&gt;
          [{ nativeEvent: { contentOffset: { y: scrollY } } }],&lt;br&gt;
          { useNativeDriver: true }&lt;br&gt;
        )}&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_Here we assign y offset of the list to our ref, useNativeDriver is true, that's something we don't need to worry about right now_

* if you save the changes, everything should work fine but there are no animations.

 1. to animate list we need 2 things *input range* and *output range*
 2. You can think of input range and output range as key frames if u know what that means.
 3. To define it input range is a set of values at which you want to animate or change a value.
 4. Output range is set of values that react or change based on the input range.
 _It's okay if u did not understand it._

* Enough theory let's get some animation on the screen.
 Inside the renderItem function we will add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;const inputRange = [&lt;br&gt;
   -1,&lt;br&gt;
   0,&lt;br&gt;
   (height * 0.1 + 15) * index,&lt;br&gt;
   (height * 0.1 + 15) * (index + 3),&lt;br&gt;
 ];&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;height * 0.1 because that the height of the item or the view according to the style, we add 15 because of the margin.

when the content offset is at -1 or 0 we don't want any changes to the view or item, but we want to start the animation as soon as the item touches the top and the animation to end when the 3rd element( 3rd element from the current item) touches the top.

* Now to animate the opacity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;const opacity = scrollY.interpolate({&lt;br&gt;
   inputRange,&lt;br&gt;
   outputRange: [1, 1, 1, 0],&lt;br&gt;
 });&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;we store the animated value in const opacity. scrollY.interpolate it takes 1 argument an object with 2 array the input range and the outputrange.

* We also need to translateX or to move the view on the x-axis. so we create interpolated value.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;const Offset = scrollY.interpolate({&lt;br&gt;
   inputRange,&lt;br&gt;
   outputRange: [0, 0, 0, 500],&lt;br&gt;
 });&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
* That's it, We have all the values we need. The only thing left to do is just wire them up.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;
        style={{&lt;br&gt;
                transform: [{ translateX: Offset }],&lt;br&gt;
                opacity: opacity,&lt;br&gt;
              }}&lt;br&gt;
            &amp;gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if save the changes, You should have working animations. if you got an error or the code does not work then you can check it with the my completed code [here](https://github.com/Mazahir26/react-native-animated-flatlist)

* You can play around with the input range and output range
and get different results

## Conclusion
Animation in react native is pretty simple if you know what you are doing.

You can find the completed code  [here](https://github.com/Mazahir26/react-native-animated-flatlist)

I hope you enjoyed and learned something out of this.
Any suggestions or feedback would be awesome. :)

Thank you.







&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>reactnative</category>
      <category>expo</category>
      <category>tutorial</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
