XLAdmin - 项目化主页 - 由ChatGpt生成
<h1 align='center'>Hello, World!该项目页面由ChatGpt提供技术支持</h1>
<p align='center'>当前XshellGithubAnonymousRat远程协助工具实时在线:<?php
$url = 'https://www.xladmin.com/shujurenshu/onlineip.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
curl_close($ch);
<p>preg_match_all('/<body.<em>?>(.</em>?)</body>/si', $output, $matches);</p>
<p>echo $matches[1][0];
?>人在线</p></p>
<div class='switch-container'>
  <input type='checkbox' id='switch' name='mode'>
  <label for='switch' class='switch'>
    <span class='toggle'></span>
  </label>
</div>
<?php
// 读取JSON文件
$data = file_get_contents('projects.json');
$projects = json_decode($data, true);
// 处理搜索请求
if(isset($_GET['search'])) {
  $search = htmlspecialchars($_GET['search']);
  $filteredProjects = array_filter($projects['projects'], function($project) use ($search) {
    return strpos(strtolower($project['name']), strtolower($search)) !== false;
  });
  $projects['projects'] = array_values($filteredProjects);
}
// 显示每个项目的信息
echo '<div class="container">';
foreach($projects['projects'] as $project) {
  echo '<div class="project">';
  echo '<img src="' . $project['image'] . '">';
  echo '<h2>' . $project['name'] . '</h2>';
  echo '<p>' . $project['description'] . '</p>';
  echo '<a href="' . $project['link'] . '">项目进入</a>';
  echo '</div>';
}
echo '</div>';
// 显示搜索框
echo '<form method="get">';
echo '<input type="text" name="search" placeholder="搜索项目">';
echo '<button type="submit">搜索</button>';
echo '</form>';
?>
<style>
form {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}
input[type="text"] {
  padding: 10px;
  border: none;
  border-radius: 20px;
  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 16px;
  width: 300px;
  margin-right: 10px;
}
button[type="submit"] {
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
}
  .container{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 20px;
    padding: 20px;
  }
  .project {
    border: 1px solid #ccc;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
  }
  
  .project img {
    max-width: 100%;
    margin-bottom: 10px;
  }
  
  .project h2 {
    font-size: 24px;
    margin-bottom: 10px;
  }
  
  .project p {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .project a {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 10px;
  }
  
  .project a:hover {
    background-color: #0062cc;
  }
  .switch-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 999;
  }
  
  .switch {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 34px;
    margin-right: 16px;
  }
  
  .switch input {
    display: none;
  }
  
  .toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color .3s;
  }
  
  .toggle:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform .3s;
  }
  
  input:checked + .toggle {
    background-color: #86d993;
  }
  
  input:checked + .toggle:before {
    transform: translateX(26px);
  }
  
  body.dark {
    background-color: #222;
    color: #fff;
  }
  
  body.dark .switch-container {
    top: 80px;
  }
  
  body.dark .project {
    background-color: #333;
    border-color: #555;
  }
  
  body.dark .project h2,
  body.dark .project p {
    color: #fff;
  }
  
  body.dark .project a {
    background-color: #86d993;
    color: #222;
  }
  
  body.dark .project a:hover {
    background-color: #7bcf8a;
  }
  
  body.dark .switch input:checked + .toggle:before {
    transform: translateX(30px);
  }
</style>
<title>XLAdmin-项目化主页-由ChatGpt生成</title>
<style>
footer {
  text-align: center;
  background-color: #f2f2f2;
  padding: 10px;
}
</style>
<footer>
<?php
    if(!file_exists("count.txt")){
        $one_file=fopen("count.txt","w+"); //建立一个统计文本,如果不存在就创建
        echo"您是第<font color='red'><b>10007</b></font>位访客"; //首次直接输出第一次
        fwrite("count.txt","1");  //把数字1写入文本
        fclose("$one_file");
     }else{ //如果不是第一次访问直接读取内容,并+1,写入更新后再显示新的访客数
        $num=file_get_contents("count.txt");
        $num++;
        file_put_contents("count.txt","$num");
        $newnum=file_get_contents("count.txt");
        echo"您是第<font color='red'><b>".$newnum."</b></font>位访客";
    }
?>
  <p>© 2023 GhostKylin</p>
</footer>
<script>
  const switchInput = document.querySelector('#switch');
  const body = document.body;
  
  switchInput.addEventListener('change', () => {
    if (switchInput.checked) {
      body.classList.add('dark');
    } else {
      body.classList.remove('dark');
    }
  });
</script>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/mCVW 著作权归作者所有。请勿转载和采集!