Skip to content

Commit 891e5ea

Browse files
author
@M-Yuu23586
committed
feat: Update hero animation to abyss effect
1 parent 2b83c88 commit 891e5ea

3 files changed

Lines changed: 44 additions & 27 deletions

File tree

docs/pages/css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ section h3 {
181181
pointer-events: none; /* Allow clicks to pass through */
182182
opacity: 0;
183183
z-index: 11; /* Add z-index, higher than indicator */
184+
white-space: nowrap; /* Prevent line breaks */
184185
}
185186

186187

docs/pages/index.html

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,48 @@ <h1>TrackWeight</h1>
2525
<div id="weight-indicator"></div>
2626
<div id="weight-display">0.00 g</div>
2727
<!-- Inlined SVG to ensure animation plays correctly -->
28-
<svg viewBox="0 0 240 150" fill="none" xmlns="http://www.w3.org/2000/svg" class="trackpad-svg" aria-label="MacBook Trackpad with click and hold animation">
29-
<defs>
30-
<linearGradient id="trackpad-gradient" x1="120" y1="0" x2="120" y2="150" gradientUnits="userSpaceOnUse">
31-
<stop stop-color="#EAEAEA"/>
32-
<stop offset="1" stop-color="#D7D7D7"/>
33-
</linearGradient>
34-
</defs>
35-
<rect x="1" y="1" width="238" height="148" rx="12" ry="12" fill="url(#trackpad-gradient)" stroke="#C4C4C4" stroke-width="2"/>
36-
<!-- A simple circle animation to indicate interactivity -->
37-
<circle cx="120" cy="75" r="0" fill="#007AFF" fill-opacity="0">
38-
<animate
39-
attributeName="r"
40-
values="0; 20; 20; 0"
41-
dur="2.5s"
42-
repeatCount="indefinite"
43-
keyTimes="0; 0.4; 0.8; 1"
44-
/>
45-
<animate
46-
attributeName="fill-opacity"
47-
values="0; 0.7; 0.7; 0"
48-
dur="2.5s"
49-
repeatCount="indefinite"
50-
keyTimes="0; 0.4; 0.8; 1"
51-
/>
52-
</circle>
53-
</svg>
28+
<svg width="240" height="150" viewBox="0 0 240 150" fill="none" xmlns="http://www.w3.org/2000/svg" class="trackpad-svg">
29+
<defs>
30+
<linearGradient id="trackpad-gradient" x1="120" y1="0" x2="120" y2="150" gradientUnits="userSpaceOnUse">
31+
<stop stop-color="#EAEAEA"/>
32+
<stop offset="1" stop-color="#D7D7D7"/>
33+
</linearGradient>
34+
</defs>
35+
36+
<!-- トラックパッド本体 -->
37+
<rect x="1" y="1" width="238" height="148" rx="12" ry="12" fill="url(#trackpad-gradient)" stroke="#C4C4C4" stroke-width="2"/>
38+
39+
<!-- アニメーション用のグループ -->
40+
<g style="user-select: none;">
41+
<!-- 下向きの矢印 -->
42+
<path d="M120 65 L114 57 L117 57 L117 45 L123 45 L123 57 L126 57 Z" fill="#007AFF">
43+
<animateTransform
44+
attributeName="transform"
45+
type="translate"
46+
values="0 0; 0 5; 0 0"
47+
dur="1.8s"
48+
repeatCount="indefinite"
49+
keyTimes="0; 0.5; 1"
50+
calcMode="spline"
51+
keySplines="0.42 0 0.58 1; 0.42 0 0.58 1"
52+
/>
53+
</path>
54+
55+
<!-- テキスト -->
56+
<text x="120" y="90" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" font-size="14" font-weight="600" fill="#007AFF" text-anchor="middle">
57+
Click & Hold
58+
<animate
59+
attributeName="opacity"
60+
values="1; 0.3; 1"
61+
dur="1.8s"
62+
repeatCount="indefinite"
63+
keyTimes="0; 0.5; 1"
64+
calcMode="spline"
65+
keySplines="0.42 0 0.58 1; 0.42 0 0.58 1"
66+
/>
67+
</text>
68+
</g>
69+
</svg>
5470
</div>
5571
<a href="https://github.com/krishkrosh/TrackWeight/releases" class="cta-button">Download now, laugh later</a>
5672
</section>

docs/pages/js/trackpad-animation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ document.addEventListener('DOMContentLoaded', () => {
7171
currentWeight = 0;
7272
const updateWeight = () => {
7373
currentWeight += Math.random() * 5; // 重量の増加をシミュレート
74-
if (currentWeight > 1000) currentWeight = 1000; // 上限を1000gに設定
74+
if (currentWeight > 500) currentWeight = 500; // 上限を500gに設定
7575
weightDisplay.textContent = `${currentWeight.toFixed(2)} g`;
7676
animationFrameId = requestAnimationFrame(updateWeight);
7777
};

0 commit comments

Comments
 (0)