cssのみで「キャプテン・レックス」アイコンを作成してみました。
今回も、これが精一杯です。ご了承ください。
「クローン・ウォーズ」と続編のテレビシリーズで結構好きになったキャラクターです。
「クローン・トルーパー」を少しいじればいいかと思ったら結構大変でした。
そしてこのクオリティ・・・。ガッカリですね!公開していいのか悩みました・・・。とりあえず誰も見てないからいいかと・・・思ってます。
今回もcssが、かなりの量になってしまいました。どんどん増えてます。難しいですね・・・
ソース
html
<div id="rex"> <div id="rex_shield"></div> <div id="rex_helmet_left_back"></div> <div id="rex_helmet_right_back"></div> <div id="rex_helmet_left"></div> <div id="rex_helmet_right"></div> <div id="rex_helmet_btm"></div> <div id="rex_helmet_mouth"></div> <div id="rex_helmet_mark_left"></div> <div id="rex_helmet_mark_right"></div> </div>
css
/* ヘルメット */
#rex {
font-size: 100px;
position: relative;
margin: 0 auto;
width: 1.0em;
height: 1.1em;
background-color: #ddd;
border-radius: 0.5em;
}
#rex::before {
position: absolute;
content: "";
top: -0.05em;
left: 0.45em;
width: 0.1em;
height: 0.3em;
background-color: #aaa;
box-shadow: 0 1px 0 2px #ccc;
}
#rex::after {
position: absolute;
content: "";
top: 0.4em;
left: 0;
width: 1.0em;
height: 0.8em;
background-color: #ddd;
}
/* シールド */
#rex_shield {
position: absolute;
top: 0.5em;
left: 0;
width: 1.0em;
height: 0.05em;
background-color: #0378d5;
z-index: 1;
}
#rex_shield::before {
position: absolute;
content: "";
top: 0.05em;
left: 0;
width: 1.0em;
height: 0.5em;
background-color: #111;
}
#clone_troopers_shield::after {
position: absolute;
content: "";
top: -0.55em;
left: 0.45em;
width: 0.1em;
height: 0.3em;
background-color: #ddd;
box-shadow: 0 -1px 0 1px #aaa;
}
/* ヘルメット左 */
#rex_helmet_left_back {
position: absolute;
top: 0.45em;
left: -0.1em;
width: 0.1em;
height: 0.75em;
background-color: #ccc;
border-radius: 0.05em 0 0 0.05em;
z-index: 2;
}
#rex_helmet_left_back::before {
position: absolute;
content: "";
top: -0.5em;
left: 0.05em;
width: 0.05em;
height: 0.5em;
background-color: #aaa;
}
#rex_helmet_left_back::after {
position: absolute;
content: "";
top: -0.6em;
left: 0.05em;
width: 0.3em;
height: 0.1em;
background-color: #bbb;
}
#rex_helmet_left {
position: absolute;
top: 0.6em;
left: 0;
width: 0.45em;
height: 0.35em;
border-top: 0.1em solid transparent;
border-bottom: 0em solid transparent;
border-left: 0.45em solid #0378d5;
z-index: 2;
}
#rex_helmet_left::before {
position: absolute;
content: "";
top: 0;
left: -0.45em;
width: 0.35em;
height: 0.35em;
border-top: 0.1em solid transparent;
border-bottom: 0 solid transparent;
border-left: 0.35em solid #ddd;
}
#rex_helmet_left::after {
position: absolute;
content: "";
top: 0;
left: -0.45em;
width: 0;
height: 0.2em;
border-top: 0.1em solid transparent;
border-bottom: 0em solid transparent;
border-left: 0.35em solid #bbb;
}
/* ヘルメット右 */
#rex_helmet_right_back {
position: absolute;
top: 0.45em;
left: 1em;
width: 0.1em;
height: 0.75em;
background-color: #ccc;
border-radius: 0 0.05em 0.05em 0;
z-index: 2;
}
#rex_helmet_right {
position: absolute;
top: 0.6em;
left: 0.1em;
width: 0.45em;
height: 0.35em;
border-top: 0.1em solid transparent;
border-bottom: 0em solid transparent;
border-right: 0.45em solid #0378d5;
z-index: 2;
}
#rex_helmet_right::before {
position: absolute;
content: "";
top: 0;
left: 0.15em;
width: 0.4em;
height: 0.35em;
border-top: 0.1em solid transparent;
border-bottom: 0em solid transparent;
border-right: 0.35em solid #ddd;
}
#rex_helmet_right::after {
position: absolute;
content: "";
top: 0em;
left: 0.55em;
width: 0;
height: 0.2em;
border-top: 0.1em solid transparent;
border-bottom: 0em solid transparent;
border-right: 0.35em solid #bbb;
}
/* ヘルメット下 */
#rex_helmet_btm {
position: absolute;
top: 1.2em;
left: 0;
width: 0.4em;
height: 0;
border-left: 0.3em solid transparent;
border-right: 0.3em solid transparent;
border-top: 0.2em solid #ddd;
z-index: 3;
}
#rex_helmet_btm::before {
position: absolute;
content: "";
top: -0.35em;
left: 0.05em;
width: 0.3em;
height: 0.4em;
background-color: #006af9;
border-radius: 0 0 0.1em 0.1em;
}
#rex_helmet_btm::after {
position: absolute;
content: "";
top: -0.1em;
left: 0.15em;
width: 0.1em;
height: 0.1em;
background-color: #222;
}
/* 口 */
#rex_helmet_mouth {
position: absolute;
top: 1.05em;
left: 0.25em;
width: 0.4em;
height: 0.4em;
border-top: 0.05em solid #111;
border-left: 0.05em solid #111;
border-bottom: 0.05em solid transparent;
border-right: 0.05em solid transparent;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
border-radius: 0.1em;
z-index: 3;
}
/* マーク左 */
#rex_helmet_mark_left {
position: absolute;
top: 0.2em;
left: 0.2em;
width: 0;
height: 0;
border-left: 0.1em solid transparent;
border-right: 0.1em solid transparent;
border-bottom: 0.2em solid #0378d5;
z-index: 3;
}
#rex_helmet_mark_left::before {
position: absolute;
content: "";
top: 0.05em;
left: -0.1em;
width: 0;
height: 0;
border-left: 0.1em solid transparent;
border-right: 0.1em solid transparent;
border-bottom: 0.2em solid #ddd;
}
#rex_helmet_mark_left::after {
position: absolute;
content: "";
top: 0.2em;
left: -0.25em;
width: 0.1em;
height: 0.05em;
background-color: #ffdd00;
}
/* マーク右 */
#rex_helmet_mark_right {
position: absolute;
top: 0.2em;
left: 0.6em;
width: 0;
height: 0;
border-left: 0.1em solid transparent;
border-right: 0.1em solid transparent;
border-bottom: 0.2em solid #0378d5;
z-index: 3;
}
#rex_helmet_mark_right::before {
position: absolute;
content: "";
top: 0.05em;
left: -0.1em;
width: 0;
height: 0;
border-left: 0.1em solid transparent;
border-right: 0.1em solid transparent;
border-bottom: 0.2em solid #ddd;
}
#rex_helmet_mark_right::after {
position: absolute;
content: "";
top: 0.2em;
left: 0.15em;
width: 0.1em;
height: 0.05em;
background-color: #ffdd00;
}

