mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-16 12:25:12 -05:00
feat: reverted the arguments page
This commit is contained in:
parent
d9dccdd727
commit
f2c6f1ce26
55 changed files with 272 additions and 619 deletions
|
@ -76,7 +76,7 @@ page shared route =
|
|||
{ init = init
|
||||
, update = update
|
||||
, subscriptions = subscriptions
|
||||
, view = view shared
|
||||
, view = view
|
||||
}
|
||||
|> Page.withLayout toLayout
|
||||
|
||||
|
@ -91,21 +91,12 @@ toLayout model =
|
|||
|
||||
|
||||
type alias Model =
|
||||
{ argExpansions : List Bool
|
||||
, argHeights : List Int
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
init : () -> ( Model, Effect Msg )
|
||||
init () =
|
||||
let
|
||||
numArgs : Int
|
||||
numArgs =
|
||||
List.length argumentList
|
||||
in
|
||||
( { argExpansions = List.repeat numArgs False
|
||||
, argHeights = List.repeat numArgs 0
|
||||
}
|
||||
( {}
|
||||
, Effect.none
|
||||
)
|
||||
|
||||
|
@ -115,151 +106,97 @@ init () =
|
|||
|
||||
|
||||
type Msg
|
||||
= GotArgHeight (List Int)
|
||||
| ToggleExpandArg Int
|
||||
= NoOp
|
||||
|
||||
|
||||
update : Msg -> Model -> ( Model, Effect Msg )
|
||||
update msg model =
|
||||
Debug.log (Debug.toString model.argHeights) <|
|
||||
case msg of
|
||||
GotArgHeight argHeights ->
|
||||
( { model | argHeights = argHeights }, Effect.none )
|
||||
case msg of
|
||||
NoOp ->
|
||||
( model
|
||||
, Effect.none
|
||||
)
|
||||
|
||||
ToggleExpandArg index ->
|
||||
( case getAt index model.argExpansions of
|
||||
Nothing ->
|
||||
model
|
||||
|
||||
Just isExpanded ->
|
||||
{ model
|
||||
| argExpansions =
|
||||
setAt index
|
||||
(not isExpanded)
|
||||
model.argExpansions
|
||||
}
|
||||
, Effect.sendCmd <| Ports.getArgHeight <| List.length model.argHeights
|
||||
)
|
||||
|
||||
-- SUBSCRIPTIONS
|
||||
|
||||
|
||||
subscriptions : Model -> Sub Msg
|
||||
subscriptions model =
|
||||
gotArgHeight GotArgHeight
|
||||
Sub.none
|
||||
|
||||
|
||||
|
||||
-- VIEW
|
||||
|
||||
|
||||
view : Shared.Model -> Model -> View Msg
|
||||
view shared model =
|
||||
{ title = debateName
|
||||
view : Model -> View Msg
|
||||
view model =
|
||||
{ title = dodgersName
|
||||
, attributes = []
|
||||
, element = debateContainer shared model
|
||||
, element = debateContainer
|
||||
}
|
||||
|
||||
|
||||
debateContainer : Shared.Model -> Model -> Element Msg
|
||||
debateContainer shared model =
|
||||
let
|
||||
a : Device
|
||||
a =
|
||||
shared.device
|
||||
in
|
||||
topLevelContainer <| debateList model
|
||||
debateContainer : Element msg
|
||||
debateContainer =
|
||||
topLevelContainer debateList
|
||||
|
||||
|
||||
debateList : Model -> Element Msg
|
||||
debateList model =
|
||||
let
|
||||
argColumn : Bool -> Element Msg
|
||||
argColumn isHidden =
|
||||
column
|
||||
[ padding 30
|
||||
, spacing 15
|
||||
]
|
||||
<|
|
||||
List.map argumentMaker <|
|
||||
List.map4
|
||||
(\w x y z ->
|
||||
{ arg = w
|
||||
, index = x
|
||||
, isExpanded = y
|
||||
, maybeHeight =
|
||||
if isHidden then
|
||||
Nothing
|
||||
|
||||
else
|
||||
z
|
||||
, titleClickMsg = ToggleExpandArg x
|
||||
}
|
||||
)
|
||||
argumentList
|
||||
(List.range 0 <| List.length model.argHeights)
|
||||
model.argExpansions
|
||||
(List.map Just model.argHeights)
|
||||
in
|
||||
el
|
||||
[ behindContent <| argColumn True
|
||||
, spacing 10
|
||||
, centerX
|
||||
, centerY
|
||||
, alignTop
|
||||
, paddingEach { top = 30, bottom = 30, left = 30, right = 30 }
|
||||
]
|
||||
debateList : Element msg
|
||||
debateList =
|
||||
column
|
||||
pageList
|
||||
<|
|
||||
argColumn False
|
||||
|
||||
|
||||
argumentList : List Argument
|
||||
argumentList =
|
||||
[ argumentApoBCVD
|
||||
, argumentAnabolicKeto
|
||||
, argumentAntagonisticPleiotropy
|
||||
, argumentCarbsObesity
|
||||
, argumentDietaryCholesterol
|
||||
, argumentFructoseNAFLD
|
||||
, argumentHealthPromotingFoods
|
||||
, argumentHealthSeeker
|
||||
, argumentHealthyChocolate
|
||||
, argumentHealthyDairy
|
||||
, argumentHealthyFattyFish
|
||||
, argumentHealthyFibre
|
||||
, argumentHealthyFood
|
||||
, argumentHealthyPlantFoods
|
||||
, argumentHealthySeedOils
|
||||
, argumentHealthySoy
|
||||
, argumentMalondialdehyde
|
||||
, argumentOmega3Omega6Ratio
|
||||
, argumentPlantBasedCVDReversal
|
||||
, argumentPolyphenolReductio
|
||||
, argumentSodiumCVD
|
||||
, argumentTMAOCausality
|
||||
, argumentUnhealthyCoconutOil
|
||||
, argumentUnhealthyProcessedMeat
|
||||
, argumentUnhealthyRedMeat
|
||||
, argumentUnhealthySaturatedFat
|
||||
, argumentAbortion
|
||||
, argumentAgnosticism
|
||||
, argumentAgriculturalPredation
|
||||
, argumentAnimalRights
|
||||
, argumentAntiRewilding
|
||||
, argumentAntiVandalism
|
||||
, argumentColonizingNature
|
||||
, argumentCropDeaths
|
||||
, argumentDairyCowRape
|
||||
, argumentEfilismPatrolSquad
|
||||
, argumentEthicalSlurs
|
||||
, argumentFineTuning
|
||||
, argumentImmortalityReductio
|
||||
, argumentOddOrderPredators
|
||||
, argumentOstroveganism
|
||||
, argumentPollinationReductio
|
||||
, argumentScratcherPioneers
|
||||
, argumentTransPeople
|
||||
, argumentVeganSocietyReductio
|
||||
, argumentBoobyTrapPagers
|
||||
, argumentEpidemiologyCausality
|
||||
, argumentFlatEarthDebunk
|
||||
, argumentTruncatedMeta
|
||||
]
|
||||
List.map argumentMaker
|
||||
[ argumentApoBCVD
|
||||
, argumentAnabolicKeto
|
||||
, argumentAntagonisticPleiotropy
|
||||
, argumentCarbsObesity
|
||||
, argumentDietaryCholesterol
|
||||
, argumentFructoseNAFLD
|
||||
, argumentHealthPromotingFoods
|
||||
, argumentHealthSeeker
|
||||
, argumentHealthyChocolate
|
||||
, argumentHealthyDairy
|
||||
, argumentHealthyFattyFish
|
||||
, argumentHealthyFibre
|
||||
, argumentHealthyFood
|
||||
, argumentHealthyPlantFoods
|
||||
, argumentHealthySeedOils
|
||||
, argumentHealthySoy
|
||||
, argumentMalondialdehyde
|
||||
, argumentOmega3Omega6Ratio
|
||||
, argumentPlantBasedCVDReversal
|
||||
, argumentPolyphenolReductio
|
||||
, argumentSodiumCVD
|
||||
, argumentTMAOCausality
|
||||
, argumentUnhealthyCoconutOil
|
||||
, argumentUnhealthyProcessedMeat
|
||||
, argumentUnhealthyRedMeat
|
||||
, argumentUnhealthySaturatedFat
|
||||
, argumentAbortion
|
||||
, argumentAgnosticism
|
||||
, argumentAgriculturalPredation
|
||||
, argumentAnimalRights
|
||||
, argumentAntiRewilding
|
||||
, argumentAntiVandalism
|
||||
, argumentColonizingNature
|
||||
, argumentCropDeaths
|
||||
, argumentDairyCowRape
|
||||
, argumentEfilismPatrolSquad
|
||||
, argumentEthicalSlurs
|
||||
, argumentFineTuning
|
||||
, argumentImmortalityReductio
|
||||
, argumentOddOrderPredators
|
||||
, argumentOstroveganism
|
||||
, argumentPollinationReductio
|
||||
, argumentScratcherPioneers
|
||||
, argumentTransPeople
|
||||
, argumentVeganSocietyReductio
|
||||
, argumentBoobyTrapPagers
|
||||
, argumentEpidemiologyCausality
|
||||
, argumentFlatEarthDebunk
|
||||
, argumentTruncatedMeta
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue