ブランジュリ

ブランジュリ

パン屋

クリエイター: 宮崎祐樹

比較的シンプルなパン屋のウェブサイト(トップページ)です。変則的なレイアウトも無く、基本的な技術のみで作られているページです。ドロワー(ハンバーガーメニュー)にjQueryを使用しています。
デザイン見本
ソースコード

HTML / CSS / JS

HTML

<!DOCTYPE html>
<html lang="ja">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/destyle.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap" rel="stylesheet">
    <!-- drawer.css -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/drawer/3.2.2/css/drawer.min.css">
    <link rel="stylesheet" href="css/style.css">
    <title>ブランジュリ</title>
</head>

<body class="drawer drawer--right">
    <header>
        <div class="header-inner">
            <h1>
                ブランジュリ
            </h1>
            <nav class="global-nav-pc">
                <ul class="pc-menu">
                    <li><a href="#">ブランジュリについて</a></li>
                    <li><a href="#">商品一覧</a></li>
                    <li><a href="#">お知らせ</a></li>
                    <li><a href="#">お問合せ</a></li>
                    <li><a href="#">アクセス</a></li>
                </ul>
            </nav>
            <button type="button" class="drawer-toggle drawer-hamburger">
                <span class="sr-only">toggle navigation</span>
                <span class="drawer-hamburger-icon"></span>
            </button>
            <nav class="global-nav-sp drawer-nav" role="navigation">
                <ul class="sp-menu drawer-menu">
                    <li><a href="#">ブランジュリについて</a></li>
                    <li><a href="#">商品一覧</a></li>
                    <li><a href="#">お知らせ</a></li>
                    <li><a href="#">お問合せ</a></li>
                    <li><a href="#">アクセス</a></li>
                </ul>
            </nav>
        </div>
    </header>
    <main>
        <picture>
            <source srcset="img/fv-pc.jpg" media="(min-width: 768px)">
            <img class="main-visual" src="img/fv-sp.jpg" alt="ブランジュリ メイン画像">
        </picture>
        <section class="introduction">
            <h2 class="introduction-heading">焼きたての幸せ、<br class="sp-only">毎日あなたの食卓へ</h2>
            <div class="introduction-text">
                <p>私たちブランジュリは、毎日丁寧に焼き上げる美味しいパンで、皆様の食卓に幸せを届けます。風味豊かな天然酵母を使用し心を込めて焼いたパンは、朝食からおやつまで、どんなシーンにもぴったりです。</p>
            </div>
        </section>
        <section>
            <h2>お知らせ</h2>
            <ul class="news-list">
                <li>
                    <p class="news-list-date">12月15日</p>
                    <p class="news-list-content">年末は30日まで通常営業、31日~1月3日まで休業いたします。年始は1月4日から通常営業いたします。</p>
                </li>
                <li>
                    <p class="news-list-date">12月1日</p>
                    <p class="news-list-content">ブリオッシュ新発売!ひとつ600円です。ぜひご来店ください。</p>
                </li>
                <li>
                    <p class="news-list-date">11月10日</p>
                    <p class="news-list-content">冬の新作パンを発売します。お楽しみに!</p>
                </li>
                <li>
                    <p class="news-list-date">9月3日</p>
                    <p class="news-list-content">秋の新作パンを発売します!ぜひお楽しみに!</p>
                </li>
            </ul>
        </section>
        <section class="recommendation">
            <h2>
                おすすめポイント
            </h2>
            <ul class="recommendation-list">
                <li>
                    <picture>
                        <source srcset="img/point1-pc.jpg" media="(min-width: 768px)">
                        <img src="img/point1-sp.jpg" alt="手作りの味わい">
                    </picture>
                    <h3>手作りの味わい</h3>
                    <p>焼きたての香りと食感で、まるでお家で作ったような温かさを感じていただけます。</p>
                </li>
                <li>
                    <picture>
                        <source srcset="img/point2-pc.jpg" media="(min-width: 768px)">
                        <img src="img/point2-sp.jpg" alt="豊富なラインナップ">
                    </picture>
                    <h3>豊富なラインナップ</h3>
                    <p>定番の食パンやクロワッサンから、季節限定のスペシャルパンまで、豊富な種類をご用意しています。</p>
                </li>
                <li>
                    <picture>
                        <source srcset="img/point3-pc.jpg" media="(min-width: 768px)">
                        <img src="img/point3-sp.jpg" alt="新鮮で安心な素材">
                    </picture>

                    <h3>新鮮で安心な素材</h3>
                    <p>お子様から大人まで、どなたでも安心してお召し上がりいただけます。</p>
                </li>

            </ul>
        </section>
        <section class="products">
            <h2>おすすめ商品</h2>
            <ul class="products-list">
                <li>
                    <picture>
                        <source srcset="img/recommendation1-pc.jpg" media="(min-width: 768px)">
                        <img src="img/recommendation1-sp.jpg" alt="">
                    </picture>
                    <h3>食パン</h3>
                    <p>
                        ふわふわの食感と香ばしい香りが魅力の、究極の食パンを毎日お届け。どんな食卓にもぴったりです。
                    </p>
                    <p class="product-price">
                        一斤500円
                    </p>
                </li>
                <li>
                    <picture>
                        <source srcset="img/recommendation2-pc.jpg" media="(min-width: 768px)">
                        <img src="img/recommendation2-sp.jpg" alt="">
                    </picture>
                    <h3>ブリオッシュ</h3>
                    <p>
                        バターの香りとしっとりした食感が自慢のブリオッシュ。贅沢なひとときをお楽しみいただけます。
                    </p>
                    <p class="product-price">
                        600円
                    </p>
                </li>
                <li>
                    <picture>
                        <source srcset="img/recommendation3-pc.jpg" media="(min-width: 768px)">
                        <img src="img/recommendation3-sp.jpg" alt="">
                    </picture>
                    <h3>クロワッサン</h3>
                    <p>
                        バターの豊かな風味とパリパリの食感がたまらないクロワッサン。朝食の時間に幸せをお届けします。
                    </p>
                    <p class="product-price">
                        250円
                    </p>
                </li>
                <li>
                    <picture>
                        <source srcset="img/recommendation4-pc.jpg" media="(min-width: 768px)">
                        <img src="img/recommendation4-sp.jpg" alt="">
                    </picture>
                    <h3>チョコマフィン</h3>
                    <p>
                        リッチなチョコの風味としっとりとした食感が絶品のチョコマフィン。朝食やおやつに是非どうぞ。
                    </p>
                    <p class="product-price">
                        400円
                    </p>
                </li>
            </ul>
            <a class="detail-button" href="#">もっと見る</a>
        </section>
        <section>
            <h2>営業時間</h2>
            <table class="business-hours-table">
                <tr>
                    <th>月曜日~土曜日</th>
                    <td>9:00 ~19:00</td>
                </tr>
                <tr>
                    <th>日曜日</th>
                    <td>9:00 ~17:00</td>
                </tr>
                <tr>
                    <th>定休日</th>
                    <td>年末年始</td>
                </tr>
            </table>
        </section>
        <section class="access">
            <h2>アクセス</h2>
            <p class="access-address">
                〒000-0000<br>
                東京都〇〇区○○町1-1-1 ○○ビル1F
            </p>
            <div class="access-map">
                <iframe
                    src="https://www.google.com/maps/embed?pb=!1m14!1m12!1m3!1d2555.494311024701!2d139.81445359801464!3d35.69562187909099!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sja!2sjp!4v1738985736990!5m2!1sja!2sjp"
                    width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"
                    referrerpolicy="no-referrer-when-downgrade"></iframe>
            </div>
        </section>
        <section>
            <h2>お問合せ</h2>
            <form action="" class="form">
                <label>
                    <span>お名前</span>
                    <input type="text">
                </label>
                <label>
                    <span>メールアドレス</span>
                    <input type="text">
                </label>
                <label>
                    <span>メッセージ</span>
                    <textarea name="" id=""></textarea>
                </label>
                <button class="form-button">
                    送信
                </button>
            </form>
        </section>
    </main>
    <footer>
        <p>©2024 ブランジュリ All Rights Reserved.</p>
    </footer>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <!-- iScroll -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/iScroll/5.2.0/iscroll.min.js"></script>
    <!-- drawer.js -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/drawer/3.2.2/js/drawer.min.js"></script>

    <script>
        $(document).ready(function () {
            $('.drawer').drawer();
        });
    </script>

