Files
forces/forces.html
T
2026-07-31 16:55:45 +08:00

1218 lines
44 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>认识力 — 经典力学互动课堂</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
:root{
--primary:#4f8cff;
--primary-dark:#2a5bd7;
--accent:#ff6b6b;
--gravity:#ff6b6b;
--elastic:#51cf66;
--friction:#ffd43b;
--bg:#f4f6fb;
--card:#ffffff;
--text:#1a202c;
--text-light:#5a6478;
--shadow:0 8px 32px rgba(30,50,90,.08);
--radius:16px;
}
html{scroll-behavior:smooth}
body{
font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
background:var(--bg);
color:var(--text);
line-height:1.7;
overflow-x:hidden;
}
nav{
position:fixed;top:0;left:0;right:0;z-index:100;
background:rgba(255,255,255,.85);
backdrop-filter:blur(20px);
-webkit-backdrop-filter:blur(20px);
border-bottom:1px solid rgba(0,0,0,.05);
padding:14px 0;
}
.nav-inner{
max-width:1200px;margin:0 auto;padding:0 24px;
display:flex;align-items:center;justify-content:space-between;
}
.logo{
font-size:1.25rem;font-weight:700;
background:linear-gradient(135deg,var(--primary),var(--accent));
-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;
}
.nav-links{display:flex;gap:28px;list-style:none;flex-wrap:wrap}
.nav-links a{
text-decoration:none;color:var(--text-light);font-size:.92rem;font-weight:500;
transition:color .2s;
}
.nav-links a:hover{color:var(--primary)}
.hero{
min-height:100vh;
background:linear-gradient(135deg,#667eea 0%,#764ba2 50%,#f093fb 100%);
display:flex;align-items:center;justify-content:center;
text-align:center;padding:120px 24px 80px;
position:relative;overflow:hidden;
}
.hero::before{
content:"";position:absolute;inset:0;
background:
radial-gradient(circle at 20% 30%,rgba(255,255,255,.15),transparent 40%),
radial-gradient(circle at 80% 70%,rgba(255,255,255,.1),transparent 40%);
}
.hero-content{position:relative;z-index:1;max-width:800px;color:#fff}
.hero h1{
font-size:clamp(2.5rem,6vw,4.5rem);
font-weight:800;margin-bottom:20px;
text-shadow:0 4px 24px rgba(0,0,0,.15);
letter-spacing:.02em;
}
.hero p{
font-size:clamp(1.05rem,2vw,1.35rem);
opacity:.95;margin-bottom:36px;max-width:600px;margin-left:auto;margin-right:auto;
}
.hero-btn{
display:inline-block;padding:14px 40px;border-radius:50px;
background:#fff;color:var(--primary-dark);
text-decoration:none;font-weight:700;font-size:1.05rem;
box-shadow:0 8px 24px rgba(0,0,0,.15);
transition:transform .2s,box-shadow .2s;
}
.hero-btn:hover{transform:translateY(-3px);box-shadow:0 12px 32px rgba(0,0,0,.2)}
section{padding:80px 24px;max-width:1200px;margin:0 auto}
.section-title{
font-size:clamp(1.75rem,3vw,2.5rem);
font-weight:800;text-align:center;margin-bottom:12px;
}
.section-sub{
text-align:center;color:var(--text-light);margin-bottom:56px;
font-size:1.05rem;
}
.card{
background:var(--card);border-radius:var(--radius);
padding:36px;box-shadow:var(--shadow);
margin-bottom:28px;
transition:transform .25s,box-shadow .25s;
}
.card:hover{transform:translateY(-4px);box-shadow:0 12px 40px rgba(30,50,90,.12)}
.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:24px}
.grid-3{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:24px}
.concept-item{
padding:28px;border-radius:14px;background:#f8faff;
border-left:4px solid var(--primary);
}
.concept-item h3{color:var(--primary-dark);margin-bottom:8px;font-size:1.2rem}
.concept-item p{color:var(--text-light)}
.vector-diagram{
display:flex;justify-content:center;align-items:center;
margin:20px 0;
}
.vector-diagram svg{max-width:100%;height:auto}
.tag{
display:inline-block;padding:4px 12px;border-radius:20px;
font-size:.8rem;font-weight:600;margin-right:6px;
}
.tag-gravity{background:#ffe8e8;color:#c92a2a}
.tag-elastic{background:#d3f9d8;color:#2b8a3e}
.tag-friction{background:#fff3bf;color:#b8860b}
.tag-primary{background:#d0ebff;color:#1971c2}
.formula{
display:inline-block;padding:4px 14px;border-radius:8px;
background:linear-gradient(135deg,#e7f5ff,#f3f0ff);
font-family:"Cambria Math",Times New Roman,serif;
font-weight:700;font-size:1.15rem;color:var(--primary-dark);
margin:6px 4px;
}
.experiment-card{
background:var(--card);border-radius:var(--radius);
padding:28px;box-shadow:var(--shadow);
border-top:4px solid var(--primary);
}
.experiment-card.gravity{border-top-color:var(--gravity)}
.experiment-card.elastic{border-top-color:var(--elastic)}
.experiment-card.friction{border-top-color:var(--friction)}
.exp-header{display:flex;align-items:center;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.exp-header h3{font-size:1.25rem}
.exp-badge{
background:linear-gradient(135deg,var(--primary),var(--accent));
color:#fff;padding:3px 10px;border-radius:20px;font-size:.75rem;font-weight:600;
}
.exp-desc{color:var(--text-light);margin-bottom:20px;font-size:.95rem}
.canvas-wrap{
position:relative;background:#f8faff;border-radius:12px;
padding:12px;border:1px solid #eef2f7;
margin-bottom:16px;
}
canvas{display:block;width:100%;height:auto;border-radius:8px}
.controls{
display:flex;flex-wrap:wrap;gap:12px;align-items:center;
padding:14px;background:#f8faff;border-radius:10px;margin-bottom:14px;
}
.controls label{font-size:.88rem;color:var(--text-light);display:flex;align-items:center;gap:8px}
.controls input[type=range]{
width:140px;accent-color:var(--primary);
}
.controls .val{
min-width:48px;text-align:right;font-weight:700;color:var(--primary-dark);
font-variant-numeric:tabular-nums;
}
.btn{
padding:8px 20px;border:none;border-radius:8px;
background:var(--primary);color:#fff;font-weight:600;font-size:.9rem;
cursor:pointer;transition:all .2s;
}
.btn:hover{background:var(--primary-dark)}
.btn.secondary{background:#e9ecef;color:var(--text)}
.btn.secondary:hover{background:#dee2e6}
.data-display{
display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;
padding:14px;background:linear-gradient(135deg,#f8faff,#f0f4ff);
border-radius:10px;font-size:.9rem;
}
.data-item{display:flex;justify-content:space-between;align-items:center}
.data-item span:first-child{color:var(--text-light)}
.data-item span:last-child{font-weight:700;color:var(--primary-dark);font-variant-numeric:tabular-nums}
.data-item .g{color:#c92a2a}
.data-item .e{color:#2b8a3e}
.data-item .f{color:#b8860b}
.comparison-table{
width:100%;border-collapse:separate;border-spacing:0;
background:var(--card);border-radius:var(--radius);
overflow:hidden;box-shadow:var(--shadow);
margin-bottom:24px;
}
.comparison-table th,.comparison-table td{
padding:16px 18px;text-align:left;font-size:.95rem;
border-bottom:1px solid #eef2f7;
}
.comparison-table th{
background:linear-gradient(135deg,#e7f5ff,#f3f0ff);
font-weight:700;color:var(--primary-dark);font-size:1rem;
}
.comparison-table tr:last-child td{border-bottom:none}
.comparison-table td:first-child{font-weight:600;color:var(--text)}
.comparison-table .gravity-row td:first-child{color:#c92a2a}
.comparison-table .elastic-row td:first-child{color:#2b8a3e}
.comparison-table .friction-row td:first-child{color:#b8860b}
.life-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:24px}
.life-card{
padding:28px;border-radius:14px;color:#fff;position:relative;overflow:hidden;
min-height:180px;display:flex;flex-direction:column;justify-content:flex-end;
}
.life-card.gravity{background:linear-gradient(135deg,#ff6b6b,#ee5a5a)}
.life-card.elastic{background:linear-gradient(135deg,#51cf66,#40c057)}
.life-card.friction{background:linear-gradient(135deg,#ffd43b,#fab005)}
.life-card h4{font-size:1.2rem;margin-bottom:8px}
.life-card p{font-size:.9rem;opacity:.95}
.life-card .icon{position:absolute;top:20px;right:20px;font-size:3rem;opacity:.3}
.life-examples{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.life-examples span{
background:rgba(255,255,255,.2);padding:4px 12px;border-radius:20px;font-size:.82rem;
}
footer{
text-align:center;padding:40px 24px;color:var(--text-light);
font-size:.9rem;border-top:1px solid #eef2f7;margin-top:40px;
}
@media(max-width:768px){
.nav-links{gap:16px;font-size:.85rem}
.nav-links a{font-size:.82rem}
section{padding:56px 18px}
.card{padding:24px}
.experiment-card{padding:20px}
.controls{flex-direction:column;align-items:stretch}
.controls input[type=range]{width:100%}
.comparison-table th,.comparison-table td{padding:10px 12px;font-size:.82rem}
}
.animate-in{opacity:0;transform:translateY(30px);transition:opacity .6s,transform .6s}
.animate-in.visible{opacity:1;transform:translateY(0)}
</style>
</head>
<body>
<nav>
<div class="nav-inner">
<div class="logo">⚡ 力的课堂</div>
<ul class="nav-links">
<li><a href="#concept">概念</a></li>
<li><a href="#unit">单位</a></li>
<li><a href="#gravity">重力</a></li>
<li><a href="#elastic">弹力</a></li>
<li><a href="#friction">摩擦</a></li>
<li><a href="#compare">对比</a></li>
<li><a href="#life">生活</a></li>
</ul>
</div>
</nav>
<section class="hero">
<div class="hero-content">
<h1>认识力</h1>
<p>力是物体对物体的作用。从苹果落地到弓箭弹射,从走路摩擦到弹簧拉伸——让我们一起走进力的奇妙世界。</p>
<a href="#concept" class="hero-btn">开始探索 →</a>
</div>
</section>
<section id="concept" class="animate-in">
<h2 class="section-title">📐 力的概念</h2>
<p class="section-sub">力是物体对物体的作用,力不能脱离物体而独立存在</p>
<div class="card">
<h3 style="margin-bottom:16px;color:var(--primary-dark);font-size:1.3rem">力的三要素</h3>
<p style="color:var(--text-light);margin-bottom:20px">力的作用效果与力的<strong>大小</strong>、<strong>方向</strong>和<strong>作用点</strong>有关,这三者称为力的三要素。</p>
<div class="grid-3">
<div class="concept-item">
<h3>📏 大小</h3>
<p>力的大小不同,作用效果不同。用力越大,弹簧伸长越长。</p>
</div>
<div class="concept-item" style="border-left-color:var(--accent)">
<h3>➡️ 方向</h3>
<p>力的方向不同,作用效果不同。推车门和拉车门,效果完全不同。</p>
</div>
<div class="concept-item" style="border-left-color:var(--elastic)">
<h3>📍 作用点</h3>
<p>力的作用点不同,作用效果不同。推门的不同位置,用力的大小不同。</p>
</div>
</div>
<div class="vector-diagram">
<svg viewBox="0 0 500 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#4f8cff"/>
</marker>
<marker id="arrowRed" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#ff6b6b"/>
</marker>
</defs>
<line x1="60" y1="100" x2="200" y2="100" stroke="#4f8cff" stroke-width="3" marker-end="url(#arrow)"/>
<text x="130" y="85" text-anchor="middle" fill="#4f8cff" font-weight="bold" font-size="14">F₁ (较大)</text>
<line x1="250" y1="100" x2="340" y2="100" stroke="#ff6b6b" stroke-width="3" marker-end="url(#arrowRed)"/>
<text x="295" y="85" text-anchor="middle" fill="#ff6b6b" font-weight="bold" font-size="14">F₂ (较小)</text>
<circle cx="100" cy="100" r="6" fill="#4f8cff"/>
<circle cx="270" cy="100" r="6" fill="#ff6b6b"/>
<text x="100" y="130" text-anchor="middle" fill="#5a6478" font-size="12">作用点</text>
<text x="270" y="130" text-anchor="middle" fill="#5a6478" font-size="12">作用点</text>
<text x="250" y="180" text-anchor="middle" fill="#1a202c" font-size="13" font-weight="600">力是矢量:既有大小又有方向</text>
</svg>
</div>
</div>
</section>
<section id="unit" class="animate-in">
<h2 class="section-title">🔬 力的单位与测量</h2>
<p class="section-sub">用牛顿(N)作为力的单位,使用弹簧测力计进行测量</p>
<div class="grid-2">
<div class="card">
<span class="tag tag-primary">单位</span>
<h3 style="margin:12px 0;font-size:1.3rem">牛顿 (N)</h3>
<p style="color:var(--text-light)">为纪念英国科学家艾萨克·牛顿而命名。</p>
<div style="margin-top:16px">
<span class="formula">1 N ≈ 100 g 物体的重力</span>
</div>
<p style="color:var(--text-light);margin-top:12px;font-size:.9rem">
托起两个鸡蛋的力大约为 1N;一个中学生的体重大约为 500N。
</p>
</div>
<div class="card">
<span class="tag tag-primary">测量工具</span>
<h3 style="margin:12px 0;font-size:1.3rem">弹簧测力计</h3>
<p style="color:var(--text-light)">
利用弹簧的弹性形变来测量力的大小。<strong>原理:</strong>在弹性限度内,弹簧的伸长量与所受拉力成正比。
</p>
<div style="margin-top:16px;padding:12px;background:#f8faff;border-radius:10px">
<strong style="color:var(--primary-dark)">使用注意:</strong>
<ul style="margin-top:8px;padding-left:20px;color:var(--text-light);font-size:.9rem">
<li>使用前调零</li>
<li>被测力的方向沿弹簧轴线方向</li>
<li>不能超过量程</li>
</ul>
</div>
</div>
</div>
</section>
<section id="gravity" class="animate-in">
<h2 class="section-title">🌍 重力</h2>
<p class="section-sub">由于地球的吸引而使物体受到的力,方向总是竖直向下</p>
<div class="grid-2" style="margin-bottom:28px">
<div class="card">
<span class="tag tag-gravity">重力</span>
<h3 style="margin:12px 0;font-size:1.3rem">重力的三要素</h3>
<p style="color:var(--text-light)">
<strong>大小:</strong><span class="formula">G = mg</span> <br>
<strong>方向:</strong>总是<strong>竖直向下</strong>(垂直于水平面向下)<br>
<strong>作用点:</strong>重心(形状规则、质量均匀的物体重心在其几何中心)
</p>
<p style="color:var(--text-light);margin-top:12px;font-size:.9rem">
g 为重力加速度,通常取 g = 9.8 N/kg 或 g ≈ 10 N/kg。
</p>
</div>
<div class="card">
<h3 style="margin-bottom:12px;font-size:1.2rem">🎮 交互实验:自由落体</h3>
<p style="color:var(--text-light);font-size:.95rem">
两个质量不同的球从同一高度同时下落,验证"同时落地"。忽略空气阻力时,下落时间与质量无关。
</p>
<div style="margin-top:12px;padding:12px;background:#fff5f5;border-radius:10px;color:#c92a2a;font-size:.88rem">
💡 提示:在真空环境中,羽毛和铁球会同时落地!
</div>
</div>
</div>
<div class="experiment-card gravity">
<div class="exp-header">
<h3>🎮 自由落体模拟</h3>
<span class="exp-badge">Canvas 交互</span>
</div>
<p class="exp-desc">点击"开始下落"按钮,观察两个质量不同的球是否同时落地。开启"空气阻力"后,重球会先落地。</p>
<div class="canvas-wrap">
<canvas id="gravityCanvas" width="800" height="400"></canvas>
</div>
<div class="controls">
<label>
<input type="checkbox" id="airResistance"> 开启空气阻力
</label>
<button class="btn" id="dropBtn">▶ 开始下落</button>
<button class="btn secondary" id="resetGravity">↻ 重置</button>
</div>
<div class="data-display">
<div class="data-item"><span>大球落地时间</span><span class="g" id="bigTime">0.00 s</span></div>
<div class="data-item"><span>小球落地时间</span><span class="g" id="smallTime">0.00 s</span></div>
<div class="data-item"><span>当前状态</span><span id="gStatus">待开始</span></div>
</div>
</div>
</section>
<section id="elastic" class="animate-in">
<h2 class="section-title">🔩 弹力</h2>
<p class="section-sub">物体发生弹性形变时产生的力,胡克定律描述了弹力与形变的关系</p>
<div class="grid-2" style="margin-bottom:28px">
<div class="card">
<span class="tag tag-elastic">弹力</span>
<h3 style="margin:12px 0;font-size:1.3rem">弹力的产生</h3>
<p style="color:var(--text-light)">
弹力是物体发生<strong>弹性形变</strong>时,在物体内部产生的恢复原状的力。
</p>
<p style="color:var(--text-light);margin-top:12px">
<strong>产生条件:</strong>① 两物体相互接触;② 发生弹性形变。
</p>
</div>
<div class="card">
<h3 style="margin-bottom:12px;font-size:1.2rem">📐 胡克定律</h3>
<div style="margin:12px 0"><span class="formula">F = kx</span></div>
<p style="color:var(--text-light)">
在弹性限度内,弹簧的弹力 F 与形变量 x 成正比。
</p>
<div style="margin-top:12px;color:var(--text-light);font-size:.88rem">
<strong>k — 弹簧的劲度系数 (N/m)</strong>,由弹簧本身的性质决定。
</div>
</div>
</div>
<div class="experiment-card elastic">
<div class="exp-header">
<h3>🎮 拉伸弹簧实验</h3>
<span class="exp-badge">Canvas 交互</span>
</div>
<p class="exp-desc">拖动滑块拉伸弹簧,实时观察形变量 x 与弹力 F 的变化,直观验证 F = kx 的线性关系。</p>
<div class="canvas-wrap">
<canvas id="elasticCanvas" width="800" height="320"></canvas>
</div>
<div class="controls">
<label>弹簧原长 L₀:<span class="val" id="l0Val">100</span> px</label>
<label>劲度系数 k:<span class="val" id="kVal">50</span> N/m</label>
<input type="range" id="kSlider" min="10" max="200" value="50" step="5">
<button class="btn secondary" id="resetElastic">↻ 重置</button>
</div>
<div class="data-display">
<div class="data-item"><span>形变量 x</span><span class="e" id="xVal">0 px</span></div>
<div class="data-item"><span>弹力 F</span><span class="e" id="fVal">0.00 N</span></div>
<div class="data-item"><span>弹簧长度</span><span id="lenVal">100 px</span></div>
<div class="data-item"><span>弹性势能</span><span class="e" id="epVal">0.00 J</span></div>
</div>
</div>
</section>
<section id="friction" class="animate-in">
<h2 class="section-title">🧱 摩擦力</h2>
<p class="section-sub">两个互相接触的物体,当它们要发生或已经发生相对运动时,在接触面上产生的阻碍相对运动的力</p>
<div class="grid-3" style="margin-bottom:28px">
<div class="card">
<span class="tag tag-friction">滑动摩擦</span>
<h3 style="margin:12px 0;font-size:1.15rem">滑动摩擦力</h3>
<div style="margin:8px 0"><span class="formula">f = μN</span></div>
<p style="color:var(--text-light);font-size:.9rem">
物体滑动时受到的摩擦力,与<strong>压力大小</strong>和<strong>接触面粗糙程度</strong>有关。
</p>
</div>
<div class="card">
<span class="tag tag-friction">静摩擦</span>
<h3 style="margin:12px 0;font-size:1.15rem">静摩擦力</h3>
<p style="color:var(--text-light);font-size:.9rem">
物体有相对运动趋势但未滑动时受到的摩擦力,大小<strong>等于推力</strong>,随推力增大而增大,直到最大静摩擦。
</p>
</div>
<div class="card">
<span class="tag tag-friction">滚动摩擦</span>
<h3 style="margin:12px 0;font-size:1.15rem">滚动摩擦力</h3>
<p style="color:var(--text-light);font-size:.9rem">
一个物体在另一个物体上滚动时产生的摩擦力。在相同条件下,滚动摩擦比滑动摩擦小得多。
</p>
</div>
</div>
<div class="experiment-card friction">
<div class="exp-header">
<h3>🎮 推动木块实验</h3>
<span class="exp-badge">Canvas 交互</span>
</div>
<p class="exp-desc">调节推力大小,观察木块的运动状态。当推力超过最大静摩擦时,木块开始滑动。可调节压力和接触面粗糙度。</p>
<div class="canvas-wrap">
<canvas id="frictionCanvas" width="800" height="300"></canvas>
</div>
<div class="controls">
<label>推力 F:<input type="range" id="forceSlider" min="0" max="300" value="0"><span class="val" id="forceVal">0</span> N</label>
<label>压力 N:<input type="range" id="normalSlider" min="50" max="300" value="100"><span class="val" id="normalVal">100</span> N</label>
<label>粗糙度 μ:<input type="range" id="muSlider" min="0.1" max="0.8" value="0.3" step="0.05"><span class="val" id="muVal">0.30</span></label>
</div>
<div class="data-display">
<div class="data-item"><span>当前状态</span><span class="f" id="motionState">静止</span></div>
<div class="data-item"><span>摩擦力</span><span class="f" id="frictionForce">0.00 N</span></div>
<div class="data-item"><span>最大静摩擦</span><span class="f" id="maxStatic">30.00 N</span></div>
<div class="data-item"><span>滑动摩擦</span><span class="f" id="slidingF">30.00 N</span></div>
</div>
</div>
</section>
<section id="compare" class="animate-in">
<h2 class="section-title">📊 三种力对比</h2>
<p class="section-sub">重力、弹力、摩擦力是力学中最常见的三种力,它们既有区别又有联系</p>
<table class="comparison-table">
<thead>
<tr>
<th>对比项</th>
<th><span class="tag tag-gravity">重力</span></th>
<th><span class="tag tag-elastic">弹力</span></th>
<th><span class="tag tag-friction">摩擦力</span></th>
</tr>
</thead>
<tbody>
<tr class="gravity-row">
<td>产生原因</td>
<td>地球的吸引</td>
<td>物体发生弹性形变</td>
<td>接触面有相对运动或趋势</td>
</tr>
<tr class="elastic-row">
<td>大小</td>
<td>G = mg</td>
<td>F = kx(胡克定律)</td>
<td>静摩擦=推力;滑动 f = μN</td>
</tr>
<tr class="friction-row">
<td>方向</td>
<td>竖直向下</td>
<td>指向恢复形变方向</td>
<td>阻碍相对运动(趋势)</td>
</tr>
<tr class="gravity-row">
<td>作用点</td>
<td>重心</td>
<td>接触面上</td>
<td>接触面上</td>
</tr>
<tr class="elastic-row">
<td>施力物体</td>
<td>地球</td>
<td>发生形变的物体</td>
<td>接触面</td>
</tr>
<tr class="friction-row">
<td>联系</td>
<td colspan="3">弹力是摩擦力产生的必要条件;重力可影响压力大小,从而影响摩擦力;三种力都是接触力(重力除外),在日常生活中常常同时存在</td>
</tr>
</tbody>
</table>
</section>
<section id="life" class="animate-in">
<h2 class="section-title">🌿 生活实例</h2>
<p class="section-sub">力学无处不在,观察生活中的力现象</p>
<div class="life-grid">
<div class="life-card gravity">
<div class="icon">🍎</div>
<h4>重力的世界</h4>
<p>熟透的苹果落地、瀑布飞流直下、雨滴从天空落下、抛出去的篮球最终落回地面……</p>
<div class="life-examples">
<span>苹果落地</span>
<span>瀑布</span>
<span>雨滴</span>
<span>篮球</span>
</div>
</div>
<div class="life-card elastic">
<div class="icon">🏹</div>
<h4>弹力的妙用</h4>
<p>拉弓射箭、弹簧床垫、蹦蹦床、橡皮筋弹射、汽车减震器……都是弹力的应用。</p>
<div class="life-examples">
<span>弓箭</span>
<span>床垫</span>
<span>蹦床</span>
<span>减震器</span>
</div>
</div>
<div class="life-card friction">
<div class="icon">👟</div>
<h4>摩擦的利与弊</h4>
<p>走路靠摩擦、轮胎抓地、刹车制动;但机器磨损、能量损耗又需要减小摩擦。</p>
<div class="life-examples">
<span>走路</span>
<span>轮胎</span>
<span>刹车</span>
<span>润滑</span>
</div>
</div>
</div>
</section>
<footer>
<p>⚡ 力的课堂 — 认识力学的奇妙世界</p>
<p style="margin-top:6px;font-size:.82rem">纯 HTML5 Canvas 实现 · 无第三方依赖 · 响应式设计</p>
</footer>
<script>
// ============ 自由落体实验 ============
(function(){
const canvas = document.getElementById('gravityCanvas');
const ctx = canvas.getContext('2d');
const W = canvas.width, H = canvas.height;
const balls = {
big: { x: 250, y: 40, r: 22, vy: 0, color: '#ff6b6b', mass: 3 },
small: { x: 550, y: 40, r: 12, vy: 0, color: '#4f8cff', mass: 1 }
};
const floorY = 350;
const g = 9.8;
let running = false;
let startTime = 0;
let landedBig = false, landedSmall = false;
let timeBig = 0, timeSmall = 0;
let airResistance = false;
function drawScene(){
ctx.clearRect(0,0,W,H);
// 地面
ctx.fillStyle = '#e9ecef';
ctx.fillRect(0, floorY, W, H - floorY);
ctx.strokeStyle = '#adb5bd';
ctx.setLineDash([4,4]);
ctx.beginPath(); ctx.moveTo(0, floorY); ctx.lineTo(W, floorY); ctx.stroke();
ctx.setLineDash([]);
ctx.fillStyle = '#868e96';
ctx.font = '14px sans-serif';
ctx.fillText('地面', 10, floorY - 6);
// 标尺
ctx.strokeStyle = '#dee2e6';
ctx.lineWidth = 1;
for(let y = 40; y < floorY; y += 40){
ctx.beginPath(); ctx.moveTo(40, y); ctx.lineTo(60, y); ctx.stroke();
ctx.fillStyle = '#adb5bd';
ctx.fillText((floorY - y) + ' px', 10, y + 4);
}
// 球
drawBall(balls.big);
drawBall(balls.small);
// 标签
ctx.fillStyle = '#495057';
ctx.font = 'bold 13px sans-serif';
ctx.fillText('大球 (m=3kg)', balls.big.x - 30, 30);
ctx.fillText('小球 (m=1kg)', balls.small.x - 30, 30);
// 连线
ctx.strokeStyle = 'rgba(255,107,107,.3)';
ctx.lineWidth = 2;
ctx.setLineDash([6,4]);
ctx.beginPath();
ctx.moveTo(balls.big.x, balls.big.y);
ctx.lineTo(balls.big.x, floorY);
ctx.stroke();
ctx.strokeStyle = 'rgba(79,140,255,.3)';
ctx.beginPath();
ctx.moveTo(balls.small.x, balls.small.y);
ctx.lineTo(balls.small.x, floorY);
ctx.stroke();
ctx.setLineDash([]);
// 状态文字
if(!running && !landedBig && !landedSmall){
ctx.fillStyle = '#868e96';
ctx.font = '16px sans-serif';
ctx.fillText('点击"开始下落"', W/2 - 60, H/2);
}
}
function drawBall(b){
const grad = ctx.createRadialGradient(b.x - b.r*0.3, b.y - b.r*0.3, b.r*0.1, b.x, b.y, b.r);
grad.addColorStop(0, '#fff');
grad.addColorStop(0.3, b.color);
grad.addColorStop(1, shadeColor(b.color, -30));
ctx.fillStyle = grad;
ctx.beginPath(); ctx.arc(b.x, b.y, b.r, 0, Math.PI*2); ctx.fill();
ctx.strokeStyle = 'rgba(0,0,0,.2)';
ctx.lineWidth = 1;
ctx.stroke();
}
function shadeColor(hex, percent){
const f = parseInt(hex.slice(1),16);
const t = percent < 0 ? 0 : 255;
const p = Math.abs(percent)/100;
const R = f >> 16, G = (f >> 8) & 0xff, B = f & 0xff;
return '#' + (
0x1000000 +
(Math.round((t-R)*p)+R)*0x10000 +
(Math.round((t-G)*p)+G)*0x100 +
(Math.round((t-B)*p)+B)
).toString(16).slice(1);
}
let lastTime = 0;
function animate(t){
if(!lastTime) lastTime = t;
const dt = Math.min((t - lastTime)/1000, 0.05);
lastTime = t;
if(running){
const elapsed = (t - startTime)/1000;
const fallDist = floorY - 40;
// 大球
if(!landedBig){
const a = airResistance ? g - 0.5 * balls.big.vy * balls.big.vy / balls.big.mass : g;
balls.big.vy += a * dt * 50;
balls.big.y += balls.big.vy * dt * 2;
if(balls.big.y >= floorY - balls.big.r){
balls.big.y = floorY - balls.big.r;
balls.big.vy = 0;
landedBig = true;
timeBig = elapsed;
}
}
// 小球
if(!landedSmall){
const a = airResistance ? g - 0.5 * balls.small.vy * balls.small.vy / balls.small.mass : g;
balls.small.vy += a * dt * 50;
balls.small.y += balls.small.vy * dt * 2;
if(balls.small.y >= floorY - balls.small.r){
balls.small.y = floorY - balls.small.r;
balls.small.vy = 0;
landedSmall = true;
timeSmall = elapsed;
}
}
if(landedBig && landedSmall){
running = false;
updateGravityUI();
} else {
updateGravityUI(elapsed);
}
}
drawScene();
requestAnimationFrame(animate);
}
function updateGravityUI(elapsed){
document.getElementById('bigTime').textContent = landedBig ? timeBig.toFixed(2) + ' s' : (elapsed ? elapsed.toFixed(2) + ' s' : '0.00 s');
document.getElementById('smallTime').textContent = landedSmall ? timeSmall.toFixed(2) + ' s' : (elapsed ? elapsed.toFixed(2) + ' s' : '0.00 s');
if(!running && !landedBig && !landedSmall){
document.getElementById('gStatus').textContent = '待开始';
} else if(landedBig && landedSmall){
const diff = Math.abs(timeBig - timeSmall);
document.getElementById('gStatus').textContent = diff < 0.01 ? '同时落地!🎉' : (timeBig < timeSmall ? '大球先落地' : '小球先落地');
} else {
document.getElementById('gStatus').textContent = '下落中...';
}
}
document.getElementById('dropBtn').addEventListener('click', () => {
if(running) return;
resetBalls();
running = true;
startTime = performance.now();
updateGravityUI(0);
});
document.getElementById('resetGravity').addEventListener('click', () => {
resetBalls();
updateGravityUI();
});
document.getElementById('airResistance').addEventListener('change', (e) => {
airResistance = e.target.checked;
});
function resetBalls(){
balls.big.y = 40; balls.big.vy = 0;
balls.small.y = 40; balls.small.vy = 0;
landedBig = false; landedSmall = false;
timeBig = 0; timeSmall = 0;
running = false;
updateGravityUI();
}
updateGravityUI();
requestAnimationFrame(animate);
})();
// ============ 拉伸弹簧实验 ============
(function(){
const canvas = document.getElementById('elasticCanvas');
const ctx = canvas.getContext('2d');
const W = canvas.width, H = canvas.height;
let wallX = 80;
let springY = H / 2;
let l0 = 100;
let k = 50;
let stretchX = 0; // 形变量,正值为拉伸
let dragging = false;
let dragHandleX = wallX + l0; // 弹簧末端 x
// 图表数据
const chartPoints = [];
const maxChartPoints = 60;
function drawScene(){
ctx.clearRect(0, 0, W, H);
// 墙壁
ctx.fillStyle = '#868e96';
ctx.fillRect(wallX - 20, springY - 80, 160, 160);
// 斜线
ctx.strokeStyle = '#495057';
ctx.lineWidth = 2;
for(let i = 0; i < 10; i++){
const y = springY - 80 + i * 18;
ctx.beginPath();
ctx.moveTo(wallX - 20, y);
ctx.lineTo(wallX, y + 15);
ctx.stroke();
}
const endX = dragHandleX;
const currentLen = endX - wallX;
const x = currentLen - l0;
// 弹簧
drawSpring(wallX, springY, endX, springY, 14);
// 滑块(手柄)
ctx.fillStyle = '#4f8cff';
ctx.fillRect(endX - 8, springY - 30, 16, 60);
ctx.fillStyle = '#2a5bd7';
ctx.fillRect(endX - 10, springY - 34, 20, 6);
ctx.fillRect(endX - 10, springY + 28, 20, 6);
// 箭头表示拉力
if(x > 0){
ctx.strokeStyle = '#ff6b6b';
ctx.fillStyle = '#ff6b6b';
ctx.lineWidth = 2;
const forceLen = Math.min(x * 0.8, 120);
ctx.beginPath();
ctx.moveTo(endX, springY + 50);
ctx.lineTo(endX + forceLen, springY + 50);
ctx.stroke();
// 箭头
ctx.beginPath();
ctx.moveTo(endX + forceLen, springY + 50);
ctx.lineTo(endX + forceLen - 8, springY + 45);
ctx.lineTo(endX + forceLen - 8, springY + 55);
ctx.closePath();
ctx.fill();
ctx.fillStyle = '#c92a2a';
ctx.font = 'bold 14px sans-serif';
const forceN = (k * x / 50).toFixed(1);
ctx.fillText('F = ' + forceN + ' N', endX + forceLen + 8, springY + 55);
}
// 标注 x 原长
ctx.strokeStyle = '#adb5bd';
ctx.setLineDash([4,4]);
ctx.lineWidth = 1;
ctx.beginPath(); ctx.moveTo(wallX + l0, springY - 60); ctx.lineTo(wallX + l0, springY + 60); ctx.stroke();
ctx.setLineDash([]);
ctx.fillStyle = '#868e96';
ctx.font = '12px sans-serif';
ctx.fillText('原长 L₀=' + l0 + 'px', wallX + l0 - 30, springY - 70);
// 实时标注
ctx.fillStyle = '#495057';
ctx.font = '13px sans-serif';
ctx.fillText('当前长度 L=' + currentLen + 'px', 20, 30);
ctx.fillText('形变量 x=' + x + 'px', 20, 55);
// 小 F-x 图表
drawFXChart(x);
}
function drawSpring(x1, y1, x2, y2, coils){
const len = x2 - x1;
const amplitude = 10;
ctx.strokeStyle = '#5c7cfa';
ctx.lineWidth = 3;
ctx.beginPath();
ctx.moveTo(x1, y1);
for(let i = 0; i <= coils * 2; i++){
const t = i / (coils * 2);
const px = x1 + len * t;
const py = y1 + (i % 2 === 0 ? -amplitude : amplitude);
ctx.lineTo(px, py);
}
ctx.lineTo(x2, y2);
ctx.stroke();
}
function drawFXChart(currentX){
const cx = 500, cy = 100;
const cw = 250, ch = 140;
ctx.fillStyle = 'rgba(248,250,255,.8)';
ctx.fillRect(cx, cy, cw, ch);
ctx.strokeStyle = '#dee2e6';
ctx.strokeRect(cx, cy, cw, ch);
// 轴
ctx.strokeStyle = '#868e96';
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(cx, cy + ch - 20);
ctx.lineTo(cx + cw - 10, cy + ch - 20);
ctx.lineTo(cx, cy + ch - 20);
ctx.lineTo(cx, cy + 10);
ctx.stroke();
// 刻度
ctx.fillStyle = '#868e96';
ctx.font = '10px sans-serif';
ctx.fillText('x (px)', cx + cw - 30, cy + ch - 5);
ctx.save();
ctx.translate(cx + 10, cy + ch - 20);
ctx.rotate(-Math.PI/2);
ctx.fillText('F (N)', 0, 0);
ctx.restore();
// F-x 线
ctx.strokeStyle = '#51cf66';
ctx.lineWidth = 2;
ctx.beginPath();
for(let i = 0; i <= 40; i++){
const px = i / 40;
const xVal = px * 400;
const fVal = k * xVal / 50;
const px_ = cx + 10 + (xVal / 400) * (cw - 20);
const py_ = cy + ch - 20 - (fVal / 80) * (ch - 30);
if(i === 0) ctx.moveTo(px_, py_);
else ctx.lineTo(px_, py_);
}
ctx.stroke();
// 当前点
const curF = k * currentX / 50;
const dotPx = cx + 10 + (Math.max(0, currentX) / 400) * (cw - 20);
const dotPy = cy + ch - 20 - (Math.max(0, curF) / 80) * (ch - 30);
ctx.fillStyle = '#ff6b6b';
ctx.beginPath(); ctx.arc(dotPx, dotPy, 5, 0, Math.PI*2); ctx.fill();
ctx.strokeStyle = '#fff';
ctx.lineWidth = 2;
ctx.stroke();
}
function updateUI(){
const curLen = dragHandleX - wallX;
const x = curLen - l0;
const F = k * x / 50;
const ep = 0.5 * k * x * x / 2500;
document.getElementById('l0Val').textContent = l0;
document.getElementById('kVal').textContent = k;
document.getElementById('xVal').textContent = x + ' px';
document.getElementById('fVal').textContent = (x > 0 ? F.toFixed(2) : '0.00') + ' N';
document.getElementById('lenVal').textContent = curLen + ' px';
document.getElementById('epVal').textContent = (x > 0 ? ep.toFixed(2) : '0.00') + ' J';
}
canvas.addEventListener('mousedown', (e) => {
const rect = canvas.getBoundingClientRect();
const mx = (e.clientX - rect.left) * (W / rect.width);
if(Math.abs(mx - dragHandleX) < 40 && Math.abs(e.clientY - rect.top - (springY * H / rect.height)) < 40){
dragging = true;
}
});
canvas.addEventListener('mousemove', (e) => {
if(!dragging) return;
const rect = canvas.getBoundingClientRect();
const mx = (e.clientX - rect.left) * (W / rect.width);
dragHandleX = Math.max(wallX + 20, Math.min(mx, W - 40));
updateUI();
});
canvas.addEventListener('mouseup', () => dragging = false);
canvas.addEventListener('mouseleave', () => dragging = false);
canvas.addEventListener('touchstart', (e) => {
const rect = canvas.getBoundingClientRect();
const mx = (e.touches[0].clientX - rect.left) * (W / rect.width);
if(Math.abs(mx - dragHandleX) < 60) dragging = true;
e.preventDefault();
});
canvas.addEventListener('touchmove', (e) => {
if(!dragging) return;
const rect = canvas.getBoundingClientRect();
const mx = (e.touches[0].clientX - rect.left) * (W / rect.width);
dragHandleX = Math.max(wallX + 20, Math.min(mx, W - 40));
updateUI();
e.preventDefault();
});
canvas.addEventListener('touchend', () => dragging = false);
document.getElementById('kSlider').addEventListener('input', (e) => {
k = parseInt(e.target.value);
updateUI();
});
document.getElementById('resetElastic').addEventListener('click', () => {
dragHandleX = wallX + l0;
k = 50;
document.getElementById('kSlider').value = 50;
updateUI();
});
function loop(){
drawScene();
requestAnimationFrame(loop);
}
updateUI();
loop();
})();
// ============ 推动木块实验 ============
(function(){
const canvas = document.getElementById('frictionCanvas');
const ctx = canvas.getContext('2d');
const W = canvas.width, H = canvas.height;
let box = { x: 300, y: 180, w: 100, h: 70, vx: 0 };
let groundY = 250;
let appliedForce = 0;
let normalForce = 100;
let mu = 0.3;
let velocity = 0;
let isMoving = false;
let animating = false;
function maxStatic(){ return mu * normalForce; }
function slidingFriction(){ return mu * normalForce; }
function drawScene(){
ctx.clearRect(0, 0, W, H);
// 地面
ctx.fillStyle = '#f8faff';
ctx.fillRect(0, groundY, W, H - groundY);
// 纹理
ctx.strokeStyle = '#ced4da';
ctx.lineWidth = 1;
const roughness = Math.floor(mu * 20);
for(let x = 0; x < W; x += 8){
const offset = (Math.sin(x * 0.1) * roughness);
ctx.beginPath();
ctx.moveTo(x, groundY);
ctx.lineTo(x + 4, groundY - 3 - offset);
ctx.stroke();
}
ctx.fillStyle = '#adb5bd';
ctx.font = '11px sans-serif';
ctx.fillText('接触面 (μ=' + mu.toFixed(2) + ')', 10, groundY + 18);
// 木块
const grad = ctx.createLinearGradient(box.x, box.y, box.x, box.y + box.h);
grad.addColorStop(0, '#ffd43b');
grad.addColorStop(1, '#fab005');
ctx.fillStyle = grad;
ctx.fillRect(box.x, box.y, box.w, box.h);
ctx.strokeStyle = '#b8860b';
ctx.lineWidth = 2;
ctx.strokeRect(box.x, box.y, box.w, box.h);
ctx.fillStyle = '#868e96';
ctx.font = 'bold 14px sans-serif';
ctx.textAlign = 'center';
ctx.fillText('m', box.x + box.w/2, box.y + box.h/2 + 5);
ctx.textAlign = 'start';
// 推力箭头
if(appliedForce > 0){
const arrowLen = Math.min(appliedForce * 0.6, 160);
drawArrow(box.x - arrowLen - 20, box.y + box.h/2, box.x - 5, box.y + box.h/2, '#4f8cff', 'F推=' + appliedForce + 'N');
}
// 摩擦力箭头
const frictionDir = isMoving ? -1 : (appliedForce > 0 && appliedForce <= maxStatic() ? -1 : (appliedForce > 0 ? -1 : 0));
const fricVal = Math.min(appliedForce, maxStatic());
if(appliedForce > 0){
const fLen = Math.min(fricVal * 0.6, 160);
if(isMoving){
drawArrow(box.x + box.w + 5, box.y + box.h/2 + 20, box.x + box.w + fLen + 20, box.y + box.h/2 + 20, '#ff6b6b', 'f滑=' + slidingFriction().toFixed(1) + 'N');
} else {
drawArrow(box.x + box.w + 5, box.y + box.h/2 + 20, box.x + box.w + fLen + 20, box.y + box.h/2 + 20, '#ffd43b', 'f静=' + fricVal.toFixed(1) + 'N');
}
}
// 重力箭头
drawArrow(box.x + box.w/2, box.y - 5, box.x + box.w/2, box.y - 55, '#5c7cfa', 'G=' + normalForce + 'N');
// 支持力箭头
drawArrow(box.x + box.w/2, box.y + box.h + 5, box.x + box.w/2, box.y + box.h + 55, '#51cf66', 'N=' + normalForce + 'N');
// 状态
ctx.fillStyle = isMoving ? '#c92a2a' : '#2b8a3e';
ctx.font = 'bold 16px sans-serif';
ctx.fillText(isMoving ? '▶ 运动中 (v=' + velocity.toFixed(1) + ')' : '■ 静止', 20, 30);
// 标题
ctx.fillStyle = '#495057';
ctx.font = 'bold 15px sans-serif';
ctx.fillText('推动木块实验', W - 130, 30);
}
function drawArrow(x1, y1, x2, y2, color, label){
ctx.strokeStyle = color;
ctx.fillStyle = color;
ctx.lineWidth = 2;
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.stroke();
const angle = Math.atan2(y2 - y1, x2 - x1);
const headLen = 10;
ctx.beginPath();
ctx.moveTo(x2, y2);
ctx.lineTo(x2 - headLen * Math.cos(angle - Math.PI/6), y2 - headLen * Math.sin(angle - Math.PI/6));
ctx.lineTo(x2 - headLen * Math.cos(angle + Math.PI/6), y2 - headLen * Math.sin(angle + Math.PI/6));
ctx.closePath();
ctx.fill();
if(label){
const mx = (x1 + x2) / 2;
const my = (y1 + y2) / 2;
ctx.font = 'bold 11px sans-serif';
const metrics = ctx.measureText(label);
ctx.fillStyle = '#fff';
ctx.fillRect(mx - metrics.width/2 - 3, my - 8, metrics.width + 6, 16);
ctx.fillStyle = color;
ctx.fillText(label, mx - metrics.width/2, my + 4);
}
}
function updatePhysics(){
const maxS = maxStatic();
let netForce = 0;
if(appliedForce <= maxS){
isMoving = false;
velocity = 0;
netForce = 0;
} else {
isMoving = true;
netForce = appliedForce - slidingFriction();
}
const mass = normalForce / 10; // 简化:质量与压力成正比
const acceleration = netForce / mass;
velocity += acceleration * 0.016;
if(isMoving){
box.x += velocity * 0.016 * 60;
if(box.x < 20) { box.x = 20; velocity = 0; }
if(box.x + box.w > W - 20) { box.x = W - 20 - box.w; velocity = 0; }
}
updateFrictionUI();
}
function updateFrictionUI(){
document.getElementById('forceVal').textContent = appliedForce;
document.getElementById('normalVal').textContent = normalForce;
document.getElementById('muVal').textContent = mu.toFixed(2);
const maxS = maxStatic();
document.getElementById('maxStatic').textContent = maxS.toFixed(2) + ' N';
document.getElementById('slidingF').textContent = slidingFriction().toFixed(2) + ' N';
let fricDisplay = 0;
if(appliedForce > 0){
if(appliedForce <= maxS){
fricDisplay = appliedForce;
document.getElementById('frictionForce').textContent = '静摩擦 ' + fricDisplay.toFixed(2) + ' N';
document.getElementById('motionState').textContent = '静止 (静摩擦)';
} else {
fricDisplay = slidingFriction();
document.getElementById('frictionForce').textContent = '滑动摩擦 ' + fricDisplay.toFixed(2) + ' N';
document.getElementById('motionState').textContent = '运动中 (滑动摩擦)';
}
} else {
document.getElementById('frictionForce').textContent = '0.00 N';
document.getElementById('motionState').textContent = '静止';
}
}
document.getElementById('forceSlider').addEventListener('input', (e) => {
appliedForce = parseInt(e.target.value);
});
document.getElementById('normalSlider').addEventListener('input', (e) => {
normalForce = parseInt(e.target.value);
});
document.getElementById('muSlider').addEventListener('input', (e) => {
mu = parseFloat(e.target.value);
});
function animate(){
updatePhysics();
drawScene();
requestAnimationFrame(animate);
}
updateFrictionUI();
animate();
})();
// ============ 滚动动画 ============
(function(){
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if(entry.isIntersecting){
entry.target.classList.add('visible');
}
});
}, { threshold: 0.1 });
document.querySelectorAll('.animate-in').forEach(el => observer.observe(el));
})();
</script>
</body>
</html>