diff --git a/db.php b/db.php new file mode 100644 index 0000000..0736f20 --- /dev/null +++ b/db.php @@ -0,0 +1,26 @@ + [ + 'ignore_errors' => true, + 'timeout' => 10 // 设置10秒超时 + ] +]); + +$response = file_get_contents($api_url, false, $context); + +if ($response === FALSE) { + header("HTTP/1.1 500 Internal Server Error"); + echo json_encode(['error' => 'Failed to fetch data from API']); +} else { + $responseData = json_decode($response, true); + if (json_last_error() === JSON_ERROR_NONE) { + header('Content-Type: application/json'); + echo $response; + } else { + header("HTTP/1.1 500 Internal Server Error"); + echo json_encode(['error' => 'Invalid JSON response from API']); + } +} diff --git a/dist/css/style.min.css b/dist/css/style.min.css index 0f98d27..200c8ac 100644 --- a/dist/css/style.min.css +++ b/dist/css/style.min.css @@ -235,45 +235,6 @@ border-color: #3f3f46 } -@font-face { - font-family: open sans; - src: url(../fonts/OpenSans-Regular.woff2)format("woff2"), url(../fonts/OpenSans-Regular.woff)format("woff"); - font-weight: 400; - font-style: normal; - font-display: swap -} - -@font-face { - font-family: open sans; - src: url(../fonts/OpenSans-Bold.woff2)format("woff2"), url(../fonts/OpenSans-Bold.woff)format("woff"); - font-weight: 700; - font-style: normal; - font-display: swap -} - -@font-face { - font-family: open sans; - src: url(../fonts/OpenSans-Light.woff2)format("woff2"), url(../fonts/OpenSans-Light.woff)format("woff"); - font-weight: 200; - font-style: normal; - font-display: swap -} - -@font-face { - font-family: open sans; - src: url(../fonts/OpenSans-Medium.woff2)format("woff2"), url(../fonts/OpenSans-Medium.woff)format("woff"); - font-weight: 500; - font-style: normal; - font-display: swap -} - -@font-face { - font-family: mrs_saint_delafieldregular; - src: url(../fonts/mrssaintdelafield-regular-webfont.woff2)format("woff2"), url(../fonts/mrssaintdelafield-regular-webfont.woff)format("woff"); - font-weight: 400; - font-style: normal -} - /*!normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css*/ html { line-height: 1.15; diff --git a/post.php b/post.php index 842e6df..b443fdf 100644 --- a/post.php +++ b/post.php @@ -228,6 +228,92 @@ document.addEventListener('DOMContentLoaded', (event) => { currentList.appendChild(item); }); }); + + need('footer.php'); ?> \ No newline at end of file