Skip to content

Commit 45ee885

Browse files
authored
トップHero画面にStarを飛ばす (#214)
* トップHero画面にStarを飛ばす * fix
1 parent 2419df8 commit 45ee885

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<template>
2+
<div class="future-star__container" :class="['future-star--kind-' + kind]">
3+
<div class="future-star"></div>
4+
</div>
5+
</template>
6+
7+
<script setup>
8+
const { kind } = defineProps({ kind: { type: String, required: true } });
9+
const starSize = 10;
10+
const lengthRate = 32; /* 正確には22程度だが動いていると短く見えるので長めに設定する */
11+
const starWidth = starSize * (lengthRate + 0.5);
12+
const starPath = `path("M 0 ${starSize / 2} l ${starSize * lengthRate} -${starSize / 2} a 1 1 0 0 1 0 ${starSize} Z")`;
13+
</script>
14+
15+
<style scoped>
16+
:global(.standards-home .clip) {
17+
/* タイトルをアンカーにする */
18+
anchor-name: --future-title;
19+
}
20+
21+
.future-star__container {
22+
position: fixed;
23+
width: calc(100vw + v-bind(starWidth * 2 + "px"));
24+
min-width: calc(800px + v-bind(starWidth * 2 + "px"));
25+
bottom: calc(100vh - 160px); /* fallback */
26+
z-index: -1; /* fallback の場合にコンテンツの後ろに配置したいので-1 */
27+
position-anchor: --future-title;
28+
bottom: calc(anchor(top) - 10px);
29+
left: v-bind(-starWidth + "px");
30+
filter: blur(3px);
31+
transform-origin: left 50%;
32+
opacity: 0.1;
33+
}
34+
.dark .future-star__container {
35+
opacity: 0.2;
36+
}
37+
.future-star--kind-1 {
38+
transform: rotate(-6deg);
39+
}
40+
.future-star--kind-2 {
41+
transform: rotate(-4deg);
42+
}
43+
.future-star {
44+
position: absolute;
45+
background-color: #da0058;
46+
height: v-bind(starSize + "px");
47+
width: v-bind(starWidth + "px");
48+
clip-path: v-bind(starPath);
49+
50+
animation-composition: add;
51+
animation-name: slide-to-right;
52+
animation-duration: 10s;
53+
animation-iteration-count: infinite;
54+
animation-timing-function: linear;
55+
animation-timeline:;
56+
}
57+
.future-star--kind-2 .future-star {
58+
animation-delay: 250ms;
59+
}
60+
@keyframes slide-to-right {
61+
0% {
62+
left: 0;
63+
}
64+
50% {
65+
left: 100%;
66+
}
67+
100% {
68+
left: 100%;
69+
}
70+
}
71+
</style>

.vitepress/theme/index.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import DefaultTheme from "vitepress/theme";
22
import "./style.css";
33
import PageInfo from "./components/PageInfo.vue";
44
import PageTitle from "./components/PageTitle.vue";
5+
import FutureStar from "./components/FutureStar.vue";
56

67
/**
78
* @typedef {import('vitepress').EnhanceAppContext} EnhanceAppContext
@@ -17,5 +18,6 @@ export default {
1718

1819
ctx.app.component("PageInfo", PageInfo);
1920
ctx.app.component("PageTitle", PageTitle);
21+
ctx.app.component("FutureStar", FutureStar);
2022
},
2123
};

index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ features:
3434
details: エンタープライズ領域では、社員・パートナーの方々を合わせて、数百人が同時に開発することも珍しくありません。 ちょっとした悩み、失敗も、人数が集まれば大変なコスト・リスクになります。 誰もが引っかかる落とし穴、悩みの種をあらかじめ排除します。
3535
- title: Performance
3636
details: 時に読みやすいソースコードはパフォーマンス劣化を招くことがあります。 しかし、常にパフォーマンスを優先したソースコードは人間の読めないソースコードになりがちです。 今、書こうとしているソースコードが、どの程度のパフォーマンスになるのか、指標を示すことで、ソフトウェア開発プロジェクトごとに最適なソースコードを選択することができます。
37+
pageClass: standards-home
3738
---
3839

3940
[![GitHub last commit](https://img.shields.io/github/last-commit/future-architect/coding-standards.svg)](https://github.com/future-architect/coding-standards)
@@ -42,3 +43,6 @@ features:
4243
## License
4344

4445
[![CC-By-4.0](https://licensebuttons.net/l/by/4.0/88x31.png)](https://creativecommons.org/licenses/by/4.0/deed.ja)
46+
47+
<FutureStar kind="1"/>
48+
<FutureStar kind="2" />

0 commit comments

Comments
 (0)