SANGOのテーマに合いそうなちょっと変わったカード型デザイン5種

カード型デザインのアイキャッチイラスト

SANGOのテーマには標準でいけてるカード型デザインが、ショートコードを入力することで全体感に馴染むデザインがすぐに使えます。

このカード型デザインをベースにYouTubeの動画や、mp4の動画をサムネイル風に使えるカード型デザインを作ったので、今回は、SANGOのテーマに合いそうなちょっと変わったカード型デザイン4種をご紹介します。

SANGOのカラムブロック

sampleは全てカラムブロックで設置し、HTML+CSSのコピペでできるように作っています。

青いグラデーションのカード型デザイン

写真下部にグラデーションの色味のカード型デザインですが、写真の色味とバランスを取らないと、非常に見づらいオブジェクトになるので使用に注意が必要なデザインです。

おそらく、こればっかり並べたページを見た場合目がチカチカする為、通常のカードと併用して使いましょう。

  • デザイナーって激務?IT関連職種の残業時間と勉強の時間

    デザイナーは残業時間が多く、制作スタッフが少ないWeb制作会社では、この残業時間がさらに多くなり、正しく残業代が支払われていないケースはよく聞く話です。

  • デザイナーって激務?IT関連職種の残業時間と勉強の時間

    デザイナーは残業時間が多く、制作スタッフが少ないWeb制作会社では、この残業時間がさらに多くなり、正しく残業代が支払われていないケースはよく聞く話です。

コードを表示する

HTML

<div class="cardgrid">
  <ul class="gridcards">
    <li class="gridcards_item">
      <div class="gridcard">
        <div class="card_image"><img src="https://dubdesign.net/wp-content/uploads/2020/05/0520_tableeyecatch.jpg"></div>
        <div class="card_content">
          <p class="card_title">デザイナーって激務?IT関連職種の残業時間と勉強の時間</p>
          <p class="gridcard_text">デザイナーは残業時間が多く、制作スタッフが少ないWeb制作会社では、この残業時間がさらに多くなり、正しく残業代が支払われていないケースはよく聞く話です。</p>
          <a href="https://dubdesign.net/note/designer-workstyle/"><button class="btn card_btn">続きを見る</button></a>
        </div>
      </div>
    </li>
</ul>
</div>

CSS


.card_image {
  height: auto;
  max-width: 100%;
  vertical-align: middle;
}

.btn {
  color: #ffffff;
  padding: 0.8rem;
  font-size: 14px;
  text-transform: uppercase;
  border-radius: 4px;
  font-weight: 400;
  display: block;
  width: 100%;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
}

.btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.gridcards {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  border: none;
}

.gridcard:hover {
    transform: translateY(-3px);
  box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08);
  transition: all .5s;
}

.cardgrid ul{
  border:0;
  padding: 0;
}

.gridcards_item {
  display: flex;
  padding: 1rem;
}

