mirror of
https://github.com/imsyy/home.git
synced 2025-06-07 22:30:15 +09:00
Add files via upload
合并了部分重复代码,并且可以更快的应用更新后的配置
This commit is contained in:
parent
b96e55d632
commit
1c53f3023f
49
config.php
49
config.php
@ -2,6 +2,7 @@
|
||||
/*
|
||||
homepage config
|
||||
author: XYZ-dragon
|
||||
默认应该是不支持短标签的,所以就没写那种
|
||||
*/
|
||||
|
||||
class Site
|
||||
@ -13,34 +14,21 @@ class Site
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
function get_linklist(int $index, string $type)
|
||||
|
||||
/**
|
||||
* @return key|value
|
||||
**/
|
||||
function get_kv(string $name, int $index, string $type): string
|
||||
{
|
||||
/* 键名不确定 */
|
||||
switch ($type) {
|
||||
case 'name':
|
||||
return array_keys($this->$name)[$index];
|
||||
case 'url':
|
||||
return $this->link_list[array_keys($this->link_list)[$index]][0];
|
||||
if (gettype($this->$name[array_keys($this->$name)[$index]]) == 'string') return $this->$name[array_keys($this->$name)[$index]];
|
||||
return $this->$name[array_keys($this->$name)[$index]][0];
|
||||
case 'icon':
|
||||
return $this->link_list[array_keys($this->link_list)[$index]][1];
|
||||
case 'name':
|
||||
return array_keys($this->link_list)[$index];
|
||||
}
|
||||
}
|
||||
function get_linklist_without_icon(int $index, string $type)
|
||||
{
|
||||
switch ($type) {
|
||||
case 'url':
|
||||
return $this->z7z8[array_keys($this->z7z8)[$index]];
|
||||
case 'name':
|
||||
return array_keys($this->z7z8)[$index];
|
||||
}
|
||||
}
|
||||
function get_wallpaperapi(int $index, string $type)
|
||||
{
|
||||
switch ($type) {
|
||||
case 'url':
|
||||
return $this->wallpaper_api[array_keys($this->wallpaper_api)[$index]];
|
||||
case 'name':
|
||||
return array_keys($this->wallpaper_api)[$index];
|
||||
// 如果不存在直接报错
|
||||
return $this->$name[array_keys($this->$name)[$index]][1];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,7 +46,7 @@ $setting = [
|
||||
'Hello world!', 'System.out.print("Hello world!");'
|
||||
],
|
||||
'des_title_change' => [
|
||||
'Oops !', '哎呀,这都被你发现了 ( 再次点击可切换 )' // 还没用上
|
||||
'Oops !', '哎呀,这都被你发现了 ( 再次点击可切换 )'
|
||||
],
|
||||
'social_contact' => [
|
||||
'github' => 'https://github.com/XYZ-dragon',
|
||||
@ -68,7 +56,7 @@ $setting = [
|
||||
'twitter' => 'https://twitter.com/zuotun0226'
|
||||
],
|
||||
'link_list' => [
|
||||
'博客' => ['https://blueeyeswhitedragon.xyz/', 'fa-solid fa-blog',],
|
||||
'博客' => ['https://blueeyeswhitedragon.xyz/', 'fa-solid fa-blog'],
|
||||
'兰空图床' => ['http://localhost:8080/', 'fa-solid fa-cloud'],
|
||||
'Null' => ['', 'fa-solid fa-music'],
|
||||
'导航站' => ['', 'fa-solid fa-compass'],
|
||||
@ -76,15 +64,16 @@ $setting = [
|
||||
'Lab' => ['', 'fa-solid fa-flask']
|
||||
],
|
||||
'z7z8' => ['站点监控' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5'],
|
||||
'weather_api' => 'https://www.yiketianqi.com/free/day?appid=43656176&appsecret=I42og6Lm&unescape=1', // 没用上
|
||||
'weather_api' => 'https://www.yiketianqi.com/free/day?appid=43656176&appsecret=I42og6Lm&unescape=1',
|
||||
'wallpaper_api' => [
|
||||
'游戏王' => 'https://blueeyeswhitedragon.xyz/api/ygo/',
|
||||
'Bing' => 'https://blueeyeswhitedragon.xyz/api/bing/',
|
||||
'随机风景' => 'https://api.ixiaowai.cn/gqapi/gqapi.php',
|
||||
'随机动漫' => 'https://api.ixiaowai.cn/api/api.php'
|
||||
],
|
||||
'Copyright_year' => '2020',
|
||||
'Copyright_text' => '酢豚'
|
||||
'copyright' => ['2020', '酢豚'],
|
||||
];
|
||||
|
||||
$site = new Site($setting);
|
||||
// echo $site->des_title[0];
|
||||
|
||||
// echo $site->get_kv('z7z8', 0, 'url');
|
||||
|
87
index.php
87
index.php
@ -204,26 +204,26 @@ require_once './config.php';
|
||||
<!--第一组-->
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a id="link-url-1" href="<?php echo $site->get_linklist(0, 'url'); ?>" target="_blank">
|
||||
<a id="link-url-1" href="<?php echo $site->get_kv('link_list', 0, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<i id="link-icon-1" class="<?php echo $site->get_linklist(0, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-1"><?php echo $site->get_linklist(0, 'name'); ?></span>
|
||||
<i id="link-icon-1" class="<?php echo $site->get_kv('link_list', 0, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-1"><?php echo $site->get_kv('link_list', 0, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col 2">
|
||||
<a id="link-url-2" href="<?php echo $site->get_linklist(1, 'url'); ?>" target="_blank">
|
||||
<a id="link-url-2" href="<?php echo $site->get_kv('link_list', 1, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<i id="link-icon-2" class="<?php echo $site->get_linklist(1, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-2"><?php echo $site->get_linklist(1, 'name'); ?></span>
|
||||
<i id="link-icon-2" class="<?php echo $site->get_kv('link_list', 1, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-2"><?php echo $site->get_kv('link_list', 1, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a id="link-url-3" href="<?php echo $site->get_linklist(2, 'url'); ?>" target="_blank">
|
||||
<a id="link-url-3" href="<?php echo $site->get_kv('link_list', 2, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<i id="link-icon-3" class="<?php echo $site->get_linklist(2, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-3"><?php echo $site->get_linklist(2, 'name'); ?></span>
|
||||
<i id="link-icon-3" class="<?php echo $site->get_kv('link_list', 2, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-3"><?php echo $site->get_kv('link_list', 2, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@ -231,26 +231,26 @@ require_once './config.php';
|
||||
<!--第二组-->
|
||||
<div class="row" style="margin-top: 1.5rem;">
|
||||
<div class="col">
|
||||
<a id="link-url-4" href="<?php echo $site->get_linklist(3, 'url'); ?>" target="_blank">
|
||||
<a id="link-url-4" href="<?php echo $site->get_kv('link_list', 3, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<i id="link-icon-4" class="<?php echo $site->get_linklist(3, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-4"><?php echo $site->get_linklist(3, 'name'); ?></span>
|
||||
<i id="link-icon-4" class="<?php echo $site->get_kv('link_list', 3, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-4"><?php echo $site->get_kv('link_list', 3, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col 2">
|
||||
<a id="link-url-5" href="<?php echo $site->get_linklist(4, 'url'); ?>" target="_blank">
|
||||
<a id="link-url-5" href="<?php echo $site->get_kv('link_list', 4, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<i id="link-icon-5" class="<?php echo $site->get_linklist(4, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-5"><?php echo $site->get_linklist(4, 'name'); ?></span>
|
||||
<i id="link-icon-5" class="<?php echo $site->get_kv('link_list', 4, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-5"><?php echo $site->get_kv('link_list', 4, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a id="link-url-6" href="<?php echo $site->get_linklist(5, 'url'); ?>" target="_blank">
|
||||
<a id="link-url-6" href="<?php echo $site->get_kv('link_list', 5, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<i id="link-icon-6" class="<?php echo $site->get_linklist(5, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-6"><?php echo $site->get_linklist(5, 'name'); ?></span>
|
||||
<i id="link-icon-6" class="<?php echo $site->get_kv('link_list', 5, 'icon'); ?>"></i>
|
||||
<span class="link-name" id="link-name-6"><?php echo $site->get_kv('link_list', 5, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@ -310,39 +310,39 @@ require_once './config.php';
|
||||
<!--网站链接-->
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="<?php echo $site->get_linklist_without_icon(0, 'url'); ?>" target="_blank">
|
||||
<a href="<?php echo $site->get_kv('z7z8', 0, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<span class="link-name"><?php echo $site->get_linklist_without_icon(0, 'name'); ?></span>
|
||||
<span class="link-name"><?php echo $site->get_kv('z7z8', 0, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col 2">
|
||||
<a href="<?php echo $site->get_linklist_without_icon(1, 'url'); ?>" target="_blank">
|
||||
<a href="<?php echo $site->get_kv('z7z8', 1, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<span class="link-name"><?php echo $site->get_linklist_without_icon(1, 'name'); ?></span>
|
||||
<span class="link-name"><?php echo $site->get_kv('z7z8', 1, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a href="<?php echo $site->get_linklist_without_icon(2, 'url'); ?>" target="_blank">
|
||||
<a href="<?php echo $site->get_kv('z7z8', 2, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<span class="link-name"><?php echo $site->get_linklist_without_icon(2, 'name'); ?></span>
|
||||
<span class="link-name"><?php echo $site->get_kv('z7z8', 2, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 1.5rem;">
|
||||
<div class="col">
|
||||
<a href="<?php echo $site->get_linklist_without_icon(3, 'url'); ?>" target="_blank">
|
||||
<a href="<?php echo $site->get_kv('z7z8', 3, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<span class="link-name"><?php echo $site->get_linklist_without_icon(3, 'name'); ?></span>
|
||||
<span class="link-name"><?php echo $site->get_kv('z7z8', 3, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col 2">
|
||||
<a href="<?php echo $site->get_linklist_without_icon(4, 'url'); ?>" target="_blank">
|
||||
<a href="<?php echo $site->get_kv('z7z8', 4, 'url'); ?>" target="_blank">
|
||||
<div class="link-card cards">
|
||||
<span class="link-name"><?php echo $site->get_linklist_without_icon(4, 'name'); ?></span>
|
||||
<span class="link-name"><?php echo $site->get_kv('z7z8', 4, 'name'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@ -390,19 +390,19 @@ require_once './config.php';
|
||||
</div>
|
||||
<div class="form-radio">
|
||||
<input type="radio" class="set-wallpaper" style="display: none;" id="radio2" value="2" name="wallpaper-type">
|
||||
<label for="radio2" id="wallpaper_text1"><?php echo $site->get_wallpaperapi(0, 'name'); ?></label>
|
||||
<label for="radio2" id="wallpaper_text1"><?php echo $site->get_kv('wallpaper_api', 0, 'name'); ?></label>
|
||||
</div>
|
||||
<div class="form-radio">
|
||||
<input type="radio" class="set-wallpaper" style="display: none;" id="radio3" value="3" name="wallpaper-type">
|
||||
<label for="radio3" id="wallpaper_text2"><?php echo $site->get_wallpaperapi(1, 'name'); ?></label>
|
||||
<label for="radio3" id="wallpaper_text2"><?php echo $site->get_kv('wallpaper_api', 1, 'name'); ?></label>
|
||||
</div>
|
||||
<div class="form-radio">
|
||||
<input type="radio" class="set-wallpaper" style="display: none;" id="radio4" value="4" name="wallpaper-type">
|
||||
<label for="radio4" id="wallpaper_text3"><?php echo $site->get_wallpaperapi(2, 'name'); ?></label>
|
||||
<label for="radio4" id="wallpaper_text3"><?php echo $site->get_kv('wallpaper_api', 2, 'name'); ?></label>
|
||||
</div>
|
||||
<div class="form-radio">
|
||||
<input type="radio" class="set-wallpaper" style="display: none;" id="radio5" value="5" name="wallpaper-type">
|
||||
<label for="radio5" id="wallpaper_text4"><?php echo $site->get_wallpaperapi(3, 'name'); ?></label>
|
||||
<label for="radio5" id="wallpaper_text4"><?php echo $site->get_kv('wallpaper_api', 3, 'name'); ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -433,11 +433,10 @@ require_once './config.php';
|
||||
<span class="uptext">
|
||||
<i class="fa-solid fa-screwdriver-wrench"></i> 移动端动画及细节</span>
|
||||
<span class="uptext">
|
||||
<i class="fa-solid fa-screwdriver-wrench"></i> 图标更换为 Font
|
||||
Awesome</span>
|
||||
<i class="fa-solid fa-screwdriver-wrench"></i> 图标更换为 FontAwesome</span>
|
||||
<span class="uptext">
|
||||
<i class="fa-solid fa-rotate-left"></i>
|
||||
<a href="<?php echo $site->domain; ?>/old/" style="color:#efefef">返回旧版站点</a>
|
||||
<a href="<?php echo $site->domain; ?>/" style="color:#efefef">返回旧版站点(X)</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -457,10 +456,9 @@ require_once './config.php';
|
||||
</main>
|
||||
<!-- 版权信息 -->
|
||||
<footer id="footer" class="fixed-bottom footer">
|
||||
<div class="power">Copyright © <span id="power-year">2020</span>
|
||||
<script>
|
||||
document.write(' - ' + (new Date()).getFullYear())
|
||||
</script> <a href="https://imsyy.top" id="power-text">無名</a> &
|
||||
<div class="power">Copyright ©
|
||||
<span id="power-year"><?php echo $site->copyright[0] . ' - ' . date('Y');; ?></span>
|
||||
<a href="<?php echo $site->domain; ?>" id="power-text"><?php echo $site->copyright[1]; ?></a> &
|
||||
<!-- 以下信息请不要修改哦 -->
|
||||
Made by <a href="https://github.com/imsyy/home" target="_blank">imsyy</a>
|
||||
</div>
|
||||
@ -482,8 +480,7 @@ require_once './config.php';
|
||||
</noscript>
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="<?php echo $site->domain; ?>/js/main.js"></script>
|
||||
<!-- <script type="text/javascript" src="<?php //echo $site->domain;
|
||||
?>/js/set.js"></script> -->
|
||||
<!-- <script type="text/javascript" src="/js/set.js"></script> -->
|
||||
<script type="text/javascript" src="<?php echo $site->domain; ?>/js/time.js"></script>
|
||||
<script type="text/javascript" src="<?php echo $site->domain; ?>/js/js.cookie.js"></script>
|
||||
<script type="text/javascript" src="<?php echo $site->domain; ?>/js/cursor.js"></script>
|
||||
@ -498,10 +495,10 @@ require_once './config.php';
|
||||
/* 天气 API */
|
||||
localStorage.setItem('weather_api', '<?php echo $site->weather_api; ?>');
|
||||
// 壁纸 API
|
||||
localStorage.setItem('wallpaper_api_1', '<?php echo $site->get_wallpaperapi(0, 'url'); ?>');
|
||||
localStorage.setItem('wallpaper_api_2', '<?php echo $site->get_wallpaperapi(1, 'url'); ?>');
|
||||
localStorage.setItem('wallpaper_api_3', '<?php echo $site->get_wallpaperapi(2, 'url'); ?>');
|
||||
localStorage.setItem('wallpaper_api_4', '<?php echo $site->get_wallpaperapi(3, 'url'); ?>');
|
||||
localStorage.setItem('wallpaper_api_1', '<?php echo $site->get_kv('wallpaper_api', 0, 'url'); ?>');
|
||||
localStorage.setItem('wallpaper_api_2', '<?php echo $site->get_kv('wallpaper_api', 1, 'url'); ?>');
|
||||
localStorage.setItem('wallpaper_api_3', '<?php echo $site->get_kv('wallpaper_api', 2, 'url'); ?>');
|
||||
localStorage.setItem('wallpaper_api_4', '<?php echo $site->get_kv('wallpaper_api', 3, 'url'); ?>');
|
||||
|
||||
/* 添加了一个壁纸 API, 其他未动 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user