WEBサイト制作の勉強

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

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

header部分の制作

以前、既存のサイトをモデルにしてレスポンシブサイトを制作し、jQueryプラグインを使いトップにスライダーを導入しましたが、モデルサイトに最も近い形のスライドショーを導入したパターンが今回のやつです。


今回のスライドショーの主なポイント

ブラウザー幅一杯にスライドを表示させる
左右の画像は半透明のブラーがかかっている
レスポンシブサイトなので、フリックにも対応


レスポンシブ対応サイト制作wideslider版
black-flag.net


<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>既存サイトのトレース</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/wideslider.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="js/wideslider.js"></script>
</head>

<body>
<header>
<div class="inner">
<h1>既存サイトのタイトル</h1>
</div>
</header>
<div class="wideslider">
<ul>
<li><a href="#1"><img src="img/mainvis_233.jpg" alt="" /></a></li>
<li><a href="#2"><img src="img/mainvis_250.jpg" alt="" /></a></li>
<li><a href="#3"><img src="img/mainvis_252.png" alt="" /></a></li>
<li><a href="#4"><img src="img/mainvis_248.jpg" alt="" /></a></li>
</ul>
</div><!--/.wideslider-->
<ul class="gallery">
<li class="size2x2"><a href="#"></a></li>
<li class="size2x1"><a href="#"></a></li>
<li class="size1x1"><a href="#"></a></li>
<li class="size1x1"><a href="#"></a></li>
<li class="size2x1"><a href="#"></a></li>
<li class="size1x1"><a href="#"></a></li>
<li class="size1x1"><a href="#"></a></li>
<li class="size1x1"><a href="#"></a></li>
<li class="size1x1"><a href="#"></a></li>
<li class="size1x1"><a href="#"></a></li>
<li class="size1x1 sp-on"><a href="#"></a></li>
</ul>
</body>
</html>


スタイルシート

@charset "utf-8";
/* CSS Document */

html,body,h1,h2,h3,p,ul,li {
  margin:0;
  padding:0;
  line-height:1.0;
}
ul {
  list-style:none;
}
a {
  text-decoration:none;
}
img {
  vertical-align: bottom;
}

/*PCレイアウト*/


/*ヘッダー部分*/
header {
  padding:16px 0;
  box-sizing:border-box;
}
h1 {
  width:103px;
  background:url(../img/head_logo_001.jpg) no-repeat center/contain;
  text-indent:100%;
  white-space:nowrap;
  overflow:hidden;
  
}


/*ギャラリー部分*/
.gallery {
  max-width:960px;
  padding:1%;
  box-sizing:border-box;
  margin:0 auto;
  overflow:hidden;
}
.gallery li {
  width:18%;
  height:0;
  padding-bottom:18%;
  float:left;
  margin:1%;
  border:1px solid #DCDCDC;
  box-sizing:border-box;
}
.gallery li.size2x2 {
  width:37.9%;
  height:0;
  padding-bottom:37.9%;
}
.gallery li.size2x1 {
  width:38%;
  height:0;
  padding-bottom:18%;
}

.gallery li a {
  display:block;
  width:100%;
  height:0;
  padding-bottom:100%;
}
.gallery li.size2x1 a {
  padding-bottom:49%;
}
.gallery li:nth-child(1) a {
  background:url(../img/image_928.jpg) no-repeat center/cover;
}
.gallery li:nth-child(2) a {
  background:url(../img/image_925.jpg) no-repeat center/cover;
}
.gallery li:nth-child(3) a {
  background:url(../img/image_930.jpg) no-repeat center/cover;
}
.gallery li:nth-child(4) a {
  background:url(../img/image_838.jpg) no-repeat center/cover;
}
.gallery li:nth-child(5) a {
  background:url(../img/image_728.png) no-repeat center/cover;
}
.gallery li:nth-child(6) a {
  background:url(../img/image_821.jpg) no-repeat center/cover;
}
.gallery li:nth-child(7) a {
  background:url(../img/image_894.jpg) no-repeat center/cover;
}
.gallery li:nth-child(8) a {
  background:url(../img/image_669.png) no-repeat center/cover;
}
.gallery li:nth-child(9) a {
  background:url(../img/image_927.jpg) no-repeat center/cover;
}
.gallery li:nth-child(10) a {
  background:url(../img/image_824.jpg) no-repeat center/cover;
}
.gallery li:nth-child(11) a {
  background:url(../img/image_912.png) no-repeat center/cover;
}




