WEBサイト制作の勉強

WEBサイト制作の勉強の為の解説ブログです。

フェリカテクニカルアカデミー

07月10日 Felica Donut&Salad 作業データ

index.html

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Felica Donut&Salad</title>
<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=Raleway:ital,wght@0,100..900;1,100..900&family=Zen+Kaku+Gothic+Antique&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/jquery.bxslider.css">
<link rel="stylesheet" href="css/lightbox.css">
</head>
<body id="top">
<header>
<h1><a href="#top">Felica<span>Donut&Salad</span></a></h1>
<nav id="pc-nav">
<ul>
<li><a href="#about">About</a></li>
<li><a href="#item">Item</a></li>
<li><a href="#access">Access</a></li>
<li><a href="#blog">Blog</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#"><img src="img/facebook-brands.svg" alt=""></a></li>
<li><a href="#"><img src="img/instagram-brands.svg" alt=""></a></li>
</ul>
</nav>
</header>

<div class="main-visual">
<ul class="bxslider">
  <li><img src="img/main-1.webp" alt=""></li>
  <li><img src="img/main-2.webp" alt=""></li>
  <li><img src="img/main-3.webp" alt=""></li>
  <li><img src="img/main-4.webp" alt=""></li>
</ul>
</div><!-- /.main-visual -->


<main>
<section class="page-section" id="news">
<h2 data-en="NEWS">お知らせ</h2>
<dl id="news-list">

</dl>
</section>

<section class="page-section" id="about">
<h2 data-en="ABOUT">私達について</h2>

<div class="about-text">
<h3>自然の恵みを味わう<br>
おいしいご褒美</h3>
<p class="lead">厳選されたオーガニック素材で作るフレッシュなサラダと、<br class="pc-on">
職人の手仕事で焼き上げたドーナツ。<br class="pc-on">
口にした瞬間、自然の甘みが広がります。<br class="pc-on">
毎日の暮らしに、ちょっとした幸せを。</p>
</div><!-- /.about-text -->
</section>

<section class="page-section" id="item">
<h2 data-en="ITEM">商品について</h2>
<div class="item-wrapper">

<div class="item-box">
<a href="img/item-1.jpg" data-lightbox="item" data-title="商品名"><img src="img/item-1.jpg" alt=""></a>
</div><!-- /.item-box -->

<div class="item-box">
<a href="img/item-2.jpg" data-lightbox="item"><img src="img/item-2.jpg" alt=""></a>
</div><!-- /.item-box -->

<div class="item-box">
<a href="img/item-3.jpg" data-lightbox="item"><img src="img/item-3.jpg" alt=""></a>
</div><!-- /.item-box -->

</div><!-- /.item-wrapper -->
</section>

<section class="page-section" id="access">
<h2 data-en="ACCESS">店舗情報</h2>
<div class="access-wrapper">
<div class="g-map">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3238.945289559118!2d139.7117402752527!3d35.72756402742839!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f8.1!3m3!1m2!1s0x60188d68f6cfe057%3A0xddd17dcd7ecaf745!2z6LGK5bO25Yy656uL5Y2X5rGg6KKL5YWs5ZyS!5e0!3m2!1sja!2sjp!4v1752123244608!5m2!1sja!2sjp" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
</div><!-- /.g-map -->
<div class="access-info">
<dl>
<dt>Address</dt>
<dd>東京都豊島区南池袋1-1-1</dd>
<dt>Tel</dt>
<dd><a href="tel:03-1234-xxxx" class="tel">03-1234-xxxx</a></dd>
<dt>Mail</dt>
<dd><a href="mailto:example@email.com">example@email.com</a></dd>
</dl>
<dl>
<dt>Open</dt>
<dd>10:00 - 19:00</dd>
<dt>定休日</dt>
<dd>年末年始</dd>
<dt>駐車場</dt>
<dd>あり(2台)</dd>
</dl>
</div><!-- /.access-info -->
</div><!-- /.access-wrapper -->
</section>

<section class="page-section" id="blog">
<h2 data-en="BLOG">スタッフブログ</h2>
</section>
</main>
<div class="link-wrapper">
</div><!-- /.link-wrapper -->
<footer></footer>


<img src="https://placehold.jp/400x300.png" alt="">


<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js' integrity='sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==' crossorigin='anonymous'></script>
<script src="js/jquery.bxslider.js"></script>
<script src="js/lightbox.js"></script>
<script>
$(function(){
//bxslider
 $('.bxslider').bxSlider({
mode: 'fade',
auto: true,
controls: false,
pager: false,
speed: 2000,
pause: 2000,
touchEnabled: false,//スマホ時のスライド内のスクロールを無効
});

//ajaxで外部データを呼び出す
$('#news-list').load('news.txt');




});
</script>
</body>
</html>

style.css

@charset "utf-8";

/* 変数の登録 */
:root{
--base_color:#f1f1ec;
--text_color:#444444;
--font_en:"Raleway", sans-serif;
--font_ja:"Zen Kaku Gothic Antique", sans-serif;
--color_1:#20d5a5;
--color_2:#d52065;
--color_3:#bad520;
}


