← 一覧へ

Modal / 28 スプリットレイアウト フルスクリーン|Split Layout Fullscreen

デザイン見本

画面を左右(flex: 1)に分割したスプリットレイアウトのフルスクリーンデザイン。片面をビジュアルエリア、もう片面をコンテンツエリアに分けることで、情報整理と視覚的なインパクトを両立します。

実装コード

HTML
<!-- モーダルを開くボタン -->
<button class="modal-button">Split Layout Modal</button>

<!-- モーダルの背景マスク -->
<div class="mask"></div>

<!-- モーダル本体(フルスクリーン対応クラスを追加) -->
<div class="modal fullscreen">
  <!-- 左側(ビジュアル) -->
  <div class="split-left"></div>
  
  <!-- 右側(コンテンツ) -->
  <div class="split-right">
    <div class="close-btn-container">
      <button class="close-btn">×</button>
    </div>
    <div class="fullscreen-content">
      <p class="modal-title">Split Layout</p>
      <p>画面を左右に分割したモダンなフルスクリーンモーダルです。左側に目を引く画像やグラフィックを配置し、右側にメッセージやフォームなどのコンテンツを配置するレイアウトは、LPやプロモーションで効果的です。</p>
      <button class="action-btn close-btn">Get Started</button>
    </div>
  </div>
</div>
CSS
/* 開くボタンのスタイル */
.modal-button {
  padding: 15px 30px;
  background: #111827;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.modal-button:hover {
  background: #374151;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 背景マスクのスタイル */
.mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mask.appear {
  opacity: 1;
  visibility: visible;
}

/* フルスクリーンモーダル本体 (スプリットレイアウト) */
.modal.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  border: none;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.fullscreen.appear {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 左右のパネル */
.split-left {
  flex: 1;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.split-left::after {
  content: "Visual Content";
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #ffffff;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .modal.fullscreen {
    flex-direction: column;
  }
  .split-left {
    flex: 0.4;
  }
  .split-right {
    flex: 0.6;
  }
  .split-left::after {
    font-size: 1.2rem;
  }
}

.close-btn-container {
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 10;
}

/* 右上のバツボタン */
.close-btn-container .close-btn {
  width: 44px;
  height: 44px;
  background: transparent;
  color: #111827;
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.close-btn-container .close-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  transform: rotate(90deg);
}

/* モーダルコンテンツ */
.fullscreen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 10%;
}

.fullscreen-content .modal-title {
  font-size: 2.5rem;
  color: #111827;
  margin-top: 0;
  margin-bottom: 20px;
  font-weight: 700;
}

.fullscreen-content p {
  color: #4b5563;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 30px;
  max-width: 500px;
}

/* アクションボタン */
.fullscreen-content .action-btn {
  padding: 14px 32px;
  background: #111827;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.fullscreen-content .action-btn:hover {
  background: #374151;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
JS
(function () {
  var btn = document.querySelector('.modal-button');
  var mask = document.querySelector('.mask');
  var modal = document.querySelector('.modal');
  var closeBtns = document.querySelectorAll('.close-btn');

  if (!btn || !mask || !modal) return;

  function openModal() {
    mask.classList.add('appear');
    modal.classList.add('appear');
    if (modal.classList.contains('fullscreen')) {
      document.body.style.overflow = 'hidden';
    }
  }

  function closeModal() {
    mask.classList.remove('appear');
    modal.classList.remove('appear');
    if (modal.classList.contains('fullscreen')) {
      document.body.style.overflow = '';
    }
  }

  btn.addEventListener('click', openModal);
  mask.addEventListener('click', closeModal);
  closeBtns.forEach(function(b) { b.addEventListener('click', closeModal); });

  document.addEventListener('keydown', function (e) {
    if (e.key === 'Escape' && modal.classList.contains('appear')) {
      closeModal();
    }
  });
})();