<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DevGrow &#8211; Helping developers grow with turorials</title>
	<atom:link href="https://devgrow.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://devgrow.com</link>
	<description></description>
	<lastBuildDate>Fri, 20 Jan 2023 12:48:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.3</generator>
	<item>
		<title>How to use AI Tool ChatGPT to create HTML and CSS and website code</title>
		<link>https://devgrow.com/how-use-ai-tool-chatgpt-create-html-css-website-code/</link>
					<comments>https://devgrow.com/how-use-ai-tool-chatgpt-create-html-css-website-code/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Fri, 20 Jan 2023 12:48:25 +0000</pubDate>
				<category><![CDATA[All Posts]]></category>
		<guid isPermaLink="false">https://devgrow.com/?p=4413</guid>

					<description><![CDATA[ChatGPT is an AI tool based on large language model built by OpenAI. It can be used in multiple ways to improvise the productivity of users such as writing stories, writing emails, writing blog posts, creating websites etc. ChatGPT if properly used can tremendously improvise the productivity of any software developer. In this article, we will look at how to use ChatGPT to create a website using the HTML and CSS code generated from chat GPT. You can also join a lot of AI and ML developer communities such as Goom or Hugging face to learn more from peers on…]]></description>
										<content:encoded><![CDATA[<p>ChatGPT is an AI tool based on large language model built by OpenAI. It can be used in multiple ways to improvise the productivity of users such as writing stories, writing emails, writing blog posts, creating websites etc.</p>
<p>ChatGPT if properly used can tremendously improvise the productivity of any software developer. In this article, we will look at how to use ChatGPT to create a website using the HTML and CSS code generated from chat GPT.</p>
<p>You can also join a lot of AI and ML developer communities such as <a title="Goom ML and AI platform" href="https://goom.ai/" target="_blank" rel="noopener">Goom</a> or <a href="https://huggingface.co/" target="_blank" rel="nofollow noopener">Hugging face</a> to learn more from peers on how to AI tools such as ChatGPT or GPT 3 to improve productivity.</p>
<h2><strong>How to use ChatGPT to create HTML and CSS and website code</strong></h2>
<p>ChatGPT can pretty much create the HTML and CSS of the website provided proper prompts are given by the developer.</p>
<h3><strong>Prompts</strong></h3>
<p>It is very important to give a proper prompt to get the required outputs. Let&#8217;s look at some of the prompts</p>
<p>Prompt if you want to need HTML and CSS for the Landing page for lead conversion.</p>
<p><strong>Prompt 1: “Give Landing page HTML and CSS with the bootstrap framework that takes the email address and phone number in the lead generation form”</strong></p>
<p><img decoding="async" fetchpriority="high" class="alignnone size-medium wp-image-4416" src="https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.03-AM-300x169.png" alt="" width="300" height="169" srcset="https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.03-AM-300x169.png 300w, https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.03-AM-1024x576.png 1024w, https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.03-AM-768x432.png 768w, https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.03-AM-1536x863.png 1536w, https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.03-AM-2048x1151.png 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><img decoding="async" class="alignnone size-medium wp-image-4417" src="https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.21-AM-300x170.png" alt="" width="300" height="170" srcset="https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.21-AM-300x170.png 300w, https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.21-AM-1024x580.png 1024w, https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.21-AM-768x435.png 768w, https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.21-AM-1536x870.png 1536w, https://devgrow.com/wp-content/uploads/2023/01/Screenshot-2023-01-20-at-11.55.21-AM-2048x1160.png 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>Below is the response from the ChatGPT AI bot for the above prompt which I believe is pretty good.</p>
<p>Prompt if you need HTML and CSS for Home Page carousal</p>
<p><strong>Prompt 2: “Give an HTML and CSS code with a tailwind for Carousel that takes 50% of the page vertical space ”</strong></p>
<p><img decoding="async" class="size-medium wp-image-4422 alignnone" src="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2b-300x168.png" alt="" width="300" height="168" srcset="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2b-300x168.png 300w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2b-1024x575.png 1024w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2b-768x431.png 768w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2b-1536x862.png 1536w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2b-2048x1149.png 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><img decoding="async" loading="lazy" class="alignnone size-medium wp-image-4421" src="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2c-300x182.png" alt="" width="300" height="182" srcset="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2c-300x182.png 300w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2c-1024x620.png 1024w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2c-768x465.png 768w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2c-1536x931.png 1536w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2c-2048x1241.png 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><img decoding="async" loading="lazy" class="alignnone size-medium wp-image-4423" src="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2a-300x184.png" alt="" width="300" height="184" srcset="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2a-300x184.png 300w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2a-1024x629.png 1024w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2a-768x472.png 768w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2a-1536x944.png 1536w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-2a-2048x1259.png 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>Response from ChatGPT AI bot for the above prompt which I believe is pretty decent as below.</p>
<p>Prompt if you need HTML and CSS to import Data from excel and show it in the tabular format</p>
<p><strong>Prompt 3: “Give an HTML and CSS code that display the table with the column&#8217;s name, date, and number”</strong></p>
<p><img decoding="async" loading="lazy" class="alignnone size-medium wp-image-4420" src="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3a-300x182.png" alt="" width="300" height="182" srcset="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3a-300x182.png 300w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3a-1024x622.png 1024w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3a-768x466.png 768w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3a-1536x933.png 1536w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3a-2048x1243.png 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><img decoding="async" loading="lazy" class="alignnone size-medium wp-image-4419" src="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3b-300x139.png" alt="" width="300" height="139" srcset="https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3b-300x139.png 300w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3b-1024x476.png 1024w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3b-768x357.png 768w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3b-1536x713.png 1536w, https://devgrow.com/wp-content/uploads/2023/01/chatgpt-html-3b-2048x951.png 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>Now, you can copy the HTML and CSS and tweak it for your use case or you can also ask follow-up questions by tweaking the prompt for your particular use case</p>
<p>ChatGPT is an amazing tool and as a developer, if used properly, it will improve your productivity by 10x. Go a head and play around and its completely free.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://devgrow.com/how-use-ai-tool-chatgpt-create-html-css-website-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>8 Best Social Share WordPress Plugins</title>
		<link>https://devgrow.com/sharebar-wordpress-plugin/</link>
					<comments>https://devgrow.com/sharebar-wordpress-plugin/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 05 Jan 2023 08:47:47 +0000</pubDate>
				<category><![CDATA[All Posts]]></category>
		<guid isPermaLink="false">https://devgrow.com/?p=730</guid>

					<description><![CDATA[Social Media Sharing is one of the most important things for any website, especially blogs which is what wordpress mainly focuses on. The more the visitors are encouraged to share, more and more people get to know about it, which in turn results in higher web traffic. If you think about it, it’s literally free advertising! Since WordPress is a software that has thousands of plugins and customization options &#8211; it also has quite a lot of them that are dedicated to Social Media Sharing.   If you want to check if the Social Media or Blog content is generated using AI or ChatGPT? Click Here In…]]></description>
										<content:encoded><![CDATA[
<p>Social Media Sharing is one of the most important things for any website, especially <strong>blogs</strong> which is what wordpress mainly focuses on. The more the visitors are encouraged to share, more and more people get to know about it, which in turn results in higher web traffic. If you think about it, it’s literally <strong>free advertising!</strong></p>



<p>Since <strong>WordPress </strong>is a software that has thousands of plugins and customization options &#8211; it also has quite a lot of them that are dedicated to <strong>Social Media Sharing. </strong></p>
<p><a title="Chat GPT and Plagiarism Checker" href="http://contentdetector.ai/" target="_blank" rel="noopener"> If you want to check if the Social Media or Blog content is generated using AI or ChatGPT? Click Here</a></p>



<p>In this article, we’ll be having a look at the <strong>Top 8 WordPress Plugins </strong>for <strong>Social Media Sharing</strong></p>
<h2>Best Social Share WordPress Plugins</h2>



<h3 class="wp-block-heading" id="h.6aolu172mmjx"><strong>Grow Social </strong>( Formerly known as <strong>Social Pug </strong>)</h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="410" class="wp-image-4407 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image5-3-1024x410.png" alt="grow social wordpress plugin" srcset="https://devgrow.com/wp-content/uploads/2022/10/image5-3-1024x410.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image5-3-300x120.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image5-3-768x308.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image5-3.png 1058w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>This plugin is probably one of the <strong>easiest to use </strong>&amp; setup on this list. It supports almost all of the <strong>major social networking sites </strong>and also has a <strong>sharing counter</strong>.</p>



<p>Here’s a list of the main features of this plugin</p>



<ol>
<li><strong>Floating Sidebar </strong>and <strong>Custom Placement of Icons</strong></li>
</ol>



<p>Using this plugin, you can place your Social Media buttons <strong>almost anywhere imaginable</strong>. This is especially useful if your website has a <strong>custom design</strong> that requires the social media buttons to be placed somewhere with <strong>easy reach</strong>.</p>



<ol start="2">
<li><strong>10+ Social Media Sites using the Premium Version</strong></li>
</ol>



<p>The premium version of this plugin has support for all of these social media networks: <em>Reddit, VK, Yummly, WhatsApp, Buffer, Telegram, Flipboard, Pocket, Tumblr and Email</em></p>



<h3 class="wp-block-heading" id="h.ejehtdpylws4"><strong>Spotlight for Instagram</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="397" class="wp-image-4406 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image8-4-1024x397.png" alt="spotlight for instagram homepage" srcset="https://devgrow.com/wp-content/uploads/2022/10/image8-4-1024x397.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image8-4-300x116.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image8-4-768x298.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image8-4.png 1386w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Almost any successful business / blog has a great social media presence. <strong>Spotlight </strong>is one such plugin that focuses mainly on bringing live <strong>Instagram Feed </strong>to your website.</p>



<p>This allows your customers to get to know your instagram better and connect with the social media content that you post. This in turn can even <strong>convert website visitors into instagram followers.</strong></p>



<p>Here are the main features of this plugin</p>



<ol>
<li><strong>Sharing Instagram Content to Non-Instagram Users</strong></li>
</ol>



<p><strong>        </strong>It is not a secret that instagram doesn’t allow users to view posts without having created an instagram account. Even if it does, it’s mostly just a few recent posts with constant &amp; irritating pop ups to create an account.</p>



<ol start="2">
<li><strong>Customize the Design of your Instagram Feed</strong></li>
</ol>



<p>Unlike a traditional <strong>Instagram Embed </strong>that has a similar design to their website, this plugin allows you to <strong>customize the feed </strong>so that it matches the design language of your website.</p>



<h3 class="wp-block-heading" id="h.496p8tb4nb4s"><strong>Better Click to Tweet</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="478" class="wp-image-4405 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image9-2-1024x478.png" alt="better click to tweet wordpress plugin" srcset="https://devgrow.com/wp-content/uploads/2022/10/image9-2-1024x478.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image9-2-300x140.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image9-2-768x358.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image9-2.png 1128w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>One thing that most people love to tweet about is the <strong>Quotes </strong>that they read on blogs/articles and this plugin encourages exactly that.</p>



<p><strong>Better Click To Tweet </strong>allows users to simply <strong>click </strong>on any <strong>quotes </strong>or important points throughout the article, and then instantly tweet them.</p>



<p>Here are the pros of this plugin</p>



<ol>
<li><strong>Most Popular Twitter Plugin out there</strong></li>
</ol>



<p><strong>        </strong>This is definitely the most <strong>popular </strong>and <strong>actively maintained </strong>twitter plugin. This means, more and more people are aware of it and there are very less chances of bugs/issues while using this plugin</p>



<ol start="2">
<li><strong>Works with Link Shorteners</strong></li>
</ol>



<p><strong>        </strong>Link Shorteners are very useful if you want to track <strong>where the traffic is coming from </strong>or just simply use <strong>shorter URLs</strong>.</p>



<p>This plugin can be configured to redirect users to this website using a short url, and to insert that short url in the tweet.</p>



<h3 class="wp-block-heading" id="h.7c6ntjwb01us"><strong>Shareaholic</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="538" class="wp-image-4404 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image7-1-1024x538.png" alt="shareaholic wordpress plugin" srcset="https://devgrow.com/wp-content/uploads/2022/10/image7-1-1024x538.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image7-1-300x158.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image7-1-768x404.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image7-1.png 1039w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Unlike the other plugins on this list <strong>Shareaholic </strong>is more of an <strong>all-in-one solution</strong> that supports <strong>Ad Monetization, Content Analytics </strong>and also <strong>Social Share Buttons</strong>.</p>



<p>Here are the main features of this plugin</p>



<ol>
<li><strong>Lightweight &amp; Heavily Optimized Plugin</strong></li>
</ol>



<p><strong>        </strong>While most of the social media share plugins add considerable loading time to the website, <strong>Shareaholic </strong>claims to be using <strong>Advanced Code Optimization Techniques </strong>such as <strong>Selective </strong>and <strong>Lazy Loading</strong>. This also makes sure that the website loads quickly and does not have significant delay / loading time.</p>



<ol start="2">
<li><strong>Supports Hundreds of Social Networks</strong></li>
</ol>



<p>As of now, <strong>Shareaholic </strong>supports the following social networking sites</p>



<p>WhatsApp, Facebook share sharing, Twitter sharing, Pinterest sharing, Instagram sharing, Reddit sharing, LinkedIn sharing, Gmail sharing, Delicious sharing, OneNote sharing, Evernote sharing, Stumbleupon sharing, Digg sharing, Tumblr sharing, Hootsuite sharing, Buffer sharing, Fancy sharing, Wanelo sharing, Yummly sharing, WeHeartIt sharing, Flipboard sharing, Printfriendly sharing, Amazon Wishlist sharing, Instapaper sharing, Pocket sharing, Odnoklassniki sharing, Houzz sharing, Hacker News sharing, Inbound.org sharing, Vk sharing.</p>



<p>This is definitely more than what any other social share plugin has to offer. It’s very rare that someone might need to share to any social network not mentioned here.</p>



<h3 class="wp-block-heading" id="h.sp8hw9s75gt5"><strong>Sharebar Plugin ( Obsolete )</strong></h3>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="1008" height="619" class="wp-image-4403 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image2-4.png" alt="sharebar - currently obsolete plugin" srcset="https://devgrow.com/wp-content/uploads/2022/10/image2-4.png 1008w, https://devgrow.com/wp-content/uploads/2022/10/image2-4-300x184.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image2-4-768x472.png 768w" sizes="(max-width: 1008px) 100vw, 1008px" /></figure>



<p><strong>NOTE: </strong>The above plugin is currently <strong>CLOSED </strong>due to <strong>security issues</strong></p>



<p>This is another plugin that has an easy-to-use interface and is also simple to set up. It also supports <strong>Share Counts</strong>, <strong>Responsive User Interfaces </strong>and a lot more stuff!</p>



<p>Here is a list of the main features that this plugin supports</p>



<ol>
<li><strong>Automatic Share Bars</strong></li>
</ol>



<p><strong>        </strong>Unless you have a really good memory, it can be hard for most people to remember to add <strong>Social Media Share Bars </strong>to every single post. That’s why this plugin supports <strong>Auto Mode</strong>.</p>



<p>If enabled, <strong>Auto Mode </strong>will automatically insert sharebars into every single post created after that.</p>



<ol start="2">
<li><strong>Customizable Behavior</strong></li>
</ol>



<p><strong>        </strong>By default, this plugin supports <strong>Horizontal / Vertical </strong>Sharebars depending on the screen size ( 1000px by default ). However this behavior can be completely customized to suit the layout of your website.</p>



<h3 class="wp-block-heading" id="h.7td16rfrr1p5"><strong>Revive Social</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="385" class="wp-image-4402 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image3-2-1024x385.png" alt="revive social wordpress plugin" srcset="https://devgrow.com/wp-content/uploads/2022/10/image3-2-1024x385.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image3-2-300x113.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image3-2-768x289.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image3-2.png 1237w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Just like all the other plugins on this list, <strong>Revive Social </strong>also brings something new to the table. This plugin comes in handy particularly for <strong>older </strong>blogs.</p>



<p>As more and more new content is added to a blog, it overshadows the old content and can reduce the traffic it receives. To help with this problem <strong>Revive Social </strong>plugin automatically shares a couple of old articles to your social media handles.</p>



<p>This helps in having uniform traffic for all the articles and makes sure that your old content doesn’t just simply go to waste.</p>



<p>Here are a couple of features of this plugin</p>



<ol>
<li><strong>Supports Google Analytics Campaign Tracking</strong></li>
</ol>



<p><strong>        Revive Social </strong>supports statistics from <strong>Google Analytics </strong>with the help of <strong>URL Shorteners </strong>and other services.</p>



<p>This allows you to have a look at the real time data and see for yourself as to how your old blog posts are performing. You can then decide what to do with them.</p>



<ol start="2">
<li><strong>Share on Publish</strong></li>
</ol>



<p><strong>        </strong>This plugin can also be configured to automatically share posts instantly on publishing. Which means, it can also improve traffic not only for <strong>old posts </strong>but also for <strong>newer posts</strong></p>



<h3 class="wp-block-heading" id="h.l0v6p91tvo7h"><strong>Sassy Social Share</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="653" class="wp-image-4401 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image6-4-1024x653.png" alt="socialshare wordpress plugin description" srcset="https://devgrow.com/wp-content/uploads/2022/10/image6-4-1024x653.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image6-4-300x191.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image6-4-768x490.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image6-4.png 1040w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>This is among the most popular social share plugins on this list, with more than <strong>100k+ Active Installs </strong>and <strong>Active Maintenance</strong>. Sassy social share supports over <strong>110 Social Networks </strong>out of the box and is also optimized for <strong>vector icons</strong>.</p>



<p>Here are a few features of this plugin</p>



<ol>
<li><strong>GDPR Compliant &#8211; </strong>Zero Cookies Stored</li>
</ol>



<p>This plugin makes it easier for websites &#8211; especially in the <strong>EU </strong>to deal with <strong>GDPR Compliance</strong>. This is because <strong>Sassy Social Share </strong>does not store any <strong>Cookies </strong>or <strong>Private Data</strong> by default.</p>



<ol start="2">
<li><strong>Completely Free Plugin &amp; No Third Party Involved</strong></li>
</ol>



<p><strong>        </strong>Unlike most of the plugins that are either paid or have a third party website involved, this plugin is completely independent &amp; free to use without any bells and whistles.</p>



<p>This is also the reason why this plugin has fast load times and is very lightweight</p>



<h3 class="wp-block-heading" id="h.ja2agjc3qyxk"><strong>Social Warfare</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="503" class="wp-image-4400 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image1-4-1024x503.png" alt="social warfare wordpress plugin homepage" srcset="https://devgrow.com/wp-content/uploads/2022/10/image1-4-1024x503.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image1-4-300x147.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image1-4-768x377.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image1-4.png 1478w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>This particular plugin comes under the <strong>feature-rich </strong>category, as it has almost all of the features of the above plugins combined. But the only con is that this is <strong>NOT a free Plugin </strong>and costs <strong>29$ </strong>for <strong>ONE website</strong></p>



<p>Whether it is justified to spend <strong>29$ </strong>on a social media share plugin totally depends on the type of organization/website you are working for.</p>



<p>Here are a few features of this plugin</p>



<ol>
<li><strong>Pinterest Pin for All Images</strong></li>
</ol>



<p><strong>        </strong>This feature is particularly useful if your website has tons of images and you have a good social media presence on <strong>Pinterest</strong>.</p>



<p>This plugin automatically adds a small <strong>Pin </strong>button at the top of every image on the website so that the user can instantly share any image they like on their pinterest page.</p>



<ol start="2">
<li><strong>Share Customization</strong></li>
</ol>



<p><strong>        </strong>This feature allows you to add <strong>Custom Text </strong>/ <strong>Hashtags </strong>to any share that the user makes using the <strong>Share Button </strong>on your website.</p>



<p>Using this feature helps if you have a <strong>Promotional Message </strong>or want to increase the popularity of <strong>any hashtag</strong></p>



<h2 class="wp-block-heading" id="h.btinupb2mgpg"><strong>Conclusion</strong></h2>



<p>Choosing the right social media plugin can be a really hard task, especially if you are new to the world of wordpress. Hopefully, after reading this article you have an idea about what all of these plugins have to offer and can choose the one that suits your needs the best.</p>



<p>However, if you are on a strict budget, my recommendation would be to go ahead with the free options and try to make the most out of them and only move on to the paid options once you find the need for them.</p>



<p>If you found this article useful and if it helped you in making your decision, do share it with your friends!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://devgrow.com/sharebar-wordpress-plugin/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating Overlays using CSS Grid and jQuery [TUTORIAL]</title>
		<link>https://devgrow.com/griddy-overlay/</link>
					<comments>https://devgrow.com/griddy-overlay/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 05 Jan 2023 08:11:11 +0000</pubDate>
				<category><![CDATA[All Posts]]></category>
		<guid isPermaLink="false">https://devgrow.com/?p=733</guid>

					<description><![CDATA[Almost any website that has a modern aesthetic design has some use of Overlays. If you’ve never heard of them, Overlays generally mean placing one element on top of the other. This gives the website a 3-dimensional look and makes it stand out more. Also, for web designers/developers this means adding another design technique under your belt. For our purposes, there are two types of overlays. Always Display overlays and Popup Overlays. A Popup Overlay &#8211; just like the name sounds, appears as a screen popup only when some user action happens ( for eg, submitting a form ) An Always Display Overlay on the other hand is mostly used in decorative banners or landing pages. They are always visible on the screen and generally,…]]></description>
										<content:encoded><![CDATA[
<p>Almost any website that has a modern <strong>aesthetic </strong>design has some use of <strong>Overlays</strong>. If you’ve never heard of them, <strong>Overlays </strong>generally mean placing one <strong>element </strong>on top of the <strong>other</strong>. This gives the website a <strong>3-dimensional look </strong>and makes it stand out more. Also, for web designers/developers this means adding another design technique under your belt.</p>



<p>For our purposes, there are <strong>two types </strong>of overlays. <strong>Always Display </strong>overlays and <strong>Popup Overlays.</strong></p>



<ol>
<li>A <strong>Popup Overlay </strong>&#8211; just like the name sounds, appears as a <strong>screen popup </strong>only when some user action happens ( for eg, submitting a form )</li>
<li>An <strong>Always Display Overlay </strong>on the other hand is mostly used in <strong>decorative banners </strong>or <strong>landing pages. </strong>They are always visible on the screen and generally, are not animated.</li>
</ol>



<p>In this tutorial, for <strong>Popup Overlays </strong>we’ll be using <strong>jQuery </strong>as we need javascript for handling <strong>User Clicks </strong>and <strong>Generating Pop Ups</strong></p>



<p>However, for displaying <strong>Always Display Overlays </strong>we make use of <strong>CSS Grid </strong>which is a relatively newer feature in the latest version of css &#8211; <strong>CSS v3</strong>  </p>









<h2 class="wp-block-heading" id="h.imdmepp56k4l"><strong>Prerequisites</strong></h2>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-4395" src="https://devgrow.com/wp-content/uploads/2022/10/image7-1.jpg" alt="man writing on paper with a pen" width="1999" height="1333" srcset="https://devgrow.com/wp-content/uploads/2022/10/image7-1.jpg 1999w, https://devgrow.com/wp-content/uploads/2022/10/image7-1-300x200.jpg 300w, https://devgrow.com/wp-content/uploads/2022/10/image7-1-1024x683.jpg 1024w, https://devgrow.com/wp-content/uploads/2022/10/image7-1-768x512.jpg 768w, https://devgrow.com/wp-content/uploads/2022/10/image7-1-1536x1024.jpg 1536w" sizes="(max-width: 1999px) 100vw, 1999px" /></p>



<p>For the most part, you do not need to know <strong>CSS Grid </strong>or <strong>Advanced jQuery </strong>as we’ll be learning a large portion of the concepts before we apply them in code.</p>



<p>However, these are the formal prerequisites of this course</p>



<ol>
<li><strong>Basic </strong>knowledge of <strong>HTML, CSS</strong></li>
<li>Little bit of experience with <strong>Javascript/jQuery </strong>will certainly be helpful</li>
</ol>



<h2 class="wp-block-heading" id="h.3phwnxxof0go"><strong>The Final Overlays using CSS Grid </strong>and <strong>jQuery</strong></h2>



<p>To keep you excited about learning overlays, here are a few designs that we will be building in this tutorial</p>



<h3 class="wp-block-heading" id="h.muzimwu1a023"><strong>Always Display Overlays Using CSS Grid</strong></h3>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="800" height="377" class="wp-image-4365 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image4-1.gif" alt="always display overlays using css grid - astronaut " /></figure>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="800" height="391" class="wp-image-4364 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image5.gif" alt="always display overlays using css grid - forest &amp; environment" /></figure>



<p>If you had any confusion about what <strong>Always Display Overlays </strong>are, hopefully they should be clear by now.</p>



<p>They are essentially <strong>multi layered content </strong>where it’s possible to put one thing ( such as an <strong>image</strong> ) on top of another ( for eg, <strong>text </strong>) to give the website a <strong>3-dimensional look </strong>making the experience feel richer</p>



<h3 class="wp-block-heading" id="h.w18gesp3qegf"><strong>Popup Overlays using jQuery</strong></h3>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="800" height="383" class="wp-image-4363 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image9-1.gif" alt="popup overlays using jquery " /></figure>



<p>Unlike <strong>Always Display Overlays</strong>, the <strong>popup </strong>overlay only appears on specific conditions ( say, a <strong>button click </strong>) and <strong>overlays </strong>the entire screen.</p>



<h2 class="wp-block-heading" id="h.bbgb9wja24at"><strong>What is CSS Grid &amp; How Does it Work?</strong></h2>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="710" height="363" class="wp-image-4362 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image11-2.png" alt="the anatomy of a css grid explained" srcset="https://devgrow.com/wp-content/uploads/2022/10/image11-2.png 710w, https://devgrow.com/wp-content/uploads/2022/10/image11-2-300x153.png 300w" sizes="(max-width: 710px) 100vw, 710px" /></figure>



<p><strong>CSS Grid </strong>is a <strong>Layout System </strong>that allows you to have total control over how elements are displayed on a screen. Unlike the previous positioning techniques in css such as <strong>position: absolute</strong> or <strong>position: relative</strong> CSS Grid makes the design process <strong>intuitive</strong> by dividing the entire screen into a <strong>2 dimensional grid</strong></p>



<h3 class="wp-block-heading" id="h.xp6hldpnmjpx"><strong>Understanding the CSS Grid Terminology</strong></h3>



<p>Now that we know that <strong>CSS Grid </strong>divides the screen into a <strong>2d Grid</strong>, let’s try to understand the division process and how to <strong>place the elements </strong>in that particular <strong>2d grid</strong></p>



<ol>
<li>The coordinate system of a <strong>CSS Grid </strong>starts at <strong>top left </strong>and expands towards the <strong>bottom right</strong></li>
<li>In <strong>CSS Grid </strong>the coordinates start from (<strong>1,1</strong>) instead of the standard <strong>(0,0) </strong>that most people might be used to</li>
<li>Each coordinate, when extended to <strong>right </strong>or <strong>bottom </strong>forms the <strong>CSS Grid Lines</strong></li>
<li>The area between those grid lines are called individual <strong>Cells.</strong> This is where we place the element</li>
<li>These <strong>Cells </strong>can also merge with the nearby cells to create space for bigger elements ( let’s say a <strong>rectangle </strong>)</li>
<li>The <strong>Cells </strong>can also have spacing between them to create better designs, these spaces are called <strong>Cell Gaps </strong></li>
</ol>



<h3 class="wp-block-heading" id="h.cv9o2b1a6mbl"><strong>Using the Chrome DevTools Grid Debugger</strong></h3>



<p>To give you a better idea, let’s use the <strong>Chrome DevTools Grid Debugger </strong>to see the grid layout for the demo banner shown above</p>



<p>For using the <strong>Grid Debugger </strong>in <strong>Chrome DevTools</strong></p>



<ol>
<li>Press <strong>Ctrl + Shift + I </strong>to open devtools</li>
<li>Go to the <strong>Elements </strong>tab and click on the little <strong>grid </strong>button that appears near the grid</li>
</ol>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="327" height="118" class="wp-image-4361 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image15-1.png" alt="chrome css grid element inspector" srcset="https://devgrow.com/wp-content/uploads/2022/10/image15-1.png 327w, https://devgrow.com/wp-content/uploads/2022/10/image15-1-300x108.png 300w" sizes="(max-width: 327px) 100vw, 327px" /></figure>



<p>You will then see a more clear representation of the <strong>structure </strong>of the <strong>CSS Grid</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="529" class="wp-image-4360 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image14-1024x529.png" alt="chrome developer tools css grid inspector" srcset="https://devgrow.com/wp-content/uploads/2022/10/image14-1024x529.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image14-300x155.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image14-768x397.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image14.png 1242w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Look at the above diagram and try to identify the <strong>Cells, Grid Lines </strong>and other <strong>dimensions</strong> of this particular grid</p>



<p>Hoping that you gave it an honest try, here are the important things to observe from the above grid</p>



<ol>
<li>The above image is divided into a <strong>6&#215;6 rectangular grid</strong></li>
<li>The grid lines are represented in <strong>pink</strong> and have corresponding numbers attached to them</li>
<li>The astronaut image occupies <strong>columns 5-6</strong> and <strong>rows 3-6</strong></li>
<li>The text <strong>overlaps </strong>the astronaut image giving it a <strong>3d look</strong></li>
</ol>



<h3 class="wp-block-heading" id="h.dyk2n07zuo9i"><strong>Writing some CSS Grid Code</strong></h3>



<p>Now that you have understood that <strong>astronaut image </strong>is specifically placed in <strong>rows 3-6 </strong>and <strong>columns 5-6 </strong>and is <strong>above the text</strong>. Let’s try to figure out how we would accomplish that in <strong>CSS</strong></p>



<p>Firstly, we make the outer container a <strong>CSS Grid </strong>by adding the <strong>display: grid;</strong> property to it.</p>



<pre class="wp-block-code"><code>.container {
display : grid;
}</code></pre>



<p>Then, we select the astronaut image using the <strong>.astronaut </strong>selector and position it properly in the grid using the <strong>grid-column </strong>and <strong>grid-row </strong>properties</p>



<p>In the <strong>grid-column </strong>and <strong>grid-row </strong>properties we specify the <strong>start line </strong>and the <strong>end line </strong>separated by a <strong>forward slash ( / )</strong></p>



<p>For eg, to position the astronaut image in the rows <strong>3-6 </strong>and column <strong>5-6</strong>, we use the following code.</p>



<pre class="wp-block-code"><code>.astronaut {
grid-column: 5/6;
grid-row: 3/6;
}</code></pre>



<h3 class="wp-block-heading" id="h.v4xa9m1rcgw1"><strong>Understanding Z-Index in CSS</strong></h3>



<p>After learning how to position elements in a <strong>CSS Grid</strong>, the only thing remaining is to understand why some elements <strong>appear</strong> <strong>above the other elements</strong> and how we can control this behavior</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="650" height="650" class="wp-image-4359 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image16-1.png" alt="image representing z-index" srcset="https://devgrow.com/wp-content/uploads/2022/10/image16-1.png 650w, https://devgrow.com/wp-content/uploads/2022/10/image16-1-300x300.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image16-1-150x150.png 150w" sizes="(max-width: 650px) 100vw, 650px" /></figure>



<p>The simplest way to understand <strong>z-index </strong>is to think of the computer screen as a <strong>2 dimensional paper </strong>with <strong>x &amp; y </strong>axes. Now, since we are working with <strong>3 dimensions</strong>, the third dimension is called the <strong>z-axis </strong>and <strong>z-index </strong>is simply the <strong>coordinate of the element in z-axis</strong></p>



<p>The <strong>higher </strong>the value of <strong>z-index </strong>the more <strong>“Front” </strong>or <strong>“top” </strong>it appears to be. For eg, a <strong>z-index </strong>of 9999 or any arbitrarily high value will ensure that this particular element will overlap any other element.</p>



<p>If two elements have the same<strong> z-index value </strong>then their overlapping behavior would be the same as if they never had any <strong>z-index property</strong>.</p>



<p>In the above situation, to make the astronaut image overlap the text, we can simply set it’s <strong>z-index </strong>to 1 which will be larger than the <strong>z-index </strong>of<strong> </strong>text element, thus overlapping it( all elements have a <strong>z-index </strong>of <strong>0 </strong>by default. )</p>



<h2 class="wp-block-heading" id="h.ai07x6gdhg9n"><strong>Using CSS Grid to Make an Overlay Banner</strong></h2>



<p>After understanding how <strong>CSS Grid </strong>works, it’s time to implement it on the final project to create an <strong>overlay banner</strong></p>



<h3 class="wp-block-heading" id="h.k1kbwz5xe4jl"><strong>Installing the Required Tools</strong></h3>



<h4 class="wp-block-heading" id="h.6sv7v0r7kc2a"><strong>IDE ( Optional )</strong></h4>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="1012" height="506" class="wp-image-4358 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image2-3.png" alt="vscode ide" srcset="https://devgrow.com/wp-content/uploads/2022/10/image2-3.png 1012w, https://devgrow.com/wp-content/uploads/2022/10/image2-3-300x150.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image2-3-768x384.png 768w" sizes="(max-width: 1012px) 100vw, 1012px" /></figure>



<p>Since we’ll be writing code to build a HTML Website we need a Code Editor or an <strong>IDE ( Integrated Development Environment ).</strong></p>



<p>If you don’t know what an <strong>IDE</strong> is, it’s a program which provides features such as <strong>Syntax Highlighting, Error Detection, </strong>and much more.</p>



<p>There are many popular IDE’s on the market ( Sublime text, Atom, Notepad++, etc )</p>



<p>But for our purposes we’ll be using Visual Studio Code, which has the most features, and is a good choice for both beginners and advanced users</p>



<h4 class="wp-block-heading" id="h.9dh3bhmx3be7"><strong>Browser</strong></h4>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" class="wp-image-4357 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image12-1024x576.jpg" alt="google chrome logo" srcset="https://devgrow.com/wp-content/uploads/2022/10/image12-1024x576.jpg 1024w, https://devgrow.com/wp-content/uploads/2022/10/image12-300x169.jpg 300w, https://devgrow.com/wp-content/uploads/2022/10/image12-768x432.jpg 768w, https://devgrow.com/wp-content/uploads/2022/10/image12-1536x864.jpg 1536w, https://devgrow.com/wp-content/uploads/2022/10/image12.jpg 1960w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Any modern browser that can run <strong>standard HTML Websites </strong>such as <strong>Google Chrome </strong>or <strong>Firefox</strong></p>



<h3 class="wp-block-heading" id="h.7pj55xbvxa9m"><strong>Setting up the Project Folder &amp; Files</strong></h3>



<p>Now that we have all the essential tools installed, it’s time to set up the files and folders for the project. Let’s get started by creating a project folder and naming it <strong>Overlay with Grid</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="370" height="250" class="wp-image-4356 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image6-3.png" alt="overlay with grid vs code project structure" srcset="https://devgrow.com/wp-content/uploads/2022/10/image6-3.png 370w, https://devgrow.com/wp-content/uploads/2022/10/image6-3-300x203.png 300w" sizes="(max-width: 370px) 100vw, 370px" /></figure>



<ul>
<li>Then, just like a standard <strong>HTML </strong>website, we create the <strong>index.html </strong>and <strong>styles.css </strong>files. Since this project also involves working with images, we also create an <strong>images/ </strong>folder and place all the images inside it.</li>
</ul>



<p><strong>Note: </strong>To Download the Images used in this particular example, you can follow the link : <a href="https://www.google.com/url?q=https://imgur.com/a/depspzb&amp;sa=D&amp;source=editors&amp;ust=1664636374707660&amp;usg=AOvVaw3MYPlhdYnegzzaMsBoY_bf" target="_blank" rel="noopener">https://imgur.com/a/depspzb</a></p>



<ul>
<li>After Downloading the <strong>images </strong>from the <strong>imgur link</strong> above, copy them to the images folder and rename them to match the above file structure so that you can follow along with the tutorial.</li>
</ul>



<p>Let’s now get started with writing some standard <strong>HTML Code </strong>in the <strong>index.html </strong>file</p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
 &lt;head&gt;
   &lt;link rel="stylesheet" href="styles.css" /&gt;
   &lt;title&gt;Overlay Using CSS Grid&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;


   &lt;/body&gt;
&lt;/html&gt;</code></pre>



<ul>
<li>In the code above, we get started by writing <strong>boilerplate </strong>stuff such as <strong>&lt;!DOCTYPE html&gt; </strong>to indicate that this is an html document.</li>
<li>Then, we create the <strong>&lt;html&gt; </strong>tag inside which, we place the standard <strong>&lt;head&gt; </strong>and <strong>&lt;body&gt; </strong>tags. If you’ve never worked with HTML before, <strong>&lt;head&gt; </strong>basically contains all of the <strong>metadata </strong>or ( content that is not displayed on the screen ). Whereas for content that we want to show on the screen, we use the <strong>&lt;body&gt; </strong>tag.</li>
<li>Inside the <strong>&lt;head&gt; </strong>tag, we first link the <strong>styles.css </strong>file using the <strong>&lt;link&gt; </strong>tag, after which we set the <strong>page title </strong>to <strong>Overlay Using CSS Grid</strong></li>
<li>The body will remain empty for now.</li>
</ul>



<p>After making the basic structure of the <strong>HTML WebPage</strong>, it’s time to finally insert the banner onto the screen using the following <strong>HTML </strong>code</p>



<pre class="wp-block-code"><code>  &lt;div class="banner1"&gt;
     &lt;img src="./images/blue_bg.jpg" class="blue-bg" /&gt;
     &lt;img src="./images/astronaut.png" class="astronaut" /&gt;
     &lt;div class="left-content-1"&gt;
       &lt;h1 class="banner1-text"&gt;Learn to Code Within 30 days*&lt;/h1&gt;
       &lt;button&gt;Get Started&lt;/button&gt;
     &lt;/div&gt;
   &lt;/div&gt;</code></pre>



<p>Let’s have a step by step walkthrough of the code above,</p>



<ul>
<li>Firstly, we create a <strong>&lt;div&gt; </strong>and give it a class of <strong>banner1 </strong>so that we can identify it in the <strong>css file </strong>later on</li>
<li>Since we are using <strong>CSS Grid</strong>, we don’t have to worry a lot about the <strong>inside elements </strong>such as the <strong>background image</strong> or <strong>text</strong>. They can simply be dumped wherever in the <strong>Container </strong>and can be arranged and sized later on in the <strong>CSS File</strong>.</li>
<li>For example, the <strong>blue background image </strong>and the <strong>astronaut image </strong>appear to be side-by-side in the <strong>HTML Code </strong>but in reality, the <strong>blue background image </strong>is content to be the <strong>full-sized parent </strong>of the <strong>astronaut image</strong> simply by using <strong>CSS Grid</strong></li>
<li>After images, we also write the banner tagline as <strong>“Learn To Code Within 30 Days*” </strong>and add a simply <strong>Get Started </strong>button below it</li>
</ul>



<h3 class="wp-block-heading" id="h.8f7qugos1t2e"><strong>Using CSS Grid to Make the Overlay</strong></h3>



<p>After being done with the <strong>HTML Code</strong>, it’s time to write the <strong>CSS </strong>that will actually make the <strong>Grid </strong>and <strong>Overlays</strong></p>



<p>Let’s start by the simplest step, setting the <strong>banner </strong>to <strong>display: grid;</strong> and giving it a fixed height of <strong>600px</strong></p>



<pre class="wp-block-code"><code>.banner1 {
 display: grid;
 height: 600px;
}</code></pre>



<p>Then, we use the following code to make sure that the <strong>blue background image </strong>occupies the entire <strong>banner</strong></p>



<pre class="wp-block-code"><code>.blue-bg {
 height: 600px;
 width: 100%;
 object-fit: cover;
 grid-column: 1/6;
 grid-row: 1/6;
}</code></pre>



<ul>
<li>Firstly, to make the image fit the banner, we have to specify the height as <strong>600px </strong>( the same height as the parent banner ) and width of <strong>100%</strong></li>
<li>Then, to make sure that this image properly fits the screen, we use the <strong>object-fit: cover; </strong>property.</li>
<li>Coming to the grid layout, as discussed, we will be dividing the banner to a <strong>6 by 6 </strong> grid. Since the blue background image covers the entire grid, we set the <strong>column </strong>and <strong>row </strong>properties to span from <strong>1 to 6</strong> covering the entire banner</li>
<li>Notice how we didn’t specify anywhere that the grid will be <strong>6 by 6. </strong>This is because, <strong>CSS Grid </strong>can automatically detect the grid dimensions based on the column and row numbers requested by its children.</li>
</ul>



<pre class="wp-block-code"><code>.astronaut {
 height: 400px;
 grid-row: 3/6;
 grid-column: 5/6;
 z-index: 1;
}</code></pre>



<ul>
<li>In the code above, we firstly size the astronaut image to <strong>400px </strong>to make sure that it is lesser than the height of the banner</li>
<li>Then, exactly like we discussed in the previous section, we span the <strong>astronaut image </strong>to <strong>rows 3-6 </strong>and <strong>columns 5-6</strong></li>
<li>Lastly, to make sure that the <strong>astronaut image </strong>overlaps the text, we give it a <strong>z-index </strong>of <strong>1</strong></li>
</ul>



<pre class="wp-block-code"><code>.banner1-text {
 color: white;
 font-size: 75px;
}</code></pre>



<pre class="wp-block-code"><code>button {
 color: blue;
 background-color: white;
 height: 60px;
 width: 300px;
 font-size: 20px;
 border-radius: 10px;
}</code></pre>



<ul>
<li>This code is mainly used for styling the <strong>banner text </strong>and the <strong>Get Started Button</strong></li>
<li>For the banner text, we simply set the <strong>font color </strong>to <strong>white </strong>and increase the <strong>font size </strong>to <strong>75px</strong></li>
<li>Coming to the button, we first set it’s dimensions to <strong>300px </strong>wide and <strong>60px </strong>height</li>
<li>Then, we change the background color to <strong>white </strong>and set the font color to <strong>blue</strong></li>
<li>To give it a more <strong>polished look</strong>, we set the <strong>border radius </strong>to <strong>10px</strong></li>
</ul>



<pre class="wp-block-code"><code>.left-content-1 {
 grid-row: 2/5;
 grid-column: 2/6;
}</code></pre>



<ul>
<li>After designing the <strong>Left Content </strong>( Banner Text &amp; Get Started Button ) we position it in the grid using the <strong>grid-row </strong>and <strong>grid-column </strong>properties</li>
<li>As discussed, we will be placing the left content element between <strong>rows 2-5 </strong>and <strong>columns 2-6</strong></li>
</ul>



<p>And that’s it! Save the <strong>.html file </strong>and <strong>.css </strong>files, and reload the page and you should see the same result as the final product shown above.</p>



<h2 class="wp-block-heading" id="h.yy3qi48cnolw"><strong>CSS Grid Overlay Banner Exercise ( Optional )</strong></h2>



<p>For people who would like to practice this overlay technique, here’s an <strong>optional exercise</strong></p>



<h3 class="wp-block-heading" id="h.7dqouce1yose"><strong>Problem</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="547" class="wp-image-4355 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image10-3-1024x547.png" alt="using chrome debugger tools for css grid " srcset="https://devgrow.com/wp-content/uploads/2022/10/image10-3-1024x547.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image10-3-300x160.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image10-3-768x410.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image10-3.png 1236w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Implement the above overlay design using <strong>CSS Grid</strong></p>



<p><strong>Note</strong>: The images required for this exercise are in the <strong>imgur link </strong>mentioned in previous sections</p>



<h3 class="wp-block-heading" id="h.teyzb9ldfcwq"><strong>Solution</strong></h3>



<p>It is important that you only look at the solution after giving the problem an honest try. But if you still can’t solve it, then it’s <strong>totally fine </strong>and you can try to learn from the solution below</p>



<h4 class="wp-block-heading" id="h.yc32gd7qf8mc"><strong>HTML Code</strong></h4>



<pre class="wp-block-code"><code>    &lt;div class="banner2"&gt;
     &lt;img src="./images/forest_bg.jpg" class="forest-bg" /&gt;
     &lt;img src="./images/tree.png" class="tree" /&gt;
     &lt;div class="banner2-text"&gt;Take Active Steps to Save Your Environment&lt;/div&gt;
   &lt;/div&gt;</code></pre>



<h4 class="wp-block-heading" id="h.skeefgk6bxqh"><strong>CSS Code</strong></h4>



<pre class="wp-block-code"><code>.banner2 {
 height: 600px;
 display: grid;
}
.forest-bg {
 object-fit: cover;
 height: 600px;
 width: 100%;
 grid-row: 1/6;
 grid-column: 1/6;
}
.tree {
 grid-row: 4/6;
 grid-column: 5/6;
 z-index: 1;
}

.banner2-text {
 grid-column: 2/6;
 grid-row: 4/5;
 color: white;
 font-size: 60px;
 font-weight: bold;
}</code></pre>



<h2 class="wp-block-heading" id="h.t2li7ldqgwcs"><strong>Animated/Dynamic Overlays using jQuery</strong></h2>



<p>Now that we are done with <strong>Fixed Banner Overlays</strong>. Let’s get started on <strong>Dynamic Popup Overlays </strong>by creating the project files &amp; folders first.</p>



<h3 class="wp-block-heading" id="h.fm4hcz97lbnn"><strong>Setting up The PopUp Overlay jQuery Project</strong></h3>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="363" height="292" class="wp-image-4354 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image1-3.png" alt="vs code project structure " srcset="https://devgrow.com/wp-content/uploads/2022/10/image1-3.png 363w, https://devgrow.com/wp-content/uploads/2022/10/image1-3-300x241.png 300w" sizes="(max-width: 363px) 100vw, 363px" /></figure>



<ul>
<li>To keep things simple, instead of creating a new folder and setting up files all over again, let’s just create an <strong>overlay.html </strong>file in the same folder.</li>
</ul>



<p>Inside the newly created <strong>overlay.html </strong>file, we start with the following code</p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
 &lt;head&gt;
   &lt;title&gt;Overlay using jQuery&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;

 &lt;/body&gt;

 &lt;style&gt;

 &lt;/style&gt;

 &lt;script&gt;
 &lt;/script&gt;

&lt;/html&gt;</code></pre>



<ul>
<li>Just like the previous sections, we get started by standard <strong>HTML Boilerplate </strong>code and declare stuff such as <strong>&lt;!DOCTYPE html&gt; </strong>and following with standard elements such as <strong>&lt;head&gt; </strong>and <strong>&lt;body&gt;</strong></li>
<li>Inside <strong>&lt;head&gt; </strong>we also make use of the <strong>&lt;title&gt; </strong>tag to set the page title as <strong>Overlay using jQuery</strong></li>
<li>Unlike the previous sections where we linked the <strong>CSS </strong>using <strong>&lt;link&gt; </strong>tag, we simply insert the <strong>css code </strong>inside the <strong>&lt;style&gt; </strong>tag. This is because, the simplicity of this project doesn’t allow to create an entirely new file for only a couple of lines of <strong>CSS Code</strong></li>
<li>Similarly, to write the <strong>jQuery code, </strong>instead of creating a dedicated javascript file, we will simply work on it inside the <strong>&lt;script&gt; </strong>tag</li>
</ul>



<h3 class="wp-block-heading" id="h.meyc6fy0o032"><strong>Installing jQuery for the Popup Overlay Project</strong></h3>



<p>Before moving ahead and writing code, it’s important that we have <strong>jQuery </strong>installed.</p>



<p>To do that,</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="408" class="wp-image-4353 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image8-3-1024x408.png" alt="cdnjs home page" srcset="https://devgrow.com/wp-content/uploads/2022/10/image8-3-1024x408.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image8-3-300x120.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image8-3-768x306.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image8-3-1536x613.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image8-3.png 1587w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul>
<li>Go to <strong><a href="https://www.google.com/url?q=https://cdnjs.com/&amp;sa=D&amp;source=editors&amp;ust=1664636374765040&amp;usg=AOvVaw1STOwM8Lhc09qFUDME5Y7C" target="_blank" rel="noopener">CDNJS</a></strong> and search for <strong>jQuery. </strong>If you’ve never heard of them, <strong>CDNJS </strong>is a popular <strong>CDN </strong>( Content Delivery Network ) that serves javascript files for popular frameworks such as <strong>jQuery, Bootstrap </strong>and a lot more!</li>
</ul>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="482" class="wp-image-4352 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image3-1-1024x482.png" alt="jquery on cdnjs" srcset="https://devgrow.com/wp-content/uploads/2022/10/image3-1-1024x482.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image3-1-300x141.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image3-1-768x361.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image3-1.png 1033w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul>
<li>Select on the <strong>Copy Script Tag </strong>button for the <strong>latest jQuery Version</strong></li>
<li>Paste the copied <strong>&lt;script&gt; </strong>tag inside the <strong>overlay.html </strong>file</li>
</ul>



<p>And done! The current project now has <strong>jQuery Installed </strong>and we can directly start using it inside the <strong>&lt;script&gt; &lt;/script&gt; </strong>block that we created previously.</p>



<h3 class="wp-block-heading" id="h.ya7hjsx816ew"><strong>Creating the HTML Structure for the jQuery Popup Overlay Project</strong></h3>



<pre class="wp-block-code"><code>  &lt;button&gt;Show Overlay!&lt;/button&gt;
   &lt;div class="overlay"&gt;
     &lt;h1&gt;This is a Sample Overlay Text&lt;/h1&gt;
     &lt;h3&gt;Click Anywhere to close this overlay&lt;/h3&gt;
   &lt;/div&gt;</code></pre>



<ul>
<li>In the above code, we get started by creating a simple button that says <strong>Show Overlay!</strong></li>
<li>After that, we create a <strong>&lt;div&gt; </strong>with a class of <strong>“overlay”</strong>. It should be pretty self explanatory that any content inside this <strong>&lt;div&gt; </strong>will act as an overlay.</li>
</ul>



<h3 class="wp-block-heading" id="h.5oppovb9t63v"><strong>Adding Styling to the jQuery Overlay Popup</strong></h3>



<pre class="wp-block-code"><code>    .overlay {
     height: 100vh;
     width: 100vw;
     position: fixed;
     opacity: 0;
     top: 0;
     left: 0;
     z-index: 1;
     color: black;
     background-color: rgba(128, 128, 128, 0.5);
     transition: all 0.3s;
   }</code></pre>



<ul>
<li>Let’s get the obvious out of the way, since we know that the <strong>overlay </strong>will <strong>cover the entire screen</strong>. We set its height to <strong>100vh </strong>and width of <strong>100vw</strong>. Here <strong>vh </strong>and <strong>vw </strong>are special <strong>css units </strong>that represent the <strong>viewport height &amp; viewport width</strong> where viewport generally means the size of the browser window.</li>
<li>Then, to make sure that the <strong>overlay remains fixed </strong>to the screen and not scrolls/moves, we use the <strong>position: fixed; </strong>property and set the <strong>top &amp; left </strong>properties to <strong>0 </strong>( top &amp; left signify the distance between the <strong>overlay </strong>and top and left of the viewport/screen )</li>
<li>For the actual overlay to work, we need to add a <strong>z-index </strong>value of <strong>1</strong>. This makes sure that this overlay is on top of all the elements ( all of them have a <strong>z-index </strong>value of <strong>0 </strong>by default )</li>
<li>We then use the <strong>color </strong>and <strong>background color </strong>properties to set the colors for the overlay.</li>
<li>The important property that affects the <strong>visibility </strong>of the <strong>popup </strong>is the <strong>opacity property.</strong> For those who don’t know, <strong>opacity </strong>is basically an <strong>opaqueness scale </strong>from <strong>0 to 1 </strong>( where <strong>0 </strong>means completely transparent and <strong>1 </strong>means fully opaque )</li>
<li>This <strong>opacity </strong>property will be modified by using <strong>jQuery </strong>from <strong>0 </strong>to <strong>1 </strong>and vice versa, depending on the situation.</li>
<li>For this <strong>opacity transition</strong> to occur smoothly, we also add a <strong>0.3 second animation </strong>by using the <strong>transition: all 0.3s;</strong> property</li>
</ul>



<h3 class="wp-block-heading" id="h.7qiv8386uf3u"><strong>Writing the jQuery code for Overlay Popup</strong></h3>



<pre class="wp-block-code"><code>  &lt;script&gt;
   const toggleOverlay = () =&gt; {
     let currentlySet = $(".overlay").css("opacity");
     let newOpacity = currentlySet == 0 ? 1 : 0;
     $(".overlay").css("opacity", newOpacity);
   };
   $("button, .overlay").on("click", () =&gt; toggleOverlay());
 &lt;/script&gt;</code></pre>



<ul>
<li>Firstly, we make a function called <strong>toggleOverlay </strong>that toggles the <strong>visibility </strong>of the <strong>overlay</strong>.</li>
<li>Inside this function, we use the <strong>.css </strong>function provided by <strong>jQuery </strong>to modify the <strong>opacity property </strong>from <strong>0 to 1 </strong>or <strong>1 </strong>to <strong>0 </strong>depending on the current visibility of the popup</li>
</ul>



<p>The only thing left now is to make sure that this <strong>toggleOverlay </strong>function is called on either of these situations:</p>



<ol>
<li>A <strong>Button Click</strong></li>
<li>A click <strong>anywhere on the overlay</strong></li>
</ol>



<ul>
<li>To register a click event for both of these situations, we combine the elements using a <strong>“comma</strong>” in the following way: <strong>button, .overlay</strong></li>
<li>Then, we use the <strong>.on(“click”) </strong>function provided by <strong>jQuery </strong>that calls the <strong>toggleOverlay </strong>function on either of the two events discussed above.</li>
</ul>



<p>And that’s it! The overlay popup should function as shown in the preview.</p>



<h2 class="wp-block-heading" id="h.e34x3k7n7bui"><strong>Conclusion</strong></h2>



<p>Congratulations on coming this far and completing this tutorial on <strong>Overlays </strong>using <strong>CSS Grid </strong>and <strong>jQuery</strong>. We covered a wide range of topics ranging from <strong>learning about CSS Grids </strong>to <strong>jQuery </strong>and even working on a small exercise. Hopefully this gave web designers a lot more inspiration to work on new ideas and designs. For people that found this interesting, there is still a lot more stuff to learn involving overlays &#8211; for example, <strong>Adding Animations </strong>/ <strong>Videos </strong>to overlays and tons of other stuff to keep you occupied for a long time. If you found this useful and learnt something new today, do share this with your friends!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://devgrow.com/griddy-overlay/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating iOS Styles Switches &#038; Contacts using HTML, CSS [TUTORIAL]</title>
		<link>https://devgrow.com/iphone-style-switches/</link>
					<comments>https://devgrow.com/iphone-style-switches/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 05 Jan 2023 08:10:45 +0000</pubDate>
				<category><![CDATA[All Posts]]></category>
		<guid isPermaLink="false">https://devgrow.com/?p=737</guid>

					<description><![CDATA[Apple is known for its intuitive design of both hardware and software. If you’ve ever used a Macbook, iPhone or basically any apple product you must have come across apps like Settings, Safari, etc. Most of the users using these apps are really impressed by their design language and ease of use. Infact, Apple spends thousands of dollars on UI Design and relevant R&#38;D to ensure that their users have the optimal experience. It doesn’t just end there, Apple’s design language has also inspired tons of other websites/apps to use their components. For eg, Apple Style Switches or Action Bar or even the Contact Manager App. And that’s exactly what we’ll be learning in this…]]></description>
										<content:encoded><![CDATA[
<p>Apple is known for its <strong>intuitive design </strong>of both hardware and software. If you’ve ever used a Macbook, iPhone or basically any apple product you must have come across apps like <strong>Settings, Safari</strong>, etc. Most of the users using these apps are really impressed by their <strong>design language </strong>and <strong>ease of use</strong>. Infact, Apple spends thousands of dollars on <strong>UI Design </strong>and relevant <strong>R&amp;D </strong>to ensure that their users have the optimal experience.</p>



<p>It doesn’t just end there, Apple’s design language has also inspired tons of other websites/apps to use their components. For eg, <strong>Apple Style Switches </strong>or <strong>Action Bar</strong> or even the <strong>Contact Manager App</strong>.</p>



<p>And that’s exactly what we’ll be learning in this tutorial, we’ll be building an <strong>iOS Style Switch </strong>and a iOS Style <strong>Contact List</strong> using only <strong>HTML </strong>and <strong>CSS</strong>. Yep, you heard that right, you <strong>DO NOT NEED Javascript </strong>to work on this tutorial. Sounds exciting? Let’s dive in. </p>
<p>Also Read, <a href="https://contentdetector.ai/" target="_blank" rel="noopener">can GPT help coders to create iOS/Objective C cade, and if you can detect the code? </a></p>



<h2 class="wp-block-heading" id="h.ja11gpwttzvi"><strong>The Final Product &#8211; iOS Switches &amp; Contact List</strong></h2>



<p>Before we go ahead and start building any application, it’s a good idea to have a <strong>Brief Image </strong>of what the final project will look like.</p>



<p>Here’s a glimpse of the final <strong>iOS Theming </strong>project that we’ll be working on. It has an <strong>iOS Styled Switch </strong>with an <strong>iOS Styled Contact List</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="438" height="469" class="wp-image-4343 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image5-2.png" alt="final ios theming project screenshot" srcset="https://devgrow.com/wp-content/uploads/2022/10/image5-2.png 438w, https://devgrow.com/wp-content/uploads/2022/10/image5-2-280x300.png 280w" sizes="(max-width: 438px) 100vw, 438px" /></figure>



<h2 class="wp-block-heading" id="h.ub7mvrajctb6"><strong>Part#1 &#8211; Installing the Required Tools for iOS Theming Project</strong></h2>



<ol>
<li><strong>An IDE</strong> ( Integrated Development Environment )<strong>:</strong></li>
</ol>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="618" class="wp-image-4344 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image4-1-1024x618.png" alt="vs code ide screenshot" srcset="https://devgrow.com/wp-content/uploads/2022/10/image4-1-1024x618.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image4-1-300x181.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image4-1-768x464.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image4-1-1536x927.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image4-1.png 1999w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong> </strong>If you don’t know what an <strong>IDE </strong>is, most of the <strong>IDEs</strong> on the market today can be considered as <strong>Advanced Code Editors</strong>. They speed up development by providing the user with advanced features such as <strong>Syntax Highlighting</strong>, <strong>Code Autocompletion</strong>, <strong>Error Detection,</strong> and a lot more. For this tutorial, we will be using <strong>Visual Studio Code</strong> which is quite popular &amp; beginner friendly</p>



<ol start="2">
<li><strong>Web Browser</strong></li>
</ol>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" class="wp-image-4342 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image8-2-1024x576.png" alt="google chrome logo" srcset="https://devgrow.com/wp-content/uploads/2022/10/image8-2-1024x576.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image8-2-300x169.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image8-2-768x432.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image8-2-1536x864.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image8-2.png 1999w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Any modern web browser, such as <strong>Google Chrome </strong>or <strong>Firefox</strong> to test the <strong>React.js </strong>application</p>



<ol start="3">
<li><strong>VS Code Live Server ( Extension )</strong></li>
</ol>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="765" height="333" class="wp-image-4341 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image2-2.png" alt="vscode live server extension" srcset="https://devgrow.com/wp-content/uploads/2022/10/image2-2.png 765w, https://devgrow.com/wp-content/uploads/2022/10/image2-2-300x131.png 300w" sizes="(max-width: 765px) 100vw, 765px" /></figure>



<p>If you’ve worked with websites before, you must’ve been in a situation where you have to <strong>Reload </strong>the page every single time you make changes to the <strong>HTML </strong>or <strong>CSS </strong>files. This can get quite frustrating when you have thousands of changes you need to make and preview.</p>



<p>To avoid this, we’ll be installing the <strong>Live Server </strong>extension on <strong>Visual Studio Code</strong>. This extension will automatically <strong>Refresh the page </strong>whenever it detects a change in either the <strong>HTML, CSS </strong>or any other project related files</p>



<h2 class="wp-block-heading" id="h.r0zg4vae4mpk"><strong>Part#2 &#8211; Setting up the Project Files for iOS Theming</strong></h2>



<p>Now that we have installed all the essential tools, let’s create the <strong>Project Files </strong>for the <strong>iOS Theming </strong>project.</p>



<p>Since this is a basic project that requires only <strong>HTML </strong>and <strong>CSS, </strong>let’s create two files <strong>index.html </strong>and <strong>styles.css </strong>inside our project folder</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="255" height="151" class="wp-image-4340 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image1-2.png" alt="ios theming project file structure in vscode" /></figure>



<p>Let’s get started by writing some <strong>boilerplate code </strong>inside the <strong>index.html file</strong></p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;

&lt;html lang=”en”&gt;

  &lt;head&gt;

    &lt;title&gt;iOS Theming&lt;/title&gt;

    &lt;link rel=”stylesheet” href=”./styles.css”&gt;&lt;/link&gt;

  &lt;/head&gt;

  &lt;body&gt;

  &lt;h1&gt; iOS Theming &lt;/h1&gt;

  &lt;/body&gt;

&lt;/html&gt;</code></pre>



<p>If you’ve already worked with standard <strong>HTML Websites </strong>before, then the above code must be easy to understand. But if you haven’t, then let&#8217;s have a walkthrough of the html code above.</p>



<ul>
<li>In the code above, we first start by writing <strong>&lt;!DOCTYPE html&gt;</strong>. This indicates that the file is a <strong>HTML file</strong></li>
<li>Inside the <strong>html tag</strong>, we set the <strong>Page Title </strong>to <strong>iOS Theming </strong>using the <strong>&lt;title&gt; </strong>tag.</li>
<li>Then, we link the <strong>styles.css </strong>file using <strong>&lt;link&gt; </strong>tag provided by html</li>
<li>Coming to the <strong>&lt;body&gt; tag</strong>, anything inside this tag will be visible to the user. So, let’s start by adding a <strong>&lt;h1&gt; </strong>Tag with <strong>iOS Theming </strong>as the main title for the website</li>
</ul>



<p>The <strong>styles.css </strong>file can stay empty for now as we do not need to style the page just yet.</p>



<h2 class="wp-block-heading" id="h.x86997x8cfus"><strong>Part#3 Creating an iOS Style Switch</strong></h2>



<h3 class="wp-block-heading" id="h.48f7e7wgz95m"><strong>Working on the HTML for iOS Style Switches</strong></h3>



<p>Now that we are done with setting up the project files, it’s time to get started on writing code for creating an <strong>iOS Style Switch</strong></p>



<ul>
<li>Let’s start by adding an <strong>H2 Heading </strong>to the page with <strong>Switches </strong>as the <strong>Title</strong></li>
</ul>



<pre class="wp-block-code"><code>&lt;h2&gt;Switches&lt;/h2&gt;</code></pre>



<p>Before we move to the next step and create the switch, it’s important that we understand how <strong>standard HTML Checkboxes work</strong></p>



<p>In this tutorial we rely heavily on <strong>in-built functionality </strong>such as <strong>Input Checkboxes </strong>and <strong>HTML5 Labels. </strong>This is to avoid writing any <strong>JavaScript code </strong>and put the built in elements to use.</p>



<p>The only thing you need to know about <strong>Inputs </strong>and <strong>Labels </strong>for now is that</p>



<ul>
<li>Every <strong>checkbox input </strong>has a <strong>name </strong>property, this is so that other parts of the code can access the <strong>current status of the checkbox ( </strong>checked status <strong>)</strong></li>
<li>On clicking a <strong>Checkbox </strong>it’s status is toggled ( on to off or off to on )</li>
<li>A <strong>Label </strong>is <strong>supporting text </strong>for a checkbox, the main thing to note here is, <strong>A Label Click </strong>is also considered as a <strong>checkbox </strong>click no matter where the label is located. So, the <strong>Checkbox Status </strong>is toggled even if the label is clicked</li>
<li>Every label knows the checkbox / input it belongs to using the <strong>for </strong>property</li>
</ul>



<p>Using all of the information above, try to come up with a solution to implement a <strong>Custom iOS Style Switch </strong>using only <strong>labels </strong>and <strong>inputs</strong></p>



<p>Hopefully, you’ve taken your time and have come up with a reasonable solution / idea. If you didn’t, i’d still recommend you give it a try before reading the solution below</p>



<pre class="wp-block-code"><code> &lt;label for=”ios-switch”&gt;

      Text for the iOS Switch

            &lt;input type=”checkbox” id=”ios-switch” name=”ios-switch” /&gt;

&lt;div class=”checkbox”&gt;

        &lt;div class=”toggle”&gt;&lt;/div&gt;

      &lt;/div&gt;

    &lt;/label&gt;</code></pre>



<ul>
<li>In the code above, we start by creating a <strong>Checkbox Input </strong>using <strong>&lt;input type=”checkbox”&gt;</strong></li>
<li>Then, we give the <strong>input </strong>a <strong>name attribute </strong>of <strong>ios-switch </strong>and use the same <strong>ios-switch </strong>value inside the <strong>&lt;label for=””&gt; </strong>property</li>
<li>An important thing to notice here would be that <strong>Label </strong>wraps the code <strong>entirely. </strong>This ensures that the <strong>switch </strong>is <strong>toggled </strong>even if the user clicks anywhere near the switch ( for eg, clicking on <strong>Label Text </strong>)</li>
<li>Then, we create two <strong>&lt;div&gt; elements </strong>that display the <strong>iOS Style Switch. </strong>The outer <strong>checkbox div </strong>represents the <strong>gray / green </strong>area of the switch whereas the inner <strong>toggle div </strong>is for the <strong>circular white toggle </strong>of an <strong>iOS Style Switch</strong></li>
</ul>



<p>If you look at the code above closely, you might observe that we not only have an <strong>input checkbox </strong>but also a <strong>&lt;div class= “checkbox”&gt;</strong>.</p>



<p>Here, the <strong>&lt;input&gt; </strong>checkbox is only used to keep track of the <strong>checked state </strong>( this is done because we don’t have any other way to store the <strong>input checked/unchecked </strong>value since we are not using any javascript ). This <strong>&lt;input&gt; </strong>is hidden by using the <strong>display: none; </strong>css property.</p>



<p>The <strong>:checked </strong>or :<strong>unchecked </strong>status of this <strong>&lt;input&gt; checkbox </strong>is used to display the correct status of <strong>&lt;div class= “checkbox”&gt;</strong></p>



<h3 class="wp-block-heading" id="h.cwo16p7c3xz4"><strong>Working on the CSS for iOS Style Switch</strong></h3>



<p>As discussed, let’s start by making the <strong>&lt;input&gt; checkbox </strong>invisible by using <strong>display: none; </strong>property</p>



<pre class="wp-block-code"><code>label input {
 display: none;
}</code></pre>



<p>Then, let’s design the <strong>checkbox </strong>and <strong>toggle &lt;div&gt; </strong>to match the style of an <strong>iOS Switch</strong></p>



<pre class="wp-block-code"><code>.checkbox {
 background-color: grey;
 width: 40px;
 height: 20px;
 border-radius: 10px;
 align-items: center;
 transition: all 0.3s;
 margin-left: 12px;
}
.toggle {
 background-color: white;
 width: 18px;
 height: 18px;
 border-radius: 10px;
 position: relative;
 top: 1px;
 left: 1px;
 transition: all 0.3s;
}</code></pre>



<ul>
<li>In the above <strong>CSS Code, </strong>we design the <strong>.checkbox </strong>div and .<strong>toggle </strong>div in their <strong>unchecked state</strong></li>
<li>In <strong>unchecked state </strong>the <strong>iOS Style Switch </strong>has a <strong>gray background </strong>and the <strong>small white circular toggle </strong>is on<strong> the left</strong></li>
<li>The <strong>toggle </strong>is positioned inside the <strong>checkbox </strong>by using <strong>position: relative;</strong> which means that properties such as <strong>left, top, right, bottom </strong>move the toggle <strong>relative to its initial position</strong></li>
<li>You can add rest of the properties such as <strong>height, width, margin </strong>etc according to your preference ( in the above code, the dimensions of the checkbox are <strong>40&#215;20 </strong>and that of the toggle are <strong>20&#215;20</strong> )</li>
<li>Then, to make the transitions smooth we add <strong>transition: all 0.3s; </strong>property to both <strong>toggle </strong>and <strong>checkbox. </strong>This makes sure that <strong>all </strong>properties ( <strong>left , right , height, width </strong>, etc ) have a <strong>smooth transition</strong> that lasts exactly <strong>0.3 seconds</strong></li>
</ul>



<pre class="wp-block-code"><code>input:checked + .checkbox {
 background-color: #5bda4e;
}

input:checked + .checkbox .toggle {
 left: 21px;
}</code></pre>



<p>After designing the <strong>unchecked </strong>states, it&#8217;s time to finally design the <strong>checked states.</strong></p>



<p>This is where the <strong>&lt;input&gt; checkbox </strong>comes handy. Using the css selector <strong>input:checked + </strong>&lt;element&gt; we can write <strong>custom css </strong>for that particular element that is <strong>only applied when input is checked</strong></p>



<ul>
<li>In the above code, we add a <strong>light green background </strong>( #5bda4e ) to the outer checkbox ( this represents the <strong>checked state </strong>)</li>
<li>Then, we also need to move the <strong>toggle </strong>to the <strong>right </strong>of the <strong>checkbox. </strong>By simple calculations of dimensions you can conclude that the <strong>left </strong>property needs to be adjusted to <strong>21px </strong>instead of the initial <strong>1px</strong></li>
</ul>



<p>And that’s it! The switch should be perfectly functional now and you won’t need to worry about <strong>animating the switch, </strong>this is because we added the <strong>transition: all 0.3s; </strong>property before hand. This by-default ensures that <strong>transitions for all properties </strong>are <strong>animated </strong>in <strong>0.3 seconds time</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="470" height="168" class="wp-image-4339 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image9.gif" alt="ios switch animation" /></figure>



<h2 class="wp-block-heading" id="h.nhur76nz6gg9"><strong>Part#4 Creating an iOS Style Contact List</strong></h2>



<p>Now that we are done with creating <strong>iOS Switches, </strong>it’s time to move ahead and work on the <strong>iOS Style Contact List</strong></p>



<ul>
<li>Just like the previous section, let’s start by adding a <strong>H2 Heading </strong>with <strong>“Contact List” </strong>as the title</li>
</ul>



<pre class="wp-block-code"><code> &lt;h2&gt;Contact List&lt;/h2&gt;</code></pre>



<ul>
<li>Then, to simulate a <strong>Mobile Device</strong> let’s create an outer container called <strong>ios-contacts-container </strong>and give it the dimensions of an <strong>iOS Device </strong>( for eg, 667&#215;375 for the latest iPhone SE )</li>
</ul>



<pre class="wp-block-code"><code>  &lt;div class=”ios-contacts-container”&gt;

    &lt;/div&gt;
</code></pre>



<pre class="wp-block-code"><code>.ios-contacts-container {
 width: 375px;
 height: 667px;
 display: flex;
}</code></pre>



<ul>
<li>Looking at the final contacts screen, the contacts app can be divided into two sections <strong>the contact list </strong>and the <strong>alphabet sidebar</strong></li>
<li>Then, let’s create two sections, <strong>ios-contacts </strong>and <strong>ios-contacts-sidebar. </strong>And make them appear horizontally by using <strong>flexbox</strong></li>
</ul>



<pre class="wp-block-code"><code>  &lt;div class=”ios-contacts”&gt;

     &lt;/div&gt;

     &lt;div class=”ios-contacts-sidebar”&gt;

      &lt;/div&gt;</code></pre>



<pre class="wp-block-code"><code>.ios-contacts {
 flex: 10;
}
.ios-contacts-sidebar {
 flex: 1;
 display: flex;
 flex-direction: column;
 justify-content: center;
}</code></pre>



<ul>
<li>In the above code, we assign the <strong>main contacts container </strong>a <strong>flex value of 10 </strong>and the sidebar a default value of <strong>1</strong></li>
<li>Since the <strong>Alphabet Sidebar </strong>contains a <strong>column </strong>of <strong>alphabets </strong>from <strong>A-Z.  </strong>It’s a good idea to mark it as a <strong>flexbox container </strong>with <strong>column direction </strong>and then finish it up by <strong>centering the alphabets </strong>using <strong>justify-content: center;</strong></li>
</ul>



<p>Looking at the main contacts section, let’s divide <strong>contacts for each letter </strong>into a separate section called <strong>ios-contact-section</strong></p>



<p>This <strong>ios-contact-section </strong>will contain two other <strong>&lt;div&gt;</strong>’s: One for the <strong>Alphabet of the current section </strong>and the other for <strong>displaying the contact names  </strong>in this section</p>



<p>Here’s an example for an <strong>ios-contact-section </strong>container that we’ll be working with</p>



<pre class="wp-block-code"><code>  &lt;div class=”ios-contact-section”&gt;

          &lt;div class=”ios-contact-letter” id=”a”&gt;A&lt;/div&gt;

          &lt;div class=”ios-contact-letter-container”&gt;

            &lt;div class=”ios-contact-name”&gt;Aaron&lt;/div&gt;

            &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Ali&lt;/div&gt;

            &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Amy&lt;/div&gt;

          &lt;/div&gt;

        &lt;/div&gt;</code></pre>



<p>Similarly, let’s create <strong>ios-contact-sections </strong>for the letters <strong>B </strong>and <strong>C</strong></p>



<pre class="wp-block-code"><code>&lt;div class=”ios-contact-section”&gt;

          &lt;div class=”ios-contact-letter” id=”b”&gt;B&lt;/div&gt;

          &lt;div class=”ios-contact-letter-container”&gt;

            &lt;div class=”ios-contact-name”&gt;Benjamin&lt;/div&gt;

            &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Bertie&lt;/div&gt;

            &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Bob&lt;/div&gt;

          &lt;/div&gt;

        &lt;/div&gt;

             &lt;div class=”ios-contact-section”&gt;

          &lt;div class=”ios-contact-letter” id=”c” &gt;C&lt;/div&gt;

          &lt;div class=”ios-contact-letter-container”&gt;

            &lt;div class=”ios-contact-name”&gt;Catherine&lt;/div&gt;

            &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Charles&lt;/div&gt;

            &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Cindy&lt;/div&gt;

             &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Cindy&lt;/div&gt;

             &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Creed&lt;/div&gt;

             &lt;hr&gt;

            &lt;div class=”ios-contact-name”&gt;Christopher&lt;/div&gt;

          &lt;/div&gt;

        &lt;/div&gt;</code></pre>



<p>In the above <strong>ios-contact-section </strong>we assign each <strong>ios-contact-letter </strong>an <strong>ID </strong>of the current letter. ( For eg, the contact section for letter c has an <strong>ID value of C </strong>)</p>



<p>These <strong>ID Values </strong>will come in handy when we have to <strong>auto-scroll to a section </strong>as soon as the user clicks on the <strong>alphabet sidebar</strong></p>



<p>Now, let’s add the <strong>Letters </strong>inside the <strong>alphabet sidebar.</strong> Each letter is a <strong>Link tag </strong>( <strong>&lt;a&gt; </strong>) with an <strong>href value </strong>of that particular letter. This <strong>href value </strong>should contain the <strong>ID Value </strong>that we discussed earlier about.</p>



<p>For eg, the <strong>Link Tag </strong>for letter <strong>B </strong>has an <strong>href attribute</strong> of <strong>#b </strong>which also happens to be the <strong>ID Value </strong>of <strong>ios-contact-section </strong>for letter <strong>B. </strong>This means, on a click event on the letter <strong>B </strong>the page is <strong>auto-scrolled </strong>to <strong>ios-contact-section </strong>for the letter <strong>B</strong></p>



<pre class="wp-block-code"><code>&lt;a href=”#a”&gt;A&lt;/a&gt;

&lt;a href=”#b”&gt;B&lt;/a&gt;

&lt;a href=”#c” &gt;C&lt;/a&gt;

&lt;a href=’#d’ &gt;D&lt;/a&gt;

&lt;a href=’#e’ &gt;E&lt;/a&gt;

&lt;a href=’#f’ &gt;F&lt;/a&gt;

&lt;a href=’#g’ &gt;G&lt;/a&gt;

&lt;a href=’#h’ &gt;H&lt;/a&gt;

&lt;a href=’#i’ &gt;I&lt;/a&gt;

&lt;a href=’#j’ &gt;J&lt;/a&gt;

&lt;a href=’#k’ &gt;K&lt;/a&gt;

&lt;a href=’#l’ &gt;L&lt;/a&gt;

&lt;a href=’#m’ &gt;M&lt;/a&gt;

&lt;a href=’#n’ &gt;N&lt;/a&gt;

&lt;a href=’#o’ &gt;O&lt;/a&gt;

&lt;a href=’#p’ &gt;P&lt;/a&gt;

&lt;a href=’#q’ &gt;Q&lt;/a&gt;

&lt;a href=’#r’ &gt;R&lt;/a&gt;

&lt;a href=’#s’ &gt;S&lt;/a&gt;

&lt;a href=’#t’ &gt;T&lt;/a&gt;

&lt;a href=’#u’ &gt;U&lt;/a&gt;

&lt;a href=’#v’ &gt;V&lt;/a&gt;

&lt;a href=’#w’ &gt;W&lt;/a&gt;

&lt;a href=’#x’ &gt;X&lt;/a&gt;

&lt;a href=’#y’ &gt;Y&lt;/a&gt;

&lt;a href=’#z’ &gt;Z&lt;/a&gt;</code></pre>



<p>The above code might look a little <strong>Too Repetitive </strong>and if you’ve heard anything about good programming practices, one of the main ones is using the <strong>DRY ( Don’t Repeat Yourself ) Principle.</strong></p>



<p>However, in this situation, since we are limiting ourselves to use only <strong>HTML &amp; CSS </strong>and are not taking advantage of the functionality that <strong>Javascript provides. </strong>It is perfectly fine if we do stuff such as writing <strong>HTML Code for ever letter</strong> repetitively and manually</p>



<p>And that’s it! After finishing, the final product should look similar to the one shown below</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="504" height="528" class="wp-image-4338 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image7.gif" alt="ios contacts list " /></figure>



<h2 class="wp-block-heading" id="h.co1zjcw3e0ek"><strong>Bonus: Using jQuery To create iOS style </strong><strong>switches</strong></h2>



<p>Working only with HTML and CSS can sometimes make it harder to do things that can be simply done using Javascript or jQuery.</p>



<p>Let&#8217;s have a look at how we can use <strong>Simple jQuery Code</strong> to create the same <strong>iOS Style Switch</strong> like the one before</p>



<p>We first get started by <strong>Installing jQuery</strong></p>



<p>To do that,</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="408" class="wp-image-4337 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image10-2-1024x408.png" alt="cdnjs home screen" srcset="https://devgrow.com/wp-content/uploads/2022/10/image10-2-1024x408.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image10-2-300x120.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image10-2-768x306.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image10-2-1536x613.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image10-2.png 1587w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul>
<li>Go to <strong><a href="https://www.google.com/url?q=https://cdnjs.com/&amp;sa=D&amp;source=editors&amp;ust=1664632654675232&amp;usg=AOvVaw0_SOkVn-eZd_-BL4NS7u87" target="_blank" rel="noopener">CDNJS</a></strong> and search for <strong>jQuery. </strong>If you’ve never heard of them, <strong>CDNJS </strong>is a popular <strong>CDN </strong>( Content Delivery Network ) that serves javascript files for popular frameworks such as <strong>jQuery, Bootstrap </strong>and a lot more!</li>
</ul>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="482" class="wp-image-4336 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image6-2-1024x482.png" alt="jquery on cdnjs" srcset="https://devgrow.com/wp-content/uploads/2022/10/image6-2-1024x482.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image6-2-300x141.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image6-2-768x361.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image6-2.png 1033w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul>
<li>Select on the <strong>Copy Script Tag </strong>button for the <strong>latest jQuery Version</strong></li>
<li>Paste the copied <strong>&lt;script&gt; </strong>tag inside the <strong>overlay.html </strong>file</li>
</ul>



<p>And done! The current project now has <strong>jQuery Installed</strong></p>



<p>After installing <strong>jQuery, </strong>let&#8217;s write the HTML code of the <strong>iOS Switch</strong></p>



<div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"><div class="wp-block-group__inner-container">
<div class="wp-block-group is-vertical is-layout-flex wp-container-4 wp-block-group-is-layout-flex">
<div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"><div class="wp-block-group__inner-container">
<div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"><div class="wp-block-group__inner-container">
<div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"><div class="wp-block-group__inner-container">
<pre class="wp-block-code"><code>    &lt;label for=”ios-switch”&gt;

      Text for the iOS Switch

&lt;div class=”checkbox”&gt;

        &lt;div class=”toggle”&gt;&lt;/div&gt;

      &lt;/div&gt;

    &lt;/label&gt;</code></pre>
</div></div>
</div></div>
</div></div>
</div>
</div></div>



<ul>
<li>One main difference you can notice between the current <strong>HTML Code </strong>and the one used previously is that – there is no <strong>&lt;input checkbox&gt; </strong>used here. This is because we can simply use a javascript variable to keep track of the <strong>on/off</strong> state</li>
<li>Remaining part of the code stays exactly the same</li>
</ul>



<pre class="wp-block-code"><code>.checkbox {
 background-color: grey;
 width: 40px;
 height: 20px;
 border-radius: 10px;
 align-items: center;
 transition: all 0.3s;
 margin-left: 12px;
}
.toggle {
 background-color: white;
 width: 18px;
 height: 18px;
 border-radius: 10px;
 position: relative;
 top: 1px;
 left: 1px;
 transition: all 0.3s;
}</code></pre>



<ul>
<li>In the above code, we design the outer grey checkbox by giving it dimensions of <strong>40 x 20 pixels </strong>and adding rounded corners to it.</li>
<li>Similarly, we then design the <strong>toggle </strong>to be a <strong>18 x 18 Pixel </strong>Circle that is initially in the off position ( left)</li>
<li>Most of the styling stays exactly the same as we are only changing the way the toggle works – not how the toggle &amp; checkbox look.</li>
</ul>



<pre class="wp-block-code"><code>let checked = false;

function toggleSwitch() {
if(checked) {
$(".checkbox").css("background", "grey");
$(".toggle").css("left", "1px");
}
else {
$(".checkbox").css("background", "#5bda4e");
$(".toggle").css("left", "21px");
}
checkbox = !checkbox
}

$(".checkbox").on("click", toggleSwitch());</code></pre>



<ul>
<li>In the above code, we store the <strong>on/off </strong>status of the switch in the <strong>checked </strong>variable</li>
</ul>



<ul>
<li>Then, we create a function <strong>toggleSwitch </strong>that changes the state of the switch depending on the <strong>checked </strong>variable</li>
<li>If <strong>checked </strong>is already true, we move the toggle to left and change the background to <strong>grey </strong>by using the <strong>jQuery css function.</strong></li>
<li>Whereas, if <strong>checked </strong>is false, we move the toggle to right and change the background color to <strong>iOS Green </strong>( Hex code: #5bda4e )</li>
<li>After that, we change the <strong>checked </strong>variable to its opposite ( true to false and false to true )</li>
<li>Lastly, we simply need to attach this function to the checkbox by using the <strong>jQuery on click </strong>function</li>
</ul>



<p>And that&#8217;s it! Hopefully you were able to see how within a few lines of <strong>jQuery </strong>code we were able to accomplish the exact same result.</p>



<h2 class="wp-block-heading" id="h.2gobmohefvat"><strong>Conclusion</strong></h2>



<p>Congratulations on coming this far and completing the tutorial on <strong>iOS Style Switches </strong>&amp; <strong>Contact Lists</strong>. Hopefully this gave you a good idea about the design principles that <strong>Apple </strong>uses in its products. In this tutorial, we also learnt that a lot more stuff such as <strong>switch animations / transitions </strong>were possible using only <strong>HTML &amp; CSS </strong>and without any <strong>Javascript</strong>. To really solidify the concepts that you learnt in this tutorial, you can try making a fully functional <strong>Clone </strong>of any <strong>iOS Application</strong>. This way, not only will you have a finished product at the end, but will also have learned a lot more than you could have by just reading. If you liked this tutorial and learnt something new today, do share it with your friends!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://devgrow.com/iphone-style-switches/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Developing Mobile Web Apps using jQuery Mobile [TUTORIAL]</title>
		<link>https://devgrow.com/mobile-web-dev-using-jquery-mobile/</link>
					<comments>https://devgrow.com/mobile-web-dev-using-jquery-mobile/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 05 Jan 2023 08:10:22 +0000</pubDate>
				<category><![CDATA[All Posts]]></category>
		<guid isPermaLink="false">https://devgrow.com/?p=739</guid>

					<description><![CDATA[With more than 60 percent of the internet traffic coming from Mobile Phones, it has never been more important to optimize your website so that it has a better user experience on mobile devices. Unlike desktop users, people browsing the internet on their phone face tons of problems such as slower loading times or smaller screen sizes. The average user is much less likely to return to your website again if it is slow to load or is not responsive enough to work on touch interfaces. Things such as smaller buttons/text or in general desktop type interfaces on mobile websites can not only make the experience bad, but can also affect search engine rankings. Yes, you heard that right…]]></description>
										<content:encoded><![CDATA[
<p>With more than <strong>60 percent </strong>of the internet traffic coming from <strong>Mobile Phones</strong>, it has never been more important to <strong>optimize </strong>your website so that it has a better user experience on mobile devices. Unlike desktop users, people browsing the internet on their phone face tons of problems such as <strong>slower loading times </strong>or <strong>smaller screen sizes</strong>.</p>



<p>The average user is much less likely to return to your website again if it is <strong>slow to load </strong>or is not <strong>responsive enough </strong>to work on touch interfaces.</p>



<p>Things such as <strong>smaller buttons/text </strong>or in general <strong>desktop type interfaces </strong>on <strong>mobile websites </strong>can not only make the experience bad, but can also <strong>affect search engine rankings</strong>.</p>



<p>Yes, you heard that right &#8211; with popular search engines such as <strong>Google </strong>aiming to provide the best possible experience to its users, a <strong>non-mobile-friendly </strong>website is much less likely to be ranked higher on search results &#8211; despite the content.</p>



<p>But, do not worry &#8211; in this tutorial we’ll tackle this problem using a framework called <strong>jQuery Mobile. </strong>This framework was built from group-up keeping in mind the rise of mobile internet users. It aims to provide developers with a <strong>smooth &amp; easy experience </strong>in making <strong>mobile-friendly </strong>web applications.</p>



<h2 class="wp-block-heading" id="h.bye6et44qawz"><strong>What is jQuery &amp; jQuery Mobile?</strong></h2>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="559" class="wp-image-4329 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image1-1-1024x559.png" alt="jquery logo " srcset="https://devgrow.com/wp-content/uploads/2022/10/image1-1-1024x559.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image1-1-300x164.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image1-1-768x419.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image1-1-1536x838.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image1-1.png 1999w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>jQuery </strong>is a lightweight <strong>javascript library</strong> used to build standard <strong>html/css/javascript </strong>websites. But, with much <strong>cleaner </strong>and <strong>shorter code</strong>. It accomplishes this by providing easy to use functions that help in <strong>animations, event handling , </strong>and <strong>manipulating the UI. </strong>Although, it is <strong>technically true </strong>that all of this can be done by using <strong>vanilla javascript </strong>&#8211; the difference arises in <strong>time taken </strong>and <strong>code readability</strong></p>



<p>Along with its standard library that was released in <strong>2006</strong>. jQuery also realized that web on mobile will grow big, and hence decided to make <strong>Mobile Web Development </strong>easier by launching <strong>jQuery Mobile.</strong></p>



<p><strong>jQuery Mobile </strong>was designed to be used <strong>alongside jQuery. </strong>It had additional features that made all of the elements <strong>Touch Optimized </strong>by default. It also came with <strong>prebuilt widgets </strong>including <strong>Buttons, Selectors, Input Sliders, Navbars </strong>and a lot more!</p>



<p>Most of these <strong>widgets </strong>that came with <strong>jQuery Mobile </strong>required very little tinkering to do as they were already optimized &#8211; both in <strong>design </strong>and <strong>functionality </strong>to run on touch screen devices such as Mobile Phones<strong>. </strong>This allowed developers to quickly release mobile versions of their websites without having to spend extra time or resources.</p>



<h2 class="wp-block-heading" id="h.c8fqxva8qq2f"><strong>The Final Mobile Web App Using jQuery Mobile</strong></h2>



<p>There is no better way to learn something than to build a small <strong>functional application </strong>using it. By following the philosophy of <strong>“learn by doing”</strong> we can ensure that not only do we understand concepts in the moment &#8211; but we also <strong>retain </strong>them for longer periods of time.</p>



<p>In this tutorial, we’ll be working on a <strong>Gamer Survey </strong>website which aims to collect <strong>important data </strong>such as <strong>Age, Playing Hours, Recently Played Games </strong>all while using tons of<strong> jQuery Mobile Features. </strong>This way, we’ll cover <strong>almost </strong>all the important <strong>functionality </strong>that <strong>jQuery Mobile </strong>provides</p>



<p>At the end, we’ll also be adding a <strong>dark theme </strong>to the app to give it a more modern look.</p>



<p>To keep you excited, here’s a demo of the final application:</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="400" height="889" class="wp-image-4328 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image19.gif" alt="final gamer survey app using jquery mobile" /></figure>



<h2 class="wp-block-heading" id="h.4pe66egv23y8"><strong>Part#1 &#8211; Installing the Required Tools for jQuery Mobile Development</strong></h2>



<p>Since <strong>jQuery </strong>is a lightweight <strong>JavaScript library </strong>and not a fully fledged framework like <strong>Angular </strong>or <strong>React </strong>there are very few &#8211; but important tools to be installed</p>



<h3 class="wp-block-heading" id="h.6sv7v0r7kc2a"><strong>IDE ( Optional )</strong></h3>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="1012" height="506" class="wp-image-4327 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image12.png" alt="microsoft visual studio code ide" srcset="https://devgrow.com/wp-content/uploads/2022/10/image12.png 1012w, https://devgrow.com/wp-content/uploads/2022/10/image12-300x150.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image12-768x384.png 768w" sizes="(max-width: 1012px) 100vw, 1012px" /></figure>



<p>Since we’ll be writing code to build a <strong>jQuery Mobile App </strong>we need a Code Editor or an <strong>IDE ( Integrated Development Environment ).</strong></p>



<p>If you don’t know what an <strong>IDE</strong> is, it’s a program which provides features such as <strong>Syntax Highlighting, Error Detection, </strong>and much more.</p>



<p>There are many popular IDE’s on the market ( Sublime text, Atom, Notepad++, etc )</p>



<p>But for our purposes we’ll be using Visual Studio Code, which has the most features, and is a good choice for both beginners and advanced users</p>



<h3 class="wp-block-heading" id="h.9dh3bhmx3be7"><strong>Browser</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" class="wp-image-4326 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image13-1024x576.jpg" alt="chrome web browser logo" srcset="https://devgrow.com/wp-content/uploads/2022/10/image13-1024x576.jpg 1024w, https://devgrow.com/wp-content/uploads/2022/10/image13-300x169.jpg 300w, https://devgrow.com/wp-content/uploads/2022/10/image13-768x432.jpg 768w, https://devgrow.com/wp-content/uploads/2022/10/image13-1536x864.jpg 1536w, https://devgrow.com/wp-content/uploads/2022/10/image13.jpg 1960w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Any modern browser that can run <strong>standard HTML Websites </strong>such as <strong>Google Chrome </strong>or <strong>Firefox</strong></p>



<h2 class="wp-block-heading" id="h.svf60xqnwf40"><strong>Part#2 &#8211; Setting up the Gamer Survey Project using jQuery Mobile</strong></h2>



<p>To create a new <strong>jQuery Mobile </strong>project, we start by</p>



<ul>
<li>Creating a project folder <strong>gamer_survey </strong>and adding an <strong>index.html </strong>file to it</li>
</ul>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="433" height="239" class="wp-image-4325 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image3.png" alt="game survey project files in vscode" srcset="https://devgrow.com/wp-content/uploads/2022/10/image3.png 433w, https://devgrow.com/wp-content/uploads/2022/10/image3-300x166.png 300w" sizes="(max-width: 433px) 100vw, 433px" /></figure>



<p>In this particular project, we won’t be needing to add any <strong>css </strong>or <strong>javascript </strong>files as <strong>jQuery Mobile </strong>already comes with <strong>pre-built widgets </strong>that have styling &amp; animations included by default!</p>



<ul>
<li>Inside the <strong>index.html </strong>file, we get started by writing standard <strong>HTML </strong>starter code</li>
</ul>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
 &lt;head&gt;
   &lt;meta charset="UTF-8" /&gt;
   &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
   &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
   &lt;title&gt;Gamer Survey&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;&lt;/body&gt;
&lt;/html&gt;</code></pre>



<ul>
<li>In the above code, we start off by writing <strong>&lt;!DOCTYPE html&gt; </strong>to declare that this is an <strong>html document</strong></li>
<li>Then, inside the <strong>&lt;html&gt; </strong>tag, we add <strong>&lt;head&gt; </strong>and <strong>&lt;body&gt; </strong>elements. If you haven’t worked with <strong>HTML </strong>before, <strong>&lt;head&gt; </strong>tag contains all of the <strong>Metadata </strong>or <strong>Website Information </strong>that is not displayed to the user. Whereas, every element inside the <strong>&lt;body&gt; </strong>tag is visible to the user</li>
<li>In the <strong>&lt;head&gt; </strong>tag, we have a few <strong>&lt;meta&gt; </strong>tags that are here by default, but we don’t have to worry about them. The only important thing inside <strong>&lt;head&gt; </strong>is the <strong>&lt;title&gt; </strong>tag. It contains, as you guessed &#8211; the <strong>page title</strong></li>
</ul>



<p>Now that we are done with setting up the <strong>HTML file</strong>, it’s time to add <strong>jQuery Mobile</strong>. To do that we’ll be using a free service called <strong>CDNJS</strong>. If you’ve never heard of them, <strong>cdn.js </strong>provides <strong>links </strong>and <strong>&lt;script&gt; </strong>tags for almost <strong>all popular libraries &amp; frameworks</strong>.</p>



<p>This way, you don’t have to spend time looking through the official website of frameworks anymore as <strong>CDNJS </strong>can work as a <strong>centralized space </strong>to find direct links to popular frameworks and libraries</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="463" class="wp-image-4324 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image2-1-1024x463.png" alt="cdnjs home page" srcset="https://devgrow.com/wp-content/uploads/2022/10/image2-1-1024x463.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image2-1-300x136.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image2-1-768x347.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image2-1-1536x695.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image2-1.png 1561w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul>
<li>Visit the <strong><a href="https://www.google.com/url?q=https://cdnjs.com/&amp;sa=D&amp;source=editors&amp;ust=1664621554510038&amp;usg=AOvVaw2ovBHiE-LJfT_kuqGv8smh" target="_blank" rel="noopener">official website</a></strong><strong> </strong>of cdn.js and search for <strong>jQuery Mobile</strong></li>
</ul>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="587" class="wp-image-4323 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image5-1-1024x587.png" alt="jquery mobile in cdnjs" srcset="https://devgrow.com/wp-content/uploads/2022/10/image5-1-1024x587.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image5-1-300x172.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image5-1-768x440.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image5-1.png 1113w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul>
<li>Copy the <strong>&lt;link&gt; </strong>and <strong>&lt;script&gt; </strong>tags for the <strong>.js </strong>and <strong>.css </strong>files shown above</li>
</ul>



<p>Since <strong>jQuery Mobile </strong>depends on <strong>jQuery, </strong>we have to install that as well. Luckily, the process is just like the one shown above and can be done using <strong>cdn.js</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="774" height="340" class="wp-image-4322 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image11-1.png" alt="jquery 2.1.0 in cdnjs" srcset="https://devgrow.com/wp-content/uploads/2022/10/image11-1.png 774w, https://devgrow.com/wp-content/uploads/2022/10/image11-1-300x132.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image11-1-768x337.png 768w" sizes="(max-width: 774px) 100vw, 774px" /></figure>



<p>It is however important to note that the last version of <strong>jQuery Mobile &#8211; 1.4.5</strong>, DOES NOT support the <strong>latest jQuery version</strong>. This is because <strong>jQuery Mobile </strong>is currently an abandoned project and is not supported anymore.</p>



<p>However, we can still make things work in this tutorial by installing an <strong>older version </strong>of <strong>jQuery</strong> &#8211; <strong>2.1.0</strong>. ( Released in <strong>2014 </strong>)</p>



<p>Copy all of the <strong>&lt;script&gt; </strong>and <strong>&lt;link&gt; </strong>tags collected from <strong>cdnjs </strong>and simply insert them in top of the <strong>&lt;head&gt; tag </strong>like shown below</p>



<pre class="wp-block-code"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;

&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mobile/1.4.5/jquery.mobile.min.js"&gt;&lt;/script&gt;

&lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-mobile/1.4.5/jquery.mobile.min.css" /&gt;</code></pre>



<p>It is important that the <strong>jQuery &lt;script&gt; </strong>tag stays above the <strong>jQuery Mobile </strong>tag. This is because <strong>jQuery Mobile </strong>depends on <strong>jQuery </strong>to be present for it to work properly.</p>



<p><strong>NOTE: </strong>It is always better to put the <strong>&lt;script&gt; </strong>tags at the end of the <strong>HTML </strong>code. This allows for websites to <strong>load faster </strong>as the main <strong>text content </strong>is loaded before heavy scripts are. However, this can be neglected for a small application like the one we’re working with.</p>



<h2 class="wp-block-heading" id="h.dspnl3wfmtug"><strong>Part#3 &#8211; Creating Pages for the jQuery Mobile Application</strong></h2>



<p>Now that we are done with the setup and have <strong>jQuery Mobile </strong>installed, it’s time to get started working on the web application. Before we get started, however, it’s important to understand the concept of <strong>Pages </strong>in <strong>jQuery Mobile</strong></p>



<p>In <strong>jQuery Mobile </strong>world, <strong>Pages </strong>can be considered as <strong>Individual Screens.</strong> For example, a website may have an <strong>Home Page </strong>&amp; an <strong>About Us </strong>page just like the <strong>Gamer Survey </strong>app that we’re working on.</p>



<p>The way that <strong>pages </strong>work is &#8211;</p>



<ul>
<li>There can be code for <strong>multiple pages </strong>in the <strong>same index.html file</strong></li>
<li>The way that pages are distinguished from each other is by having a <strong>unique ID </strong>( For eg &lt;div id=”page1”&gt;</li>
<li>Any <strong>&lt;div&gt; </strong>element can be declared as a page simply by passing the <strong>data-role= “page” </strong>attribute to that element.</li>
<li>To <strong>switch between </strong>pages, we can simply use the default<strong> </strong>link tags <strong>&lt;a href= “#id”&gt; </strong>where <strong>id </strong>is the <strong>id </strong>of the page that you want to switch to</li>
</ul>



<p>Let’s use the following code to create <strong>two pages </strong>for the application.</p>



<pre class="wp-block-code"><code>    &lt;div data-role="page" id="survey"&gt;
     &lt;div data-role="header"&gt;&lt;/div&gt;
     &lt;div class="ui-content"&gt;&lt;/div&gt;
     &lt;div data-role="footer"&gt;&lt;/div&gt;
   &lt;/div&gt;    &lt;div data-role="page" id="about-us"&gt;
     &lt;div data-role="header"&gt;&lt;/div&gt;
     &lt;div class="ui-content"&gt;&lt;/div&gt;
     &lt;div data-role="footer"&gt;&lt;/div&gt;
   &lt;/div&gt;</code></pre>



<ul>
<li>In the above code, we created <strong>two pages </strong>by making two <strong>&lt;div&gt; </strong>elements and assigning them an attribute of <strong>data-role= “page”</strong></li>
<li>To identify them uniquely and to switch between them, we also need to assign <strong>IDs </strong>to these pages. In the above code, the pages are assigned <strong>ID </strong>values of <strong>#survey </strong>and <strong>#about-us</strong></li>
<li>Although it is not mandatory to do so, but almost every <strong>jQuery Mobile Page </strong>is divided into three sections: <strong>header, content </strong>and <strong>footer</strong></li>
<li>Therefore, we create three <strong>child &lt;div&gt; </strong>elements inside the parent <strong>&lt;div&gt; </strong>and assign them as <strong>header/footer </strong>by using the <strong>data-role </strong>attribute</li>
</ul>



<p><strong>NOTE: </strong>By default <strong>jQuery Mobile </strong>displays the page that <strong>comes first </strong>in the <strong>HTML file</strong></p>



<p>Then, just like in the final application, we design the <strong>header section</strong>. To simply be a <strong>Navbar </strong>that simply displays the website title</p>



<pre class="wp-block-code"><code>&lt;div data-role="navbar"&gt;
  &lt;h1 class="ui-title"&gt;Gamer Survey&lt;/h1&gt;&lt;/div&gt;</code></pre>



<ul>
<li>Firstly, we specify that the <strong>header </strong>element will be a <strong>navbar </strong>using the <strong>data-role= “navbar” </strong>attribute</li>
<li>Inside the navbar, we simply have an <strong>&lt;h1&gt; </strong>tag that displays the website title &#8211; <strong>Gamer Survey</strong></li>
<li>To give the title a good styling we use the pre-built <strong>jQuery Mobile Class </strong>of <strong>ui-title</strong></li>
</ul>



<p><strong>Note: </strong>It is important to add this <strong>navbar </strong>in <strong>both the pages </strong>as page switches remove <strong>all the elements inside </strong>&#8211; including the <strong>navbar</strong></p>



<p>Similarly, let’s design the <strong>footer </strong>to display <strong>two options </strong>to choose from &#8211; <strong>Home Page </strong>and the <strong>About Page</strong></p>



<pre class="wp-block-code"><code>&lt;div data-role="navbar"&gt;
     &lt;ul&gt;
       &lt;li&gt;
         &lt;a href="#survey" data-icon="home" class="ui-btn-active"&gt;Home&lt;/a&gt;
       &lt;/li&gt;
       &lt;li&gt;
         &lt;a href="#about-us" data-icon="info"&gt;About Us&lt;/a&gt;
       &lt;/li&gt;
     &lt;/ul&gt;
&lt;/div&gt;</code></pre>



<ul>
<li>The above code should be pretty simple to understand as it is just a basic <strong>jQuery Mobile Navbar</strong></li>
<li>A <strong>Navbar </strong>can have <strong>multiple navigation options </strong>&#8211; or multiple <strong>pages that it can navigate</strong></li>
<li>To declare the navigation options for a navbar, we simply use an <strong>unordered list &lt;ul&gt; </strong>which has multiple <strong>list elements </strong>each of them containing <strong>links </strong>to that particular page</li>
<li>It is important to note that these <strong>links </strong>must have correct <strong>id</strong> values that represent the corresponding <strong>page</strong></li>
<li>Finally, for this navbar to work properly, <strong>it has to be present on every page</strong></li>
</ul>



<h2 class="wp-block-heading" id="h.3h2fmxa6raid"><strong>Part#4 &#8211; Adding Basic Form Elements to the jQuery Mobile App</strong></h2>



<p>After having the basic structure of the pages ready, it’s time to work on the <strong>homepage </strong>and design all of the <strong>form elements </strong>such as <strong>Sliders, Input Boxes, Radio Buttons, Check Boxes </strong>and a lot more!</p>



<p>Let’s get started by writing a simple <strong>heading </strong>for the form using the <strong>&lt;h1&gt; </strong>tag as shown below</p>



<pre class="wp-block-code"><code>&lt;h1&gt;Please help us by answering the following survey!&lt;/h1&gt;</code></pre>



<p>If you look the final web app closely, you realize that each form element has <strong>two parts</strong></p>



<ol>
<li>a <strong>label</strong></li>
<li>The input <strong>element itself</strong></li>
</ol>



<p>In <strong>HTML </strong>a <strong>form label </strong>is linked to the <strong>form element </strong>by using the <strong>for= “#id” </strong>property. Here, <strong>#id </strong>represents the <strong>id </strong>of the <strong>form element</strong></p>



<h3 class="wp-block-heading" id="h.7frmsnc67wb1"><strong>Option Selector using jQuery Mobile</strong></h3>



<pre class="wp-block-code"><code>     &lt;label for="age" class="select"&gt;What is your age?&lt;/label&gt;
       &lt;select name="age" id="age" data-native-menu="false"&gt;
         &lt;option&gt;&lt;/option&gt;
         &lt;option value="under13"&gt;&lt;13&lt;/option&gt;
         &lt;option value="13to18"&gt;13-18&lt;/option&gt;
         &lt;option value="18-25"&gt;18-25&lt;/option&gt;
         &lt;option value="above25"&gt;25+&lt;/option&gt;
       &lt;/select&gt;</code></pre>



<ul>
<li>In the code above, we firstly use the <strong>&lt;label&gt; </strong>tag to attach a <strong>question </strong>to the form element</li>
<li>Then, we use the standard <strong>&lt;select&gt; </strong>tag provided by <strong>HTML </strong>and give it a <strong>name </strong>and an <strong>id</strong> ( It is important that this <strong>#id </strong>matches the one inside the <strong>label for= “#id” </strong>)</li>
<li>Inside the <strong>&lt;select&gt; </strong>menu we declare all the possible options for different ages by using the <strong>&lt;option&gt; </strong>tag provided by <strong>HTML</strong></li>
<li>Lastly, to give <strong>custom styling </strong>to this <strong>&lt;select&gt; </strong>menu, we pass it the <strong>data-native-menu= “false” </strong>attribute. This ensures that the <strong>default native </strong>stying of the <strong>&lt;select&gt; </strong>tag is not used.</li>
</ul>



<h3 class="wp-block-heading" id="h.nqo217y2k27v"><strong>Range Slider using jQuery Mobile</strong></h3>



<pre class="wp-block-code"><code>     &lt;label for="hours"&gt;How many hours do you play daily ? &lt;/label&gt;
       &lt;input
         type="range"
         id="hours"
         value="1"
         min="0"
         max="24"
         step="1"
         data-highlight="true"
       /&gt;</code></pre>



<ul>
<li>Similar to the option selector, we start by declaring a <strong>&lt;label&gt; </strong>tag relevant to the <strong>form element</strong></li>
<li>Then, we add an <strong>&lt;input&gt; </strong>tag providing it with the following <strong>attributes</strong></li>
</ul>



<ol>
<li><strong>Type: range </strong>is an html property used to declare that this particular <strong>&lt;input&gt; </strong>element is a <strong>range slider</strong></li>
<li><strong>Id: hours </strong>is a standard <strong>id </strong>property for this element. The same id also used in the <strong>label for= “” </strong>property to link both of these together</li>
<li><strong>Min: 0 </strong>and <strong>Max: 24 </strong>represent the <strong>minimum </strong>and <strong>maximum </strong>values attainable by this slider. Since a day has a maximum of <strong>24 hours</strong>. 0-24 would be an ideal choice for min &amp; max attributes</li>
<li><strong>Step: 1 </strong>ensures that there are no <strong>decimal / floating point values </strong>and all possible values have a <strong>difference </strong>of <strong>1</strong> ( for eg: 0,1,2,3,4….24 )</li>
<li><strong>Value: 1 </strong>is the <strong>initial </strong>or <strong>default value </strong>of the slider. It can be anything between <strong>0 and 24</strong></li>
<li><strong>Data-highlight: True </strong>is a decorative property that adds a <strong>light blue highlighting color </strong>to the range slider</li>
</ol>



<h3 class="wp-block-heading" id="h.t07ab1lqlpdz"><strong>Radio Buttons using jQuery Mobile</strong></h3>



<pre class="wp-block-code"><code>&lt;fieldset data-role="controlgroup"&gt;
             
         &lt;legend&gt;
           Do you find that gaming interferes with your social / academic life?
         &lt;/legend&gt;
         &lt;input type="radio" name="yes" id="yes" value="yes" /&gt;&lt;label for="yes"
           &gt;Yes&lt;/label
         &gt;

         &lt;label for="no"&gt;No&lt;/label
         &gt;&lt;input type="radio" name="no" id="no" value="no" /&gt;
&lt;/fieldset&gt;</code></pre>



<ul>
<li>Usually, <strong>Radio Buttons </strong>are used when <strong>only one </strong>option can be selected out of a list of possible options</li>
<li>In <strong>jQuery Mobile </strong>to use <strong>Radio Buttons </strong>and <strong>Checkboxes </strong>they are wrapped in a &lt;<strong>fieldset&gt; </strong>tag and are given a <strong>data-role </strong>value of <strong>“controlgroup”</strong></li>
<li>The title of this particular <strong>fieldset </strong>is set by using the <strong>&lt;legend&gt; </strong>tag. This is different from a <strong>&lt;label&gt; </strong>tag.</li>
<li><strong>&lt;label&gt; </strong>tags are used to set <strong>labels </strong>for <strong>individual form elements</strong>. In this case, <strong>the possible options </strong>are <strong>individual form elements</strong> therefore, they have to be named by using the <strong>&lt;label&gt; </strong>tag</li>
<li>However, to name a group of <strong>&lt;input&gt; tags </strong>or a <strong>&lt;fieldset&gt; </strong>the <strong>&lt;legend&gt; </strong>tag is used</li>
<li>In the above code, we make <strong>&lt;label&gt; </strong>and <strong>&lt;input&gt; </strong>for both the possible options <strong>Yes </strong>and <strong>No</strong></li>
</ul>



<h3 class="wp-block-heading" id="h.wvkmwnflijsg"><strong>Checkboxes using jQuery Mobile</strong></h3>



<pre class="wp-block-code"><code>    &lt;fieldset data-role="controlgroup"&gt;
         &lt;legend&gt;Have you played any of these games recently?&lt;/legend&gt;
         &lt;input type="checkbox" name="bgmi" id="bgmi" /&gt;&lt;label for="bgmi"
           &gt;Call of Duty&lt;/label
         &gt;&lt;input type="checkbox" name="Among Us" id="amongus" /&gt;&lt;label
           for="amongus"
           &gt;Among Us&lt;/label
         &gt;&lt;input type="checkbox" name="Fall Guys" id="fallguys" /&gt;&lt;label
           for="fallguys"
           &gt;Fall Guys&lt;/label
         &gt;
       &lt;/fieldset&gt;</code></pre>



<ul>
<li>Just like <strong>Radio Buttons</strong>, we declare a <strong>&lt;fieldset&gt; </strong>and give it a <strong>data-role </strong>of <strong>controlgroup</strong></li>
<li>Then, we declare <strong>&lt;input&gt; </strong>and <strong>&lt;label&gt; </strong>elements containing the <strong>possible options</strong></li>
<li>The only real difference between this code and the one in <strong>Radio Buttons </strong>is that we are using <strong>&lt;input type= “checkbox”&gt; </strong>in this code.</li>
<li>Lastly, to name the entire options group, we use the <strong>&lt;legend&gt; </strong>tag which contains the appropriate question.</li>
</ul>



<h3 class="wp-block-heading" id="h.nuooiwgkf6mn"><strong>Yes/No Switch using jQuery Mobile</strong></h3>



<pre class="wp-block-code"><code>        &lt;label for="tc"
         &gt;I have understood &amp; agree with the Terms &amp; Conditions
       &lt;/label&gt;
       &lt;select name="tc" id="tc" data-role="slider" data-mini="true"&gt;
         &lt;option value="off"&gt;No&lt;/option&gt;
         &lt;option value="on"&gt;Yes&lt;/option&gt;
       &lt;/select&gt;</code></pre>



<ul>
<li>jQuery Mobile also supports a simple <strong>Yes/No toggle </strong>using the code above.</li>
<li>Firstly, just like all the form elements before &#8211; we start by writing a <strong>&lt;label&gt; </strong>with the appropriate text</li>
<li>Then, we create a <strong>&lt;select&gt; </strong>menu containing <strong>two &lt;option&gt; tags</strong> &#8211; each of them representing <strong>Yes </strong>and <strong>No</strong></li>
<li>Finally, to give it that <strong>toggle look </strong>we simply add a <strong>data-role= “slider” </strong>property to the <strong>&lt;select&gt; </strong>menu</li>
<li>You can also optionally make the <strong>toggle </strong>small by using the <strong>data-mini= “true” </strong>attribute</li>
</ul>



<h3 class="wp-block-heading" id="h.a6ty73mt1xcv"><strong>Buttons &amp; Popups using jQuery Mobile</strong></h3>



<pre class="wp-block-code"><code>
         &lt;a
           href="#submitPopup"
           data-rel="popup"
           class="ui-btn ui-corner-all ui-shadow"
           data-transition="pop"
           &gt;Submit&lt;/a
         &gt;


       &lt;div data-role="popup" id="submitPopup"&gt;
         &lt;p&gt;The form was submitted successfully!&lt;/p&gt;
       &lt;/div&gt;</code></pre>



<p>The above button acts as a <strong>Submit Form </strong>button. However, as this is a demo application this button only displays a <strong>“Form Submitted Successfully” </strong>popup after being clicked.</p>



<ul>
<li>Firstly, we create a <strong>&lt;div&gt; </strong>and give it a <strong>data-role </strong>of <strong>popup</strong>.</li>
<li>After this, anything inside the <strong>&lt;div&gt; </strong>becomes <strong>invisible </strong>by default and will only become visible when someone <strong>calls this popup</strong></li>
<li>However, to call this popup we need to provide it with an <strong>id</strong> ( for eg: submitPopup)</li>
<li>Then, we create a <strong>button </strong>using the <strong>link tag &lt;a&gt; </strong>and inside it’s <strong>href value </strong>we provide the <strong>#id </strong>value of the popup. This makes sure that the relevant popup is shown after the button is clicked</li>
<li>To add additional styling to the <strong>button </strong>we add default <strong>jQuery Mobile </strong>classes such as <strong>ui-btn</strong></li>
<li>To make the button <strong>corners rounded </strong>and to add a <strong>shadow </strong>to the buttons, we use the <strong>ui-corner-all </strong>and <strong>ui-shadow </strong>classes respectively</li>
</ul>



<h2 class="wp-block-heading" id="h.dyrdu8afocwx"><strong>Part#5 &#8211; Designing the “About Us” page on the jQuery Mobile Application</strong></h2>



<p>Lastly, we add content to the <strong>About Us </strong>page using the code below</p>



<pre class="wp-block-code"><code>       &lt;h1&gt;About Us&lt;/h1&gt;
       &lt;p&gt;
         This is a demo application built using &lt;b&gt;jQuery Mobile&lt;/b&gt;. This
         shows basic features of jQuery Mobile such as Buttons, Themes, Navbar,
         Sliders, Checkboxes and a lot more !
       &lt;/p&gt;</code></pre>



<ul>
<li>In the above code, we start by declaring a <strong>&lt;h1&gt; </strong>tag with the title of the page &#8211; <strong>About Us</strong></li>
<li>Lastly, we add a simple paragraph tag <strong>&lt;p&gt; </strong>to write the description of this page</li>
<li>We also make use of the <strong>bold tag &lt;b&gt; </strong>to highlight a few sections of the text by making them bolder</li>
</ul>



<h2 class="wp-block-heading" id="h.dprrm7hb8fsa"><strong>Part#6 &#8211; Theming the jQuery Mobile Web App in Dark Mode</strong></h2>



<p>By now, your application should look something like this</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="461" height="1024" class="wp-image-4321 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image7-461x1024.jpg" alt="final jquery mobile website in light mode" srcset="https://devgrow.com/wp-content/uploads/2022/10/image7-461x1024.jpg 461w, https://devgrow.com/wp-content/uploads/2022/10/image7-135x300.jpg 135w, https://devgrow.com/wp-content/uploads/2022/10/image7-691x1536.jpg 691w, https://devgrow.com/wp-content/uploads/2022/10/image7.jpg 720w" sizes="(max-width: 461px) 100vw, 461px" /></figure>



<p>It’s time to make stuff more interesting by <strong>theming the app</strong>. By default, <strong>jQuery Mobile </strong>also provides us with a <strong>Web Tool </strong>called <strong>themeroller </strong>( <a href="https://www.google.com/url?q=https://themeroller.jquerymobile.com/&amp;sa=D&amp;source=editors&amp;ust=1664621554571963&amp;usg=AOvVaw3SbqWsgEdPa7A5vXAVD7mL" target="_blank" rel="noopener">https://themeroller.jquerymobile.com/</a> )</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="565" class="wp-image-4320 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image15-1024x565.png" alt="jquery mobile themeroller" srcset="https://devgrow.com/wp-content/uploads/2022/10/image15-1024x565.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image15-300x166.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image15-768x424.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image15.png 1214w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>In <strong>jQuery Mobile </strong>themes work in the following way</p>



<ul>
<li>In a single web app, there can be <strong>upto 26 themes </strong>each having a <strong>letter </strong>from <strong>A-Z</strong></li>
<li>Every single <strong>page </strong>or any <strong>&lt;div&gt; </strong>can have it’s own theme by using the <strong>data-theme </strong>attribute which takes a letter from <strong>A-Z</strong></li>
</ul>



<p>Since we only require <strong>one dark theme</strong> &#8211; we’ll be selecting the <strong>letter A </strong>and creating a <strong>dark theme </strong>on that</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="842" height="92" class="wp-image-4319 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image8-1.png" alt="jquery mobile themeroller colorpicker" srcset="https://devgrow.com/wp-content/uploads/2022/10/image8-1.png 842w, https://devgrow.com/wp-content/uploads/2022/10/image8-1-300x33.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image8-1-768x84.png 768w" sizes="(max-width: 842px) 100vw, 842px" /></figure>



<p>Using the <strong>color palette </strong>shown above, simply drag and drop the colors into the <strong>letter A </strong>to create your desired theme <strong>A</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="623" class="wp-image-4318 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image18-1024x623.png" alt="adding dark theme in themeroller swatch A" srcset="https://devgrow.com/wp-content/uploads/2022/10/image18-1024x623.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image18-300x183.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image18-768x467.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image18.png 1196w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>The final result for a dark theme looks like the one above. You can leave the theme letters <strong>B </strong>and <strong>C </strong>empty for now as we will only be needing the single dark theme present in the letter <strong>A</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="546" height="58" class="wp-image-4317 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image9-1.png" alt="downloading the theme zip file from themeroller" srcset="https://devgrow.com/wp-content/uploads/2022/10/image9-1.png 546w, https://devgrow.com/wp-content/uploads/2022/10/image9-1-300x32.png 300w" sizes="(max-width: 546px) 100vw, 546px" /></figure>



<p>From the menu above, simply click on the <strong>download </strong>theme zip file and copy the <strong>themes </strong>folder into your project directory as shown example below</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="325" height="103" class="wp-image-4316 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image16.png" alt="adding the themes folder in jquery mobile project " srcset="https://devgrow.com/wp-content/uploads/2022/10/image16.png 325w, https://devgrow.com/wp-content/uploads/2022/10/image16-300x95.png 300w" sizes="(max-width: 325px) 100vw, 325px" /></figure>



<p>Then, we simply need to add the below lines in the beginning of the <strong>&lt;head&gt; </strong>tag to link these themes into the <strong>index.html </strong>file</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="837" height="140" class="wp-image-4315 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image17.png" alt="linking the themeroller files to the jquery mobile project " srcset="https://devgrow.com/wp-content/uploads/2022/10/image17.png 837w, https://devgrow.com/wp-content/uploads/2022/10/image17-300x50.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image17-768x128.png 768w" sizes="(max-width: 837px) 100vw, 837px" /></figure>



<p>Then, simply add <strong>data-theme= “a” </strong>attribute to the <strong>&lt;body&gt; </strong>tag to enable <strong>site-wide darktheme!</strong></p>



<h2 class="wp-block-heading" id="h.fkthx1yb75m5"><strong>Bonus: Adding Plugins to jQuery Mobile App &#8211; ( jCollapsible Comments )  </strong></h2>



<p>This is an optional section for people who are interested in learning more about adding <strong>custom plugins </strong>in <strong>jQuery Mobile</strong></p>



<p>After completing the <strong>Game Survey Web App </strong>above, we’ll be making a <strong>simple demo </strong>that will make use of the <strong>jCollapsible Plugin</strong>.</p>



<p>This plugin essentially converts an <strong>HTML List </strong>to a <strong>properly formatted comment thread</strong> with only a few lines of code</p>



<ul>
<li>Firstly, download the <strong>jCollapsible.js </strong>file using the <a href="https://www.google.com/url?q=https://web.archive.org/web/20160313020501/http://demos.devgrow.com/jcollapsible/jCollapsible.js&amp;sa=D&amp;source=editors&amp;ust=1664621554579484&amp;usg=AOvVaw0Olof7VVx0lE1-5njblIWd">following link</a></li>
<li>Move the downloaded javascript file to your project folder</li>
</ul>



<p>Let’s create a <strong>sample comment section </strong>with <strong>HTML lists </strong>using the code below</p>



<pre class="wp-block-code"><code>  &lt;ul id="comments"&gt;
     &lt;li&gt;
       This video was really good!
       &lt;ul&gt;
         &lt;li&gt;Yes I Agree!&lt;/li&gt;
         &lt;li&gt;Me too!&lt;/li&gt;
       &lt;/ul&gt;
     &lt;/li&gt;
     &lt;li&gt;Inspiring..&lt;/li&gt;
     &lt;li&gt;Could have been better&lt;/li&gt;
   &lt;/ul&gt;</code></pre>



<p>The above code should return an output similar to the one shown below.</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="280" height="152" class="wp-image-4314 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image6-1.png" alt="" /></figure>



<p>To make the comment section collapsible, we simply add the <strong>jQuery Collapsible </strong>plugin and use the <strong>.collapsible() </strong>method like shown below</p>



<pre class="wp-block-code"><code>    &lt;script src="./jCollapsible.js"&gt;&lt;/script&gt;
   &lt;script&gt;
     $("#comments").collapsible();
   &lt;/script&gt;</code></pre>



<p>The above code should make the <strong>#comments </strong>section collapsible giving the following result</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="624" height="270" class="wp-image-4313 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image4.gif" alt="" /></figure>



<h2 class="wp-block-heading" id="h.nyckoc3mfhfn"><strong>Conclusion</strong></h2>



<p>Congratulations on coming this far and completing this journey of learning <strong>jQuery Mobile</strong>. In this tutorial we discussed a wide range of topics such as <strong>Sliders, Radio Buttons, Checkboxes, Switches, Buttons, Popus </strong>and even <strong>Pages</strong>. We also learnt a little bit about <strong>theming </strong>and adding dark themes in <strong>jQuery Mobile</strong>.</p>



<p>However, do not consider <strong>jQuery Mobile </strong>to be limited to what we discussed today as there is a lot more to learn from their <a href="https://www.google.com/url?q=https://api.jquerymobile.com/1.4/&amp;sa=D&amp;source=editors&amp;ust=1664621554587899&amp;usg=AOvVaw1Wae-LmH5fk5Inzvg4SUFx" target="_blank" rel="noopener">official documentation</a> and this tutorial was only intended to give you enough information so that you can learn the rest on your own</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="916" height="211" class="wp-image-4312 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image10-1.png" alt="jquery mobile depreciation notice" srcset="https://devgrow.com/wp-content/uploads/2022/10/image10-1.png 916w, https://devgrow.com/wp-content/uploads/2022/10/image10-1-300x69.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image10-1-768x177.png 768w" sizes="(max-width: 916px) 100vw, 916px" /></figure>



<p>Another important thing to note is that <strong>jQuery Mobile </strong>is no longer supported and it has been that way for a long time since 2014-2015. However, there are still tons of mobile websites that still make use of this library. While it is good to know about it, it is definitely not recommended to start a new <strong>jQuery Mobile project </strong>especially in 2022.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://devgrow.com/mobile-web-dev-using-jquery-mobile/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>7 Awesome UI Kits for Figma</title>
		<link>https://devgrow.com/ui-pack/</link>
					<comments>https://devgrow.com/ui-pack/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 05 Jan 2023 08:08:58 +0000</pubDate>
				<category><![CDATA[All Posts]]></category>
		<guid isPermaLink="false">https://devgrow.com/?p=741</guid>

					<description><![CDATA[In the tech world, in almost every field we have strived for making workflows easier by focusing our attention on optimizing the process and building tools that make our jobs easier. For example, developers have tools called frameworks/libraries that prevent them from re-inventing the wheel over and over again and helps them write less code. Similarly, UI/UX designers also have UI Kits or UI Packs that help them in designing the User Interfaces and Prototypes quickly. Most of these UI Kits have reusable components such as buttons, input elements, headings etc… so that they don’t have to recreate them over and over again for every single use case. Do you need a UI Kit or…]]></description>
										<content:encoded><![CDATA[
<p>In the tech world, in almost every field we have strived for making workflows easier by focusing our attention on <span class="c0">optimizing </span>the process and building tools that make our jobs easier. For example, developers have tools called <span class="c0">frameworks/libraries </span><span class="c1">that prevent them from re-inventing the wheel over and over again and helps them write less code.</span></p>



<p>Similarly, <span class="c0">UI/UX </span>designers also have <span class="c0">UI Kits or UI Packs </span>that help them in designing the <span class="c0">User Interfaces </span>and <span class="c0">Prototypes </span>quickly. Most of these <span class="c0">UI Kits </span>have reusable components such as <span class="c0">buttons, input elements, headings </span><span class="c1">etc… so that they don’t have to recreate them over and over again for every single use case.</span></p>



<h2 class="wp-block-heading" id="h.v9tf7g30prd3"><span class="c18 c0">Do you need a UI Kit or UI Pack?</span></h2>



<p>Some of you might be hesitant to spend money on a <span class="c0">UI Kit </span><span class="c1">and worry about disrupting your current workflow.</span></p>



<p>But the truth is, even though <span class="c0">UI Kits </span><span class="c1">might slow you down a little at the start – just like learning anything new does, overtime they save you so much time and money compared to the initial investment you have to put in.</span></p>



<p>The only situation where it’s <span class="c0">not recommended </span>to purchase a UI Kit is when you’re just getting started on learning <span class="c0">UI/UX Design </span>or <span class="c0">Figma</span></p>



<p>But for most working professionals in <span class="c0">UI/UX </span><span class="c1">UI Kits cannot be recommended enough.</span></p>



<p>With that out of the way, here are <span class="c0">Top 7 UI Kits for Figma</span></p>



<h2 class="wp-block-heading" id="h.xcxz03y0r2qo"><span class="c15 c0"><a class="c8" href="https://www.google.com/url?q=https://www.untitledui.com/&amp;sa=D&amp;source=editors&amp;ust=1664618010423571&amp;usg=AOvVaw1TthjbAcx1m4-dZ5NoOOTq" target="_blank" rel="noopener">UntitledUI</a></span><span class="c0"> </span>&#8211; ( <span class="c0">199$ </span>with <span class="c0">FREE Version </span><span class="c18 c20">)</span></h2>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="471" class="wp-image-4293 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image2-1024x471.png" alt="untitled ui kit " srcset="https://devgrow.com/wp-content/uploads/2022/10/image2-1024x471.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image2-300x138.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image2-768x354.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image2-1536x707.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image2.png 1914w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>&nbsp;</p>



<p><span class="c0">Untitled UI </span>is one of the leading <span class="c0">UI Kit Design Systems </span>for Figmawith over <span class="c0">1000+ 5 Star Reviews </span>and over <span class="c0">2000+ Components </span><span class="c1">to use.</span></p>



<p><span class="c1">It comes with the following features</span></p>



<ol>
<li class="c2 li-bullet-0"><span class="c0">30 DAY Money Back Guarantee</span><span class="c1"> </span></li>
</ol>



<p><span class="c1">It’s always good to have a peace of mind that you can return the product anytime and get your money back if it doesn’t seem to fit well for you.</span></p>



<p><span class="c0">UntitledUI </span><span class="c1">provides you with a 30day money back guarantee that should be enough for most people to get an idea of their service.</span></p>



<ol start="2">
<li class="c2 li-bullet-0"><span class="c5 c0">100% Auto Layout Components</span></li>
</ol>



<p><span class="c0">        </span>All of the components provided in <span class="c0">Untitled UI </span>are made keeping in mind <span class="c5 c0">AutoLayout.</span></p>



<p><span class="c0">        </span>If you’ve never heard of it, <span class="c0">Autolayout </span>is essentially a property for figma components that allow them to be <span class="c0">resized </span>and <span class="c0">re-adjusted </span><span class="c1">based on the device screen size</span></p>



<h2 class="wp-block-heading" id="h.k9z36wjctzo"><span class="c15 c0"><a class="c8" href="https://www.google.com/url?q=https://www.thedesignership.com/products/figma-design-system%23section-overview&amp;sa=D&amp;source=editors&amp;ust=1664618010427131&amp;usg=AOvVaw1Wb0c6uh0Xc0UtfgNunBhP" target="_blank" rel="noopener">Shipfaster</a></span><span class="c15 c0"><a class="c8" href="https://www.google.com/url?q=https://www.thedesignership.com/products/figma-design-system%23section-overview&amp;sa=D&amp;source=editors&amp;ust=1664618010427578&amp;usg=AOvVaw2bDxQx_uB1G4-aOaSa15hn" target="_blank" rel="noopener"> UI</a></span><span class="c0 c6"> &#8211; </span><span class="c6">( </span><span class="c0 c6">90$ </span><span class="c6 c11">)</span></h2>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="381" class="wp-image-4294 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image11-1024x381.png" alt="shipfaster ui kit" srcset="https://devgrow.com/wp-content/uploads/2022/10/image11-1024x381.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image11-300x112.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image11-768x286.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image11.png 1299w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>&nbsp;</p>



<p><span class="c0">Shipfaster UI </span>is mainly known for being used by some of the most popular tech giants such as <span class="c0">Zoho, Shopify, CoinmarketCap</span>, <span class="c0">Stripe</span> <span class="c0"> </span><span class="c1">and a lot more..</span></p>



<p>Here are the main features that <span class="c0">Shipfaster</span><span class="c0"> UI </span><span class="c1">provides</span></p>



<ol>
<li class="c2 li-bullet-0"><span class="c5 c0">Over 6000 Customizable Components</span></li>
</ol>



<p><span class="c0">        </span><span class="c1">Shipfaster UI probably has the highest number of customizable components on this list. The more the components, more are the options for design and easier it is to find the exact component that you were looking for</span></p>



<ol start="2">
<li class="c2 li-bullet-0"><span class="c0">Detailed Video &amp; Text Documentation</span></li>
</ol>



<p>This is one of the main features that sets apart <span class="c0">Shipfaster</span><span class="c0"> UI </span>when compared to other <span class="c0">UI Kits </span><span class="c1">available in the market. They have videos &amp; detailed text documentation that demonstrate the working and use-cases of almost every single component.</span></p>



<h2 class="wp-block-heading" id="h.d0p95dalofy7"><span class="c0 c15"><a class="c8" href="https://www.google.com/url?q=https://www.cabanaforfigma.com/&amp;sa=D&amp;source=editors&amp;ust=1664618010430750&amp;usg=AOvVaw1YrnFhH_G0ibAVbaaFbtus" target="_blank" rel="noopener">Cabana</a></span><span class="c0"> &#8211; </span>( <span class="c0">69$ </span><span class="c18 c20">)</span></h2>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="456" class="wp-image-4295 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image7-1024x456.png" alt="cabana ui ki" srcset="https://devgrow.com/wp-content/uploads/2022/10/image7-1024x456.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image7-300x134.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image7-768x342.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image7.png 1364w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>&nbsp;</p>



<p><span class="c0">Cabana </span>aims to create a <span class="c0">performant UI Kit </span><span class="c1">that runs smoothly on every device and is suitable for all designers ranging from beginner to advanced.</span></p>



<p>Most of the <span class="c0">Cabana Components </span>also come with something called <span class="c0">Component Props </span>( similar to <span class="c0">React.js </span><span class="c1">props, if you’ve worked in React before ). These help in customizing the elements easily &amp; quickly</span></p>



<p>Here are the main features that separate cabana from other <span class="c0">UI Kits</span></p>



<ol>
<li class="c2 li-bullet-0"><span class="c5 c0">60 Day Free Trial Without Credit Card</span></li>
</ol>



<p><span class="c0">        </span>With most the <span class="c0">UI Kits </span>either charging you hefty one-time prices or not giving a free trial. <span class="c0">Cabana </span>aims to do things differently by providing a <span class="c0">60 day free trial </span><span class="c1">without requiring a credit/debit card.</span></p>



<ol start="2">
<li class="c2 li-bullet-0"><span class="c5 c0">Starter Templates</span></li>
</ol>



<p><span class="c0">        Cabana </span>realized that it’s quite hard to do creative work when staring at a blank screen. That’s why, it provides designers with simple <span class="c0">starter systems </span>or <span class="c0">templates </span><span class="c1">that help them quickly get started on their work and finish the designs within a few minutes</span></p>



<h2 class="wp-block-heading" id="h.umvaxg4rd3w0"><span class="c0">UI Prep </span>&#8211; ( <span class="c0">79$ </span><span class="c18 c20">)</span></h2>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="834" height="359" class="wp-image-4296 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image6.png" alt="ui prep ui kit" srcset="https://devgrow.com/wp-content/uploads/2022/10/image6.png 834w, https://devgrow.com/wp-content/uploads/2022/10/image6-300x129.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image6-768x331.png 768w" sizes="(max-width: 834px) 100vw, 834px" /></figure>



<p>&nbsp;</p>



<p>Unlike other UI Kits that tend to overload people with thousands of <span class="c0">Components </span>/ <span class="c0">Icons</span>. This particular <span class="c0">UI Kit </span>aims to do the opposite following the philosophy of <span class="c0">“Less is More”</span></p>



<p>Here are a few features of <span class="c0">UI Prep</span></p>



<ol>
<li class="c2 li-bullet-0"><span class="c5 c0">Simplistic &amp; Clean Interface</span></li>
</ol>



<p><span class="c0">        </span>UI Prep focuses on providing the designers with only the <span class="c0">important </span>and <span class="c0">well-designed </span>components. It is probably one of the most <span class="c0">lightweight </span>and <span class="c0">bloat-free </span><span class="c1">UI Kits out there. So if you’re someone who likes minimalism and keeps things simple, this particular UI Kit might be a good fit for you.</span></p>



<ol start="2">
<li class="c2 li-bullet-0"><span class="c0">Supports Light &amp; Dark Themes</span></li>
</ol>



<p>All of the components are designed keeping in mind the <span class="c0">Light and Dark Themes </span><span class="c1">and themes can be easily switched only with a couple of clicks here and there.</span></p>



<h2 class="wp-block-heading" id="h.eug0awawh1a9"><span class="c15 c0"><a class="c8" href="https://www.google.com/url?q=https://antforfigma.com/&amp;sa=D&amp;source=editors&amp;ust=1664618010436236&amp;usg=AOvVaw0Skhl74hI0Z5QrkxvCPrpT" target="_blank" rel="noopener">ANT Design System</a></span><span class="c0"> &#8211; </span>( <span class="c0">99$ </span>)</h2>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="347" class="wp-image-4297 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image4-1024x347.png" alt="ant design system ui kit" srcset="https://devgrow.com/wp-content/uploads/2022/10/image4-1024x347.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image4-300x102.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image4-768x260.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image4.png 1285w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>&nbsp;</p>



<p>This <span class="c0">UI Kit </span>is inspired by the <span class="c0">Ant Design </span>system used in <span class="c0">ReactJS</span>. It aims to provide users with a similar experience on <span class="c0">Figma.</span> This <span class="c0">UI Kit </span>is also available on <span class="c0">Adobe XD</span></p>



<p>Here are a few features of this <span class="c5 c0">UI Kit</span></p>



<ol>
<li class="c2 li-bullet-0"><span class="c5 c0">Easier for Developers to Implement</span></li>
</ol>



<p><span class="c0">        </span>Since this UI Kit was built based on <span class="c0">Ant Design</span>, most of the <span class="c0">UI Component Code </span><span class="c1">is similar to the actual code that developers would write on the frontend. This speeds up the development process incredibly.</span></p>



<ol start="2">
<li class="c2 li-bullet-0"><span class="c5 c0">Exhaustive Documentation</span></li>
</ol>



<p><span class="c0">        </span>Ant design is one of the few <span class="c0">UI Kits </span><span class="c1">that come with a large &amp; exhaustive developer documentation. This makes it easier for developers and beginners who are just starting out.</span></p>



<h2 class="wp-block-heading" id="h.j6t8tnmvsawv"><span class="c15 c0"><a class="c8" href="https://www.google.com/url?q=https://www.lofiwireframekit.com/&amp;sa=D&amp;source=editors&amp;ust=1664618010439410&amp;usg=AOvVaw3QFJED42pcyCEqvPOZzj9i" target="_blank" rel="noopener">Lofi Wireframe Kit</a></span><span class="c0"> &#8211; </span>( <span class="c0">FREE </span><span class="c18 c20">)</span></h2>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="504" class="wp-image-4298 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image1-1024x504.png" alt="lofi wireframe ui kit" srcset="https://devgrow.com/wp-content/uploads/2022/10/image1-1024x504.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image1-300x148.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image1-768x378.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image1-1536x756.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image1.png 1903w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>&nbsp;</p>



<p>Unlike most other prototype philosophies that take time and have many unnecessary details, <span class="c0">Wireframing </span>is a process where the main focus is on building a <span class="c0">blueprint </span><span class="c1">of what the app will actually look like. Here’s an example of what wireframing looks like</span><img decoding="async" title="" src="images/image10.png" alt="" /></p>





<p><img decoding="async" loading="lazy" class=" wp-image-4305 aligncenter" src="https://devgrow.com/wp-content/uploads/2022/10/image10.png" alt="wireframing example" width="1112" height="765" srcset="https://devgrow.com/wp-content/uploads/2022/10/image10.png 2000w, https://devgrow.com/wp-content/uploads/2022/10/image10-300x207.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image10-1024x705.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image10-768x529.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image10-1536x1058.png 1536w" sizes="(max-width: 1112px) 100vw, 1112px" /></p>



<p>As you can see, <span class="c0">Wireframing </span><span class="c1">is more like a brief sketch of the application than a fully working UI prototype.</span></p>



<p>Here are a few features of <span class="c0">Lofi Wireframe Kit</span></p>



<ol>
<li class="c2 li-bullet-0"><span class="c5 c0">One of the Best Wireframing Kits Available</span></li>
</ol>



<p><span class="c0">        </span>With most of the other UI kits geared towards building more complete <span class="c0">UI Designs</span>. There are not a lot of good <span class="c0">UI Kits </span>that exclusively support wireframing. Despite that <span class="c0">Lofi Wireframing Kit </span><span class="c1">made its way around to be the most popular wireframing kit currently</span></p>



<ol start="2">
<li class="c2 li-bullet-0"><span class="c5 c0">FREE for Everyone!</span></li>
</ol>



<p><span class="c0">        </span>This is probably the only <span class="c0">UI Kit </span>on this list that is completely <span class="c0">Free for Everyone. </span>However, if you like the product and want to support the developer &#8211; you can always use the <span class="c0">donate </span><span class="c1">option on their website</span></p>



<h2 class="wp-block-heading" id="h.bbs2g7g0m314"><span class="c15 c0"><a class="c8" href="https://www.google.com/url?q=https://buninux.gumroad.com/l/framesx&amp;sa=D&amp;source=editors&amp;ust=1664618010442582&amp;usg=AOvVaw34tXbKTVSYKrxG8hkhQnSU" target="_blank" rel="noopener">Frames X UI Kit</a></span><span class="c0"> </span>&#8211; ( <span class="c0">99$ </span><span class="c18 c20">)</span></h2>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="515" class="wp-image-4299 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image8-1024x515.png" alt="frames x ui kit" srcset="https://devgrow.com/wp-content/uploads/2022/10/image8-1024x515.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image8-300x151.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image8-768x386.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image8.png 1138w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>&nbsp;</p>



<p><span class="c0">Frames X </span>is a <span class="c0">UI Kit + Ebook </span>that contains thousands of components and <span class="c0">instructions &amp; documentation </span>to make use of these components. It is mainly based on the <span class="c0">Bootstrap Framework. </span>This makes it easier for people familiar with bootstrap to get started with this <span class="c0">UI Kit</span></p>



<p>Here is a list of the features that <span class="c0">Frames X </span><span class="c1">offers</span></p>



<ol>
<li class="c2 li-bullet-0"><span class="c5 c0">More than 5500+ Components</span></li>
</ol>



<p><span class="c0">        </span>The number of components is certainly on par with most of the other popular frameworks. All of these components are completely customizable and support <span class="c0">responsive </span>layouts with the help of <span class="c0">Auto Layout 4.0</span></p>



<ol start="2">
<li class="c2 li-bullet-0"><span class="c5 c0">Built in Chart Library</span></li>
</ol>



<p><span class="c0">        </span>This feature is really helpful if you are looking to design a <span class="c0">Customizable Chart </span>for things such as <span class="c0">Dashboards </span>and <span class="c0">Portfolios. </span>The <span class="c0">Frames X UI Kit </span>comes with more than <span class="c0">200+ </span>blocks for <span class="c0">Charts</span></p>



<h2 class="wp-block-heading" id="h.tlwug2jctb9q"><span class="c0 c18">Tips for Designing for Global Audience</span></h2>



<p>Creating <span class="c0">Internationalized </span><span class="c1">Designs for every single language can quickly turn into a daunting task where you create a new design for every type of audience / demographic.</span></p>



<p>This can get even more complicated when languages such as <span class="c0">Urdu </span>( read from <span class="c0">right to left </span><span class="c1">instead of the standard left-to-right ) come into the picture.</span></p>



<p>To avoid that, most people use a <span class="c0">Figma Plugin </span>that supports <span class="c0">Localization</span><span class="c1">. These plugins allow you to easily create dynamic components with features        that make it easier for them to work with multiple languages</span></p>



<p>As of now, the most popular <span class="c0">Figma Localization Plugin </span>is <span class="c15 c0"><a class="c8" href="https://www.google.com/url?q=https://www.figma.com/community/plugin/818840482503404814&amp;sa=D&amp;source=editors&amp;ust=1664618010446427&amp;usg=AOvVaw1Ta7yaVCUaShgagLav8rEq" target="_blank" rel="noopener">Lokalise</a></span><span class="c5 c0"> </span></p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="592" class="wp-image-4300 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image9-1024x592.png" alt="lokalise wordpress plugin" srcset="https://devgrow.com/wp-content/uploads/2022/10/image9-1024x592.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image9-300x173.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image9-768x444.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image9.png 1123w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>&nbsp;</p>



<p>Here is a quick list of the features that <span class="c0">Lokalise </span><span class="c1">supports</span></p>



<ol>
<li class="c2 li-bullet-0"><span class="c0">Allows Developers, Translator </span>and <span class="c0">Designers </span><span class="c1">to work in the same place</span></li>
<li class="c2 li-bullet-0">Adjusting <span class="c0">Images &amp; Videos </span><span class="c1">depending on the region.</span></li>
<li class="c2 li-bullet-0">Easily transfer <span class="c0">translated </span>texts from <span class="c0">Lokalise</span> to <span class="c0">Figma </span><span class="c1">and vice versa</span></li>
<li class="c2 li-bullet-0">Quickly switch between multiple languages in figma to adjust the designs</li>
</ol>



<p>However, if you’re not interested in trying out paid options such as <span class="c0">Lokalize, </span><span class="c1">you can always open up figma plugin search and choose from a ton of free options like shown below</span></p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="586" class="wp-image-4301 aligncenter" title="" src="https://devgrow.com/wp-content/uploads/2022/10/image5-1024x586.png" alt="wordpress internationlization plugins list" srcset="https://devgrow.com/wp-content/uploads/2022/10/image5-1024x586.png 1024w, https://devgrow.com/wp-content/uploads/2022/10/image5-300x172.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image5-768x440.png 768w, https://devgrow.com/wp-content/uploads/2022/10/image5-1536x880.png 1536w, https://devgrow.com/wp-content/uploads/2022/10/image5.png 1884w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>&nbsp;</p>



<h2 class="wp-block-heading" id="h.20e3mq4zlurj"><span class="c0">Conclusion</span></h2>



<p>Choosing the right <span class="c0">UI Kit </span>can be a daunting task, especially for people just getting started and are on a strict budget. Hopefully, this article helped you in realizing the utilities &amp; time savings that a <span class="c0">Good UI Kit </span>can provide you with. However, if you’re still hesitant to spend money &#8211; it’s a good idea to explore options such as <span class="c0">Untitled UI, Cabana </span>or <span class="c0">Lo Fi Wireframe Kit</span><span class="c1"> that are either completely free or come with a free trial.</span></p>



<p>If you liked this article and it helped you in finding your dream <span class="c0">UI Kit</span>, do share it with your friends!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://devgrow.com/ui-pack/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>7 Awesome Animated Buttons using pure CSS [Turorial &#038; Exercises ]</title>
		<link>https://devgrow.com/perfect-css3-buttons/</link>
					<comments>https://devgrow.com/perfect-css3-buttons/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 05 Jan 2023 08:08:32 +0000</pubDate>
				<category><![CDATA[All Posts]]></category>
		<guid isPermaLink="false">https://devgrow.com/?p=735</guid>

					<description><![CDATA[It would not be an exaggeration to say that buttons are the most important part of any website. Think about it, almost any website you visit presents you with a Sign up / Login Button or maybe a Get Started button at first. If we can enhance the way that buttons work, by let’s say adding animations or 3d effects on button hovering and clicking. This would make the website feel a lot more interactive and adds a little bit of fun element to the user experience. In this tutorial, we’ll be having a look at creating 7 Animated Button Styles using only css. This may be helpful for web designers looking for a new perspective on button…]]></description>
										<content:encoded><![CDATA[
<p>It would not be an exaggeration to say that buttons are the most important part of any website. Think about it, almost any website you visit presents you with a <strong>Sign up / Login Button </strong>or maybe a <strong>Get Started </strong>button at first.</p>



<p>If we can enhance the way that buttons work, by let’s say adding <strong>animations </strong>or <strong>3d effects </strong>on button <strong>hovering </strong>and <strong>clicking</strong>. This would make the website feel a lot more interactive and adds a little bit of fun element to the user experience.</p>



<p>In this tutorial, we’ll be having a look at creating <strong>7 Animated Button Styles </strong>using <strong>only css</strong>.</p>



<p>This may be helpful for <strong>web designers</strong> looking for a <strong>new perspective</strong> on button styles, and most importantly for new <strong>web developers</strong> looking to make their websites <strong>creative</strong> &amp; good.</p>



<h2 class="wp-block-heading" id="h.87yv4r2el9hl"><strong>The 7 Button Styles using CSS Animations</strong></h2>



<p>Before moving ahead and working on making the <strong>Animated Buttons</strong>, let’s have a look at the final product that we will be building.</p>



<ol>
<li><strong>Rainbow Animated Button</strong></li>
</ol>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" class="aligncenter wp-image-4388" src="https://devgrow.com/wp-content/uploads/2022/10/image1.gif" alt="rainbow animated button" width="640" height="190" /></figure>



<p>This button has a <strong>Rainbow Gradient </strong>on the <strong>Border </strong>that covers the entire button as soon as the user <strong>hovers over it</strong>.</p>



<ol start="2">
<li><strong>Rotating Border Animation</strong></li>
</ol>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" class="aligncenter wp-image-4387" src="https://devgrow.com/wp-content/uploads/2022/10/image3.gif" alt="rotating border animation button" width="602" height="194" /></figure>



<p>In the inactive state, this button is a simple button with <strong>black text </strong>and <strong>black borders</strong>. But after a user <strong>hovers </strong>on the button, the <strong>border turns red </strong>starting from <strong>top left </strong>making a full rotation.</p>



<ol start="3">
<li><strong>Flipping 3D Button Animation</strong></li>
</ol>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" class="aligncenter wp-image-4386" src="https://devgrow.com/wp-content/uploads/2022/10/image6-1.gif" alt="flipping 3d button animation" width="614" height="204" /></figure>



<p>These types of buttons are useful when there is additional information related to a user action ( for eg, <strong>Terms &amp; Conditions</strong> )</p>



<p>On a <strong>mouse hover</strong>, the button <strong>flips vertically</strong> to reveal the additional content behind the button.</p>



<ol start="4">
<li><strong>Color Filling Button Animation</strong></li>
</ol>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" class="aligncenter wp-image-4385" src="https://devgrow.com/wp-content/uploads/2022/10/image4-2.gif" alt="color filling button animation" width="800" height="184" /></figure>



<p>This animation is probably one of the most widely used button animations, mainly because it looks good and is <strong>easier to implement </strong>than any of the other button animations shown above.</p>



<p>In these buttons, on user <strong>hover</strong> &#8211; the buttons start <strong>filling up</strong> with the <strong>selected color</strong>. The <strong>fill direction </strong>and <strong>starting point</strong> can be chosen according to user preference.</p>



<h2 class="wp-block-heading" id="h.v0ve0it7iuwl"><strong>Prerequisites</strong></h2>



<p>Since there is no javascript involved and we will be learning stuff such as <strong>CSS Animations, Keyframes </strong>and <strong>Transitions </strong>from scratch, the prerequisites are quite minimal.</p>



<ol>
<li><strong>Basic HTML Knowledge </strong>( knowledge about <strong>classes, ids, element tags </strong>etc )</li>
<li>Recommended to have an understanding of <strong>Basic CSS </strong>( importantly, stuff such as <strong>positions, z-index, flexbox </strong>)</li>
</ol>



<p>However, do not worry as you can still go through <strong>most of the tutorial </strong>without having an in-depth knowledge of the concepts mentioned above.</p>



<h2 class="wp-block-heading" id="h.e97x07j029rb"><strong>Installing the Required Tools</strong></h2>



<h3 class="wp-block-heading" id="h.6sv7v0r7kc2a"><strong>IDE ( Optional )</strong></h3>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" class="aligncenter wp-image-4384" src="https://devgrow.com/wp-content/uploads/2022/10/image10-4.png" alt="vs code ide " width="1012" height="506" srcset="https://devgrow.com/wp-content/uploads/2022/10/image10-4.png 1012w, https://devgrow.com/wp-content/uploads/2022/10/image10-4-300x150.png 300w, https://devgrow.com/wp-content/uploads/2022/10/image10-4-768x384.png 768w" sizes="(max-width: 1012px) 100vw, 1012px" /></figure>



<p>Since we’ll be writing code to build a HTML Website we need a Code Editor or an <strong>IDE ( Integrated Development Environment ).</strong></p>



<p>If you don’t know what an <strong>IDE</strong> is, it’s a program which provides features such as <strong>Syntax Highlighting, Error Detection, </strong>and much more.</p>



<p>There are many popular IDE’s on the market ( Sublime text, Atom, Notepad++, etc )</p>



<p>But for our purposes we’ll be using Visual Studio Code, which has the most features, and is a good choice for both beginners and advanced users</p>



<h3 class="wp-block-heading" id="h.9dh3bhmx3be7"><strong>Browser</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" class="aligncenter wp-image-4383" src="https://devgrow.com/wp-content/uploads/2022/10/image8-1024x576.jpg" alt="google chrome logo" width="1024" height="576" srcset="https://devgrow.com/wp-content/uploads/2022/10/image8-1024x576.jpg 1024w, https://devgrow.com/wp-content/uploads/2022/10/image8-300x169.jpg 300w, https://devgrow.com/wp-content/uploads/2022/10/image8-768x432.jpg 768w, https://devgrow.com/wp-content/uploads/2022/10/image8-1536x864.jpg 1536w, https://devgrow.com/wp-content/uploads/2022/10/image8.jpg 1960w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Any modern browser that can run <strong>standard HTML Websites </strong>such as <strong>Google Chrome </strong>or <strong>Firefox</strong></p>



<h2 class="wp-block-heading" id="h.o3ulljf2f2xb"><strong>Understanding CSS Keyframes, Transitions and Animations</strong></h2>



<p>We can obviously dive right ahead into the code and get started on without understanding any of these concepts, but when you <strong>truly understand </strong>what’s behind the code that’s being written &#8211; it actually feels a lot more fun &amp; interesting and it’s much more likely that you will retain them for a longer period of time.</p>



<h3 class="wp-block-heading" id="h.dystwjz2xnwu"><strong>CSS Transitions</strong></h3>



<p>Let’s say you want to make a <strong>Color Changing Square </strong>that changes its color from <strong>pink </strong>to <strong>blue </strong>whenever the user <strong>hovers over it</strong></p>



<p>Using the knowledge that you already have, you might come up with a solution similar to this..</p>



<pre class="wp-block-code"><code>.square {
 width: 50px;
 height: 50px;
 background: pink;
}

.square:hover {
 background:blue;
}</code></pre>



<ul>
<li>In the above code, we assume an <strong>empty &lt;div&gt; container </strong>has a <strong>class </strong>of <strong>square</strong></li>
<li>Firstly, let’s declare the <strong>dimensions </strong>of the square as <strong>50px </strong>by <strong>50px </strong>using the <strong>height </strong>and <strong>width </strong>properties</li>
<li>Then, we use the <strong>background </strong>property to set the <strong>default background color </strong>of the <strong>square </strong>as <strong>pink</strong></li>
<li>We then make use of the <strong>:hover </strong>selector to change the <strong>background color </strong>of the <strong>square </strong>to <strong>blue </strong>whenever the mouse hovers over the square</li>
</ul>



<p>Sounds simple right? On running the above code, you should get a result like this:</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" class="aligncenter wp-image-4382" src="https://devgrow.com/wp-content/uploads/2022/10/image7-1.gif" alt="simple css transitions" width="800" height="215" /></figure>



<p>The above result might seem quite odd to you, especially the people who were expecting a <strong>smooth transition </strong>between the colors <strong>pink </strong>and <strong>blue</strong></p>



<p>But there is a way to make this <strong>smooth transition </strong>to work, by using the &#8211; you guessed it &#8211; <strong>transition </strong>property!</p>



<p>The <strong>transition </strong>property takes <strong>4 optional arguments</strong></p>



<pre class="wp-block-code"><code>{
transition: property-name duration type delay;
}</code></pre>



<p>Let’s try to apply a simple <strong>transition </strong>to the <strong>square element </strong>above.</p>



<pre class="wp-block-code"><code>{
transition: background 0.25s ease 0s;
}</code></pre>



<p>The above transition property essentially states that:</p>



<p>“<em>A </em><strong><em>Smooth Transition </em></strong><em>should occur whenever there is a </em><strong><em>change </em></strong><em>in the </em><strong><em>background </em></strong><em>property, this transition should last </em><strong><em>0.25seconds </em></strong><em>and have a </em><strong><em>delay </em></strong><em>of </em><strong><em>0 seconds</em></strong><em>”</em></p>



<p>Each of these transitions have an <strong>optional type parameter</strong>. This essentially provides instructions on <strong>how those 0.25 seconds </strong>are spent.<strong> </strong>The <strong>important possible</strong> <strong>values </strong>are</p>



<ol>
<li><strong>Ease </strong>( default ) &#8211; the animations <strong>start</strong> <strong>slow &amp; end slow</strong> but are fast in between</li>
<li><strong>Linear </strong>&#8211; the transition <strong>does not change speed </strong>and goes in a constant linear fashion.</li>
</ol>



<p>However, for most <strong>short transitions </strong>( below <strong>0.5 seconds </strong>) this does not matter as it’s hardly noticeable by an <strong>average user </strong>on a <strong>mid-range monitor.  </strong></p>



<p>Applying the above transition on the square, the results are</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" class="aligncenter wp-image-4381" src="https://devgrow.com/wp-content/uploads/2022/10/image2.gif" alt="simple css animated transitions" width="800" height="212" /></figure>



<p>The above <strong>transition </strong>looks much more <strong>smooth </strong>and <strong>polished </strong>compared to what we did previously.</p>



<p>If you’d like to learn more <strong>in-depth </strong>information about <strong>CSS Transitions</strong> you can follow the <strong>MDN </strong>( Mozilla Developer Network )’s <strong>Free Documentation </strong>at the following link</p>



<p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transition" target="_blank" rel="noopener">https://developer.mozilla.org/en-US/docs/Web/CSS/transition</a></p>



<h3 class="wp-block-heading"><strong>CSS Keyframes</strong></h3>



<p>For simple <strong>one-step animations </strong>such as <strong>changing the color </strong>or <strong>filling up the button</strong>, making use of <strong>CSS Transitions </strong>should be enough.</p>



<p>But coming to <strong>complex animations </strong>such as the <strong>Rotating Border Animation </strong>or any <strong>multi step animation </strong>in general, the easiest way to accomplish those is to use <strong>Keyframes</strong>.</p>



<p>Rather than explaining what a <strong>keyframe </strong>is, here’s the <strong>keyframe code </strong>required for the following <strong>multistep animation</strong></p>



<h4 class="wp-block-heading" id="h.9srfr3y4rbvh"><strong>Multi Step Animation</strong></h4>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" class="aligncenter wp-image-4380" src="https://devgrow.com/wp-content/uploads/2022/10/image9-2.gif" alt="css multistep animation using keyframes" width="373" height="315" /></figure>



<h4 class="wp-block-heading" id="h.gv93q9db1838"><strong>Keyframes Code</strong></h4>



<pre class="wp-block-code"><code>@keyframes anim {
 0% {
   width: 50px;
   height: 50px;
   background:pink;
 }
 33% {
   width: 100px;
   height: 50px;
   background: pink;
 }
 66% {
   height: 100px;
   width: 100px;
   background:pink;
 }
 100% {
   height: 100px;
   width: 100px;
   background: blue;
 }
}</code></pre>



<p>The above <strong>multi-step </strong>animation, has <strong>4 steps</strong></p>



<ol>
<li>The <strong>Initial 50&#215;50 Pink Square</strong></li>
<li>The <strong>width </strong>of this square is <strong>increased to 100px</strong></li>
<li>The <strong>height </strong>of this square is <strong>increased to 100px</strong></li>
<li>The <strong>background color </strong>is changed<strong> </strong>from <strong>pink to blue</strong></li>
</ol>



<p>If you observe closely, the <strong>keyframes code </strong>represent <strong>exactly the same 4 steps.</strong></p>



<p>Basically, a <strong>keyframes </strong>is a <strong>collection of individual frames </strong>and the <strong>time at which that frame is displayed</strong></p>



<p>So the above code can be understood as,</p>



<ul>
<li>At <strong>0% </strong>of the time, ( initial position ) &#8211; show a <strong>square </strong>of <strong>pink background </strong>having a <strong>width </strong>and <strong>height </strong>of <strong>50px</strong></li>
<li>At <strong>33% </strong>or <strong>1/3rd </strong>of the time &#8211; show a <strong>rectangle </strong>of <strong>pink background </strong>having a  <strong>width of 100px </strong>but a height of <strong>100px</strong></li>
<li>At <strong>66% </strong>or <strong>2/3rd </strong>of the time &#8211; show a <strong>square </strong>of <strong>pink background </strong>and a <strong>width </strong>and <strong>height </strong>of <strong>100px</strong></li>
<li>At the <strong>end of the animation </strong>or <strong>100% </strong>&#8211; show a <strong>square </strong>of <strong>blue background </strong>and a <strong>width </strong>&amp; <strong>height </strong>of <strong>100px</strong></li>
</ul>



<p>As you can see, we are simply specifying what the object should look like at any point of time. The rendering engine is smart enough to automatically <strong>calculate what’s changed </strong>between the current frame and the previous frame ( for eg, in the <strong>second frame </strong>only <strong>width </strong>in increased to <strong>100px </strong>whereas the <strong>height remains same</strong>. )</p>



<p>This allows for optimal rendering and smooth animations.</p>



<h3 class="wp-block-heading" id="h.lfwvkzkexqib"><strong>CSS Animations</strong></h3>



<p>The above <strong>keyframe </strong>has no use on its own, they ( keyframes ) are generally passed to the <strong>animation </strong>property for the animation to happen.</p>



<p>A standard <strong>animation </strong>property takes the following parameters</p>



<pre class="wp-block-code"><code>{
animation: &lt;keyframes name&gt; | animation duration | type | direction | delay ....
}</code></pre>



<p>The <strong>animation </strong>property can take a lot of optional parameters, but for this tutorial, we’ll only need the following</p>



<ol>
<li><strong>Keyframes name</strong> &#8211; Exactly what it sounds like, the <strong>name </strong>of the <strong>keyframes </strong>being used.</li>
<li><strong>Animation Duration </strong>&#8211; the duration of the animation</li>
<li><strong>Direction </strong>&#8211; whether the keyframes should run <strong>forwards </strong>or <strong>backwards</strong></li>
<li><strong>Type &#8211; </strong>Similar to the <strong>types </strong>we discussed in <strong>transitions </strong>( ease, linear, etc  )</li>
<li><strong>Delay </strong>&#8211; The amount of time to wait before starting the animation</li>
</ol>



<p>To make use of the above <strong>@keyframes anim, </strong>we use the following code</p>



<pre class="wp-block-code"><code>{
animation: anim 0.5s ease forwards 0s
}</code></pre>



<h2 class="wp-block-heading" id="h.ka3zgj6icqdh"><strong>Working on the Rainbow CSS Animated Button</strong></h2>



<p>Now that we have understood the basic theory behind the concepts that make up these animations, it’s time to <strong>implement them!</strong></p>



<p>Let’s start by writing the following <strong>HTML </strong>for the <strong>Rainbow Button</strong></p>



<pre class="wp-block-code"><code>      &lt;button class="rainbow-btn"&gt;
       &lt;div class="rainbow-btn-inner"&gt;Click Me!&lt;/div&gt;
     &lt;/button&gt;</code></pre>



<ul>
<li>In the above code, we create a simple button using the <strong>&lt;button&gt; </strong>tag and inside it, add an <strong>inner div </strong>with the text <strong>Click Me!</strong></li>
</ul>



<p>Instead of creating a <strong>Single Element </strong>and adding the <strong>Click Me! </strong>Text, we are going with the above code because the <strong>Rainbow Button </strong>involves having <strong>2 layers</strong></p>



<ol>
<li>The <strong>bottom layer </strong>consists of an <strong>always running </strong>Rainbow animation</li>
<li>This layer is <strong>semi-overlapped </strong>by a <strong>black container </strong>that is just small enough so that only a little part ( the borders ) of the rainbow animation is seen.</li>
<li>This <strong>overlapping layer </strong>become <strong>invisible </strong>on a <strong>mouse hover</strong> which exposes the <strong>complete rainbow </strong>animation underneath</li>
</ol>



<p>Let’s first define what the two layers are and then work on each of them individually</p>



<h3 class="wp-block-heading" id="h.vmtfxfhdyl3j"><strong>The Bottom Layer </strong> &#8211; ( class= “rainbow-btn” )</h3>



<p>The bottom layer should be simple enough, as it is a <strong>constantly running rainbow </strong>animation</p>



<pre class="wp-block-code"><code> .rainbow-btn {
 display: flex;
 justify-content: center;
 align-items: center;
 border: none;
 height: 50px;
 width: 250px;
 border-radius: 10px;
 color: white;
 font-size: 20px;
 background: linear-gradient(
   90deg,
   #ff0000,
   #ff7300,
   #fffb00,
   #48ff00,
   #00ffd5,
   #002bff,
   #7a00ff,
   #ff00c8,
   #ff0000
 );
 animation: bpx 15s linear;
 animation-iteration-count: infinite;
}</code></pre>



<ul>
<li>In the above code, we first get started by declaring the element as <strong>flex </strong>and using <strong>justify-content </strong>and <strong>align-items </strong>to center the <strong>inner black container </strong>( the front layer )</li>
<li>Then, we remove the default button borders by using the <strong>border: none;</strong> property and set the <strong>border-radius </strong>to <strong>10px </strong>to give the button a more rounded look</li>
<li>We then set the <strong>button dimensions </strong>as <strong>250&#215;50</strong> pixels</li>
<li>Since the background is a <strong>rainbow </strong>we use a variation of the following colors</li>
</ul>



<ul>
<li>Violet</li>
<li>Indigo</li>
<li>Blue</li>
<li>Green</li>
<li>Yellow</li>
<li>Orange</li>
<li>Red</li>
</ul>



<ul>
<li>All of these colors can be combined by putting them in the <strong>linear-gradient </strong>property and rotating these colors at any angle ( <strong>45deg </strong>or <strong>90deg </strong>) to make them look better</li>
<li>After that, we make use of the <strong>bpx</strong><strong> keyframe </strong>that is responsible for <strong>moving these colors </strong>across the button to give it an animated look.</li>
<li>Since we want the animation to basically keep running forever, we set the <strong>animation-iteration-count </strong>to <strong>infinite</strong></li>
</ul>



<p>Let’s now create the <strong>bpx keyframe </strong>that we discussed earlier</p>



<pre class="wp-block-code"><code>@keyframes bpx {
 0% {
   background-position-x: 0px;
 }
 100% {
   background-position-x: 10000px;
 }
}</code></pre>



<ul>
<li>To keep the <strong>rainbow colors </strong>changing, we make use of the <strong>background-position-x </strong>property.</li>
<li>This property basically <strong>moves the background </strong>along the <strong>x-axis </strong>( horizontally )</li>
<li>For every iteration of this animation, we move the rainbow background by <strong>10,000px</strong> in <strong>15 seconds</strong>.</li>
<li>After <strong>15 seconds</strong>, the animation keeps repeating itself because we set the iteration count to infinity</li>
</ul>



<h3 class="wp-block-heading" id="h.ku0jp1661cmn"><strong>The Front Layer &#8211; </strong>( Inner Div )</h3>



<p>Writing the <strong>CSS Code </strong>for the <strong>Inner Div </strong>should be pretty simple because it’s only a <strong>black container </strong>that loses the <strong>background color </strong>on <strong>hover</strong></p>



<pre class="wp-block-code"><code>.rainbow-btn-inner {
 background-color: black;
 height: 46px;
 width: 246px;
 border-radius: 10px;
 display: flex;
 justify-content: center;
 align-items: center;
 transition: background-color 0.3s;
}

.rainbow-btn-inner:hover {
 background-color: transparent;
}</code></pre>



<ul>
<li>Firstly, we set the <strong>height </strong>and <strong>width </strong>properties just a little bit less than the <strong>rainbow layer</strong> so that the colors are visible on the border of the black container.</li>
<li>Then, we use <strong>flexbox </strong>properties, <strong>justify-content </strong>and <strong>align-items </strong>to center the inner text, “<strong>Click Me</strong>”</li>
<li>As discussed, we make the <strong>background-color </strong>transparent on hover by using the <strong>:hover </strong>css selector.</li>
<li>To make this <strong>background-color </strong>transition smooth, we make use of the <strong>transition</strong> property and set the duration to <strong>0.3 seconds</strong></li>
</ul>



<p>And that’s it! The <strong>Rainbow Animated </strong>button should now be completely functional.</p>



<h2 class="wp-block-heading" id="h.c1b9szk0q7w3"><strong>Working on the Rotating Border Animation Button</strong></h2>



<p>Just like how we worked on the previous button, let’s start by writing the <strong>HTML Code </strong>for this button</p>



<pre class="wp-block-code"><code>      &lt;button class="translate-btn"&gt;
       &lt;div class="up-transition"&gt;&lt;/div&gt;
       &lt;p class="translate-btn-text"&gt;Click Me!&lt;/p&gt;
       &lt;div class="low-transition"&gt;&lt;/div&gt;
     &lt;/button&gt;</code></pre>



<p>The rotating border button also involves using <strong>two layers</strong></p>



<ol>
<li>The <strong>bottom layer</strong> is just a simple button that contains the <strong>Click Me </strong>text and a <strong>Black Border</strong></li>
<li>The <strong>top layer</strong> consists of <strong>two divs</strong>, the <strong>up-transition </strong>and the <strong>low-transition</strong></li>
<li>These <strong>&lt;div&gt;s </strong>are basically <strong>transparent containers </strong>that only have a <strong>red-border</strong></li>
<li>One such div is placed in the <strong>top left </strong>and the other is placed on the <strong>bottom right</strong></li>
<li>Both of these divs are <strong>initially zero sized </strong>( width &amp; height are 0 )</li>
<li>As soon as the button is hovered, the <strong>top left </strong>div starts expanding in two steps</li>
</ol>



<ol>
<li><strong>Step 1</strong> : Width Increases to 100%</li>
<li><strong>Step 2</strong>: Height Increase to 100%</li>
</ol>



<ol start="7">
<li>Then, the <strong>bottom right </strong>corner starts expanding and follows the exact same steps</li>
<li>Since both the <strong>&lt;div&gt;</strong>s are transparent and only their border is visible, the animation appears like the <strong>border </strong>is rotating starting from top left.</li>
</ol>



<h3 class="wp-block-heading" id="h.nedhrnuytlz1"><strong>The Bottom Layer </strong>( “Click Me!” Text )</h3>



<pre class="wp-block-code"><code>.translate-btn {
 width: 250px;
 height: 50px;
 border: 2px solid black;
 background-color: white;
 font-size: 20px;
 transition: color 0.3;
 position: relative;
}</code></pre>



<ul>
<li>We get started by setting the dimensions of the button to <strong>250 x 50 pixels</strong></li>
<li>As discussed, we set the initial <strong>border color </strong>to <strong>black </strong>and give the button a background color of <strong>white</strong></li>
<li>Then, we increase the <strong>font size </strong>to <strong>20px</strong></li>
<li>Since we are also changing the <strong>font color </strong>of inner text to red, we make use of the <strong>transition </strong>property and set the duration to <strong>0.3 seconds</strong></li>
<li>We also need to set the position type of this element as <strong>relative</strong>, this is because we are positioning the children ( top layer <strong>&lt;div&gt;s </strong>) in positions such as <strong>top-left </strong>and <strong>bottom-right</strong></li>
</ul>



<h3 class="wp-block-heading" id="h.xok6794ys9i5"><strong>The Top Layer</strong></h3>



<pre class="wp-block-code"><code>.up-transition,
.low-transition {
 position: absolute;
 z-index: 1;
}

.up-transition {
 top: -2px;
 left: -2px;
 border-top: 2px solid red;
 border-right: 2px solid red;
}
.low-transition {
 bottom: -2px;
 right: -2px;
 border-bottom: 2px solid red;
 border-left: 2px solid red;
}</code></pre>



<ul>
<li>Firstly, we set the <strong>position type </strong>of these elements to <strong>absolute</strong>. This means that they can be placed <strong>relative </strong>to the <strong>parent container </strong>( the bottom layer )</li>
<li>Since this is the <strong>top layer</strong> and we want it’s <strong>red border </strong>to overlap the existing <strong>black border </strong>of the bottom layer, we set it’s <strong>z-index </strong>to <strong>1</strong></li>
<li>Then, we position the <strong>up-transition &lt;div&gt; </strong>in the <strong>top left </strong>using the <strong>top &amp; left properties </strong>( the <strong>-2px </strong>is so that this layer overlaps the existing 2px wide black border )</li>
<li>Similarly, we position the <strong>low-transition &lt;div&gt; </strong>in the <strong>bottom right </strong>by using the <strong>bottom &amp; right </strong>properties</li>
<li>Lastly, we set <strong>partial borders </strong>for both of these <strong>&lt;div&gt;s </strong>by using the <strong>border-top</strong>, <strong>border-bottom</strong>, <strong>border-right </strong>and <strong>border-left </strong>properties</li>
</ul>



<pre class="wp-block-code"><code>.translate-btn:hover {
 color: red;
}

.translate-btn:hover .up-transition {
 animation: anim1 0.3s ease forwards;
}

.translate-btn:hover .low-transition {
 animation: anim1 0.3s ease 0.3s forwards;
}</code></pre>



<ul>
<li>In the above code, we work on the changes / animations that happen when the user <strong>hovers </strong>over this button</li>
<li>Firstly, the <strong>font color </strong>of the inner text is changed from <strong>Black </strong>to <strong>Red </strong>by using the <strong>color </strong>property</li>
<li>Then, we use the <strong>anim1 </strong>keyframe ( for now let’s assume that it travels the border partially ) for the <strong>top left div </strong>so that the border travels from top left to bottom right in <strong>0.3 seconds</strong></li>
<li>Lastly, after the <strong>anim1 </strong>keyframe runs on the <strong>top left div</strong>, we make the same keyframe run on the <strong>bottom right &lt;div&gt; </strong>( the bottom left div has a delay that waits for the top left &lt;div&gt;’s animation to finish ) so that the entire border turns red</li>
</ul>



<p>Let’s now have a look at the <strong>keyframes </strong>for <strong>anim1 </strong>that we just used</p>



<pre class="wp-block-code"><code>@keyframes anim1 {
 0% {
   height: 0px;
   width: 0px;
 }
 50% {
   width: 248px;
   height: 0px;
 }
 100% {
   width: 248px;
   height: 48px;
 }
}</code></pre>



<ul>
<li>In the above keyframe, we first start with a <strong>zero sized div</strong>, exactly like we discussed earlier</li>
<li>Then, we increase the <strong>width </strong>of this invisible div to simulate that the border is traveling from left to right or right to left</li>
<li>Lastly, we increase the <strong>height </strong>of the invisible div to show a similar effect that the border is traveling from top to bottom or bottom to top.</li>
</ul>



<p>And that’s it! The button should now function exactly the same as shown above.</p>



<h2 class="wp-block-heading" id="h.qqhxck8gipok"><strong>Working on the Flipping 3D Button Animation</strong></h2>



<p>Let&#8217;s get started on writing the <strong>HTML Code</strong> for the <strong>3D Flip Animated Button</strong></p>



<pre class="wp-block-code"><code> &lt;button class="flip-btn"&gt;
       &lt;div class="btn-back"&gt;
         By clicking &amp;thinsp;&lt;a href="#"&gt;here&lt;/a&gt; &amp;thinsp; you confirm your
         subscription
       &lt;/div&gt;
       &lt;div class="btn-front"&gt;Hover me!&lt;/div&gt;
&lt;/button&gt;</code></pre>



<ul>
<li>The above code consists of <strong>two &lt;div&gt;’s </strong>representing the <strong>front </strong>and the <strong>back </strong>of the flippable button.</li>
<li>On the backside of the flippable button, there is a simple text containing a link asking for confirmation of the subscription. Whereas, the frontside contains a simple “<strong>Hover me!” </strong>text.</li>
<li>These two <strong>&lt;div&gt;s </strong>are wrapped inside a parent container called <strong>flip-btn</strong></li>
</ul>



<p>Just like all of the buttons before, this also has <strong>two layers</strong>. But the difference is that, instead of keeping the layers transparent like before, we have <strong>two opaque layers </strong>and we see their content by <strong>flipping the button</strong></p>



<h3 class="wp-block-heading" id="h.d9fi46wgwuqh"><strong>CSS For the Parent Container</strong></h3>



<pre class="wp-block-code"><code>.flip-btn {
 width: 250px;
 height: 50px;
 border: none;
 background-color: transparent;
 transition: all 0.3s;
 position: relative;
}</code></pre>



<ul>
<li>Firstly, we set the dimensions of the parent container to that of a standard button &#8211; <strong>250 x 50 pixels</strong></li>
<li>Then, we turn the parent container invisible by <strong>removing the borders </strong>and making the background transparent</li>
<li>To ensure smooth transitions / flipping, we use the <strong>transition </strong>property</li>
<li>Since we will be positioning the child elements manually, we have to keep the parent container’s position <strong>relative </strong>using the <strong>position: relative;</strong> property</li>
</ul>



<h3 class="wp-block-heading" id="h.stq82u7tnq0m"><strong>Creating the Front and Back Layer</strong></h3>



<h4 class="wp-block-heading" id="h.tone6ddofnd9"><strong>Front Layer</strong></h4>



<pre class="wp-block-code"><code>.btn-front {
 background-color: lightblue;
 height: 100%;
 width: 100%;
 position: absolute;
 top: 0%;
 left: 0%;
 border-radius: 10px;
 border: 2px solid transparent;
 display: flex;
 justify-content: center;
 align-items: center;
}</code></pre>



<ul>
<li>We start by setting the <strong>background-color </strong>to <strong>light blue </strong>and setting the height and width to <strong>100%</strong></li>
<li>Then, we align the front layer to the parent container by using <strong>position: absolute;</strong> and setting the <strong>top &amp; left </strong>distances to <strong>zero</strong></li>
<li>After that, we add a <strong>2px wide border </strong>and set its radius to <strong>10px </strong>to give it a more rounded look.</li>
<li>Lastly, we center the inner content by using <strong>flexbox</strong> and setting <strong>justify-content </strong>and <strong>align-items</strong></li>
</ul>



<h4 class="wp-block-heading" id="h.zebhul62twv6"><strong>Back Layer</strong></h4>



<pre class="wp-block-code"><code>.btn-back {
 position: absolute;
 width: 100%;
 height: 100%;
 background-color: white;
 top: 0%;
 left: 0%;
 transform: rotateX(180deg);
 border: 2px solid lightgrey;

 border-radius: 10px;
 display: flex;
 justify-content: center;
 align-items: center;
}</code></pre>



<ul>
<li>Just like the front layer, we use <strong>position: absolute;</strong> and position the element exactly in the same location as the <strong>front layer</strong>. This is so that these both layers appear to be <strong>glued together</strong> and behave like a single button.</li>
<li>Then, we set the <strong>width </strong>and <strong>height </strong>of this element to <strong>100% </strong>covering the entire button.</li>
<li>Since this layer is on the back, the contents ( for eg, letters ) when flipped, will appear in the opposite direction &#8211; thus making the text unreadable. To avoid this, we internally flip the back layer by <strong>180deg</strong> so that when we actually flip the button, it adds up to <strong>180deg + 180deg = 360deg </strong>which makes the text readable</li>
<li>After this, we center the inner text by using <strong>justify-content </strong>and <strong>align-items </strong>properties provided by flexbox.</li>
</ul>



<h3 class="wp-block-heading" id="h.4qilsnmomq7k"><strong>Adding the 3D Flipping Mechanism</strong></h3>



<pre class="wp-block-code"><code>.flip-btn:hover {
 transform: rotateX(180deg);
}</code></pre>



<p>The flipping part should be relatively simple, as we are just rotating the entire container by <strong>180degrees </strong>on <strong>mouse hover</strong></p>



<ul>
<li>In the above code, we make use of the <strong>rotateX </strong>function that rotates a container <strong>along the x-axis </strong>by any specified angle</li>
</ul>



<p>And that finishes the process of making this button!  If everything went right, your results should match with the one shown above</p>



<h2 class="wp-block-heading" id="h.am36ailjq0xk"><strong>Exercise: Working on the Color Filling Animation Button</strong></h2>



<p>It is possible to make the final button using only the techniques that we learnt above. That’s why it’s best that you try making the final <strong>color filling </strong>button on your own.</p>



<h3 class="wp-block-heading" id="h.op4jw5jj8dmg"><strong>Hint</strong></h3>



<p>This button also involves <strong>two layers</strong></p>



<ul>
<li><strong>First Layer</strong></li>
</ul>



<p>This is simply a <strong>transparent layer </strong>with <strong>colored borders </strong>and <strong>inner text content</strong></p>



<ul>
<li><strong>Background Layer</strong></li>
</ul>



<p>This layer consists of a <strong>container </strong>that is initially <strong>empty </strong>and is gradually filled with color on <strong>hover</strong></p>



<h3 class="wp-block-heading" id="h.ql75us4zlsx4"><strong>Solution</strong></h3>



<h4 class="wp-block-heading" id="h.dnwvt4xqxyka"><strong>HTML Code</strong></h4>



<pre class="wp-block-code"><code>     &lt;div class="fill-buttons"&gt;
       &lt;button class="fill-button"&gt;
         &lt;div class="text-layer"&gt;Fill from Top&lt;/div&gt;

         &lt;div class="bg-layer-top"&gt;&lt;/div&gt;
       &lt;/button&gt;
       &lt;button class="fill-button"&gt;
         &lt;div class="text-layer"&gt;Fill from Right&lt;/div&gt;

         &lt;div class="bg-layer-right"&gt;&lt;/div&gt;
       &lt;/button&gt;
       &lt;button class="fill-button"&gt;
         &lt;div class="text-layer"&gt;Fill from Left&lt;/div&gt;

         &lt;div class="bg-layer-left"&gt;&lt;/div&gt;
       &lt;/button&gt;
       &lt;button class="fill-button"&gt;
         &lt;div class="text-layer"&gt;Fill from Bottom&lt;/div&gt;

         &lt;div class="bg-layer-bottom"&gt;&lt;/div&gt;
       &lt;/button&gt;
     &lt;/div&gt;</code></pre>



<h4 class="wp-block-heading" id="h.2v47nt6cag81"><strong>CSS Code</strong></h4>



<pre class="wp-block-code"><code>.fill-buttons {
 display: flex;
 justify-content: space-between;
 align-items: center;
 flex-wrap: wrap;
}

.fill-button {
 width: 250px;
 height: 50px;
 margin: 5px;
 background-color: transparent;
 border: 2px solid lightgreen;
 position: relative;
}

.text-layer {
 position: absolute;
 top: 0%;
 left: 0%;
 width: 100%;
 height: 100%;
 display: flex;
 justify-content: center;
 align-items: center;
}

.bg-layer-left,
.bg-layer-top {
 position: absolute;
 top: -1px;
 left: -1px;
 background-color: lightgreen;
 z-index: -1;
}

.bg-layer-bottom,
.bg-layer-right {
 position: absolute;
 bottom: -1px;
 right: -1px;
 background-color: lightgreen;
 z-index: -1;
}

.text-layer:hover ~ .bg-layer-left,
.text-layer:hover ~ .bg-layer-right {
 animation: fillh 0.3s ease forwards;
}
.text-layer:hover ~ .bg-layer-top,
.text-layer:hover ~ .bg-layer-bottom {
 animation: fillv 0.3s ease forwards;
}

@keyframes fillh {
 from {
   height: 50px;
   width: 0px;
 }
 to {
   height: 50px;
   width: 249px;
 }
}

@keyframes fillv {
 from {
   height: 0px;
   width: 249px;
 }
 to {
   height: 50px;
   width: 249px;
 }
}</code></pre>



<h2 class="wp-block-heading" id="h.ft397qqzc9fg"><strong>Conclusion</strong></h2>



<p>Congratulations on coming this far and completing this tutorial. Hopefully, you’ve successfully finished the final exercise and really solidified all the concepts that you learnt today. We discussed a lot of topics starting from scratch such as <strong>Animations, Keyframes </strong>and <strong>Transitions</strong>. However, it doesn’t end here, there is a lot more you can explore and tons of other designs to try out. This is especially true once you start working with <strong>Javascript</strong> as it can unlock the possibilities and types of designs that are possible. If you liked this tutorial and learnt something from it, do share it with your friends!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://devgrow.com/perfect-css3-buttons/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!-- plugin=object-cache-pro client=phpredis metric#hits=6425 metric#misses=7 metric#hit-ratio=99.9 metric#bytes=978438 metric#prefetches=205 metric#store-reads=20 metric#store-writes=3 metric#store-hits=216 metric#store-misses=1 metric#sql-queries=8 metric#ms-total=1387.58 metric#ms-cache=25.92 metric#ms-cache-avg=1.1783 metric#ms-cache-ratio=1.9 -->