</body>

</html>

CSS

@charset "UTF-8";

body {
    font-family: "Noto Sans JP", serif;
    font-optical-sizing: auto;
}

img {
    width: 100%;
}

p {
    font-size: 14px;
    line-height: 1.7;
}

h2 {
    font-size: 24px;
    color: #145004;
    text-align: center;
    font-weight: 300;
}

section {
    padding: 40px 20px;
}

section:nth-of-type(2n-1) {
    background-color: #f6efe8;
}

header {
    background-color: #ab9171;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1220px;
    margin-inline: auto;
}

h1 {
    color: #fff;
    font-size: 24px;
    padding: 11px 23px;

}

nav {
    color: #fff;
}

.global-nav-pc {
    display: none;
}

.sp-menu li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #ddd;
}

.sp-menu li a::after {
    display: block;
    content: "";
    width: 15px;
    height: 15px;
    border-top: 2px solid #ddd;
    border-right: 2px solid #ddd;
    rotate: 45deg;
}

.introduction-heading {
    line-height: 1.5;
}

.introduction-text {
    margin-top: 32px;
}

.introduction-text p {
    font-size: 16px;
}

.news-list {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.news-list li {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

section.recommendation {
    background: #ab9171 url(../img/falling-triangles.png) center top / 24px;
}

section.recommendation h2,
section.recommendation h3,
section.recommendation p {
    color: #fff;
}

.recommendation-list {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.recommendation-list li {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recommendation-list img {
    border-radius: 10px;
    box-shadow: 0 4px 10px #7D5A2F;
}

.recommendation-list h3 {
    font-size: 20px;
}

.products-list {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.products-list li {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.products-list img {
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.products-list h3 {
    font-size: 20px;
}

.product-price {
    font-size: 20px;
}

.detail-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 40px auto 0;
    background-color: #145004;
    color: #fff;
    font-size: 20px;
    padding: 18px;
    border-radius: 60px;
    max-width: 380px;

}

.detail-button::after {
    display: block;
    content: "";
    width: 15px;
    height: 15px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    rotate: 45deg;
}

.business-hours-table {
    width: 100%;
    border: 1px solid #666;
    margin: 32px auto 0;
    max-width: 400px;
}

.business-hours-table th,
.business-hours-table td {
    border: 1px solid #666;
    background-color: #fff;
    padding: 14px 8px;
}

.business-hours-table th {
    font-weight: normal;
    width: 135px;
}

.access {
    padding: 40px 0 0;
}

.access-address {
    display: flex;
    margin-top: 32px;
    justify-content: center;
}

.access-map {
    margin-top: 40px;
}

.access-map iframe {
    width: 100%;
    height: 180px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 590px;
    margin: 32px auto 0;
}

.form label {
    display: block;
}

.form label span {
    display: block;
}

.form input[type="text"],
.form textarea {
    border: 1px solid #C8C8C8;
    background-color: #fff;
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

.form textarea {
    height: 144px;
    resize: vertical;
}

.form-button {
    display: block;
    margin: 16px auto 0;
    text-align: center;
    background-color: #145004;
    color: #fff;
    font-size: 20px;
    padding: 18px 0;
    border-radius: 60px;
    width: 160px;
}

footer {
    padding: 23px;
    background-color: #ab9171;
    color: #fff;
    text-align: center;
}

/* drawer */
.drawer-hamburger {
    padding: 15px .75rem 22px;
}

.drawer-hamburger-icon,
.drawer-hamburger-icon::after,
.drawer-hamburger-icon::before {
    background-color: #fff;
}

.drawer-overlay {
    background-color: rgba(0, 0, 0, .7);
}


@media screen and (768px <=width) {
    .sp-only {
        display: none;
    }

    .global-nav-pc {
        display: block;
    }

    .sp-menu,
    .drawer-hamburger {
        display: none;
    }

    .pc-menu {
        display: flex;
        align-items: center;
    }

    .pc-menu li a {
        display: block;
        padding: 20px 12px;
        transition: background-color 0.6s;
    }

    .pc-menu li a:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }

    .news-list {
        width: fit-content;
        max-width: 794px;
        margin-inline: auto;
    }

    .news-list li {
        flex-direction: row;
    }

    .news-list-date {
        width: 100px;
    }

    .recommendation-list {
        flex-direction: row;
        justify-content: center;
    }

    .recommendation-list li {
        flex: 1;
        max-width: 380px;
    }

    .products-list {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 700px;
        margin-inline: auto;
    }

    .products-list li {
        width: calc(50% - 20px);
    }

    .detail-button {
        transition: background-color 0.2s;
    }

    .detail-button:hover {
        background-color: #0a2a01;
    }

    .access-map iframe {
        height: 250px;
    }

    .form-button {
        transition: background-color 0.2s;
    }

    .form-button:hover {
        background-color: #0a2a01;
    }

}

@media screen and (1024px <=width) {

    p {
        font-size: 16px;
    }

    h2 {
        font-size: 36px;
    }

    section {
        padding: 80px 20px;
    }

    .main-visual {
        height: 600px;
        object-fit: cover;
    }

    .introduction-text {
        margin-top: 56px;
        display: flex;
        justify-content: center;
    }

    .introduction-text p {
        font-size: 20px;
        width: 794px;
    }

    .news-list {
        margin-top: 56px;
        width: auto;
    }

    .news-list li {
        justify-content: space-between;
    }

    .news-list-date,
    .news-list-content {
        font-size: 20px;
    }

    .news-list-content {
        width: 656px;
    }

    .recommendation-list {
        margin-top: 56px;
    }

    .recommendation-list h3 {
        font-size: 24px;
    }

    .products-list {
        justify-content: center;
        max-width: none;
        margin-top: 56px;
    }

    .products-list li {
        width: 100%;
        max-width: 275px;
        flex: 1;
    }

    .detail-button {
        margin: 80px auto 0;
        font-size: 24px;
        padding: 24px;
    }

    .business-hours-table {
        font-size: 24px;
        max-width: 589px;
        margin-top: 56px;
    }

    .business-hours-table th {
        width: 210px;
        padding: 16px;
    }

    .business-hours-table td {
        padding: 16px 16px 16px 44px;
    }

    .access {
        padding: 80px 0 0 0;
    }

    .access-address {
        margin-top: 56px;
        font-size: 20px;
    }

    .access-map {
        margin-top: 56px;
    }

    .access-map iframe {
        height: 400px;
    }

    .form label span {
        font-size: 18px;
    }

    .form textarea {
        height: 232px;
    }

    .form-button {
        font-size: 24px;
        padding: 24px 0;
    }

    footer {
        padding: 30px;
        font-size: 16px;
    }
}
解説

動画を用意しましたのでこちらを見ながらやってみるのも良いでしょう。
※動画では画像の書き出しから行っていますが、当課題では書き出した画像が素材の中に含まれていますので、改めて書き出す必要はありません。

ポイント

  • お知らせ欄の文章が長くなる時に、日付の下に文章が回り込まないように気を付けましょう。
  • おすすめ商品欄は、中間画面サイズでは2×2なる様に調整しましょう。
  • ドロワー部分にjQueryを使用していますが、難しい場合にはいったん実装無しでやってみましょう。
  • 使用フォントはNoto Sans JPです。

まずは、模写コーディングの準備を読んで準備をしましょう。そして、模写コーディングの手順を参考にしながら挑戦してみましょう。