.gridcard {
  background-color: white;
  border-radius: 0.25rem;
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card_content {
  padding: 1rem;
  background: linear-gradient(to bottom left, #6bb6ff 60%, #4f96f6 100%);
}

.card_title {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2em;
  letter-spacing: 1px;
  text-transform: capitalize;
  margin: 0px;
}

.card_content P {
  margin: 10px 0 20px 0;
}

.gridcard_text {
  color: #ffffff;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;    
  font-weight: 400;
}
.made_by{
  font-weight: 400;
  font-size: 13px;
  margin-top: 35px;
  text-align: center;
}


普通のカード型デザイン

至って普通のカード型デザインです。

タイトルタイトルタイトル
ああああああああああ
タイトルタイトルタイトル
いいいいいいいいいいいいい

コードを表示する

HTML

<div class="eccard_container">
  <div class="ec_card">
    <div class="card-inner">
      <img src="https://dubdesign.net/wp-content/uploads/2020/05/0520_tableeyecatch.jpg">
      <div class="card-title">
        タイトルタイトルタイトル 
      </div>
      <div class="card-price">ああああああああああ</div>
      <div class="card-action">
        <a href="#">Select Option</a>
      </div>
    </div>
  </div>
</div>

CSS

.eccard_container {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.ec_card {
  width: 100%;
  transition: linear 0.2s;
  margin-bottom: 35px;
}

.card img {
  height: 200px;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
}

.card-inner {
  background: #FFF;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  margin: 10px;
  height: 100%;
  box-shadow: 0px 0px 10px 0px #ccc;
  border-radius: 6px;
}

.card-title {
  margin: 20px 0 10px 0;
  color: #333;
  padding: 0 20px;
  box-sizing: border-box;
  font-weight: 400;
}

.card-price {
  margin: 0 0 15px;
  font-weight: 700;
  color: #256b28;
  font-size: 18px;
  padding: 0 20px;
  box-sizing: border-box;
}

.card-action {
  margin-top: auto;
  text-align: center;
  margin-bottom: 35px;
}

.card-action a {
  color: #333;
  padding: 10px;
  border:1px solid #7d7d7d;
  text-decoration: none;
  border-radius: 3px;
  font-size: 14px;
  background: #FFF;
  font-weight: 400;
}

.card-action a:hover {
  background: #333;
  color: #FFF;
}


YouTubeを再生できるカード型デザイン

カード上でYouTubeを再生できるカード型デザインです。

PCで、2カラム表示をすると極小のフレームで再生されてしまうので、1カラムでの使用推奨です。

YouTube
YouTube

コードを表示する

HTML

<article class="cardtype__article_custom">
    <div class="cardtype__link_custom">
      <p class="cardtype__img_custom movie-wrap">
<!--ここからYOUTUBE iframe-->
<iframe width="854" height="480" src="https://www.youtube.com/embed/vI4LHl4yFuo" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<!--ここまでYOUTUBE iframe-->
      <div class="cardtype__article-info">
        <div class="cardcustom_title">YOUTUBE Google — Year In Search 2017</div>
      </div>
    </div>
  <a class="dfont cat-name_custom catid47" href="https://dubdesign.net/category/download/html-css/">YouTube</a>  </article>

CSS

/*--------------------------------------
YouTubeカード型CSS
--------------------------------------*/
.cardtype__article_custom {
  position: relative;
  width: 100%;
  margin: 0 0 25px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.12), 0 2px 3px 0 rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: 0.2s ease-in-out;
}
.cardtype__article_custom:hover {
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15), 0 0 5px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}
.cardtype__link_custom {
  display: block;
  color: #555;
  text-decoration: none;
  cursor: pointer;
}
.cardtype__link_custom:hover {
  color: #555;
  text-decoration: none;
}
.cardtype__img_custom {
  margin: 0;
  overflow: hidden;
  position: relative;
  height: 0;
  padding-bottom: 57.7%;
}
.cardtype__img_custom img {
  border-radius: 2px 2px 0 0;
  width: 100%;
}
.cardtype__link_custom {
  padding-bottom: 25px;
}
.cardcustom_title {
  margin: 0 25px;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1.6rem;
}
.cardtype time {
  display: block;
  margin: 13px 13px 8px;
  color: #b5b5b5;
  font-size: 13px;
  font-weight: bold;
}

.cat-name_custom {
  display: inline-block;
  background: #FF0000;
  text-decoration: none;
  overflow: hidden;
  position: absolute;
  top: 13px;
  left: 13px;
  height: 22px;
  margin: 0;
  padding: 0 10px;
  border-radius: 14px;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  vertical-align: middle;
  line-height: 22px;
}
.cat-name_custom:hover {
  text-decoration: none;
  background: silver;
}

.movie-wrap {
     position: relative;
     padding-bottom: 56.25%; /*アスペクト比 16:9の場合の縦幅*/
     height: 0;
     overflow: hidden;
}
 
.movie-wrap iframe {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
}


mp4の動画をサムネイルっぽく使うカード型デザイン

mp4をmuteのautoplayで流して、動くサムネイルっぽい感じで使うカード型デザインです。

通信環境が遅く、動画が遅い環境での閲覧も想定してposterの画像もしっかりと設定しておきましょう。

コードを表示する

HTML

<article class="cardtype__article_custom2">
    <a class="cardtype__link_custom2" href="">
      <p class="cardtype__img_custom2 movie-wrap2">
<!--ここからmp4 srcにファイルURL-->
<video autoplay loop muted src="https://dubdesign.net/wp-content/uploads/2020/05/production-ID_4065924-online-video-cutter.com_.mp4" width="100%" poster="URL"></video>
<!--ここまでmp4 srcにファイルURL-->
      <div class="cardtype__article-info2">
        <div class="cardcustom_title2">YOUTUBE Google — Year In Search 2017</div>
      </div>
    </a>
  <a class="dfont cat-name_custom2 catid47" href="https://dubdesign.net/category/download/html-css/">HTML・CSS</a>  </article>

CSS

.cardtype__article_custom2 {
  position: relative;
  width: 100%;
  margin: 0 0 25px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.12), 0 2px 3px 0 rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: 0.2s ease-in-out;
}
.cardtype__article_custom2:hover {
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15), 0 0 5px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}
.cardtype__link_custom2 {
  display: block;
  color: #555;
  text-decoration: none;
  cursor: pointer;
}
.cardtype__link_custom2:hover {
  color: #555;
  text-decoration: none;
}
.cardtype__img_custom2 {
  margin: 0;
  overflow: hidden;
  position: relative;
  height: 0;
  padding-bottom: 57.7%;
}
.cardtype__img_custom2 img {
  border-radius: 2px 2px 0 0;
  width: 100%;
}
.cardtype__link_custom2 {
  padding-bottom: 25px;
}
.cardcustom_title2 {
  margin: 0 25px;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1.6rem;
}
.cardtype time2 {
  display: block;
  margin: 13px 13px 8px;
  color: #b5b5b5;
  font-size: 13px;
  font-weight: bold;
}