/*共有パーツ*/
.inner {
  width:960px;
  margin:0 auto;
  overflow:hidden;
}
.sp-on {
  display:none;
}
@media screen and (max-width:640px) {
.gallery li {
  width:48%;
  height:0;
  padding-bottom:48%;
}
.gallery li.size2x2 {
  width:98%;
  height:0;
  padding-bottom:48%;
}
.gallery li.size2x1 {
  width:98%;
  height:0;
  padding-bottom:48%;
}
.gallery li.size2x2 a {
  width:98%;
  height:0;
  padding-bottom:48%;
}

.gallery li:nth-child(1) a {
  background:url(../img/image_929.jpg) no-repeat center/cover;
}
.sp-on {
  display:block;
}

}

建築CGパースのストレート

池袋にあるCGパース、建築パースのストレート

建築CGパース制作の株式会社ストレートでは、調査・設計・提案書など様々なサービスをワンストップで提供致します。
VRなどの最先端技術やアニメーションも積極的に取り入れています。CAD教育・講習にも力を入れています。

求人情報も随時更新中

CSS3アニメーション・transition

CSS3によるアニメーションは大きく分けて、トランジション(transition)とアニメーション(animation)の2つに別ける事が出来ます。

CSS3におけるトランジション(transition)とアニメーション(animation)の違い

「transition」

  • 動かすために:hoverなどのきっかけが必要
  • トランジションでは実行後に元のプロパティ値に戻る
  • 比較的簡単な記述で動かす事が可能

「animation」

  • transitionより細かい設定が可能
  • 記述が複雑
  • 「@keyframes」の記述が必要
「transition」を使ったホバーアクション

今回は「transition」を使い、ホバーアクションを設定します。


transitionでは4つのプロパティを指定出来ます。
transition-duration トランジションデュレーション 変化が始まって終わるまでの時間を指定します。
transition-property トランジション・プロパティ 変化が適用されるCSSのプロパティを指定します。
transition-timing-function トランジション・タイミング・ファンクション 変化の度合いを指定します。
transition-delay トランジション・ディレイ 変化が始まる時間を指定します。


transition-timing-function

アニメーションのタイミングや進め方を指定します。
ease(初期値)
ease-in
ease-out
ease-in-out
linear


weboook.blog22.fc2.com








cssanimation.rocks






www.nxworld.net


photoshopvip.net

transformプロパティ

CSS3のtransformプロパティを使うことで要素に2D変形、または3D変形を適用する事が出来ます。


transformプロパティでは

  • 移動(translate)
  • 縮尺(scale)
  • 回転(rotate)
  • 傾斜(skew)
  • 遠近効果(perspective)

の5つの動きがありますが、このうち移動、縮尺、回転は良く使用するので覚えておきましょう。

縦と横の移動(translate)に関しては、positionプロパティでも同等の動きを表現出来ますが「positionプロパティ」と「transformプロパティ」の特性の違いをしっかりと理解し、効率良く使い分けましょう。

「positionプロパティ」で指定した場合はCPUが処理を行います。

「transformプロパティ」で指定した場合はGPUが処理を行います。

GPU「 Graphcs Prosessing Unit」は画像の処理が得意なので、描画をGPUで行う事でCPUの負担が軽減され、結果としてページ全体の表示も早くなります。
しかし、必要以上にGPUでの作業が増えるとかえってPC全体の処理速度が遅くなるので、「transformプロパティ」の使い過ぎにも注意が必要です。



transformとtransitionの併用

transformのみで使用する場合、変形する事はしますが、ファイルが開かれた瞬間に変形が始まって瞬時に終わってしまうので、変形している様子は解らず、変形後の結果だけが表示されてしまいます。CSS3のtransitionやanimationと併用する事でユーザーの望むタイミングで変形させましょう。

<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>無題ドキュメント</title>
<style>
.box {
  width: 200px;
  height: 200px;
  margin: 10px;
}
.top {
  background: #006699;
  transition: 1s;
}
.top:hover {
  transform: translate(200px,0);
}
.mid {
  background: #FF0033;
  transition: 1s;
}
.mid:hover {
  transform: rotate(360deg);
  transition: 1s;
}
.btm {
  background: #66CC33;
  transition: 1s;
}
.btm:hover {
  transform: scale(1.5);
}
</style>
</head>

<body>
<div class="box top">右に200px</div>
<div class="box mid">360度回転</div>
<div class="box btm">1.5倍に拡大</div>
</body>
</html>

豊島園駅から徒歩5分にある Bakery Old Kitchen Organic

豊島園駅から徒歩5分にある、おいしいパン屋オールドキッチン


豊島園駅から徒歩5分程にあるおいしいパン屋オールドキッチン。オールドキッチンではオーガニック素材を使用して体にやさしいパンを提供します。季節によっていろいろな種類のメニューをお出しします。


tokyoatomic.html.xdomain.jp



f:id:yachin29:20171209180035p:plain