Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 9110

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 28, 20242024-11-28T07:20:09+00:00 2024-11-28T07:20:09+00:00

Building a Shopify App – Day4

  • 60k

Alrighty, kicking off day 4 of my side project with nothing but positive vibes πŸ™ŒπŸΌ

Initial Thoughts

  • This popup needs to be 3-step.
  • First step, customer enters the secret sauce.
  • Second step, we verify if it is indeed the secret sauce πŸ€“
  • Third step, customer gets a discount and we get their secret sauce. Win win πŸŽ‰
  • Need to look at some animation stuff. Because I am thinking of adding an animation when customer move to next step. Something like a Wizard or Multi-step form πŸ€”
  • Not sure how would I achieve this in TailwindCSS.

Jumping into code… πŸ‘¨πŸ½β€πŸ’»

Before that… Googling for multi-step form with TailwindCSS πŸ˜‚

Alright, below link seems like a good starting point πŸ‘‡πŸΌ
https://tailwindcomponents.com/component/multistep-form-with-tailwindcss-and-alpinejs

Jumping into code… Again πŸ‘¨πŸ½β€πŸ’»

Progress

  • I was able to tweak the above snippet according to my requirements and achieve the multi-step concept just yet. Its not fully functional of course. Multi-Step form with TailwindCSS and AlpineJS

Putting the code for this below πŸ‘‡πŸΌ

<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <meta http-equiv="X-UA-Compatible" content="ie=edge">     <title>Discount Popup</title> </head> <body>     <!-- component --> <!-- This is an example component --> <div class="h-screen">      <link rel="stylesheet" href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css">     <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.js" defer></script>      <style>         [x-cloak] {             display: none;         }     </style>      <div x-data="app()" x-cloak>         <div class="container bg-purple-600 py-6 px-5 rounded">             <div class="max-w-3xl mx-auto mb-10">                  <div x-show.transition="step === 'complete'">                     <div class="bg-white rounded-lg p-10 flex items-center shadow justify-between">                         <div>                             <svg class="mb-4 h-20 w-20 text-green-500 mx-auto" viewBox="0 0 20 20" fill="currentColor">  <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>                              <h2 class="text-2xl mb-4 text-gray-800 text-center font-bold">DISCOUNT</h2>                              <div class="text-gray-600 mb-8">                                 Thank you. Enjoy your discount at the checkout.                             </div>                              <button                                 @click="step = 1"                                 class="w-40 block mx-auto focus:outline-none py-2 px-5 rounded-lg shadow-sm text-center text-gray-600 bg-white hover:bg-gray-100 font-medium border"                              >Back to home</button>                         </div>                     </div>                 </div>                  <div x-show.transition="step != 'complete'">                         <div class="text-white py-5 px-5">                         <h1>Hi πŸ‘‹</h1>                         <p>Up for a Discount?</p>                     </div>                      <!-- Step Content -->                     <div class="bg-white py-5 px-5 rounded">                             <div x-show.transition.in="step === 1">                             <div class="mb-5">                                 <label for="firstname" class="font-bold mb-1 text-gray-700 block">Secret Sauce Part 1</label>                                 <input type="text"                                     class="w-full px-4 py-3 rounded-lg shadow-sm focus:outline-none focus:shadow-outline text-gray-600 font-medium border-2"                                     placeholder="Enter your secret sauce... ">                             </div>                              <div class="mb-5">                                 <label for="email" class="font-bold mb-1 text-gray-700 block">Secret Sauce Part 2</label>                                 <input type="text"                                     class="w-full px-4 py-3 rounded-lg shadow-sm focus:outline-none focus:shadow-outline text-gray-600 font-medium border-2"                                     placeholder="Enter your secret sauce...">                             </div>                             <div class="w-1/2">                                 <button                                 @click="step++"                                 class="w-32 focus:outline-none border border-transparent py-2 px-5 rounded-lg shadow-sm text-center text-white bg-blue-500 hover:bg-blue-600 font-medium"                              >Next</button>                         </div>                          </div>                         <div x-show.transition.in="step === 2">                             <div class="mb-5">                                 <label for="profession" class="font-bold mb-1 text-gray-700 block">Verification</label>                                 <input type="text"                                     class="w-full px-4 py-3 rounded-lg shadow-sm focus:outline-none focus:shadow-outline text-gray-600 font-medium border-2"                                     placeholder="Just making sure it belongs to you">                             </div>                             <div class="flex justify-between">                                 <div class="w-1/2">                                     <button                                     @click="step--"                                     class="w-32 focus:outline-none py-2 px-5 rounded-lg shadow-sm text-center text-gray-600 bg-white hover:bg-gray-100 font-medium border"                                  >Go Back</button>                                  </div>                                 <div class="w-1/2 ">                                     <button                                     @click="step = 'complete'"                                     class="w-32 focus:outline-none border border-transparent py-2 px-5 rounded-lg shadow-sm text-center text-white bg-blue-500 hover:bg-blue-600 font-medium"                                  >Verify</button>                             </div>                             </div>                         </div>                     </div>                     <!-- / Step Content -->                 </div>             </div>         </div>     </div>      <script>         function app() {             return {                 step: 1,             }         }     </script> </body> </html> 
Enter fullscreen mode Exit fullscreen mode

Time Spent

1 and half hour


Signing off 😴

P.S.

If anybody ( other than me πŸ˜‚ ) reading it, you might be interested in following me on Twitter. I tweet about Laravel, Shopify and React stuff.

laravelshopifysideprojectswebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 1k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.