CSS Battle #11 – Eye of Sauron #909
piotrszymaniec
started this conversation in
CSS Battles
Replies: 5 comments 1 reply
-
My first solution using grid – 600.29 {729}<div class=md id=l></div><div id=lg><div id=sm></div></div><div class=md id=r></div>
<style>
body {
background: #191210;
display: grid;
grid-template: 1fr / 60px 20px 40px 20px 60px;
place-items: center;
margin: 0 30px;
}
div { border-radius: 100%; }
#sm {
position: relative;
width: 50px;
height: 50px;
background: #84271C;
top: 25;
left: 25;
}
#lg {
width: 100px;
height: 100px;
grid-column: 5;
}
.md {
width: 60px;
height: 60px;
rotate: -45deg;
}
.md, #lg { border: 20px solid #ECA03D; }
#l {
grid-column: 2;
border-color: #FFFFFF00 #FFFFFF00 #ECA03D #ECA03D;
}
#r {
grid-column: 6;
border-color: #ECA03D #ECA03D #FFFFFF00 #FFFFFF00;
}
</style>Second attempt using flex and relative positioning – 601.15 {614}<l></l>
<m><div s></div></m>
<r></r>
<style>
body {
background: #191210;
display: flex;
place-items: center;
place-content: center;
}
* {
border-radius: 50%;
position: relative;
}
l, r {
width: 60px;
height: 60px;
border: 20px solid;
border-color: #FFFFFF00 #FFFFFF00 #ECA03D #ECA03D;
}
l {
left: 20;
rotate: -45deg;
}
r {
left: -20;
rotate: 135deg;
}
m {
width: 100px;
height: 100px;
border: 20px solid #ECA03D;
}
[s] {
width: 50px;
height: 50px;
background: #84271C;
left: 25;
top: 25;
}
</style>Second attempt using flex and relative positioning (minified) – 609.18 {396}<l></l><m><div s></div></m><r></r><style>body{background:#191210;display:flex;place-items:center;place-content:center}*{border-radius:50%;position:relative}l,r{width:60;height:60;border:20px solid;border-color:#FFFFFF00#FFFFFF00#ECA03D#ECA03D}l{left:20;rotate:-45deg}r{left:-20;rotate:135deg}m{width:100;height:100;border:20px solid#ECA03D}[s]{width:50;height:50;background:#84271C;left:25;top:25 |
Beta Was this translation helpful? Give feedback.
0 replies
-
first try – 600.11 {860}your cssbattle code here! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Here's my solution from a while ago: Minified – 629.09 {275}<p a b><p><p a><style>body{display:flex;margin:84 50;background:#191210}p{width:50;height:50;background:#84271C;border-radius:25vw;outline:5vw solid#ECA03D;border:solid 25px#191210}[b]{scale:1 -1}[a]{width:0;height:0;margin:36 20;border-width:30;clip-path:inset(-50% -33% 50% |
Beta Was this translation helpful? Give feedback.
1 reply
-
using positions, before & after – 600.25 {773}<div><p></p></div>
<style>
body{
background: #191210;
display: grid;
place-items: center;
}
div {
width: 100px;
height: 100px;
border: 20px solid #ECA03D;
border-radius: 50%;
position: relative;
display: grid;
place-items: center;
}
div::before,div::after{
content: '';
width: 60px;
height: 30px;
position: absolute;
border: 20px solid #ECA03D;
border-top: 0;
}
div::before{
top: 50px;
right: 100px;
border-radius: 0 0 110px 110px;
}
div::after{
top: 0px;
left: 100px;
border-radius: 0 0 120px 120px;
transform: scaleY(-1);
backface-visibility: hidden;
}
p{
width: 50px;
height: 50px;
background: #84271C;
border-radius: 50%;
}
</style> |
Beta Was this translation helpful? Give feedback.
0 replies
-
1st Try – 596.44 {880}/details> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to battle:
Let's battle! ⚔️
Copy the code block below to format your comment on the discussion thread:
What others will see:
This will result in a nice hidden bit like so:
Code Source – score {character count}
Beta Was this translation helpful? Give feedback.
All reactions