Replace Angular expand/collapse with native HTML details/summary for brand story

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Pavel
2026-02-19 21:23:09 +00:00
parent f86eb3fb82
commit b528bb47a0
5 changed files with 65 additions and 44 deletions

View File

@@ -1,5 +1,2 @@
angular.module('Darkswarm').controller "HomeCtrl", ($scope) ->
$scope.brandStoryExpanded = false
$scope.toggleBrandStory = ->
$scope.brandStoryExpanded = !$scope.brandStoryExpanded
# Controller kept for potential future use

View File

@@ -6,21 +6,21 @@
%p
= t :brandstory_intro
#brand-story-text.hide-show.slideable
%p
= t :brandstory_part1
%p
= t :brandstory_part2
%p
= t :brandstory_part3
%p
= t :brandstory_part4
%p
%strong
= t :brandstory_part5_strong
%p
= t :brandstory_part6
%a.text-vbig{"slide-toggle" => "#brand-story-text", "ng-click" => "toggleBrandStory()"}
%i.ofn-i_005-caret-down{"ng-hide" => "brandStoryExpanded"}
%i.ofn-i_006-caret-up{ "ng-show" => "brandStoryExpanded"}
%details#brand-story-text.text-vbig
%summary
%i.ofn-i_005-caret-down
%i.ofn-i_006-caret-up
.brand-story-content
%p
= t :brandstory_part1
%p
= t :brandstory_part2
%p
= t :brandstory_part3
%p
= t :brandstory_part4
%p
%strong
= t :brandstory_part5_strong
%p
= t :brandstory_part6

View File

@@ -5,7 +5,7 @@
- content_for :page_alert do
= render "shared/menu/alert"
%div{"ng-controller" => "HomeCtrl"}
%div
= render "home/tagline"
#panes

View File

@@ -71,8 +71,51 @@
}
}
a.text-vbig i {
font-size: 75px;
#brand-story-text {
cursor: pointer;
text-align: center;
margin-top: 1rem;
summary {
list-style: none;
cursor: pointer;
display: inline-block;
&::-webkit-details-marker {
display: none;
}
&::marker {
display: none;
}
i {
font-size: 75px;
}
.ofn-i_005-caret-down {
display: inline-block;
}
.ofn-i_006-caret-up {
display: none;
}
}
&[open] summary {
.ofn-i_005-caret-down {
display: none;
}
.ofn-i_006-caret-up {
display: inline-block;
}
}
.brand-story-content {
margin-top: 1rem;
text-align: left;
}
}
}

View File

@@ -1,19 +0,0 @@
describe "HomeCtrl", ->
ctrl = null
scope = null
beforeEach ->
module 'Darkswarm'
scope = {}
inject ($controller) ->
ctrl = $controller 'HomeCtrl', {$scope: scope}
it "starts with the brand story contracted", ->
expect(scope.brandStoryExpanded).toBe false
it "toggles the brand story", ->
scope.toggleBrandStory()
expect(scope.brandStoryExpanded).toBe true
scope.toggleBrandStory()
expect(scope.brandStoryExpanded).toBe false