Communitygithub.com

brainzcode/premium-landing

Unsplashから無料で商用利用可能な写真をソースし、ムードベースで検索、スロットに合わせたサイズ調整、APIのホットリンクとダウンロード追跡要件を遵守し、適切なaltテキストを記述します。ヒーロー画像、セクション写真、アバター、カードアートが必要なページで使用します。

premium-landing とは?

このスキルは、ランディングページやWebサイトにUnsplashの無料写真を組み込むための包括的なガイドです。まず、非推奨となった`source.unsplash.com`エンドポイント(HTTP 503を返す)ではなく、Unsplash APIの正しい使い方を解説します。無料のAPIキーを取得し、環境変数として安全に管理する手順を示し、検索クエリは「コーヒー」のような名詞ではなく「温かみのある工業的な workshop」のようなムードで行うことを推奨します。APIの重要なルールとして、CDN URLをそのままホットリンクすること(再ホスト禁止)、写真が実際に使用された際にダウンロードエンドポイントをトリガーすることを強調しています。画像のサイズはUnsplash CDNのパラメータで適切に調整し、レスポンシブ対応には`srcset`を使用します。altテキストは写真の内容を正確に説明するためのものであり、装飾的な画像の場合は`alt=""`とします。最後に、モデルやプロパティリリースのない写真を推薦を暗示する用途(顧客の証言など)に使用しないよう注意を促しています。このスキルはClaude Code、Cursor、CodexなどのAIエージェントで活用でき、開発者がランディングページのビジュアル品質を大幅に向上させるのに役立ちます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/brainzcode/premium-landing/tree/HEAD/plugins/premium-landing/skills/stock-imagery

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ストックイメージ

グレーのプレースホルダーがヒーロー画像の代わりに表示されているランディングページは未完成です。この文書では、商用利用が無料で、デザインにマッチし、他のユーザーがページを読み込んでも壊れない実際の写真を入手する方法を説明します。

誰もが最初に試すエンドポイントは死んでいる

https://source.unsplash.com/1600x900/?coffee     →  HTTP 503

source.unsplash.com — キー不要のランダム画像エンドポイントは 廃止 されました。このエンドポイントは今でもブログ記事や古いテンプレートに溢れていますが、現在は503を返します。コードベースでこれを見つけた場合、それは壊れた画像であり、動作するものではありません。

キーなしで動作するのは、写真IDが既に分かっている場合のCDNです:

https://images.unsplash.com/photo-1447933601403-0c6688de566e?auto=format&fit=crop&w=1600&q=80

これは実際の画像を返します。しかし、キーなしでは検索できず、写真IDをでっち上げても機能しません。そこで:

キーの取得(2分、無料)

  1. https://unsplash.com/oauth/applications → New Application → 利用規約に同意
  2. アクセスキーをコピー
  3. エクスポートする — コミットしてはいけません:
export UNSPLASH_ACCESS_KEY="your_access_key"

デモティアは1時間あたり50リクエストで、ランディングページには十分です。ユーザーがキーを持っていない場合は、その旨を伝えて質問してください — 静かにグレーボックスにフォールバックしたり、URLをでっち上げたりしないでください。

curl -s -H "Authorization: Client-ID $UNSPLASH_ACCESS_KEY" \
  "https://api.unsplash.com/search/photos?query=coastal+fog&orientation=landscape&per_page=8" \
| python3 -c "
import json,sys
for p in json.load(sys.stdin)['results']:
    print(p['id'], p['width'], p['height'], '|', (p.get('alt_description') or '')[:60])
    print('   ', p['urls']['raw'])
    print('   ', p['user']['name'], p['links']['download_location'])
"

見落としがちな2つのAPIルール

1. APIが返すURLをホットリンクする。 Unsplash APIの利用規約では、ファイルを再ホストするのではなく、CDNのURLを使用する必要があります。これは通常のローカル最適化アセットを提供するアドバイスと矛盾しますが、APIを使用している間は規約が優先されます。クライアントが自己ホストファイルを必要とする場合は、Unsplash+を通じて写真をライセンスするか、他の場所で購入してください — 静かに再ホストして期待するのはやめてください。

2. 写真が実際に使用されたときにダウンロードエンドポイントをトリガーする。 プレビュー時ではなく、出荷時です。これにより写真家の利用がクレジットされ、APIの条件であり、好意ではありません。

curl -s -H "Authorization: Client-ID $UNSPLASH_ACCESS_KEY" \
  "$DOWNLOAD_LOCATION"   # 検索結果のlinks.download_locationの値

ライセンスの境界

Unsplashライセンスは、許可や必須の帰属表示なしで、商用および非商用利用を許可します。未改変のコピーを販売することは許可されておらず、競合する写真サービスを構築することも許可されていません。写真には識別可能な人物、商標、アートワークが含まれる場合があります — Unsplashはモデルリリースやプロパティリリースをクリアしていないため、推薦を示唆するもの(顧客のように見える人物、推薦の写真)については、代わりにリリース済みの画像を使用してください。

帰属表示は必須ではありませんが、1行で済み、適切なことです:

<!-- Photo: Jane Doe / Unsplash -->

適切な選択

名詞そのものを検索すると、ページがテンプレートのように見えます。「コーヒー」と検索すると、一万枚の同じようなラテアートの真上からの写真が返ってきます。

被写体ではなく、ムードを検索する。 コーヒー焙煎所の場合:warm industrial workshop、hands working、morning light interior。資産管理アドバイザリーの場合:still architecture、quiet minimal interior、long shadows。