html{box-sizing:border-box;-webkit-text-size-adjust:100%}*,:after,:before{background-repeat:no-repeat;box-sizing:inherit}:after,:before{text-decoration:inherit;vertical-align:inherit}*{padding:0;margin:0;box-sizing:border-box;}audio:not([controls]){display:none;height:0}hr{overflow:visible}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}summary{display:list-item}small{font-size:80%}[hidden],template{display:none}abbr[title]{border-bottom:1px dotted;text-decoration:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}code,kbd,pre,samp{font-family:monospace,monospace}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}input{border-radius:0}[role=button],[type=button],[type=reset],[type=submit],button{cursor:pointer}[disabled]{cursor:default}[type=number]{width:auto}[type=search][type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}button,input,optgroup,select,textarea{font:inherit}optgroup{font-weight:700}button{overflow:visible}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:0;padding:0}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button:-moz-focusring{outline:1px dotted}[type=reset],[type=submit],button,html [type=button]button,select{text-transform:none}button,input,select,textarea{background-color:transparent;border-style:none;color:inherit}select::-ms-expand{display:none}select::-ms-value{color:currentColor}legend{border:0;color:inherit;display:table;max-width:100%;white-space:normal}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[type=search]img{border-style:none;vertical-align: bottom}progress{vertical-align:baseline}svg:not(:root){overflow:hidden}audio,canvas,progress,video{display:inline-block}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){position:absolute!important;clip:rect(0 0 0 0)!important}}[aria-busy=true]{cursor:progress}[aria-controls]{cursor:pointer}[aria-disabled]{cursor:default}::-moz-selection{background-color:#b3d4fc;color:#000;text-shadow:none}::selection{background-color:#b3d4fc;color:#000;text-shadow:none}ul,ol{list-style:none;}a{text-decoration:none;}img{max-width: 100%;vertical-align: bottom;}

html{
scroll-behavior: smooth;
}

body{
background-color: var(--base_color);
color: var(--text_color);
font-family: sans-serif;
}

/* ヘッダー部分 */
header{
width: fit-content;
font-family: var(--font_en);
position: fixed;
top: 0;
left: 0;
background-color: var(--base_color);
z-index: 10;
padding: 60px 20px;
>h1{
font-size: 36px;
margin-bottom: 80px;
>a{
color: var(--text_color);
>span{
display: block;
font-size: 0.8em;
}
}
}
}



/* pc用ナビゲーション */
#pc-nav{
li{
margin-bottom: 10px;
>a{
color: var(--text_color);
display: block;
padding: 10px 0;
&:hover{
text-decoration: underline;
text-underline-offset: 3px;
color: #666;
}
}
&:nth-of-type(n+6){
width: 30px;
margin-bottom: 0;
}
}
}



/* メインビジュアル */
.main-visual{
padding: 30px 30px 30px 60px;
width: 100%;
height: 100vh;
li{
width: 100%;
height: calc(100vh - 60px);
>img{
object-fit: cover;
width: 100%;
height: 100%;
}
}
}

/* 共通部分のスタイル */
.page-section{
min-height: 100vh;
padding: 100px 20px 100px 20%;
>h2{
font-family: var(--font_ja);
text-align: center;
font-size: 30px;
color: var(--color_2);
text-indent: -20%;
margin-bottom: 60px;
&::after{
content: attr(data-en);
display: block;
font-family: var(--font_en);
font-size: 0.8em;
color: var(--color_1);
}
}
}

/* お知らせ部分 */
#news-list{
font-size: 18px;
>dt{
font-weight: bold;
margin-bottom: 10px;
&:nth-of-type(n+4){
display: none;
}
}
dd{
margin-bottom: 50px;
&:nth-of-type(n+4){
display: none;
}
>a{
color: var(--text_color);
&:hover{
text-decoration: underline;
}
}
}
}



/* about部分 */
.about-text{
max-width: 600px;
margin-left: 15%;
text-align: center;
font-family: var(--font_ja);
>h3{
font-size: 28px;
line-height: 2.4;
margin-bottom: 50px;
}
.lead{
font-size: 20px;
line-height: 2.4;
}
}


/* 商品について部分 */
.item-wrapper{
width: 80%;
display: flex;
justify-content: center;
gap: 0 40px;
margin-top: 150px;
.item-box:first-of-type{
margin-top: -50px;
}
.item-box:last-of-type{
margin-top: 50px;
}
}

.item-box{
overflow: hidden;
width: 100%;
height: 100%;
aspect-ratio: 4/3;
border-radius: 20px;
}
.item-box img{
transition: 0.2s;
object-fit: cover;
width: 100%;
height: 100%;
}
.item-box:hover img{
scale: 1.1;
}



/* 店舗情報部分 */
.g-map{
width: 100%;
aspect-ratio: 2/0.75;
margin-bottom: 50px;
>iframe{
width: 100%;
height: 100%;
}
}

.access-info{
display: flex;
>dl{
width: 50%;
display: flex;
flex-wrap: wrap;
gap: 20px 0;
align-items: baseline;
>dt{
width: 30%;
font-weight: bold;
background-color: #20d5a5;

}
>dd{
width: 70%;
>a{
color: var(--text_color);
}
}
}
}

/* 電話番号 */
.tel{
font-size: 22px;
pointer-events: none;/* リンクを無効にするautoが有効 */
}