Conical gradient in pure CSS
How do I make an conical gradient in pure css?
Color wheel in pure CSS simulating the conical gradient.See my article about this in http://css-tricks.com/conical-gradients-css/. What is a conical gradient in pure css? How do you make a conical gradient in pure css? This script and codes were developed by Shankar Cabus on 24 June 2022, Friday.
Conical gradient in pure CSS - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Conical gradient in pure CSS</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ .wheel, .umbrella, .color { content: ""; position: absolute; border-radius: 50%; left: calc(50% - 7.5em); top: calc(50% - 7.5em); width: 15em; height: 15em;
}
.wheel { overflow: hidden; width: 15em; height: 15em; position: relative;
}
.umbrella { position: relative; -webkit-filter: blur(1.7em); -webkit-transform: scale(1.35);
}
.color, .color:nth-child(n+7):after { clip: rect(0, 15em, 15em, 7.5em);
}
.color:after, .color:nth-child(n+7) { content: ""; position: absolute; border-radius: 50%; left: calc(50% - 7.5em); top: calc(50% - 7.5em); width: 15em; height: 15em; clip: rect(0, 7.5em, 15em, 0);
}
.color:nth-child(1):after { background-color: #9ED110; transform: rotate(30deg); z-index: 12;
}
.color:nth-child(2):after { background-color: #50B517; transform: rotate(60deg); z-index: 11;
}
.color:nth-child(3):after { background-color: #179067; transform: rotate(90deg); z-index: 10;
}
.color:nth-child(4):after { background-color: #476EAF; transform: rotate(120deg); z-index: 9;
}
.color:nth-child(5):after { background-color: #9f49ac; transform: rotate(150deg); z-index: 8;
}
.color:nth-child(6):after { background-color: #CC42A2; transform: rotate(180deg); z-index: 7;
}
.color:nth-child(7):after { background-color: #FF3BA7; transform: rotate(180deg);
}
.color:nth-child(8):after { background-color: #FF5800; transform: rotate(210deg);
}
.color:nth-child(9):after { background-color: #FF8100; transform: rotate(240deg);
}
.color:nth-child(10):after { background-color: #FEAC00; transform: rotate(270deg);
}
.color:nth-child(11):after { background-color: #FFCC00; transform: rotate(300deg);
}
.color:nth-child(12):after { background-color: #EDE604; transform: rotate(330deg);
}
body { background: #f2f2f2; padding: 50px;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="wheel"><ul class="umbrella"><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li><li class="color"></li></ul></div> <script src="js/index.js"></script>
</body>
</html>
Conical gradient in pure CSS - Script Codes CSS Codes
.wheel, .umbrella, .color { content: ""; position: absolute; border-radius: 50%; left: calc(50% - 7.5em); top: calc(50% - 7.5em); width: 15em; height: 15em;
}
.wheel { overflow: hidden; width: 15em; height: 15em; position: relative;
}
.umbrella { position: relative; -webkit-filter: blur(1.7em); -webkit-transform: scale(1.35);
}
.color, .color:nth-child(n+7):after { clip: rect(0, 15em, 15em, 7.5em);
}
.color:after, .color:nth-child(n+7) { content: ""; position: absolute; border-radius: 50%; left: calc(50% - 7.5em); top: calc(50% - 7.5em); width: 15em; height: 15em; clip: rect(0, 7.5em, 15em, 0);
}
.color:nth-child(1):after { background-color: #9ED110; transform: rotate(30deg); z-index: 12;
}
.color:nth-child(2):after { background-color: #50B517; transform: rotate(60deg); z-index: 11;
}
.color:nth-child(3):after { background-color: #179067; transform: rotate(90deg); z-index: 10;
}
.color:nth-child(4):after { background-color: #476EAF; transform: rotate(120deg); z-index: 9;
}
.color:nth-child(5):after { background-color: #9f49ac; transform: rotate(150deg); z-index: 8;
}
.color:nth-child(6):after { background-color: #CC42A2; transform: rotate(180deg); z-index: 7;
}
.color:nth-child(7):after { background-color: #FF3BA7; transform: rotate(180deg);
}
.color:nth-child(8):after { background-color: #FF5800; transform: rotate(210deg);
}
.color:nth-child(9):after { background-color: #FF8100; transform: rotate(240deg);
}
.color:nth-child(10):after { background-color: #FEAC00; transform: rotate(270deg);
}
.color:nth-child(11):after { background-color: #FFCC00; transform: rotate(300deg);
}
.color:nth-child(12):after { background-color: #EDE604; transform: rotate(330deg);
}
body { background: #f2f2f2; padding: 50px;
}
Conical gradient in pure CSS - Script Codes JS Codes
/* See more in http://css-tricks.com/conical-gradients-css/
*/
Developer | Shankar Cabus |
Username | shankarcabus |
Uploaded | June 24, 2022 |
Rating | 4.5 |
Size | 3,548 Kb |
Views | 60,720 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Color Picker in Pure CSS | 5,072 Kb |
Front in Aracaju Logo Pure CSS | 2,581 Kb |
Compass pure CSS | 4,350 Kb |
A Pen by Shankar Cabus | 2,336 Kb |
JusBrasil logo single element | 2,542 Kb |
Flat Progress Bar CSS e HTML | 3,296 Kb |
Single element heart | 2,602 Kb |
Transformers Cube with device orientation | 2,616 Kb |
Guest Post on CSS-Tricks | 6,425 Kb |
Super Mario CSS | 8,335 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Fun animations with CSS3 | Minimalmonkey | 2,360 Kb |
Pure CSS Read More Arrow | Zephyr | 1,747 Kb |
Brown by pure CSS, no image, no javascript | Aaronchuo | 2,652 Kb |
Button shaking | SusanneLundblad | 2,227 Kb |
Flat UI - Checkbox FIX | ARS | 2,663 Kb |
12 DAYS OF XMAS | Proto78 | 2,313 Kb |
We Simplify animation | Meodai | 48,169 Kb |
A Pen by Patrick Cox | Pcridesagain | 2,899 Kb |
Animated Slide Hamburger Mobile Menu | BJack | 2,247 Kb |
CMP5-Opdracht15 | SannevanGastel | 2,733 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!