.cat-name_custom2 {
  display: inline-block;
  background: #4f96f6;
  text-decoration: none;
  overflow: hidden;
  position: absolute;
  top: 13px;
  left: 13px;
  height: 22px;
  margin: 0;
  padding: 0 10px;
  border-radius: 14px;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  vertical-align: middle;
  line-height: 22px;
}
.cat-name_custom2:hover {
  text-decoration: none;
  background: silver;
}

.movie-wrap2 {
     position: relative;
     padding-bottom: 56.25%; /*アスペクト比 16:9の場合の縦幅*/
     height: 0;
     overflow: hidden;
}
 
.movie-wrap2 iframe {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
}


YouTubeをモーダルで再生させるカード型デザイン

最後は、YouTubeを再生するカード型デザインで、カードをクリックするとモーダルが開きそのモーダルウィンドウでYouYubeを再生する仕組みです。

カード全体がクリックorタップでモーダルウィンドウが開き、モーダル は右上のcloseかモーダル外をクリックでモーダル が閉じます。

コードを表示する

HTML

<article class="cardtype__article_custom_modal">
    <a class="cardtype__link_custom_modal" href="#modal-01">
      <p class="cardtype__img_custom_modal movie-wrap_modal">
<!--ここからYOUTUBE iframe-->
<img src="https://dubdesign.net/wp-content/uploads/2020/05/Google-—-Year-In-Search-2017-0-11-screenshot.jpg">
<!--ここまでYOUTUBE iframe-->
      <div class="cardtype__article-info">
        <div class="cardcustom_title_modal">YOUTUBE Google — Year In Search 2017</div>
      </div>
    </a>
  <a class="dfont cat-name_custom_modal catid47" href="#modal-01"><i class="fab fa-youtube"></i></a>  </article>
<div class="modal-wrapper_modal" id="modal-01">
  <a href="#!" class="modal-overlay_modal"></a>
  <div class="modal-window_modal">
    <div class="modal-content_modal">
      <p class="modal_title_modal">モーダルの中身</p>
      <p>
