Dla poćwiczenia zwojów mózgowych oraz ewentualnej zamiany obecnego logo (np. w mailach) z formy graficznej na wersję tekstową, zrobiłem swoje pierwsze logo w CSS. Póki co sama ikona, nie szperałem, czy font jest gdzieś dostępny (@Adam Boduch?).
Za eksperta się nie mam, więc jeśli ktoś chce się pobawić i zmniejszyć kod, to zapraszam, bo obecnie to nieco przydługi się wydaje.
W kodzie jest ukryty obrazek - eksport .svg sporego rozmiaru z Inkspace - dla porównania (są pomijalne niuanse rzędu pikseli).
Niestety, nie znalazłem sposobu, by wycinanki były przeźroczyste, więc obecnie są białe (większość :after
) co wymusza kolor tła - w tej kwestii ta wersja przegrywa z .png. Może ktoś zna jakieś sztuczki w tej kwestii.
Przydałoby się też pewnie łatwiejsze ustalanie rozmiaru - choć zawsze można transform: scale()
na parencie, ale wolę jednak konkretne wartości.
Zachęcam do poprawek :)
https://jsfiddle.net/d28sygtz/
<html>
<head>
<style>
body {
align-items: center;
background-color: lightgray;
display: flex;
height: 100%;
justify-content: center;
}
img {
position: absolute;
display: none;
}
.icon-4p-background {
background-color: white;
height: 594px;
position: relative;
width: 616px;
}
.icon-4p {
background-color: #97BE0D;
}
.icon-4p:before {
border-radius: 50%;
box-shadow: -69px 0 0 10px #A7A8AA;
content: "";
height: 478px;
left: 87px;
position: absolute;
top: 58px;
width: 478px;
}
.icon-4p:after {
border-radius: 50%;
box-shadow: 80px 0 0 12px #878889;
content: "";
height: 554px;
left: -38px;
position: absolute;
top: 20px;
width: 554px;
}
.icon-4p .level1 {
background-color: inherit;
border-radius: 25px;
height: 100px;
left: 311px;
position: absolute;
top: 123px;
width: 100px;
}
.icon-4p .level1:before {
background-color: inherit;
content: "";
height: 50px;
left: -16px;
position: absolute;
top: 67px;
width: 50px;
}
.icon-4p .level1:after {
background-color: white;
border-radius: 16px;
content: "";
height: 67px;
left: 15px;
position: absolute;
top: 100px;
width: 50px;
z-index: 1;
}
.icon-4p .level2 {
background-color: inherit;
border-radius: 25px;
height: 100px;
left: 227px;
position: absolute;
top: 207px;
width: 100px;
}
.icon-4p .level2:before {
background-color: inherit;
content: "";
height: 25px;
left: 95px;
position: absolute;
top: 65px;
width: 25px;
}
.icon-4p .level2:after {
background-color: white;
border-radius: 16px;
content: "";
height: 50px;
left: 34px;
position: absolute;
top: -50px;
width: 50px;
}
.icon-4p .level3 {
background-color: inherit;
border-radius: 25px 25px 0;
height: 100px;
left: 143px;
position: absolute;
top: 290px;
width: 268px;
}
.icon-4p .level3:before {
background-color: inherit;
content: "";
height: 25px;
left: 64px;
position: absolute;
top: -17px;
width: 25px;
}
.icon-4p .level3:after {
background-color: white;
border-radius: 16px;
content: "";
height: 50px;
left: 34px;
position: absolute;
top: -50px;
width: 50px;
}
.icon-4p .level4 {
background-color: inherit;
border-radius: 0 0 25px 25px;
height: 100px;
left: 311px;
position: absolute;
top: 375px;
width: 100px;
}
.icon-4p .level4:before {
background-color: inherit;
content: "";
height: 25px;
left: -22px;
position: absolute;
top: 11px;
width: 25px;
}
.icon-4p .level4:after {
background-color: white;
border-radius: 16px;
content: "";
height: 50px;
left: -50px;
position: absolute;
top: 15px;
width: 50px;
}
</style>
</head>
<body>
<img src="http://i.imgur.com/kqiJ5xp.png" width="600px">
<div class="icon-4p-background">
<div class="icon-4p">
<div class="level1"></div>
<div class="level2"></div>
<div class="level3"></div>
<div class="level4"></div>
</div>
</div>
</body>
</html>
Dla poćwiczenia zwojów mózgowych
;) zainspirowany http://www.bchanx.com/logos-in-pure-css i tym podobnymi