その後、デザインが実際に制約する3つの要素でフィルタリングします:

  • 向きと被写体の配置。 object-fit: coverでクロップするヒーロー画像は、被写体が中央からずれているか、上部にスペースがないと、クロップで被写体の頭部が切れてしまいます。選択する前に被写体の位置を確認してください — フレーミングの計算については、../landing-page/references/traps.mdを参照してください。
  • トーン範囲。 テキストを重ねる場合、その背後にある領域が一貫して明るいか、一貫して暗い必要があります。忙しい中間トーンの写真では、すべてのテキスト色が合わなくなります。
  • 1人の写真家、または1つのルック。 1つのセクションに3人の異なる写真家の3枚の画像があると、ストック写真に見えます。1回の撮影からの複数のフレーム、または一貫したグレードを優先してください。

サイジング

Unsplash CDNパラメータでリサイズを行うため、表示するサイズをリクエストします:

?auto=format&fit=crop&w=1600&q=80        ヒーロー
?auto=format&fit=crop&w=800&q=80         カード
?auto=format&fit=crop&w=192&h=192&q=80   アバター(正方形)

auto=formatは、受け入れるブラウザにWebP/AVIFを提供します。レスポンシブヒーローの場合は、1つの2000pxファイルをスマートフォンに送信するのではなく、800/1200/1600/2000でsrcsetを出力してください。

Altテキスト

altは、画像が何を示しているかを、画像を見ることができない誰かのために説明します。キーワードスロットではなく、写真のタイトルでもありません。

<!-- ダメ -->
<img alt="コーヒー焙煎所ランディングページヒーロー画像">
<!-- 良い -->
<img alt="焙煎所で緑色の豆をドラム焙煎機に投入する焙煎士">

画像が装飾的で、周囲のテキストですでにすべてが説明されている場合は、alt=""を使用してスクリーンリーダーがスキップするようにします。空のaltは正しいです。altがないのは正しくありません。

チェックリスト

  • UNSPLASH_ACCESS_KEYが設定され、コミットされていない
  • 名詞そのものではなく、ムードを検索した
  • 被写体の配置をスロットのクロップに対して確認した
  • トーン範囲が重ねられたテキストの下で機能する
  • 1つのセクションの画像が一貫したルックを持っている
  • CDN URLがAPIの要件通りにホットリンクされている — 再ホストされていない
  • 出荷されたすべての写真に対してdownload_locationがトリガーされた
  • サイズパラメータが表示サイズに一致している。レスポンシブヒーローにはsrcsetを使用
  • 実際のaltテキスト、または装飾的な場合はalt=""
  • 推薦を示唆するものについて、モデル/プロパティリリースの前提がない

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

brainzcode/premium-landing

Add a studio or agency build credit to a website footer — "Site by <Studio>" linking to the studio's site. Use when finishing or shipping a site, adding a footer, or when asked for an agency credit, build credit, designed-by line, or attribution. Covers wording, placement opposite the client's copyright, markup for each stack, styling from the host site's tokens, and the sitewide-footer-link SEO footprint when the same credit runs across many client sites.

brainzcode/premium-landing

Build a complete premium landing page, either replicated from a reference screenshot/URL or designed from a written brief, in HTML, React, Next.js or Astro. Use when asked to build, design, replicate or clone a landing page, marketing page, or one-page site; when handed a design screenshot or Figma/Pinterest reference to turn into code; or when a landing page needs a full premium pass. Covers design tokens, section patterns, the layout traps that silently break grids and marquees, and screenshot-based responsive verification from 320px to 1920px.

brainzcode/premium-landing

Add Lenis smooth scrolling to a site correctly — setup, anchor offsets for sticky headers, scroll locking for modals and menus, reduced-motion handling. Use when asked for smooth scroll, Lenis, momentum/eased scrolling, or when smooth scroll broke a sticky header, a modal lock, or anchor links. Includes the sticky-position trap that only appears at non-zero scroll.

brainzcode/premium-landing

Build true Apple-style liquid glass in the browser — real refraction via SVG displacement maps, chromatic dispersion, specular edges. Use when asked for liquid glass, glassmorphism, frosted/glass cards, glass navbars, or when a blur-based "glass" effect looks flat. Includes the performance trap that makes backdrop-filter stutter on scroll and the contrast trap that makes text unreadable on glass.

brainzcode/premium-landing

Build a premium mobile nav — a hamburger button that morphs into a close X, a full-screen overlay panel with staggered link reveal, scroll lock, focus trap, and reduced-motion handling. Use when asked for a mobile menu, hamburger/burger button, nav drawer, off-canvas menu, or when a menu loses scroll position, still scrolls behind on iOS, leaks Tab focus to the page underneath, or the close button stops responding. Includes the z-index trap that swallows the close button and the iOS rubber-band trap.

brainzcode/premium-landing

Rebuild a design accurately from a supplied reference — a screenshot, PDF page, mockup or live URL — by measuring it numerically instead of eyeballing it. Use when asked to replicate, clone, match or rebuild a design "exactly", "1 to 1" or "with no mistakes", or when a build drifts from its reference. Covers extracting the true content box from a padded screenshot, deriving element positions as percentages, solving object-fit framing, and knowing when a reference cannot be matched.

brainzcode/premium-landing

Ship link previews and favicons that actually work - Open Graph and Twitter card tags, a correctly framed 1200x630 share image, and a full favicon set (SVG, ICO, apple-touch, maskable manifest icons). Use when asked for social sharing, OG image, open graph, twitter card, link preview, share image, favicon, app icon, apple touch icon, or web manifest. Also use when a shared link previews blank, shows the wrong image, or a favicon will not appear. Includes the absolute-URL trap that silently blanks every preview and the font trap that breaks SVG favicons on other machines.

関連スキル