This commit is contained in:
2025-10-19 15:43:04 +08:00
parent 9894e82a99
commit 66964305d3
2 changed files with 45 additions and 41 deletions

View File

@@ -1,14 +1,14 @@
{
"name": "@kevisual/astro-simplate-template",
"name": "@kevisual/me-dnake-docs",
"version": "0.0.1",
"description": "",
"main": "index.js",
"basename": "/root/astro-simplate-template",
"basename": "/root/me-dnake-docs",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"pub": "envision deploy ./dist -k astro-simplate-template -v 0.0.1 -u",
"pub": "envision deploy ./dist -k me-dnake-docs -v 0.0.1 -u",
"sn": "pnpm dlx shadcn@latest add "
},
"keywords": [],

View File

@@ -1,47 +1,51 @@
---
// import { query } from '@/modules/query.ts';
console.log('Hello from index.astro');
import '../styles/global.css';
const links = [
{
link: './adb/',
title: 'ADB 文档',
},
{
link: './mz/',
title: 'Dnake的adb 的快捷指令,相关资料',
},
];
---
<html lang='en'>
<html lang='zh-CN'>
<head>
<meta charset="UTF-8" />
<title>My Homepage</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<h1 onclick="{onClick}">Welcome to my website!</h1>
<div class='bg-amber-50 w-20 h-20 rounded-full'></div>
<div id='root'></div>
<script type='importmap' data-vite-ignore is:inline>
{
"imports": {
"react": "https://esm.sh/react@19.1.0",
"react-dom": "https://esm.sh/react-dom@19.1.0/client.js",
"react-toastify": "https://esm.sh/react-toastify@11.0.5"
}
}
</script>
<script type='module' data-vite-ignore is:inline>
import { Button, message } from 'https://esm.sh/antd?standalone';
import React from 'react';
import { ToastContainer, toast } from 'react-toastify';
import { createRoot } from 'react-dom';
setTimeout(() => {
toast.loading('Hello from index.astro');
window.toast = toast;
console.log('message', toast);
}, 1000);
console.log('Hello from index.astro', Button);
const root = document.getElementById('root');
const render = createRoot(root);
const App = () => {
const button = React.createElement(Button, null, 'Hello');
const messageEl = React.createElement(ToastContainer, null, 'Hello');
const wrapperMessage = React.createElement('div', null, [button, messageEl]);
return wrapperMessage;
};
// render.render(React.createElement(Button, null, 'Hello'), root);
render.render(App(), root);
</script>
<body class="bg-gray-50 min-h-screen">
<div class="container mx-auto px-4 py-8">
<h1 class="text-3xl font-bold text-gray-800 mb-8 text-center">文档导航</h1>
<div class="max-w-2xl mx-auto">
<ul class="space-y-4">
{links.map((item) => (
<li>
<a
href={item.link}
class="block p-6 bg-white rounded-lg shadow-md hover:shadow-lg transition-shadow duration-300 border border-gray-200 hover:border-blue-300 group"
>
<h2 class="text-xl font-semibold text-gray-800 group-hover:text-blue-600 transition-colors duration-200">
{item.title}
</h2>
<p class="text-gray-600 mt-2">点击查看详细文档</p>
<div class="flex items-center mt-3 text-blue-500 group-hover:text-blue-700">
<span class="text-sm">查看文档</span>
<svg class="w-4 h-4 ml-2 transform group-hover:translate-x-1 transition-transform duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</div>
</a>
</li>
))}
</ul>
</div>
</div>
</body>
</html>