<iframe width="854" height="480" src="https://www.youtube.com/embed/vI4LHl4yFuo" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
      </p>
    </div>
    <a href="#!" class="modal-close_modal"><i class="far fa-times-circle"></i></a>
  </div>
</div>

CSS

.cardtype__article_custom_modal {
  position: relative;
  width: 100%;
  margin: 0 0 25px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.12), 0 2px 3px 0 rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: 0.2s ease-in-out;
}
.cardtype__article_custom_modal:hover {
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15), 0 0 5px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}
.cardtype__link_custom_modal {
  display: block;
  color: #555;
  text-decoration: none;
  cursor: pointer;
}
.cardtype__link_custom_modal:hover {
  color: #555;
  text-decoration: none;
}
.cardtype__img_custom_modal {
  margin: 0;
  overflow: hidden;
  position: relative;
  height: 0;
  padding-bottom: 57.7%;
}
.cardtype__img_custom_modal img {
  border-radius: 2px 2px 0 0;
  width: 100%;
}
.cardtype__link_custom_modal {
  padding-bottom: 25px;
}
.cardcustom_title_modal {
  margin: 0 25px;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1.6rem;
}

.cat-name_custom_modal {
  display: inline-block;
  text-decoration: none;
  overflow: hidden;
  position: absolute;
  top: 20%;
  bottom: auto;
  left: 32%;
  right: 30%;
  height: 22px;
  margin: 0;
  padding: 20px 40px 50px;
  border-radius: 4px;
  color: #ff0000;
  font-size: 46px;
  font-weight: bold;
  vertical-align: middle;
  line-height: 0px;
  opacity: 0.5;
}
.cat-name_custom_modal:hover {
  text-decoration: none;
  opacity: 1.0;
}

.movie-wrap_modal {
     position: relative;
     padding-bottom: 56.25%; /*アスペクト比 16:9の場合の縦幅*/
     height: 0;
     overflow: hidden;
}
 
.movie-wrap_modal iframe {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
}

.modal-wrapper_modal {
  z-index: 999;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 40px 10px;
  text-align: center;
}

.modal-wrapper_modal:not(:target) {
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

.modal-wrapper_modal:target {
  opacity: 1;
  visibility: visible;
  transition: opacity .4s, visibility .4s;
}

.modal-wrapper_modal::after {
  display: inline-block;
  height: 100%;
  margin-left: -.05em;
  vertical-align: middle;
  content: ""
}

.modal-wrapper_modal .modal-window_modal {
  box-sizing: border-box;
  display: inline-block;
  z-index: 20;
  position: relative;
  width: 100%;
  max-width: 800px;
  padding: 0 10px 10px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 30px rgba(0, 0, 0, .6);
  vertical-align: middle
}

.modal-wrapper_modal .modal-window_modal .modal-content_modal {
  max-height: 80vh;
  overflow-y: auto;
  text-align: left
}

.modal_title_modal {
  font-size: 1.5em;
	position: relative;
	overflow: hidden;
  padding: 0;
}

.modal_title_modal::before,
.modal_title_modal::after{
	content: "";
	position: absolute;
	bottom: 0;
}

/* h2 プライマリカラー*/
.modal_title_modal:before{
	border-bottom: 4px solid #6bb6ff;
	width: 100%;
}
/* h2 セカンダリカラー*/
.modal_title_modal:after{
	border-bottom: 4px solid #c8e4ff;
	width: 100%;
}

.modal-content_modal p {
  margin: 10px 0 0 0;
}

.modal-overlay_modal {
  z-index: 10;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, .8)
}

.modal-wrapper_modal .modal-close_modal {
  z-index: 20;
  position: absolute;
  top: 5px;
  right: 5px;
  width: 35px;
  color: #95979c !important;
  font-size: 30px;
  font-weight: 700;
  line-height: 35px;
  text-align: center;
  text-decoration: none;
  text-indent: 0
}

.modal-wrapper_modal .modal-close_modal:hover {
  color: #2b2e38 !important
}


カテゴリーのイラスト

同じカテゴリの記事一覧

ボタンの影