├── .gitignore ├── LICENSE ├── README.md ├── assets ├── bg-boost-desktop.svg ├── bg-boost-mobile.svg ├── bg-shorten-desktop.svg ├── bg-shorten-mobile.svg ├── favicon-32x32.png ├── icon-brand-recognition.svg ├── icon-detailed-records.svg ├── icon-facebook.svg ├── icon-fully-customizable.svg ├── icon-instagram.svg ├── icon-pinterest.svg ├── icon-twitter.svg ├── illustration-working.svg └── logo.svg ├── design ├── desktop-active-states.jpg ├── desktop-design.jpg ├── desktop-preview.jpg ├── mobile-active-states.jpg ├── mobile-design.jpg └── mobile-navigation.jpg ├── index.html ├── script.js ├── style-guide.md └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | # Avoid accidental Sketch file upload 2 | ############################################### 3 | ## Please do not remove line 5 - thanks! 🙂 ## 4 | ############################################### 5 | *.sketch 6 | 7 | # Avoid accidental XD or Figma upload if you convert the design file 8 | ####################################################### 9 | ## Please do not remove lines 11 and 12 - thanks! 🙂 ## 10 | ####################################################### 11 | *.xd 12 | *.fig 13 | 14 | # Avoid your project being littered with annoying .DS_Store files! 15 | .DS_Store 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Sarthak Sachdev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shortly - URL Shortening App 2 | 3 | ## Welcome! 👋 4 | 5 | ## Table of contents 6 | 7 | - [Overview](#overview) 8 | - [The challenge](#the-challenge) 9 | - [How to setup the project](#how-to-setup-the-project) 10 | - [Screenshot](#screenshot) 11 | - [Links](#links) 12 | - [My process](#my-process) 13 | - [Built with](#built-with) 14 | - [What I learned](#what-i-learned) 15 | - [Continued development](#continued-development) 16 | - [Useful resources](#useful-resources) 17 | - [Author](#author) 18 | - [Acknowledgments](#acknowledgments) 19 | 20 | ## Overview 21 | 22 | ### The challenge 23 | 24 | Shortly is a URL shortening app that allows users to shorten any valid URL at the convinience of a click absolutely free of cost 24/7. 25 | 26 | Users should be able to: 27 | - View the optimal layout for the component depending on their device's screen size. 28 | - Receive an error message when the form is submitted if the input field is empty. 29 | - See a list of their shortened links (even after refreshing the browser). 30 | - Copy the shortened link to their clipboard in a single click. 31 | 32 | ### How to setup the project 33 | 34 | To set up the project locally, follow these steps: 35 | 36 | 1. Clone the repository using GitHub Desktop or Git Bash: 37 | ```bash 38 | git clone https://github.com/SartHak-0-Sach/URL-shortening-API_frontend_project.git 39 | ``` 40 | 2. Open the project folder in your code editor. 41 | 3. Run the project using a live server extension or deploy it using Netlify, Vercel, or another web hosting and deployment service. 42 | 43 | ### Screenshot 44 | 45 |  46 | 47 | ### Links 48 | 49 | - Solution URL: [GitHub Repository](https://github.com/SartHak-0-Sach/URL-shortening-API_frontend_project) 50 | - Live Site URL: [Live Site](https://url-shortening-frontend.netlify.app/) 51 | 52 | ## My process 53 | 54 | ### Built with 55 | 56 | - HTML5 57 | - CSS3 58 | - JavaScript 59 | 60 | You will find all the required assets in the `/design` folder. The assets are already optimized. 61 | 62 | There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts. 63 | 64 | ### What I learned 65 | 66 | In this project I got to learn about various aspects of JavaScript like DOM manipulation and using query selectors to change inner text, inner HTML and inner style of elements as shown below- 67 | 68 | ```js 69 | const searhApi = async (value) => { 70 | if (!value || value == "") { 71 | return searchBar.classList.add("error"); 72 | } 73 | button.innerText = "Loading..."; 74 | button.disabled = true; 75 | let apiUrl = "https://api.shrtco.de/v2/shorten"; 76 | let ApiReq = await fetch(apiUrl + `?url=${value}`); 77 | let ApiRes = await ApiReq.json(); 78 | button.innerText = "Shorten it!"; 79 | button.disabled = false; 80 | if (ApiRes.ok) { 81 | searchBar.classList.remove("error"); 82 | const localData = JSON.parse(data); 83 | let obj = { 84 | userInput: value, 85 | shortenUrl: ApiRes.result.full_short_link, 86 | }; 87 | localData.push(obj); 88 | localStorage.setItem("_html", JSON.stringify(localData)); 89 | showHtml(); 90 | } else { 91 | searchBar.classList.add("error"); 92 | if (ApiRes.error_code == 2) { 93 | error.innerText = "invalid Url"; 94 | } else { 95 | error.innerText = ApiRes.error; 96 | } 97 | } 98 | }; 99 | ``` 100 | 101 | ### Continued development 102 | 103 | The continuously learning journey of a programmer never ends. This project made me realize that there are many concepts that I need to work upon including fundamentals like flex-box and its properties, to more complex concepts like working with fetch and async await in javascript. These areas are some that I think I need to work more upon in the upcoming future as they highlight some of the most significant regions of web development that are important for every developer to know of. 104 | 105 | These key points mentioned here will help me grow accountable and consistent towards improving at writing good quality code and be a successful full stack developer one day. 106 | 107 | ### Useful resources 108 | 109 | - [Harkirat Singh course notes](https://github.com/SartHak-0-Sach/harkirat-singh-course_code_and_notes) - I have added notes of all lectures along with code and lecture insights of all weeks along with bonus lectures to help you all as much as I can. 110 | - [My development code and notes](https://github.com/SartHak-0-Sach/cwh-web-dev-playlist_code_and_notes) - These are my notes that I made while working on my development skills in initial days and did these courses. Make sure to star the repository if you like it.✨💫 111 | - [MDN documentation hover state for CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/:hover) - This is an amazing article which helped me finally understand hover states. I'd recommend it to anyone still learning this concept. 112 | 113 | ## Author 114 | 115 | Sarthak Sachdev 116 | - Website - [Sarthak Sachdev](https://itsmesarthak.netlify.app/) 117 | - LeetCode - [@sarthak_sachdev](https://leetcode.com/u/sarthak_sachdev/) 118 | - Twitter - [@sarthak_sach69](https://www.twitter.com/sarthak_sach69) 119 | 120 | ## Acknowledgments 121 | 122 | I feel like the solutions provided on the website and the continuous doubt solving by industry experts on discord for free is something that is unmatched by anyone else and need to be acknowledged for their efforts in improving me as a developer by suggesting the best practices in your respective tech stack. 123 | 124 | ## Got feedback for me? 125 | 126 | I love receiving feedback! I am always looking to improve my code and take up new innovative ideas to work upon. So if you have anything you'd like to mention, please email 'hi' at saarsaach30[at]gmail[dot]com. 127 | 128 | If you liked this project make sure to spread the word and share it with all your friends. 129 | 130 | **Happy coding!** ☺️🚀 131 | -------------------------------------------------------------------------------- /assets/bg-boost-desktop.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/bg-boost-mobile.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/bg-shorten-desktop.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/bg-shorten-mobile.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/URL-shortening-API_frontend_project/7d70117264d76b45f4eb7b333f21c85ed47fc2e7/assets/favicon-32x32.png -------------------------------------------------------------------------------- /assets/icon-brand-recognition.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/icon-detailed-records.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/icon-facebook.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/icon-fully-customizable.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/icon-instagram.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/icon-pinterest.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/icon-twitter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/illustration-working.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /design/desktop-active-states.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/URL-shortening-API_frontend_project/7d70117264d76b45f4eb7b333f21c85ed47fc2e7/design/desktop-active-states.jpg -------------------------------------------------------------------------------- /design/desktop-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/URL-shortening-API_frontend_project/7d70117264d76b45f4eb7b333f21c85ed47fc2e7/design/desktop-design.jpg -------------------------------------------------------------------------------- /design/desktop-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/URL-shortening-API_frontend_project/7d70117264d76b45f4eb7b333f21c85ed47fc2e7/design/desktop-preview.jpg -------------------------------------------------------------------------------- /design/mobile-active-states.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/URL-shortening-API_frontend_project/7d70117264d76b45f4eb7b333f21c85ed47fc2e7/design/mobile-active-states.jpg -------------------------------------------------------------------------------- /design/mobile-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/URL-shortening-API_frontend_project/7d70117264d76b45f4eb7b333f21c85ed47fc2e7/design/mobile-design.jpg -------------------------------------------------------------------------------- /design/mobile-navigation.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/URL-shortening-API_frontend_project/7d70117264d76b45f4eb7b333f21c85ed47fc2e7/design/mobile-navigation.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |50 | Build your brand's recognition and get detailed insights on how 51 | your links are performing. 52 |
53 | 54 |80 | Track how your links are performing across the web with Our 81 | advanced statistics dashboard. 82 |
83 |92 | Boost your brand recognition with each click. Generic links 93 | don’t mean a thing. Branded links help instil confidence in your 94 | content. 95 |
96 |103 | Gain insights into who is clicking your links. Knowing when and 104 | where people engage with your content helps inform better 105 | decisions. 106 |
107 |114 | Improve brand awareness and content discoverability through 115 | customizable links, supercharging audience engagement. 116 |
117 |