Did you know you can use the CSS clip-path property to create any Shapes? Here is a thread to explain it most beginner-friendly way,
π§΅ π
The CSS clip-path helps to clip a region of an HTML element and show it. The outside of the clipped region is hidden.
See the image below. A circular region is clipped from a div of equal height and width. The circle is visible, and the rest is hidden.
π
There are 6 CSS functions to create shapes.
1. circle 2. inset 3. polygon 4. ellipse 5. A clip source using url() 6. path
You need an idea of the coordinate system to use the first 4 functions. It is easy. Just imagine an x and y-axis with an initial coordinate at (0,0).
π
1οΈβ£ circle() - Creates a circular shape.
We specify the position and radius of the circle using the circle() function.
clip-path: circle(70px at 70px 70px) creates a circle with a radius of 70px at the position coordinate (70, 70).
See, you get the full circular shape here
π
Alright, how do you get a quadrant of a circle now, say the bottom-left portion π€?
Here it is,
clip-path: circle(70px at 0 0)
Here we are creating a circle with a 70px radius at the (0, 0) coordinate. Hence only a portion is inside the visible clipped area. Bingo!!!
π
2οΈβ£ inset() - Creates a rectangular shape.
You can specify the top, right, bottom, and left offsets from the edges. Provide a border-radius value for curvy corners.
clip-path: inset(30px) creates a rectangular shape with 30px offset from the edges.
π
3οΈβ£ polygon() - Creates polygonal shape using a set of vertices.
You can go most creative with this function. Provide as many vertex positions as possible to create a shape of your choice.
A picture is worth of thousand words
π
4οΈβ£ ellipse() - Creates elliptical shapes using two radii and a position.
Here is an ellipse with 2 radii 70px and 100px respectively at the position (50%, 50%)
π
5οΈβ£ url() - provide the clip-path elementβs ID as an argument to render an SVG shape.
Let's define a heart shape using SVG and clipPath. Now we can use the ID value of the clipPath element as an argument to the url() function to render this shape.
π
6οΈβ£ path() - We can use the path values directly in the path() to draw the shape.
Here are 15 GitHub repositories for you to Contribute, Get Mentoring, and Learn Open Source
(A Thread) π§΅ β
β Before we start, here are a few callouts:
- Intention is not to make these projects popular.
- The intention is to improve them with contributions.
- At the same time, contributors learn what they aspire to, get mentoring, and complete hactoberfest goals.
It's a WIN-WIN.
β
1οΈβ£ ReactPlay
An app to learn ReactJS with the practice-based model.
Is Communication just about Speaking/Writing in English or any other language?
90% of Dev takes "Communication" for granted, which can be stressful in the long run.
10 tips to get better at it.
(A Thread) π§΅ β
Effective communication is NOT just about the language we speak or write. It's more than that.
Communication is also NOT about you. It's about others understanding you without any misunderstanding.
Here are 10 things I've been practising for years.
β
1) Listen π
- Communication is both ways. You need to listen to react and continue a discussion.
- The moment you stop listening, you are disconnected from the communication.
- Not listening to someone may make them feel low, break trust, and even damage the relationship.
Here are 5 tools to know as the Project Maintainer.
(A THREAD) π§΅ β
First of all,
Open Source Software(OSS) project maintainers are folks who start the project, manage it, make decisions, brainstorm ideas, and work closely with contributors, users, and marketing platforms.
They need tools to automate many basic tasks.
β
1οΈβ£ semantic-release
Automates the release workflow with the next version number, generating the release notes and publishing the package.
A much-needed tool to take away the headache of doing so much manual work on a project.
You don't want to make these 5 mistakes on your resume.
(A THREAD) β
Before we start,
- The intention here is to provide feedback, not to criticize.
- Making resumes and keeping them up-to-date is not easy.
- Reducing mistakes in resumes has higher chances of someone looking into it for a longer time, increasing the chance of getting the job.
1οΈβ£ Bad Formatting
- Make sure the alignments of columns are correct.
- You use a better/readable font.
- Readable texts, links.
- Proper headings.
- Bulleted points.
- People scan your resume at a go. Better formatting helps in doing that.
- Formatting reflects you.
Do you find JavaScript PROMISES and Asynchronous Programming hard to grasp?
Here is a thread with a complete ROADMAP π₯ and curated RESOURCES π to make you comfortable with it.
A Mega Thread π§΅ π
As a beginner, DO NOT jump into Promises directly. Start with an understanding of,
βοΈ Functions
βοΈ Give special attention to Callback Functions and their various usages.
βοΈ Understand the differences between Synchronous and Asynchronous Programming in JavaScript.
[...]
Functions
- A function is a block of code, a self-contained, isolated piece that performs some task.
- With functions, you gain reusability of functionality.
- You can declare, invoke, use it as an argument, return it from another function, and assign it to a variable.
5 Reactjs based CHARTING LIBRARIES I have analyzed last week. Here is my LEARNING from it.
A Thread π§΅ π
Using charts to do Data Visualization may be a typical ask for your web project. I had a similar requirement for a Reactjs project.
I was looking for an Opensource Data Visualization library built with D3.js, and that's when I came across these five.
π
1οΈβ£ Recharts
- Popular with examples, documentation
- Customizable
- Responsive charts
- Utilities like tool-tips, axes, labels are very useful.
- Plenty of OOTB Charts support
- Goes well with React apps using TypeScript