Spaces:
Sleeping
Sleeping
Commit
·
c32e8f0
1
Parent(s):
09ee276
chore: move for teachers and for students to the middel and modify dockerfile
Browse files- Dockerfile +12 -4
- app/page.tsx +13 -16
Dockerfile
CHANGED
|
@@ -6,10 +6,18 @@ RUN apk add --no-cache libc6-compat
|
|
| 6 |
WORKDIR /app
|
| 7 |
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
| 8 |
RUN \
|
| 9 |
-
if [ -f yarn.lock ]; then
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
fi
|
| 14 |
|
| 15 |
FROM base AS frontend-builder
|
|
|
|
| 6 |
WORKDIR /app
|
| 7 |
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
| 8 |
RUN \
|
| 9 |
+
if [ -f yarn.lock ]; then \
|
| 10 |
+
echo "Installing dependencies with yarn..." && \
|
| 11 |
+
yarn --frozen-lockfile || exit 1; \
|
| 12 |
+
elif [ -f package-lock.json ]; then \
|
| 13 |
+
echo "Installing dependencies with npm..." && \
|
| 14 |
+
npm ci || exit 1; \
|
| 15 |
+
elif [ -f pnpm-lock.yaml ]; then \
|
| 16 |
+
echo "Installing dependencies with pnpm..." && \
|
| 17 |
+
yarn global add pnpm && pnpm i --frozen-lockfile || exit 1; \
|
| 18 |
+
else \
|
| 19 |
+
echo "No lockfile found. Please provide either yarn.lock, package-lock.json, or pnpm-lock.yaml" && \
|
| 20 |
+
exit 1; \
|
| 21 |
fi
|
| 22 |
|
| 23 |
FROM base AS frontend-builder
|
app/page.tsx
CHANGED
|
@@ -11,7 +11,7 @@ export default function LandingPage() {
|
|
| 11 |
<div className="min-h-screen bg-background-primary">
|
| 12 |
{/* Modern Header */}
|
| 13 |
<header className="fixed w-full bg-background-secondary/80 backdrop-blur-sm border-b border-border z-50">
|
| 14 |
-
<div className="container mx-auto px-4 py-4 flex items-center
|
| 15 |
<Link href="/" className="text-3xl font-bold">
|
| 16 |
<span className="text-[#FF6B6B]">P</span>
|
| 17 |
<span className="text-[#4ECDC4]">l</span>
|
|
@@ -22,23 +22,20 @@ export default function LandingPage() {
|
|
| 22 |
<span className="ml-2 text-[#45B7D1]">A</span>
|
| 23 |
<span className="text-[#FDCB6E]">I</span>
|
| 24 |
</Link>
|
| 25 |
-
<nav className="flex items-center space-x-8">
|
| 26 |
<Link href="/for-teachers" className="text-text-secondary hover:text-primary">
|
| 27 |
-
|
| 28 |
</Link>
|
| 29 |
<Link href="/for-students" className="text-text-secondary hover:text-primary">
|
| 30 |
-
|
| 31 |
</Link>
|
| 32 |
-
<Link href="/community" className="text-text-secondary hover:text-primary">
|
| 33 |
-
Community
|
| 34 |
-
</Link>
|
| 35 |
-
<button
|
| 36 |
-
onClick={toggleTheme}
|
| 37 |
-
className="px-4 py-2 rounded-lg bg-primary text-white hover:bg-primary/90"
|
| 38 |
-
>
|
| 39 |
-
{theme === 'light' ? '🌙' : '☀️'}
|
| 40 |
-
</button>
|
| 41 |
</nav>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
</div>
|
| 43 |
</header>
|
| 44 |
|
|
@@ -62,7 +59,7 @@ export default function LandingPage() {
|
|
| 62 |
<h3 className="text-xl font-semibold mb-2">Interactive Learning</h3>
|
| 63 |
<p className="text-text-secondary">Engage with AI-powered quizzes, projects, and virtual labs</p>
|
| 64 |
</div>
|
| 65 |
-
|
| 66 |
<div className="p-6 rounded-xl bg-background-primary">
|
| 67 |
<div className="w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4">
|
| 68 |
<svg className="w-6 h-6 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
@@ -137,7 +134,7 @@ export default function LandingPage() {
|
|
| 137 |
</h3>
|
| 138 |
<p className="text-text-secondary">Making learning fun and accessible for everyone</p>
|
| 139 |
</div>
|
| 140 |
-
|
| 141 |
<div className="text-center">
|
| 142 |
<h3 className="font-semibold mb-4">Learning Resources</h3>
|
| 143 |
<ul className="space-y-2">
|
|
@@ -146,7 +143,7 @@ export default function LandingPage() {
|
|
| 146 |
<li><Link href="/blog" className="text-text-secondary hover:text-primary">Educational Blog</Link></li>
|
| 147 |
</ul>
|
| 148 |
</div>
|
| 149 |
-
|
| 150 |
<div className="text-center md:text-right">
|
| 151 |
<h3 className="font-semibold mb-4">Connect With Us</h3>
|
| 152 |
<div className="flex justify-center md:justify-end space-x-4">
|
|
|
|
| 11 |
<div className="min-h-screen bg-background-primary">
|
| 12 |
{/* Modern Header */}
|
| 13 |
<header className="fixed w-full bg-background-secondary/80 backdrop-blur-sm border-b border-border z-50">
|
| 14 |
+
<div className="container mx-auto px-4 py-4 flex items-center">
|
| 15 |
<Link href="/" className="text-3xl font-bold">
|
| 16 |
<span className="text-[#FF6B6B]">P</span>
|
| 17 |
<span className="text-[#4ECDC4]">l</span>
|
|
|
|
| 22 |
<span className="ml-2 text-[#45B7D1]">A</span>
|
| 23 |
<span className="text-[#FDCB6E]">I</span>
|
| 24 |
</Link>
|
| 25 |
+
<nav className="flex items-center justify-center flex-1 space-x-8">
|
| 26 |
<Link href="/for-teachers" className="text-text-secondary hover:text-primary">
|
| 27 |
+
我是老師
|
| 28 |
</Link>
|
| 29 |
<Link href="/for-students" className="text-text-secondary hover:text-primary">
|
| 30 |
+
我是學生
|
| 31 |
</Link>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
</nav>
|
| 33 |
+
<button
|
| 34 |
+
onClick={toggleTheme}
|
| 35 |
+
className="px-4 py-2 rounded-lg bg-primary text-white hover:bg-primary/90"
|
| 36 |
+
>
|
| 37 |
+
{theme === 'light' ? '🌙' : '☀️'}
|
| 38 |
+
</button>
|
| 39 |
</div>
|
| 40 |
</header>
|
| 41 |
|
|
|
|
| 59 |
<h3 className="text-xl font-semibold mb-2">Interactive Learning</h3>
|
| 60 |
<p className="text-text-secondary">Engage with AI-powered quizzes, projects, and virtual labs</p>
|
| 61 |
</div>
|
| 62 |
+
|
| 63 |
<div className="p-6 rounded-xl bg-background-primary">
|
| 64 |
<div className="w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4">
|
| 65 |
<svg className="w-6 h-6 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
| 134 |
</h3>
|
| 135 |
<p className="text-text-secondary">Making learning fun and accessible for everyone</p>
|
| 136 |
</div>
|
| 137 |
+
|
| 138 |
<div className="text-center">
|
| 139 |
<h3 className="font-semibold mb-4">Learning Resources</h3>
|
| 140 |
<ul className="space-y-2">
|
|
|
|
| 143 |
<li><Link href="/blog" className="text-text-secondary hover:text-primary">Educational Blog</Link></li>
|
| 144 |
</ul>
|
| 145 |
</div>
|
| 146 |
+
|
| 147 |
<div className="text-center md:text-right">
|
| 148 |
<h3 className="font-semibold mb-4">Connect With Us</h3>
|
| 149 |
<div className="flex justify-center md:justify-end space-x-4">
|