- Use
npm install
in the project root to install all dependencies. - Check the
name
field in each package's package.json to confirm the correct name—ignore the top-level one. - Use
npm run dev
to start the local development server. - Use
npm run build
to create a production build. - Use
npm run lint
to check code quality and TypeScript types. - Use
npm run typecheck
to run TypeScript type checking independently (if configured).
<div class="loop">
<p aria-hidden="true">A Future of Smiles and Growth</p>
<p aria-hidden="true">A Future of Smiles and Growth</p>
</div>
.loop {
position: absolute;
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
<button type="button" class="openModal js-modalTrigger" data-modal-id="dialog1">Open Modal</button> | |
<dialog id="dialog1" aria-label="Modal name" class="dialog scrollControl js-modal"> | |
<div class="modal__inner js-modalContent"> | |
<h1 class="modal__title">Lorem ipsum dolor sit.</h1> | |
<p class="modal__text"> | |
Lorem ipsum dolor sit amet consectetur adipisicing elit. Culpa cumque odit quaerat libero, facere tempora placeat molestias eum sed | |
error rerum quisquam veritatis. Excepturi beatae ut vitae autem saepe expedita! | |
</p> | |
<button type="button" class="closeModal js-modalClose">Close Modal</button> | |
</div> |
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
document.addEventListener("DOMContentLoaded", () => { | |
document.querySelectorAll(".js-details").forEach((el) => { | |
const summary = el.querySelector(".js-summary") | |
const content = el.querySelector(".js-content") | |
summary.addEventListener("click", (event) => toggleContent(el, content, event)) | |
}) | |
}) | |
const animTiming = { |
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
// ビューポートのサイズを取得する | |
const viewportSize = () => { | |
const vw = window.innerWidth * 0.01 | |
const vh = window.innerHeight * 0.01 | |
document.documentElement.style.setProperty("--vw", `${vw}px`) | |
document.documentElement.style.setProperty("--vh", `${vh}px`) | |
} | |
// 375px以下のビューポートを固定 |
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
// 三点リーダー | |
@mixin line-clamp($num, $num-sp: null) { | |
display: -webkit-box; | |
-webkit-box-orient: vertical; | |
-webkit-line-clamp: $num; | |
overflow: hidden; | |
@if $num-sp { | |
@include sp { | |
-webkit-line-clamp: $num-sp; |
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
*, | |
::before, | |
::after { | |
--clamp-root-font-size: 16; | |
--clamp-slope: calc( | |
(var(--clamp-max) - var(--clamp-min)) / | |
(var(--clamp-viewport-max) - var(--clamp-viewport-min)) | |
); | |
--clamp-y-axis-intersection: calc( | |
var(--clamp-min) - (var(--clamp-slope) * var(--clamp-viewport-min)) |
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
<div class="tabs-container"> | |
<div class="tabs-list" role="tablist" aria-label="サンプルタブ"> | |
<button class="tab" role="tab" aria-selected="true" aria-controls="panel-1" id="tab-1" tabindex="0"> | |
タブ1 | |
</button> | |
<button class="tab" role="tab" aria-selected="false" aria-controls="panel-2" id="tab-2" tabindex="-1"> | |
タブ2 | |
</button> | |
<button class="tab" role="tab" aria-selected="false" aria-controls="panel-3" id="tab-3" tabindex="-1"> | |
タブ3 |
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
document.addEventListener("DOMContentLoaded", () => { | |
const handleInternalLink = (e) => { | |
e.preventDefault() | |
const targetId = e.currentTarget.getAttribute("href").slice(1) | |
const targetElement = document.getElementById(targetId) | |
if (targetElement) { | |
const headerHeight = document.querySelector("header")?.offsetHeight || 0 | |
const scrollToPosition = targetElement.offsetTop - headerHeight | |
window.scrollTo({ | |
top: scrollToPosition, |
NewerOlder