-
Notifications
You must be signed in to change notification settings - Fork 0
fix: レスポンシブ表示の崩れとページ遷移の待ち時間を解消する #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
858b543
fix: 固定ヘッダーとコンテンツの重なりを解消しレスポンシブ表示を整える
Tsuchiya2 e502679
fix: Rails 8移行で失われたフォントとフェードインのスタイルを復元する
Tsuchiya2 020b95e
perf: ナビゲーションリンクをプリロードしページ遷移の待ち時間をなくす
Tsuchiya2 7a44fbd
refactor: 非推奨のconfig.cache_classesをconfig.enable_reloadingへ置き換える
Tsuchiya2 afa11f7
feat: トップページの使い方セクションをlg以上で左右交互の2カラムにする
Tsuchiya2 3644638
fix: レビュー指摘を反映する
Tsuchiya2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| $reline-navbar-height: 3.5rem; | ||
| $reline-navbar-height-lg: 4rem; | ||
|
|
||
| :root { | ||
| --reline-navbar-height: #{$reline-navbar-height}; | ||
|
|
||
| @include media-breakpoint-up(lg) { | ||
| --reline-navbar-height: #{$reline-navbar-height-lg}; | ||
| } | ||
| } | ||
|
|
||
| .navbar.fixed-top { | ||
| min-height: var(--reline-navbar-height); | ||
| } | ||
|
|
||
| body { | ||
| padding-top: var(--reline-navbar-height); | ||
| } | ||
|
|
||
| html { | ||
| scroll-padding-top: var(--reline-navbar-height); | ||
| } | ||
|
|
||
| .fade-in { | ||
| opacity: 0; | ||
| transition-duration: 1000ms; | ||
| transition-property: opacity, transform; | ||
| } | ||
|
|
||
| .fade-in-up { | ||
| transform: translate(0, 50px); | ||
| } | ||
|
|
||
| .scroll-in { | ||
| opacity: 1; | ||
| transform: translate(0, 0); | ||
| } | ||
|
|
||
| @media (prefers-reduced-motion: reduce) { | ||
| .fade-in { | ||
| opacity: 1; | ||
| transition: none; | ||
| } | ||
|
|
||
| .fade-in-up { | ||
| transform: none; | ||
| } | ||
| } | ||
|
|
||
| .usage-section { | ||
| max-width: 960px; | ||
| margin-inline: auto; | ||
| } | ||
|
|
||
| .web-font { | ||
| font-family: 'Hachi Maru Pop', cursive; | ||
| } | ||
|
|
||
| .meiryo-font { | ||
| font-family: Meiryo, sans-serif; | ||
| } | ||
|
|
||
| .feedback-input { | ||
| resize: none; | ||
| height: 280px; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| @import 'bootstrap/scss/bootstrap'; | ||
| @import 'bootstrap-icons/font/bootstrap-icons'; | ||
| @import 'layout'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,19 @@ | ||
| window.addEventListener('scroll', () => { // 'スクロール'(イベント)が発生するとアロー関数以下が動きます。 | ||
| let targets = document.querySelectorAll('.fade-in'); // 'fade-in'クラスを集計。 | ||
| for (let i = 0; i < targets.length; i++){ // iに0を代入し、'targets'の数を下回れば、iの値を増やします。 | ||
| const selectorPlace = targets[i].getBoundingClientRect().top; // 個々の'targets'までの距離 | ||
| const scrollAmount = window.scrollY || document.documentElement.scrollTop; // 現在のスクロール位置 | ||
| const referencePoint = selectorPlace + scrollAmount; // 基準点 | ||
| const windowHeight = window.innerHeight; // ユーザーが使用しているブラウザの高さ | ||
| if (scrollAmount > referencePoint - windowHeight + 275) { | ||
| targets[i].classList.add('scroll-in'); | ||
| const REVEAL_OFFSET = 275; | ||
|
|
||
| const revealVisibleTargets = () => { | ||
| const targets = document.querySelectorAll('.fade-in:not(.scroll-in)'); | ||
| const windowHeight = window.innerHeight; | ||
| const revealOffset = Math.min(REVEAL_OFFSET, windowHeight * 0.35); | ||
|
|
||
| targets.forEach((target) => { | ||
| if (target.getBoundingClientRect().top < windowHeight - revealOffset) { | ||
| target.classList.add('scroll-in'); | ||
| } | ||
| } | ||
| }); | ||
| }); | ||
| }; | ||
|
|
||
| window.addEventListener('scroll', revealVisibleTargets, { passive: true }); | ||
| window.addEventListener('resize', revealVisibleTargets, { passive: true }); | ||
|
|
||
| // https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Statements/for | ||
| // https://developer.mozilla.org/ja/docs/Web/API/Element/getBoundingClientRect | ||
| // https://developer.mozilla.org/ja/docs/Web/API/Window/scrollY | ||
| // https://developer.mozilla.org/ja/docs/Web/API/Element/scrollTop | ||
| // https://flex-box.net/js-scrollin/ | ||
| document.addEventListener('DOMContentLoaded', revealVisibleTargets); | ||
| document.addEventListener('turbo:load', revealVisibleTargets); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| - reverse = local_assigns.fetch(:reverse, false) | ||
| .fade-in.fade-in-up.usage-section.my-5 | ||
| .row.align-items-center.g-4.g-lg-5 | ||
| div class=['col-12', 'col-lg-6', ('order-lg-2' if reverse)] | ||
| - lines.each do |paragraph| | ||
| .h4.mb-0.mt-4.mt-lg-0 | ||
| = safe_join(paragraph, tag.br) | ||
| div class=['col-12', 'col-lg-6', ('order-lg-1' if reverse)] | ||
| .usage-images | ||
| = image_tag image, class: 'img-fluid', alt: '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,26 @@ | ||
| nav.navbar.navbar-expand-xl.navbar-dark.bg-secondary.fixed-top | ||
| = link_to 'ReLINE', root_path, class: 'navbar-brand ps-3' | ||
| nav.navbar.navbar-expand-lg.navbar-dark.bg-secondary.fixed-top | ||
| = link_to 'ReLINE', root_path, class: 'navbar-brand ps-3', data: { turbo_preload: true } | ||
| button.navbar-toggler.me-3 data-bs-toggle='collapse' data-bs-target="#navbarSupportedContent" aria-label="Toggle navigation" | ||
| span.navbar-toggler-icon | ||
| .collapse.navbar-collapse id='navbarSupportedContent' | ||
| ul.navbar-nav.ps-3 | ||
| li.nav-item | ||
| = link_to root_path, class: 'nav-link my-1 mx-1 d-inline-flex align-items-center' do | ||
| = link_to root_path, class: 'nav-link my-1 mx-1 d-inline-flex align-items-center', data: { turbo_preload: true } do | ||
| icon.fas.fa-home.me-2 | ||
| .guide-text | ||
| | ホーム | ||
| li.nav-item | ||
| = link_to terms_path, class: 'nav-link my-1 mx-1 d-inline-flex align-items-center' do | ||
| = link_to terms_path, class: 'nav-link my-1 mx-1 d-inline-flex align-items-center', data: { turbo_preload: true } do | ||
| icon.far.fa-file.me-2 | ||
| .guide-text.ms-1 | ||
| | 利用規約 | ||
| li.nav-item | ||
| = link_to privacy_policy_path, class: 'nav-link my-1 mx-1 d-inline-flex align-items-center' do | ||
| = link_to privacy_policy_path, class: 'nav-link my-1 mx-1 d-inline-flex align-items-center', data: { turbo_preload: true } do | ||
| icon.fas.fa-lock.me-2 | ||
| .guide-text | ||
| | プライバシーポリシー | ||
| li.nav-item | ||
| = link_to new_feedback_path, class: 'nav-link my-1 mx-1 d-inline-flex align-items-center' do | ||
| = link_to new_feedback_path, class: 'nav-link my-1 mx-1 d-inline-flex align-items-center', data: { turbo_preload: true } do | ||
| icon.far.fa-comment.me-2 | ||
| .guide-text | ||
| | フィードバック |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.