Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 80 additions & 77 deletions app/components/course-card/index.hbs
Original file line number Diff line number Diff line change
@@ -1,99 +1,102 @@
<LinkTo
class="group bg-white dark:bg-gray-925 p-5 rounded-md shadow-sm hover:shadow-md transition-shadow cursor-pointer flex flex-col justify-between border border-gray-200 dark:border-white/5 relative
{{if this.shouldShowLockIcon 'opacity-50 hover:opacity-100'}}"
class="flex flex-col justify-stretch group bg-white
{{if this.shouldShowLockIcon 'dark:bg-gray-950/70 hover:dark:bg-gray-925/70' 'dark:bg-gray-925/70'}}
p-5 rounded-md shadow-sm hover:shadow-md transition-shadow cursor-pointer border border-gray-200 dark:border-white/5 relative"
@route={{this.linkToRoute.name}}
@model={{this.linkToRoute.model}}
@query={{this.linkToRoute.query}}
data-test-course-card={{not this.isSkeleton}}
>
{{! Logo }}
<div class="w-8 transform scale-100 group-hover:scale-105 shrink-0 transition-transform absolute top-5 right-5">
{{#if this.isSkeleton}}
<div class="bg-gray-100 dark:bg-gray-900 w-8 h-8 rounded-full" />
{{else}}
<CourseLogo @course={{this.course}} />
{{/if}}
</div>

{{! Text }}
<div class="mb-6">
<div class="flex items-center mb-3 flex-wrap gap-y-2 pr-10">
<div class="text-lg font-semibold text-gray-900 dark:text-gray-200 mr-2" data-test-course-name>
{{#if this.isSkeleton}}
<span class="inline-block bg-gray-100 dark:bg-gray-900 rounded-sm">{{#each (repeat 30)}}&nbsp;{{/each}}</span>
{{else}}
<span>{{this.course.name}}</span>
{{/if}}
</div>
</div>

<div class="text-sm leading-relaxed text-gray-600 dark:text-gray-400 pr-10" data-test-course-description>
<div class="flex flex-col grow justify-between {{if this.shouldShowLockIcon 'opacity-50 group-hover:opacity-100'}}">
{{! Logo }}
<div class="w-8 transform scale-100 group-hover:scale-105 shrink-0 transition-transform absolute top-5 right-5">
{{#if this.isSkeleton}}
<div>
<div class="relative inline-block w-full">{{#each (repeat 15)}}&nbsp;{{/each}}
<div class="absolute left-0 right-0 top-[2px] bottom-[2px] bg-gray-100 dark:bg-gray-900 rounded-sm"></div>
</div>
<div class="relative inline-block w-full">{{#each (repeat 15)}}&nbsp;{{/each}}
<div class="absolute left-0 right-0 top-[2px] bottom-[2px] bg-gray-100 dark:bg-gray-900 rounded-sm"></div>
</div>
</div>
<div class="bg-gray-100 dark:bg-gray-900 w-8 h-8 rounded-full" />
{{else}}
<span>{{this.course.shortDescription}}</span>
<CourseLogo @course={{this.course}} />
{{/if}}
</div>
</div>

{{! Footer }}
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
{{#if this.isSkeleton}}
<div class="bg-gray-100 dark:bg-gray-900 rounded-sm h-4 w-24"></div>
{{else}}
{{#if this.lastUsedRepository}}
<CourseCard::ProgressBar @course={{this.course}} @lastUsedRepository={{this.lastUsedRepository}} class="shrink-0" />
{{else}}
{{#if this.course.releaseStatusIsAlpha}}
<div
class="text-xs text-gray-400 dark:text-gray-600 font-semibold border border-gray-300 dark:border-gray-700 rounded-sm px-1 py-0.25 mr-3"
data-test-course-alpha-label
>
ALPHA
</div>
{{else if this.course.releaseStatusIsBeta}}
<BetaCourseLabel class="mr-3" />
{{else if (and this.course.isFree (not this.currentUser.canAccessMembershipBenefits))}}
<FreeCourseLabel @course={{this.course}} />
{{! Text }}
<div class="mb-6">
<div class="flex items-center mb-3 flex-wrap gap-y-2 pr-10">
<div class="text-lg font-semibold text-gray-900 dark:text-gray-200 mr-2" data-test-course-name>
{{#if this.isSkeleton}}
<span class="inline-block bg-gray-100 dark:bg-gray-900 rounded-sm">{{#each (repeat 30)}}&nbsp;{{/each}}</span>
{{else}}
<div class="flex items-center">
{{svg-jar "academic-cap" class="w-4 mr-1 fill-current text-gray-400 dark:text-gray-600"}}
<span class="text-xs text-gray-500">{{this.course.stages.length}} stages</span>
</div>
<span>{{this.course.name}}</span>
{{/if}}
</div>
</div>

<div class="text-sm leading-relaxed text-gray-600 dark:text-gray-400 pr-10" data-test-course-description>
{{#if this.isSkeleton}}
<div>
<div class="relative inline-block w-full">{{#each (repeat 15)}}&nbsp;{{/each}}
<div class="absolute left-0 right-0 top-[2px] bottom-[2px] bg-gray-100 dark:bg-gray-900 rounded-sm"></div>
</div>
<div class="relative inline-block w-full">{{#each (repeat 15)}}&nbsp;{{/each}}
<div class="absolute left-0 right-0 top-[2px] bottom-[2px] bg-gray-100 dark:bg-gray-900 rounded-sm"></div>
</div>
</div>
{{else}}
<span>{{this.course.shortDescription}}</span>
{{/if}}
{{/if}}
</div>
</div>

<div class="flex items-center">
{{#if this.shouldShowLockIcon}}
<div class="flex items-center justify-center" data-test-lock-icon>
{{svg-jar "lock-closed" class="w-4 mr-1 fill-current text-gray-400 dark:text-gray-600"}}
</div>
{{else}}
<span class="font-bold text-teal-500 text-xs mr-2 opacity-0 group-hover:opacity-100 transition-opacity" data-test-action-text>
{{#if this.lastUsedRepository.allStagesAreComplete}}
Start Again
{{else if this.lastUsedRepository}}
Resume
{{! Footer }}
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
{{#if this.isSkeleton}}
<div class="bg-gray-100 dark:bg-gray-900 rounded-sm h-4 w-24"></div>
{{else}}
{{#if this.lastUsedRepository}}
<CourseCard::ProgressBar @course={{this.course}} @lastUsedRepository={{this.lastUsedRepository}} class="shrink-0" />
{{else}}
Start
{{#if this.course.releaseStatusIsAlpha}}
<div
class="text-xs text-gray-400 dark:text-gray-600 font-semibold border border-gray-300 dark:border-gray-700 rounded-sm px-1 py-0.25 mr-3"
data-test-course-alpha-label
>
ALPHA
</div>
{{else if this.course.releaseStatusIsBeta}}
<BetaCourseLabel class="mr-3" />
{{else if (and this.course.isFree (not this.currentUser.canAccessMembershipBenefits))}}
<FreeCourseLabel @course={{this.course}} />
{{else}}
<div class="flex items-center">
{{svg-jar "academic-cap" class="w-4 mr-1 fill-current text-gray-400 dark:text-gray-600"}}
<span class="text-xs text-gray-500">{{this.course.stages.length}} stages</span>
</div>
{{/if}}
{{/if}}
</span>
{{/if}}
</div>

{{svg-jar
"arrow-right"
class="w-4 fill-current text-gray-300 dark:text-gray-700 group-hover:text-teal-500 dark:group-hover:text-teal-500 transition-colors"
}}
{{/if}}
<div class="flex items-center">
{{#if this.shouldShowLockIcon}}
<div class="flex items-center justify-center" data-test-lock-icon>
{{svg-jar "lock-closed" class="w-4 mr-1 fill-current text-gray-400 dark:text-gray-600"}}
</div>
{{else}}
<span class="font-bold text-teal-500 text-xs mr-2 opacity-0 group-hover:opacity-100 transition-opacity" data-test-action-text>
{{#if this.lastUsedRepository.allStagesAreComplete}}
Start Again
{{else if this.lastUsedRepository}}
Resume
{{else}}
Start
{{/if}}
</span>

{{svg-jar
"arrow-right"
class="w-4 fill-current text-gray-300 dark:text-gray-700 group-hover:text-teal-500 dark:group-hover:text-teal-500 transition-colors"
}}
{{/if}}
</div>
</div>
</div>
</LinkTo>
2 changes: 1 addition & 1 deletion app/components/tracks-page/track-card/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div
class="group bg-white dark:bg-gray-925 p-5 rounded-md shadow-xs hover:shadow-sm transition-shadow cursor-pointer flex flex-col justify-between border border-gray-200 dark:border-white/5 relative"
class="group bg-white dark:bg-gray-925/70 p-5 rounded-md shadow-xs hover:shadow-sm transition-shadow cursor-pointer flex flex-col justify-between border border-gray-200 dark:border-white/5 relative"
role="button"
{{on "click" this.navigateToTrack}}
data-test-track-card
Expand Down
3 changes: 2 additions & 1 deletion app/services/dark-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ export default class DarkModeService extends Service {
* "dark route", or derived from localStorage & system preference
*/
get isEnabled(): boolean {
return this.currentRouteSupportsDarkMode && (this.#currentRouteRequiresDarkMode || this.#isEnabledViaPreferences || this.isEnabledTemporarily);
return true;
// return this.currentRouteSupportsDarkMode && (this.#currentRouteRequiresDarkMode || this.#isEnabledViaPreferences || this.isEnabledTemporarily);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Dark mode forced on light-only routes

The isEnabled getter now hardcodes true, forcing dark mode on all routes including those that only support light mode. Routes with RouteColorScheme.Light (the default) will display dark mode styling even though they may lack proper dark mode support. The commented-out original logic suggests this is temporary development code that was accidentally committed.

Fix in Cursor Fix in Web

}

/**
Expand Down
22 changes: 22 additions & 0 deletions app/templates/catalog.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
{{page-title "Catalog"}}

<div class="fixed inset-0 flex items-stretch justify-stretch pointer-events-none">
<div class="w-full relative overflow-hidden rounded-sm">
{{! Left blurred gradient }}
<div class="w-1/2 h-60 absolute -bottom-32 -left-1/4 opacity-50 animate-spin-slow filter blur-[100px]">
<div class="relative">
<div class="rounded-full h-60 w-full bg-purple-800"></div>
<div class="absolute bottom-24 -left-24 rounded-full h-60 w-full bg-red-800"></div>
<div class="absolute top-24 left-24 rounded-full h-60 w-full bg-purple-600"></div>
</div>
</div>

{{! Right blurred gradient }}
<div class="w-1/2 h-60 absolute -bottom-40 -right-1/4 opacity-50 animate-spin-slow filter blur-[100px]">
<div class="relative">
<div class="rounded-full h-60 w-full bg-blue-600"></div>
<div class="absolute bottom-24 -left-24 rounded-full h-60 w-full bg-blue-700"></div>
<div class="absolute top-24 left-24 rounded-full h-60 w-full bg-purple-600"></div>
</div>
</div>
</div>
</div>

<div class="container mx-auto lg:max-w-(--breakpoint-lg) pt-6 md:pt-10 pb-10 md:pb-48 px-3 md:px-6">
<div class="border-b border-gray-200 dark:border-white/5 pb-2 mb-6">
<h1 class="text-3xl text-gray-700 dark:text-gray-300 font-bold tracking-tighter">Challenges</h1>
Expand Down
22 changes: 22 additions & 0 deletions app/templates/course-overview.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
{{page-title this.model.course.name}}

<div class="fixed inset-0 flex items-stretch justify-stretch pointer-events-none">
<div class="w-full relative overflow-hidden rounded-sm">
{{! Left blurred gradient }}
<div class="w-1/2 h-60 absolute -bottom-32 -left-1/4 opacity-50 animate-spin-slow filter blur-[100px]">
<div class="relative">
<div class="rounded-full h-60 w-full bg-purple-800"></div>
<div class="absolute bottom-24 -left-24 rounded-full h-60 w-full bg-red-800"></div>
<div class="absolute top-24 left-24 rounded-full h-60 w-full bg-purple-600"></div>
</div>
</div>

{{! Right blurred gradient }}
<div class="w-1/2 h-60 absolute -bottom-40 -right-1/4 opacity-50 animate-spin-slow filter blur-[100px]">
<div class="relative">
<div class="rounded-full h-60 w-full bg-blue-600"></div>
<div class="absolute bottom-24 -left-24 rounded-full h-60 w-full bg-blue-700"></div>
<div class="absolute top-24 left-24 rounded-full h-60 w-full bg-purple-600"></div>
</div>
</div>
</div>
</div>

<div class="container mx-auto lg:max-w-(--breakpoint-lg) pt-6 md:pt-10 pb-10 px-3 md:px-6">
<CourseOverviewPage::Header @course={{this.model.course}} @language={{this.model.language}} class="mb-6 md:mb-10" />

Expand Down
26 changes: 24 additions & 2 deletions app/templates/track.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
{{page-title @model.language.name}}

<div class="fixed inset-0 flex items-stretch justify-stretch pointer-events-none">
<div class="w-full relative overflow-hidden rounded-sm">
{{! Left blurred gradient }}
<div class="w-1/2 h-60 absolute -bottom-32 -left-1/4 opacity-50 animate-spin-slow filter blur-[100px]">
<div class="relative">
<div class="rounded-full h-60 w-full bg-purple-800"></div>
<div class="absolute bottom-24 -left-24 rounded-full h-60 w-full bg-red-800"></div>
<div class="absolute top-24 left-24 rounded-full h-60 w-full bg-purple-600"></div>
</div>
</div>

{{! Right blurred gradient }}
<div class="w-1/2 h-60 absolute -bottom-40 -right-1/4 opacity-50 animate-spin-slow filter blur-[100px]">
<div class="relative">
<div class="rounded-full h-60 w-full bg-blue-600"></div>
<div class="absolute bottom-24 -left-24 rounded-full h-60 w-full bg-blue-700"></div>
<div class="absolute top-24 left-24 rounded-full h-60 w-full bg-purple-600"></div>
</div>
</div>
</div>
</div>

<div class="container mx-auto lg:max-w-(--breakpoint-lg) px-3 md:px-6 py-6 md:py-10">
<TrackPage::Header @language={{@model.language}} @courses={{this.sortedCourses}} />
</div>

<div class="h-px bg-gray-200 dark:bg-white/5 w-full"></div>

<div class="bg-white dark:bg-gray-925">
<div class="bg-white dark:bg-gray-950">
<div class="container mx-auto lg:max-w-(--breakpoint-lg) px-3 md:px-6 py-6 md:py-10">
<div class="flex items-start">
<div class="grow">
Expand All @@ -18,7 +40,7 @@
/>
{{/if}}

<div class="border-b border-gray-200 dark:border-gray-700 pb-1 mb-4 flex">
<div class="border-b border-gray-200 dark:border-gray-900 pb-1 mb-4 flex">
<div class="text-2xl font-semibold text-gray-900 dark:text-gray-200">
{{@model.language.name}}
Challenges
Expand Down
Loading