幅いっぱいの画像に与えるさまざまなCSSグラデーションを簡単に生成できる便利ツール -The Hero Generator
Post on:2020年5月11日
ヒーローヘッダに使用する幅いっぱいの画像に与えるさまざまなグラデーションのスタイルシートを1クリックで生成できるジェネレーターを紹介します。
グラデーションのカスタマイズや自分の画像をアップロードすることもできるので、出来映えを確認しながら生成できます。

The Hero Generator
The Hero Generator -GitHub
使い方は、簡単です。
さっそく試してみました。
ヒーローヘッダに使用されている画像は、「Upload a new image」から画像をアップロードして変更できます。

グラデーションの種類やカラー、タイトルやボタンなどはカスタマイズできます。

カスタマイズ後
カスタマイズが完了した後は、「code」ボタンをクリックするだけで、実装コードが生成されます。

コードの生成
生成されたコードは、下記の通りです。
1 2 3 4 5 |
<section class="masthead" role="img" aria-label="Image Description"> <h1> The Hero Generator </h1> </section> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
.masthead { display: flex; justify-content: center; align-items: center; flex-direction: column; text-align: center; width: 100%; height: 100vh; /* if you don't want it to take up the full screen, reduce this number */ overflow: hidden; background-size: cover; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 45%, rgba(255,255,255,0.65) 100%), url(1.jpeg) no-repeat center center scroll; } h1 { font-style: normal; font-weight: bold; color: #eee; font-size: 11vmin; letter-spacing: 0.03em; line-height: 1; text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.8); margin-bottom: 40px; } |
The Hero Generatorには、さまざまなグラーデションが用意されています。

Gradient Overlay: Circular

Gradient Overlay: Up

Gradient Overlay: Down

Gradient Overlay: ↘

Gradient Overlay: ↗
sponsors