Loading...
Loading...
Compare original and translation side by side
Skill by ara.so — Devtools Skills collection.
由 ara.so 提供的 Skill — 开发者工具技能合集。
git clone https://github.com/evilmartians/devtool-template.git my-landing-page
cd my-landing-pagegit clone https://github.com/evilmartians/devtool-template.git my-landing-page
cd my-landing-page├── index.html # Main landing page
├── index.css # Styles and CSS variables
├── index.js # Interactive components
├── images/ # Image assets
└── fonts/ # Custom fonts├── index.html # 主落地页
├── index.css # 样式与CSS变量
├── index.js # 交互组件
├── images/ # 图片资源
└── fonts/ # 自定义字体index.htmlimages/index.htmlimages/theme-dark<html><!-- Light theme (default) -->
<html lang="en">
<!-- Dark theme -->
<html lang="en" class="theme-dark"><html>theme-dark<!-- 亮色主题(默认) -->
<html lang="en">
<!-- 暗色主题 -->
<html lang="en" class="theme-dark">index.css:root {
/* Primary brand color */
--color-primary-h: 210;
--color-primary-s: 100%;
--color-primary-l: 50%;
/* Accent color */
--color-accent-h: 350;
--color-accent-s: 100%;
--color-accent-l: 60%;
/* Background */
--color-bg: #ffffff;
--color-bg-secondary: #f5f5f5;
/* Text */
--color-text: #1a1a1a;
--color-text-secondary: #666666;
}
.theme-dark {
--color-bg: #1a1a1a;
--color-bg-secondary: #2a2a2a;
--color-text: #ffffff;
--color-text-secondary: #cccccc;
}index.css:root {
/* 主品牌色 */
--color-primary-h: 210;
--color-primary-s: 100%;
--color-primary-l: 50%;
/* 强调色 */
--color-accent-h: 350;
--color-accent-s: 100%;
--color-accent-l: 60%;
/* 背景色 */
--color-bg: #ffffff;
--color-bg-secondary: #f5f5f5;
/* 文本色 */
--color-text: #1a1a1a;
--color-text-secondary: #666666;
}
.theme-dark {
--color-bg: #1a1a1a;
--color-bg-secondary: #2a2a2a;
--color-text: #ffffff;
--color-text-secondary: #cccccc;
}<section class="hero">
<div class="container">
<h1 class="hero__title">Your Dev Tool Name</h1>
<p class="hero__description">
A brief, compelling description of what your tool does
</p>
<div class="hero__cta">
<a href="#get-started" class="button button--primary">Get Started</a>
<a href="https://github.com/yourname/repo" class="button button--secondary">
View on GitHub
</a>
</div>
</div>
</section><section class="hero">
<div class="container">
<h1 class="hero__title">你的开发者工具名称</h1>
<p class="hero__description">
一段简洁、有吸引力的工具功能描述
</p>
<div class="hero__cta">
<a href="#get-started" class="button button--primary">开始使用</a>
<a href="https://github.com/yourname/repo" class="button button--secondary">
在GitHub查看
</a>
</div>
</div>
</section><section class="features">
<div class="container">
<h2 class="section__title">Key Features</h2>
<div class="features__grid">
<div class="feature">
<div class="feature__icon">🚀</div>
<h3 class="feature__title">Fast Setup</h3>
<p class="feature__description">Get started in minutes</p>
</div>
<div class="feature">
<div class="feature__icon">🔧</div>
<h3 class="feature__title">Easy Configuration</h3>
<p class="feature__description">Minimal config required</p>
</div>
</div>
</div>
</section><section class="features">
<div class="container">
<h2 class="section__title">核心功能</h2>
<div class="features__grid">
<div class="feature">
<div class="feature__icon">🚀</div>
<h3 class="feature__title">快速搭建</h3>
<p class="feature__description">几分钟即可开始使用</p>
</div>
<div class="feature">
<div class="feature__icon">🔧</div>
<h3 class="feature__title">易于配置</h3>
<p class="feature__description">只需极少配置</p>
</div>
</div>
</div>
</section><section class="code-example">
<div class="container">
<h2 class="section__title">Quick Start</h2>
<pre class="code-block"><code>npm install your-tool
npx your-tool init
your-tool run</code></pre>
</div>
</section><section class="code-example">
<div class="container">
<h2 class="section__title">快速开始</h2>
<pre class="code-block"><code>npm install your-tool
npx your-tool init
your-tool run</code></pre>
</div>
</section><section class="cta">
<div class="container">
<h2 class="cta__title">Ready to get started?</h2>
<p class="cta__description">Join thousands of developers using this tool</p>
<a href="#signup" class="button button--large button--primary">
Start Free Trial
</a>
</div>
</section><section class="cta">
<div class="container">
<h2 class="cta__title">准备好开始了吗?</h2>
<p class="cta__description">加入数千名正在使用此工具的开发者行列</p>
<a href="#signup" class="button button--large button--primary">
开始免费试用
</a>
</div>
</section>index.js// Mobile menu toggle
const menuButton = document.querySelector('.menu-toggle');
const nav = document.querySelector('.nav');
menuButton?.addEventListener('click', () => {
nav.classList.toggle('nav--open');
});
// Smooth scroll to anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
target?.scrollIntoView({ behavior: 'smooth' });
});
});
// Track CTA clicks
document.querySelectorAll('.button--primary').forEach(button => {
button.addEventListener('click', () => {
// Analytics tracking
if (window.gtag) {
gtag('event', 'cta_click', {
'button_text': button.textContent
});
}
});
});index.js// 移动端菜单切换
const menuButton = document.querySelector('.menu-toggle');
const nav = document.querySelector('.nav');
menuButton?.addEventListener('click', () => {
nav.classList.toggle('nav--open');
});
// 锚点链接平滑滚动
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
target?.scrollIntoView({ behavior: 'smooth' });
});
});
// 追踪行动召唤按钮点击
document.querySelectorAll('.button--primary').forEach(button => {
button.addEventListener('click', () => {
// 分析追踪
if (window.gtag) {
gtag('event', 'cta_click', {
'button_text': button.textContent
});
}
});
});index.html<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
<!-- Or Plausible -->
<script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js"></script>GA_MEASUREMENT_IDindex.html<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
<!-- 或Plausible -->
<script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js"></script>GA_MEASUREMENT_IDmain/https://username.github.io/repo-namemain/https://username.github.io/repo-nameundefinedundefined
Or connect your GitHub repo in the Netlify dashboard.
或者在Netlify控制台中连接你的GitHub仓库。undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedindex.css/* Mobile: default styles */
.container {
padding: 0 16px;
}
/* Tablet and up */
@media (min-width: 768px) {
.container {
padding: 0 32px;
}
}
/* Desktop and up */
@media (min-width: 1024px) {
.container {
max-width: 1200px;
margin: 0 auto;
}
}index.css/* 移动端:默认样式 */
.container {
padding: 0 16px;
}
/* 平板及以上 */
@media (min-width: 768px) {
.container {
padding: 0 32px;
}
}
/* 桌面端及以上 */
@media (min-width: 1024px) {
.container {
max-width: 1200px;
margin: 0 auto;
}
}undefinedundefined
Use WebP format for better compression:
```html
<picture>
<source srcset="images/hero.webp" type="image/webp">
<img src="images/hero.jpg" alt="Hero image">
</picture>
使用WebP格式以获得更好的压缩效果:
```html
<picture>
<source srcset="images/hero.webp" type="image/webp">
<img src="images/hero.jpg" alt="Hero image">
</picture>index.html<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Dev Tool - Tagline</title>
<meta name="description" content="Your concise product description for search results">
<!-- Open Graph -->
<meta property="og:title" content="Your Dev Tool">
<meta property="og:description" content="Your product description">
<meta property="og:image" content="https://yourdomain.com/images/og-image.jpg">
<meta property="og:url" content="https://yourdomain.com">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Your Dev Tool">
<meta name="twitter:description" content="Your product description">
<meta name="twitter:image" content="https://yourdomain.com/images/twitter-card.jpg">
</head>index.html<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>你的开发者工具 - 标语</title>
<meta name="description" content="面向搜索结果的简洁产品描述">
<!-- Open Graph -->
<meta property="og:title" content="你的开发者工具">
<meta property="og:description" content="你的产品描述">
<meta property="og:image" content="https://yourdomain.com/images/og-image.jpg">
<meta property="og:url" content="https://yourdomain.com">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="你的开发者工具">
<meta name="twitter:description" content="你的产品描述">
<meta name="twitter:image" content="https://yourdomain.com/images/twitter-card.jpg">
</head>index.cssindex.html<link rel="stylesheet" href="index.css">index.cssindex.html<link rel="stylesheet" href="index.css">theme-dark<html><body>:root.theme-darktheme-dark<html><body>:root.theme-darkimages/photo.jpg/images/photo.jpgimages/photo.jpg/images/photo.jpgindex.js</body>index.js</body>fonts/@font-facefonts/@font-face