Skip to content

Commit

Permalink
各ページにnameを配置・スタイルの軽微な変更
Browse files Browse the repository at this point in the history
  • Loading branch information
otoneko1102 committed Sep 18, 2024
1 parent be9a2cd commit ee841c0
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>
<body>
<img class="logo" src="/img/logo.png">
<h2 id="name"></h2>
<div id="description"></div>
<h2>サイトマップ</h2>
<ul id="sitemap"></ul>
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>
<body>
<img class="logo" src="/img/logo.png">
<h2 id="name"></h2>
<div id="description"></div>
<h2>サイトマップ</h2>
<ul id="sitemap"></ul>
Expand Down
1 change: 1 addition & 0 deletions main/blackjack/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</head>
<body>
<img class="logo" src="/img/logo.png">
<h2 id="name"></h2>
<div id="description"></div>
<h2>サイトマップ</h2>
<ul id="sitemap"></ul>
Expand Down
1 change: 1 addition & 0 deletions main/exchange/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</head>
<body>
<img class="logo" src="/img/logo.png">
<h2 id="name"></h2>
<div id="description"></div>
<h2>サイトマップ</h2>
<ul id="sitemap"></ul>
Expand Down
1 change: 1 addition & 0 deletions main/fake/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</head>
<body>
<img class="logo" src="/img/logo.png">
<h2 id="name"></h2>
<div id="description"></div>
<h2>サイトマップ</h2>
<ul id="sitemap"></ul>
Expand Down
1 change: 1 addition & 0 deletions main/ping/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</head>
<body>
<img class="logo" src="/img/logo.png">
<h2 id="name"></h2>
<div id="description"></div>
<div class="url-input-container">
<input type="text" id="url-input" placeholder="URLを入力">
Expand Down
1 change: 1 addition & 0 deletions main/replace/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</head>
<body>
<img class="logo" src="/img/logo.png">
<h2 id="name"></h2>
<div id="description"></div>
<h2>サイトマップ</h2>
<ul id="sitemap"></ul>
Expand Down
3 changes: 2 additions & 1 deletion main/tategaki/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"name": "縦書き変換"
"name": "縦書き変換",
"description": "横書きの文章を擬似的に縦書きに変換します"
}
1 change: 1 addition & 0 deletions main/tategaki/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</head>
<body>
<img class="logo" src="/img/logo.png">
<h2 id="name"></h2>
<div id="description"></div>
<h2>サイトマップ</h2>
<ul id="sitemap"></ul>
Expand Down
2 changes: 1 addition & 1 deletion pages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
/main/fake/ 偽リンク生成 ...
/main/ping/ ステータスチェック 指定したページのステータスをチェックします
/main/replace/ 文字置き換え ...
/main/tategaki/ 縦書き変換 ...
/main/tategaki/ 縦書き変換 横書きの文章を擬似的に縦書きに変換します
7 changes: 6 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ document.addEventListener('DOMContentLoaded', () => {

const lines = data.split('\n');

const pageName = document.getElementById('name');
const descriptionDiv = document.getElementById('description');
const newParagraph = document.createElement('p');
newParagraph.textContent = 'Not found.'
Expand All @@ -20,13 +21,17 @@ document.addEventListener('DOMContentLoaded', () => {

const now = `/${window.location.href.split('/').slice(3).join('/')}`;
console.log(now);

if (
now.includes(path) ||
(
now === '/' &&
path === '/index.html'
)
) newParagraph.textContent = description;
) {
pageName.textContent = name;
newParagraph.textContent = description;
}

const listItem = document.createElement('li');
const link = document.createElement('a');
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body {
margin: 0;
}

h1, p {
h1, h2, p {
text-align: center;
}

Expand Down

0 comments on commit ee841c0

Please sign in to comment.