-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
204 lines (196 loc) · 5.07 KB
/
Copy pathindex.html
File metadata and controls
204 lines (196 loc) · 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>安藤ポータルサイト</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Helvetica Neue", sans-serif;
background: linear-gradient(135deg, #1a73e8, #0f9d58);
color: white;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.container {
max-width: 900px;
margin: 0 auto;
padding: 50px 20px;
flex: 1;
}
header {
text-align: center;
margin-bottom: 3rem;
}
.site-title {
font-size: 2.5rem;
margin-bottom: 0.5rem;
font-weight: bold;
}
.site-subtitle {
font-size: 1rem;
opacity: 0.9;
}
main {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 2rem;
}
.posts-section {
background: rgba(255, 255, 255, 0.1);
padding: 2rem;
border-radius: 12px;
}
.section-title {
color: #ffeb3b;
font-size: 1.5rem;
margin-bottom: 1.5rem;
border-bottom: 2px solid #ffeb3b;
padding-bottom: 0.5rem;
}
.post-item {
background: rgba(255, 255, 255, 0.05);
padding: 1.5rem;
margin-bottom: 1rem;
border-radius: 8px;
transition: all 0.3s;
border-left: 4px solid #ffeb3b;
}
.post-item:hover {
background: rgba(255, 255, 255, 0.15);
transform: translateX(5px);
}
.post-item a {
text-decoration: none;
color: white;
}
.post-title {
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 0.5rem;
display: block;
}
.post-date {
color: #ffeb3b;
font-size: 0.85rem;
margin-bottom: 0.5rem;
}
.post-description {
font-size: 0.95rem;
opacity: 0.9;
line-height: 1.4;
}
.sidebar {
background: rgba(255, 255, 255, 0.1);
padding: 2rem;
border-radius: 12px;
height: fit-content;
}
.sidebar h3 {
color: #ffeb3b;
font-size: 1.2rem;
margin-bottom: 1rem;
border-bottom: 2px solid #ffeb3b;
padding-bottom: 0.5rem;
}
.sidebar ul {
list-style: none;
}
.sidebar li {
margin-bottom: 0.8rem;
}
.sidebar a {
color: #fff;
text-decoration: underline;
transition: color 0.3s;
}
.sidebar a:hover {
color: #ffeb3b;
}
footer {
text-align: center;
padding: 2rem;
margin-top: 2rem;
font-size: 0.9rem;
opacity: 0.8;
border-top: 1px solid rgba(255, 255, 255, 0.2);
}
@media (max-width: 768px) {
main {
grid-template-columns: 1fr;
}
.container {
padding: 20px 10px;
}
.site-title {
font-size: 1.8rem;
}
}
</style>
</head>
<body>
<div class="container">
<header>
<div class="site-title">安藤ポータルサイト</div>
<div class="site-subtitle">日記とリンク集</div>
</header>
<main>
<section class="posts-section">
<h2 class="section-title">📔 最新の日記</h2>
<div id="posts-list"></div>
</section>
<aside class="sidebar">
<h3>🔗 リンク</h3>
<ul>
<li><a href="https://github.com/">GitHub</a></li>
<li><a href="https://pages.github.com/">GitHub Pages</a></li>
</ul>
</aside>
</main>
</div>
<footer>
© 2025 Ando Lab
</footer>
<script>
// 記事データを読み込んで表示
async function loadPosts() {
try {
const response = await fetch('./posts/data.json');
const data = await response.json();
// 日付の新しい順にソート
const sortedPosts = data.posts.sort((a, b) => new Date(b.date) - new Date(a.date));
const postsContainer = document.getElementById('posts-list');
postsContainer.innerHTML = '';
sortedPosts.forEach(post => {
const postElement = document.createElement('a');
postElement.href = `./posts/${post.id}.html`;
postElement.className = 'post-item';
const dateObj = new Date(post.date);
const formattedDate = dateObj.toLocaleDateString('ja-JP', {
year: 'numeric',
month: '2-digit',
day: '2-digit'
});
postElement.innerHTML = `
<div class="post-title">${post.title}</div>
<div class="post-date">📅 ${formattedDate}</div>
<div class="post-description">${post.description}</div>
`;
postsContainer.appendChild(postElement);
});
} catch (error) {
console.error('記事の読み込みに失敗しました:', error);
document.getElementById('posts-list').innerHTML = '<p>記事を読み込めませんでした。</p>';
}
}
// ページ読み込み時に記事を読み込む
document.addEventListener('DOMContentLoaded', loadPosts);
</script>
</body>
</html>