-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 名刺QRからアクセス時、特定条件下で別サイトへリダイレクトするようにした
今回はジョジ会の日にXに飛ぶように
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,12 @@ | ||
// 現在のURLのパラメーターを取得 | ||
const urlParams = new URLSearchParams(window.location.search); | ||
const meishiParam = urlParams.get('meishi'); | ||
|
||
// 今日の日付を取得 | ||
const today = new Date(); | ||
const targetDate = new Date('2024-10-20'); | ||
|
||
// パラメーターが「meishi=2」で、今日が2024年10月20日である場合、リダイレクト | ||
if (meishiParam === '2' && today.toDateString() === targetDate.toDateString()) { | ||
window.location.href = "https://x.com/hyouhyan"; | ||
} |