diff --git a/frontend/src/Config/Colour.elm b/frontend/src/Config/Colour.elm index 4e22888..37399e6 100755 --- a/frontend/src/Config/Colour.elm +++ b/frontend/src/Config/Colour.elm @@ -13,7 +13,9 @@ type alias Theme = , highlightTextHover : Color , backgroundColour : Color , debugColour : Color - , darker : Color + , cardBackground : Color + , barGreen : Color + , barRed : Color } @@ -25,5 +27,7 @@ colourTheme = , highlightTextHover = rgb255 120 60 0 , backgroundColour = rgb255 40 40 40 , debugColour = rgb255 227 28 121 - , darker = rgb255 30 30 30 + , cardBackground = rgb255 30 30 30 + , barGreen = rgb255 0 102 0 + , barRed = rgb255 102 0 0 } diff --git a/frontend/src/Debate/Arguments/Abortion.elm b/frontend/src/Debate/Arguments/Abortion.elm index b9f2e2b..22245df 100755 --- a/frontend/src/Debate/Arguments/Abortion.elm +++ b/frontend/src/Debate/Arguments/Abortion.elm @@ -10,7 +10,7 @@ argumentAbortion = , propositionReductio = "" , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(P~2Q~5R),(P),(Q),((R~1F~1~3H)~5M),(F),(~3H),(M~5~3W)%7C=(~3W)" - + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "one consents to becoming pregnant" diff --git a/frontend/src/Debate/Arguments/Agnosticism.elm b/frontend/src/Debate/Arguments/Agnosticism.elm index 3055a25..687c579 100755 --- a/frontend/src/Debate/Arguments/Agnosticism.elm +++ b/frontend/src/Debate/Arguments/Agnosticism.elm @@ -10,7 +10,7 @@ argumentAgnosticism = , propositionReductio = "" , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x~6y(~3Pxy~5~3Qxy)),(~6x~6y(~3Qxy~5Rxy)),(~3Por)|=(Ror)" - + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x,y)" , definiens = "(x) can unpack what evidence would lead them to change their doxastic attitude on (y)" diff --git a/frontend/src/Debate/Arguments/AgriculturalPredation.elm b/frontend/src/Debate/Arguments/AgriculturalPredation.elm index 6a75244..4b5279e 100755 --- a/frontend/src/Debate/Arguments/AgriculturalPredation.elm +++ b/frontend/src/Debate/Arguments/AgriculturalPredation.elm @@ -11,6 +11,7 @@ argumentAgriculturalPredation = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x~6y~6z(Px~4Qxyz~1(Rxyz~2Sxyz)~1Wxyz)),(Qahl),(Rahl~2Sahl),(Wahl)%7C=(Pa)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) counts as predation" diff --git a/frontend/src/Debate/Arguments/AnabolicKeto.elm b/frontend/src/Debate/Arguments/AnabolicKeto.elm index 9e1d607..d1d4acb 100755 --- a/frontend/src/Debate/Arguments/AnabolicKeto.elm +++ b/frontend/src/Debate/Arguments/AnabolicKeto.elm @@ -11,6 +11,7 @@ argumentAnabolicKeto = , propositionSummary = "A higher proportion of amino acids are spent on gluconeogenesis while on ketogenic diets, reducing the amount available for hypertrophy. This likely costs anabolic potential on ketogenic diets compared to non-ketogenic diets." , proofLink = "https://www.umsu.de/trees/#(P~5Q),(P),(Q~5R)|=(R)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "a higher proportion of amino acids are spent on gluconeogenesis while on ketogenic diets compared to non-ketogenic diets" diff --git a/frontend/src/Debate/Arguments/AnimalRights.elm b/frontend/src/Debate/Arguments/AnimalRights.elm index 807d199..041a065 100755 --- a/frontend/src/Debate/Arguments/AnimalRights.elm +++ b/frontend/src/Debate/Arguments/AnimalRights.elm @@ -11,6 +11,7 @@ argumentAnimalRights = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5~3Qx)),(~3Pa~5~7t(Rta~5(Rth~5~3Ph))),(~3~7t(Rta~5(Rth~5~3Ph))),(Pa)|=(~3Qa)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) has moral worth" diff --git a/frontend/src/Debate/Arguments/AntagonisticPleiotropy.elm b/frontend/src/Debate/Arguments/AntagonisticPleiotropy.elm index 1c0b3ee..70facda 100755 --- a/frontend/src/Debate/Arguments/AntagonisticPleiotropy.elm +++ b/frontend/src/Debate/Arguments/AntagonisticPleiotropy.elm @@ -11,6 +11,7 @@ argumentAntagonisticPleiotropy = , propositionSummary = "Humans have more genetic adaptations to ancestral foods than novel foods, which makes the long-term negative consequences of antagonistic pleiotropy a greater concern for ancestral foods." , proofLink = "https://www.umsu.de/trees/#(P~5Q),(Q~5R),(P)|=(R)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "humans have more genetic adaptations to ancestral foods than novel foods" diff --git a/frontend/src/Debate/Arguments/AntiRewilding.elm b/frontend/src/Debate/Arguments/AntiRewilding.elm index fa75868..f03a158 100755 --- a/frontend/src/Debate/Arguments/AntiRewilding.elm +++ b/frontend/src/Debate/Arguments/AntiRewilding.elm @@ -11,6 +11,7 @@ argumentAntiRewilding = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5~3Qx)),(Pa),(~3Qa~5~3R),(~3R~5Sa)|=(Sa)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) has negative rights" diff --git a/frontend/src/Debate/Arguments/AntiVandalism.elm b/frontend/src/Debate/Arguments/AntiVandalism.elm index 9007514..a45067f 100755 --- a/frontend/src/Debate/Arguments/AntiVandalism.elm +++ b/frontend/src/Debate/Arguments/AntiVandalism.elm @@ -11,6 +11,7 @@ argumentAntiVandalism = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(P~5Q),(P),(Q~5R)%7C=(R)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "zoos must spend extra money cleaning graffiti" diff --git a/frontend/src/Debate/Arguments/ApoBCVD.elm b/frontend/src/Debate/Arguments/ApoBCVD.elm index 0c567d3..795b257 100755 --- a/frontend/src/Debate/Arguments/ApoBCVD.elm +++ b/frontend/src/Debate/Arguments/ApoBCVD.elm @@ -10,6 +10,7 @@ argumentApoBCVD = , propositionReductio = "" , propositionSummary = "ApoB-containing lipoproteins consistently and proportionately associate with increased plaque volume after controlling for relevant confounders, which satisfies the conditions outlined for an exposure to cause atherosclerosis." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qw)|=(Pw)" + , argumentCertainty = 9 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) dose-dependently causes atherosclerosis" diff --git a/frontend/src/Debate/Arguments/BoobyTrapPagers.elm b/frontend/src/Debate/Arguments/BoobyTrapPagers.elm index a61b7e7..8d63641 100755 --- a/frontend/src/Debate/Arguments/BoobyTrapPagers.elm +++ b/frontend/src/Debate/Arguments/BoobyTrapPagers.elm @@ -11,6 +11,7 @@ argumentBoobyTrapPagers = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4(Qx~1Rx~1Sx))),(Qp),(Rp),(~3Sp)|=(~3Pp)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is a booby-trap" diff --git a/frontend/src/Debate/Arguments/CarbsObesity.elm b/frontend/src/Debate/Arguments/CarbsObesity.elm index 7e9d32c..474498c 100755 --- a/frontend/src/Debate/Arguments/CarbsObesity.elm +++ b/frontend/src/Debate/Arguments/CarbsObesity.elm @@ -11,6 +11,7 @@ argumentCarbsObesity = , propositionSummary = "There are a number of predictions made from the hypothesis that carbohydrates uniquely cause obesity. One of those predictions is that obesity would track with carbohydrate intake, but it doesn't" , proofLink = "https://www.umsu.de/trees/#(P~5Q),(~3Q)|=(~3P)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "carbs uniquely cause fat accumulation or obesity" diff --git a/frontend/src/Debate/Arguments/ColonizingNature.elm b/frontend/src/Debate/Arguments/ColonizingNature.elm index 1628e9f..4c8429d 100755 --- a/frontend/src/Debate/Arguments/ColonizingNature.elm +++ b/frontend/src/Debate/Arguments/ColonizingNature.elm @@ -11,6 +11,7 @@ argumentColonizingNature = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(P~1~3Q~1~3R~1~3S~5W),(P),(~3Q),(~3R),(~3S)%7C=(W)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "the natural world contains intolerable rights violations" diff --git a/frontend/src/Debate/Arguments/CropDeaths.elm b/frontend/src/Debate/Arguments/CropDeaths.elm index 4c58156..e914e0a 100755 --- a/frontend/src/Debate/Arguments/CropDeaths.elm +++ b/frontend/src/Debate/Arguments/CropDeaths.elm @@ -11,6 +11,7 @@ argumentCropDeaths = , propositionSummary = "We can't claim to know that cropland kills more animals than wildland, because if we did know this, there would be evidence for it, and there isn't any such evidence." , proofLink = "https://www.umsu.de/trees/#(P~5Q),(~3Q)%7C=(~3P)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "it is known that cropland leads to more animal death than wildland" diff --git a/frontend/src/Debate/Arguments/DairyCowRape.elm b/frontend/src/Debate/Arguments/DairyCowRape.elm index 7019d8c..0c51e1a 100755 --- a/frontend/src/Debate/Arguments/DairyCowRape.elm +++ b/frontend/src/Debate/Arguments/DairyCowRape.elm @@ -11,6 +11,7 @@ argumentDairyCowRape = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x~6y(Px~4(Qxy~1~3Ryx))),(Qae),(~3Rea)|=(Pa)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) qualifies as rape" diff --git a/frontend/src/Debate/Arguments/DietaryCholesterol.elm b/frontend/src/Debate/Arguments/DietaryCholesterol.elm index 292cce9..1d7ee6d 100755 --- a/frontend/src/Debate/Arguments/DietaryCholesterol.elm +++ b/frontend/src/Debate/Arguments/DietaryCholesterol.elm @@ -10,6 +10,7 @@ argumentDietaryCholesterol = , propositionReductio = "" , propositionSummary = "LDL causally associates with heart disease in a linear and proportional manner, and in all cases exposures that durably increase LDL over time produce likewise increases in heart disease risk. Dietary cholesterol is one such exposure." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5Qx)),(Pd)|=(Qd)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "consuming high amounts of (x) increases LDL" diff --git a/frontend/src/Debate/Arguments/EfilismPatrolSquad.elm b/frontend/src/Debate/Arguments/EfilismPatrolSquad.elm index f7add8d..82427ff 100755 --- a/frontend/src/Debate/Arguments/EfilismPatrolSquad.elm +++ b/frontend/src/Debate/Arguments/EfilismPatrolSquad.elm @@ -10,6 +10,7 @@ argumentEfilismPatrolSquad = , propositionReductio = "Efilists fundamentally believe that sentient life is inherently characterized by suffering and that the most ethical action is to prevent the creation of any new sentient beings, ultimately aiming to completely eliminate all conscious life in the universe to end suffering permanently." , propositionSummary = "If efilists follow their own logic to its ultimate conclusion, they would paradoxically be committed to a form of pragmatic natalism - the very opposite of their core philosophical stance." , proofLink = "https://www.umsu.de/trees/#(P~5Q),(~3Q),(~3P~1R~5~3S),(R),(~3S~5W)|=(W)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "humans abstaining from procreation maximally reduces rights violations" diff --git a/frontend/src/Debate/Arguments/EpidemiologyCausality.elm b/frontend/src/Debate/Arguments/EpidemiologyCausality.elm index eab0036..b4dee63 100755 --- a/frontend/src/Debate/Arguments/EpidemiologyCausality.elm +++ b/frontend/src/Debate/Arguments/EpidemiologyCausality.elm @@ -11,6 +11,7 @@ argumentEpidemiologyCausality = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5Qx)),(Pe)|=(Qe)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) consistently identifies associations that are later confirmed by randomized controlled trials" diff --git a/frontend/src/Debate/Arguments/EthicalSlurs.elm b/frontend/src/Debate/Arguments/EthicalSlurs.elm index 94cd1e7..e8d6c58 100755 --- a/frontend/src/Debate/Arguments/EthicalSlurs.elm +++ b/frontend/src/Debate/Arguments/EthicalSlurs.elm @@ -11,6 +11,7 @@ argumentEthicalSlurs = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(~6x(~3Px~5Rx)),(~3Pr),(~3Qr~1Rr~5Sr),(Sr~5Wr)|=(Wr)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x)'s negative connotations have been neutralised" diff --git a/frontend/src/Debate/Arguments/FineTuning.elm b/frontend/src/Debate/Arguments/FineTuning.elm index 202b48c..9c88f1d 100755 --- a/frontend/src/Debate/Arguments/FineTuning.elm +++ b/frontend/src/Debate/Arguments/FineTuning.elm @@ -11,6 +11,7 @@ argumentFineTuning = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5Qx)),(Pg),(Qg~5R)%7C=(R)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is finely tuned" diff --git a/frontend/src/Debate/Arguments/FlatEarthDebunk.elm b/frontend/src/Debate/Arguments/FlatEarthDebunk.elm index 70dd9e9..0131bcd 100755 --- a/frontend/src/Debate/Arguments/FlatEarthDebunk.elm +++ b/frontend/src/Debate/Arguments/FlatEarthDebunk.elm @@ -11,6 +11,7 @@ argumentFlatEarthDebunk = , propositionSummary = "The argument is structured to demonstrate that, within the context of a flat Earth model, if the stars are perceived as rotating counter-clockwise from the center, they cannot also be perceived as rotating clockwise from any point on the Earth." , proofLink = "https://www.umsu.de/trees/#(~6x~6y~6z(Pxy~5(Qyz~5Rxz))),(Pkt~1Qta),(Rka~5~3Ska)|=(~3Ska)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x,y)" , definiens = "(x) is perceived as rotating counter-clockwise from point (y)" diff --git a/frontend/src/Debate/Arguments/FructoseNAFLD.elm b/frontend/src/Debate/Arguments/FructoseNAFLD.elm index 2275557..d5abd24 100755 --- a/frontend/src/Debate/Arguments/FructoseNAFLD.elm +++ b/frontend/src/Debate/Arguments/FructoseNAFLD.elm @@ -11,6 +11,7 @@ argumentFructoseNAFLD = , propositionSummary = "Experimental investigations into fructose overfeeding have consistently failed to produce a fatty liver phenotype in humans. This suggests that fructose, contrary to popular belief in some domains, does not uniquely cause fatty liver disease." , proofLink = "https://www.umsu.de/trees/#(P~5~3Q),(P)|=(~3Q)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "experimental investigations into fructose overfeeding consistently fail to recreate a fatty liver phenotype in humans" diff --git a/frontend/src/Debate/Arguments/HealthPromotingFoods.elm b/frontend/src/Debate/Arguments/HealthPromotingFoods.elm index 00fe84d..f256579 100755 --- a/frontend/src/Debate/Arguments/HealthPromotingFoods.elm +++ b/frontend/src/Debate/Arguments/HealthPromotingFoods.elm @@ -10,6 +10,7 @@ argumentHealthPromotingFoods = , propositionSummary = "Given that food is, by its very definition, material that provides essential nutrients and energy to sustain bodily functions and growth, it follows that anything classified as food must be inherently health-promoting by its very nature." , proofLink = "https://www.umsu.de/trees/#(P~5Q),(P)|=(Q)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "food is defined as material consisting essentially of protein, carbohydrate, and/or fat used in the body of an organism to sustain growth, repair, and vital processes and to furnish energy" diff --git a/frontend/src/Debate/Arguments/HealthSeeker.elm b/frontend/src/Debate/Arguments/HealthSeeker.elm index 3885bd5..eef5779 100755 --- a/frontend/src/Debate/Arguments/HealthSeeker.elm +++ b/frontend/src/Debate/Arguments/HealthSeeker.elm @@ -11,6 +11,7 @@ argumentHealthSeeker = , propositionSummary = "If someone values consuming ancestral foods over novel foods because they have the overall value of reducing disease risk, but a novel food reduces disease risk when replacing an ancestral food, they would be acting against their values by rejecting the novel food." , proofLink = "https://www.umsu.de/trees/#(~7x(Px)~1~7y(Qy)~5~6x~6y(~3Rxy~5Sx)),(~7x(Px)),(~7y(Qy))|=(~6x~6y(~3Rxy~5Sx))" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) favours consuming ancestral foods to the exclusion of (y) because they value reducing disease risk" diff --git a/frontend/src/Debate/Arguments/HealthyChocolate.elm b/frontend/src/Debate/Arguments/HealthyChocolate.elm index 61ad52a..86dc292 100755 --- a/frontend/src/Debate/Arguments/HealthyChocolate.elm +++ b/frontend/src/Debate/Arguments/HealthyChocolate.elm @@ -11,6 +11,7 @@ argumentHealthyChocolate = , propositionSummary = "Despite chocolate containing high amounts of saturated fat, populations that consume more chocolate do not exhibit higher rates of atherosclerosis, suggesting that chocolate does not have the same effect on heart disease risk as most other saturated fat sources." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5Qx)),(~3Qc)|=(~3Pc)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) causes atherosclerosis" diff --git a/frontend/src/Debate/Arguments/HealthyDairy.elm b/frontend/src/Debate/Arguments/HealthyDairy.elm index be6e8e1..9c027ee 100755 --- a/frontend/src/Debate/Arguments/HealthyDairy.elm +++ b/frontend/src/Debate/Arguments/HealthyDairy.elm @@ -10,6 +10,7 @@ argumentHealthyDairy = , propositionSummary = "The diet-heart hypothesis would predict that populations consuming more dairy foods should have higher rates of the disease. However, even when you account for factors that could plausibly influence the results, non-churned, non-homogenized dairy have been shown to consistently reduce the risk of morbidity and mortality, strongly suggesting that they directly contribute to better health outcomes, particularly with respect to cardiovascular disease and colorectal cancer." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5Qx)),(~3Qh)|=(~3Ph)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) causes atherosclerosis" diff --git a/frontend/src/Debate/Arguments/HealthyFattyFish.elm b/frontend/src/Debate/Arguments/HealthyFattyFish.elm index abfc797..bb8d055 100755 --- a/frontend/src/Debate/Arguments/HealthyFattyFish.elm +++ b/frontend/src/Debate/Arguments/HealthyFattyFish.elm @@ -11,6 +11,7 @@ argumentHealthyFattyFish = , propositionSummary = "Even when you account for factors that could plausibly influence the results, fatty fish have been shown to consistently reduce the risk of morbidity and mortality, strongly suggesting that they directly contribute to better health outcomes, particularly with respect to cardiovascular disease." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qf)|=(Pf)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is overwhelmingly healthy" diff --git a/frontend/src/Debate/Arguments/HealthyFibre.elm b/frontend/src/Debate/Arguments/HealthyFibre.elm index 19be25f..8c781ad 100755 --- a/frontend/src/Debate/Arguments/HealthyFibre.elm +++ b/frontend/src/Debate/Arguments/HealthyFibre.elm @@ -11,6 +11,7 @@ argumentHealthyFibre = , propositionSummary = "Even when you account for factors that could plausibly influence the results, both refined and whole fibre have been shown to consistently reduce the risk of morbidity and mortality, strongly suggesting that they directly contribute to better health outcomes, particularly with respect to cardiovascular disease." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qb)|=(Pb)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is overwhelmingly healthy" diff --git a/frontend/src/Debate/Arguments/HealthyFood.elm b/frontend/src/Debate/Arguments/HealthyFood.elm index d967513..1f9561d 100755 --- a/frontend/src/Debate/Arguments/HealthyFood.elm +++ b/frontend/src/Debate/Arguments/HealthyFood.elm @@ -11,6 +11,7 @@ argumentHealthyFood = , propositionSummary = "A food is considered healthier than another in a specific context if it increases the time before illness or disease sets in when replacing the other food. On a desert island, since Pepsi can extend the time before starvation compared to leafy greens, it is considered healthier than leafy greens in that context." , proofLink = "https://www.umsu.de/trees/#(~6x~6y~6z~6w(Pxyw~4Qwxzy)),(Qdpsl)|=(Ppld)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x,y,w)" , definiens = "(x) is healthy compared to (w) when in (y)" diff --git a/frontend/src/Debate/Arguments/HealthyPlantFoods.elm b/frontend/src/Debate/Arguments/HealthyPlantFoods.elm index b21e455..27eb159 100755 --- a/frontend/src/Debate/Arguments/HealthyPlantFoods.elm +++ b/frontend/src/Debate/Arguments/HealthyPlantFoods.elm @@ -11,6 +11,7 @@ argumentHealthyPlantFoods = , propositionSummary = "Since whole plant foods consistently consistently associate with reduced risk of illness and death, it is reasonable to conclude that whole plant foods are overwhelmingly healthy." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qf)|=(Pf)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is overwhelmingly healthy" diff --git a/frontend/src/Debate/Arguments/HealthySeedOils.elm b/frontend/src/Debate/Arguments/HealthySeedOils.elm index e626682..c8d74ad 100755 --- a/frontend/src/Debate/Arguments/HealthySeedOils.elm +++ b/frontend/src/Debate/Arguments/HealthySeedOils.elm @@ -11,6 +11,7 @@ argumentHealthySeedOils = , propositionSummary = "Even when you account for factors that could plausibly influence the results, non-hydrogenated vegetable oils have been shown to consistently reduce the risk of morbidity and mortality, strongly suggesting that they directly contribute to better health outcomes." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5Qx)),(Pv)|=(Qv)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is overwhelmingly healthy" diff --git a/frontend/src/Debate/Arguments/HealthySoy.elm b/frontend/src/Debate/Arguments/HealthySoy.elm index b7c5445..c615a6b 100755 --- a/frontend/src/Debate/Arguments/HealthySoy.elm +++ b/frontend/src/Debate/Arguments/HealthySoy.elm @@ -11,6 +11,7 @@ argumentHealthySoy = , propositionSummary = "Even when you account for factors that could plausibly influence the results, non-hydrogenated soy products have been shown to consistently reduce the risk of morbidity and mortality, strongly suggesting that they directly contribute to better health outcomes, particularly with respect to cardiovascular disease." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qs)|=(Ps)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is overwhelmingly healthy" diff --git a/frontend/src/Debate/Arguments/ImmortalityReductio.elm b/frontend/src/Debate/Arguments/ImmortalityReductio.elm index ef2a359..1bb9ae2 100755 --- a/frontend/src/Debate/Arguments/ImmortalityReductio.elm +++ b/frontend/src/Debate/Arguments/ImmortalityReductio.elm @@ -11,6 +11,7 @@ argumentImmortalityReductio = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x~6y(Hx~5~3Rxy)),(Hs)%7C=(~3Rsd)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "humans undergo (x)" diff --git a/frontend/src/Debate/Arguments/Malondialdehyde.elm b/frontend/src/Debate/Arguments/Malondialdehyde.elm index 44949f3..280d655 100755 --- a/frontend/src/Debate/Arguments/Malondialdehyde.elm +++ b/frontend/src/Debate/Arguments/Malondialdehyde.elm @@ -11,6 +11,7 @@ argumentMalondialdehyde = , propositionSummary = "If one takes the view that in order for a substance to increase the risk of atherosclerosis, it must facilitate the oxidative modification of LDL particles via malondialdehyde production, and one also affirms that omega-3s are anti-atherogenic, then this would imply that all fatty acids that produce malondialdehyde, including omega-3s, must also be atherogenic, which contradicts the their belief that omega-3s are heart-healthy." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qm),(Pm~5~6x(Rx))%7C=(Ro)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) increases the risk of atherosclerosis" diff --git a/frontend/src/Debate/Arguments/OddOrderPredators.elm b/frontend/src/Debate/Arguments/OddOrderPredators.elm index a72317a..339e6d0 100755 --- a/frontend/src/Debate/Arguments/OddOrderPredators.elm +++ b/frontend/src/Debate/Arguments/OddOrderPredators.elm @@ -11,6 +11,7 @@ argumentOddOrderPredators = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~5~3Qx)),(Pa),(~3Qa~5R)%7C=(R)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) has negative rights" diff --git a/frontend/src/Debate/Arguments/Omega3Omega6Ratio.elm b/frontend/src/Debate/Arguments/Omega3Omega6Ratio.elm index 5e00e53..15d75b3 100755 --- a/frontend/src/Debate/Arguments/Omega3Omega6Ratio.elm +++ b/frontend/src/Debate/Arguments/Omega3Omega6Ratio.elm @@ -10,6 +10,7 @@ argumentOmega3Omega6Ratio = , propositionSummary = "More often than not, the associated risks of a high omega-6/omega-3 ratio are better explained by omega-3 alone. In multivariable analyses, the ratio looks like it matters, but in univariable anaylses, low omega-3 is almost always driving the risk via lowering the denominator." , proofLink = "https://www.umsu.de/trees/#(P~5Q),(~3Q)|=(~3P)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "increases or decreases in disease risk associated with a high or low omega-6/omega-3 ratio are better explained by changes in omega-3 alone" diff --git a/frontend/src/Debate/Arguments/Ostroveganism.elm b/frontend/src/Debate/Arguments/Ostroveganism.elm index 70782f7..83571c4 100755 --- a/frontend/src/Debate/Arguments/Ostroveganism.elm +++ b/frontend/src/Debate/Arguments/Ostroveganism.elm @@ -11,6 +11,7 @@ argumentOstroveganism = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx~1Rx~1(Sx~2Wx))),(Qc~1~3Rc~1Sc~1~3Wc),(~3Pc~5~6x(~3Tx))|=(~3Tb)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) counts as a brain" diff --git a/frontend/src/Debate/Arguments/PlantBasedCVDReversal.elm b/frontend/src/Debate/Arguments/PlantBasedCVDReversal.elm index 20b4798..c60535c 100755 --- a/frontend/src/Debate/Arguments/PlantBasedCVDReversal.elm +++ b/frontend/src/Debate/Arguments/PlantBasedCVDReversal.elm @@ -11,6 +11,7 @@ argumentPlantBasedCVDReversal = , propositionSummary = "To date, there is not a single case of supposed heart disease reversal from a plant-based diet that is actually compatible with established definitions of heart disease reversal in the literature." , proofLink = "https://www.umsu.de/trees/#(P~1~3Q~5~3R),(P),(~3Q)|=(~3R)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "there are established definitions for atherosclerosis reversal in the domain of cardiology" diff --git a/frontend/src/Debate/Arguments/PollinationReductio.elm b/frontend/src/Debate/Arguments/PollinationReductio.elm index a81774f..bd76c29 100755 --- a/frontend/src/Debate/Arguments/PollinationReductio.elm +++ b/frontend/src/Debate/Arguments/PollinationReductio.elm @@ -11,6 +11,7 @@ argumentPollinationReductio = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4~3Qx)),(Qb),(~3Pb~5~6y(~3Ry))|=(~3Ra)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is vegan" diff --git a/frontend/src/Debate/Arguments/PolyphenolReductio.elm b/frontend/src/Debate/Arguments/PolyphenolReductio.elm index 93b380d..1cb352e 100755 --- a/frontend/src/Debate/Arguments/PolyphenolReductio.elm +++ b/frontend/src/Debate/Arguments/PolyphenolReductio.elm @@ -11,6 +11,7 @@ argumentPolyphenolReductio = , propositionSummary = "If one is committed to the notions that polyphenols in plants are bad for humans, and that grass-fed red meat is the healthiest available type of red meat, then they're pragmatically committed to being pro-GMO to lower the grass-derived polyphenol content of grass-fed beef." , proofLink = "https://www.umsu.de/trees/#(~6x~6y(Px~1Qxy~5Rxy)),(Pp),(Qpg),(Rpg~5Spg),(Spg~5Wp)|=(Wp)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is harmful" diff --git a/frontend/src/Debate/Arguments/ScratcherPioneers.elm b/frontend/src/Debate/Arguments/ScratcherPioneers.elm index a4c063c..5443204 100755 --- a/frontend/src/Debate/Arguments/ScratcherPioneers.elm +++ b/frontend/src/Debate/Arguments/ScratcherPioneers.elm @@ -11,6 +11,7 @@ argumentScratcherPioneers = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx~2Rx~2Sx)),(Qt),(Rt),(St)%7C=(Pt)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is a scratcher" diff --git a/frontend/src/Debate/Arguments/SodiumCVD.elm b/frontend/src/Debate/Arguments/SodiumCVD.elm index 28eef5f..b09a6c8 100755 --- a/frontend/src/Debate/Arguments/SodiumCVD.elm +++ b/frontend/src/Debate/Arguments/SodiumCVD.elm @@ -10,6 +10,7 @@ argumentSodiumCVD = , propositionSummary = "In all of the strongest analysis on the relationship between sodium intake and cardiovascular disease risk, there is a linear and proportional relationship. Particularly when the strongest measurement methods are used, such as multiple 24-hour urinary collections." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~1Q~5Rx)),(Ps),(Q)|=(Rs)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) consistently raises blood pressure in controlled studies" diff --git a/frontend/src/Debate/Arguments/TMAOCausality.elm b/frontend/src/Debate/Arguments/TMAOCausality.elm index f49b4aa..240edc8 100755 --- a/frontend/src/Debate/Arguments/TMAOCausality.elm +++ b/frontend/src/Debate/Arguments/TMAOCausality.elm @@ -11,6 +11,7 @@ argumentTMAOCausality = , propositionSummary = "In the strongest research we have on the relationship between TMAO and heart disease risk, such as with Mendelian randomization and genome-wide associational studies, there is no persuasive causal link between TMAO in the blood and heart disease risk." , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(~3Qt)|=(~3Pt)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is likely to be causative of heart diseas" diff --git a/frontend/src/Debate/Arguments/Template.elm b/frontend/src/Debate/Arguments/Template.elm index 41728b2..c7cc948 100755 --- a/frontend/src/Debate/Arguments/Template.elm +++ b/frontend/src/Debate/Arguments/Template.elm @@ -10,6 +10,7 @@ argument = , propositionReductio = "" , propositionSummary = "" , proofLink = "" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "" , definiens = "" diff --git a/frontend/src/Debate/Arguments/TransPeople.elm b/frontend/src/Debate/Arguments/TransPeople.elm index 90158e8..6880a51 100755 --- a/frontend/src/Debate/Arguments/TransPeople.elm +++ b/frontend/src/Debate/Arguments/TransPeople.elm @@ -11,6 +11,7 @@ argumentTransPeople = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Rx~1Wx)),(~6x(Qx~4Sx~1Wx)),(Ra~1Wa),(Sg~1Wg)|=(Pa~1Qg)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "Male" , definiens = "the cluster of traits that associate with small, but not large, gametes." diff --git a/frontend/src/Debate/Arguments/TruncatedMeta.elm b/frontend/src/Debate/Arguments/TruncatedMeta.elm index 57a9122..1c6afd0 100755 --- a/frontend/src/Debate/Arguments/TruncatedMeta.elm +++ b/frontend/src/Debate/Arguments/TruncatedMeta.elm @@ -11,6 +11,7 @@ argumentTruncatedMeta = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(P~5Q),(P)%7C=(Q)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "underpowered studies provide weaker causal estimates than adequately powered studies" diff --git a/frontend/src/Debate/Arguments/UnhealthyCoconutOil.elm b/frontend/src/Debate/Arguments/UnhealthyCoconutOil.elm index 8b6a40c..73438f0 100755 --- a/frontend/src/Debate/Arguments/UnhealthyCoconutOil.elm +++ b/frontend/src/Debate/Arguments/UnhealthyCoconutOil.elm @@ -11,6 +11,7 @@ argumentUnhealthyCoconutOil = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~1Qx~5~3Rx)),(Pc),(Qc)|=(~3Rc)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P" , definiens = "a given (x) increases LDL-C at a similar rate to other saturated fat sources" diff --git a/frontend/src/Debate/Arguments/UnhealthyProcessedMeat.elm b/frontend/src/Debate/Arguments/UnhealthyProcessedMeat.elm index cd8c6fe..470e041 100755 --- a/frontend/src/Debate/Arguments/UnhealthyProcessedMeat.elm +++ b/frontend/src/Debate/Arguments/UnhealthyProcessedMeat.elm @@ -11,6 +11,7 @@ argumentUnhealthyProcessedMeat = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qs)|=(Ps)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is overwhelmingly unhealthy" diff --git a/frontend/src/Debate/Arguments/UnhealthyRedMeat.elm b/frontend/src/Debate/Arguments/UnhealthyRedMeat.elm index e7afd5a..8c7c67e 100755 --- a/frontend/src/Debate/Arguments/UnhealthyRedMeat.elm +++ b/frontend/src/Debate/Arguments/UnhealthyRedMeat.elm @@ -11,6 +11,7 @@ argumentUnhealthyRedMeat = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qm)|=(Pm)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is overwhelmingly unhealthy" diff --git a/frontend/src/Debate/Arguments/UnhealthySaturatedFat.elm b/frontend/src/Debate/Arguments/UnhealthySaturatedFat.elm index c4c4f77..dc7c55a 100755 --- a/frontend/src/Debate/Arguments/UnhealthySaturatedFat.elm +++ b/frontend/src/Debate/Arguments/UnhealthySaturatedFat.elm @@ -11,6 +11,7 @@ argumentUnhealthySaturatedFat = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4Qx)),(Qf)|=(Pf)" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "(x) is overwhelmingly unhealthy" diff --git a/frontend/src/Debate/Arguments/VeganSocietyReductio.elm b/frontend/src/Debate/Arguments/VeganSocietyReductio.elm index a5eebac..a80bc2b 100755 --- a/frontend/src/Debate/Arguments/VeganSocietyReductio.elm +++ b/frontend/src/Debate/Arguments/VeganSocietyReductio.elm @@ -11,6 +11,7 @@ argumentVeganSocietyReductio = , propositionSummary = "Summary" , proofLink = "https://www.umsu.de/trees/#(~6x(Px~4~3Qx)),(~6x~6y(~3Rx~5~3Q(e(y)))),(~3Rg)%7C=(P(e(g)))" + , argumentCertainty = 1 , definitionTable = [ { definiendum = "P(x)" , definiens = "it is vegan to do (x)" diff --git a/frontend/src/Debate/Helpers.elm b/frontend/src/Debate/Helpers.elm index e66add3..e55ab91 100755 --- a/frontend/src/Debate/Helpers.elm +++ b/frontend/src/Debate/Helpers.elm @@ -13,7 +13,7 @@ import Element.Background as B exposing (..) import Element.Border as D exposing (..) import Element.Events as V exposing (..) import Element.Font as F exposing (..) -import Html.Attributes exposing (form) +import Html.Attributes exposing (form, id) import Layouts import List.Extra exposing (..) import Maybe exposing (withDefault) @@ -35,46 +35,47 @@ import View exposing (View) -- ) -argumentMaker : (Int -> msg) -> List Bool -> Argument -> Int -> Element msg -argumentMaker onClickMsg areArgsExpanded argument indexExpand = +argumentMaker : (Int -> msg) -> List Int -> Argument -> Int -> Element msg +argumentMaker onClickMsg argHeights argument indexExpand = let - isArgumentExpanded : Bool + isArgumentExpanded : Int isArgumentExpanded = - withDefault False <| getAt indexExpand areArgsExpanded + withDefault 0 <| getAt indexExpand argHeights in column - [ B.color colourTheme.darker + [ B.color colourTheme.cardBackground , rounded 10 , E.width <| px 700 + , E.htmlAttribute (id <| "arg" ++ String.fromInt indexExpand) ] [ titleMaker onClickMsg indexExpand argument.argumentTitle isArgumentExpanded , column ([ E.width <| px 600, centerX, transitionStyle, spacing 10 ] - ++ (if not isArgumentExpanded then - [ transitionStyle - , height <| px 0 - , roundEach { topLeft = 0, topRight = 0, bottomRight = 10, bottomLeft = 10 } - , clip - ] - - else - [ transitionStyle - , height <| px 800 - , clip - ] - ) + -- ++ (if not isArgumentExpanded then + -- [ transitionStyle + -- -- , height <| px 0 + -- , roundEach { topLeft = 0, topRight = 0, bottomRight = 10, bottomLeft = 10 } + -- , clip + -- ] + -- else + -- [ transitionStyle + -- , height <| px 300 + -- , clip + -- ] + -- ) ) [ propositionMaker argument isArgumentExpanded , reductioMaker argument isArgumentExpanded , summaryMaker argument isArgumentExpanded + , strengthMaker argument isArgumentExpanded , tableMaker argument isArgumentExpanded , proofTreeMaker argument isArgumentExpanded ] ] -titleMaker : (Int -> msg) -> Int -> String -> Bool -> Element msg -titleMaker onClickMsg indexExpand title isArgumentExpanded = +titleMaker : (Int -> msg) -> Int -> String -> Int -> Element msg +titleMaker onClickMsg indexExpand title argHeight = paragraph (paragraphBoldFormat ++ [ F.size 20 @@ -94,7 +95,7 @@ titleMaker onClickMsg indexExpand title isArgumentExpanded = ] , V.onClick <| onClickMsg indexExpand ] - ++ (if not isArgumentExpanded then + ++ (if argHeight == 30 then [ rounded 10 ] else @@ -105,22 +106,37 @@ titleMaker onClickMsg indexExpand title isArgumentExpanded = ] -propositionMaker : Argument -> Bool -> Element msg -propositionMaker argument isArgumentExpanded = - row [ paddingEach { top = 10, right = 0, bottom = 0, left = 0 } ] +propositionMaker : Argument -> Int -> Element msg +propositionMaker argument argHeight = + row + [ paddingEach { top = 10, right = 0, bottom = 0, left = 0 } + ] [ column [ E.alignTop, E.alignLeft ] - [ paragraph (paragraphBoldFormat ++ [ F.size 18, E.width <| px 100 ]) + [ paragraph + (paragraphBoldFormat + ++ [ F.size 18 + , E.width <| px 100 + ] + ) [ el [ tooltip below (myTooltip "A proposition is a declarative statement that can be evaluated as either true or false, and which serves as the basis for debate.") ] (text "Proposition:") |> el [ F.color colourTheme.highlightText ] ] ] , column [ E.width fill, E.alignLeft ] - [ paragraph (paragraphBoldFormat ++ [ F.size 18 ]) [ text argument.propositionTitle |> el [ F.color colourTheme.nonHighlightedText, F.regular, F.size 16 ] ] ] + [ paragraph (paragraphBoldFormat ++ [ F.size 18 ]) + [ text argument.propositionTitle + |> el + [ F.color colourTheme.nonHighlightedText + , F.regular + , F.size 16 + ] + ] + ] ] -reductioMaker : Argument -> Bool -> Element msg -reductioMaker argument isArgumentExpanded = +reductioMaker : Argument -> Int -> Element msg +reductioMaker argument argHeight = case argument.propositionReductio of "" -> none @@ -140,8 +156,8 @@ reductioMaker argument isArgumentExpanded = ] -summaryMaker : Argument -> Bool -> Element msg -summaryMaker argument isArgumentExpanded = +summaryMaker : Argument -> Int -> Element msg +summaryMaker argument argHeight = row [] [ column [ E.alignTop, E.alignLeft ] @@ -151,12 +167,99 @@ summaryMaker argument isArgumentExpanded = ] , column [ E.width fill, E.alignLeft ] - [ paragraph (paragraphBoldFormat ++ [ F.size 18, spacing 3 ]) [ text argument.propositionSummary |> el [ F.color colourTheme.nonHighlightedText, F.regular, F.size 16 ] ] ] + [ paragraph + (paragraphBoldFormat + ++ [ F.size 18 + , spacing 3 + ] + ) + [ text argument.propositionSummary + |> el + [ F.color colourTheme.nonHighlightedText + , F.regular + , F.size 16 + ] + ] + ] ] -tableMaker : Argument -> Bool -> Element msg -tableMaker argument isArgumentExpanded = +strengthMaker : Argument -> Int -> Element msg +strengthMaker argument argHeight = + let + barMaker : Int -> Element msg + barMaker num = + el + [ E.height <| px 12 + , E.width <| px 500 + , D.rounded 10 + , D.color colourTheme.nonHighlightedDarkText + , D.width 2 + , B.gradient + { angle = 90 + , steps = + List.concat + [ List.repeat num colourTheme.barGreen + , List.repeat (10 - num) colourTheme.barRed + ] + } + , tooltip below (myTooltip (getConfidenceTooltip num)) + ] + none + + getConfidenceTooltip : Int -> String + getConfidenceTooltip num = + case num of + 0 -> + "Extremely low. Speculative reasoning." + + 1 -> + "Very low. Extremely weak reasoning." + + 2 -> + "Kinda low. Weak reasoning." + + 3 -> + "Low. Somewhat weak reasoning." + + 4 -> + "Below average. More weak than strong." + + 5 -> + "Moderate. OK reasoning." + + 6 -> + "Above average. More strong than weak." + + 7 -> + "High. Somewhat strong reasoning." + + 8 -> + "Kinda high. Robust reasoning." + + 9 -> + "Very high. Extremely robust reasoning." + + 10 -> + "Extremely high. Air tight reasoning." + + _ -> + "Confidence level out of expected range." + in + row [ paddingEach { top = 10, right = 0, bottom = 0, left = 0 } ] + [ column + [ E.alignTop, E.alignLeft ] + [ paragraph (paragraphBoldFormat ++ [ F.size 18, E.width <| px 100 ]) + [ el [ tooltip below (myTooltip "This represents my confidence in the soundness of the argument.") ] (text "Confidence:") |> el [ F.color colourTheme.highlightText ] ] + ] + , column + [ E.width fill, E.alignLeft, centerY ] + [ barMaker argument.argumentCertainty ] + ] + + +tableMaker : Argument -> Int -> Element msg +tableMaker argument argHeight = let formalizationMaker : List (Element msg) formalizationMaker = @@ -265,8 +368,8 @@ tableMaker argument isArgumentExpanded = ] -proofTreeMaker : Argument -> Bool -> Element msg -proofTreeMaker argument isArgumentExpanded = +proofTreeMaker : Argument -> Int -> Element msg +proofTreeMaker argument argHeight = row [ paddingEach { top = 10, right = 0, bottom = 10, left = 0 }, centerX, E.width fill ] [ column [ E.alignRight ] [ newTabLink diff --git a/frontend/src/Debate/Types.elm b/frontend/src/Debate/Types.elm index 7d86ead..3b533a2 100755 --- a/frontend/src/Debate/Types.elm +++ b/frontend/src/Debate/Types.elm @@ -1,5 +1,6 @@ module Debate.Types exposing (..) + type alias Argument = { argumentTitle : String , propositionTitle : String @@ -7,6 +8,7 @@ type alias Argument = , propositionReductio : String , proofLink : String , definitionTable : List Definition + , argumentCertainty : Int , argumentFormalization : List ArgumentEntry } diff --git a/frontend/src/Hashtags/Helpers.elm b/frontend/src/Hashtags/Helpers.elm old mode 100644 new mode 100755 diff --git a/frontend/src/Hashtags/Types.elm b/frontend/src/Hashtags/Types.elm old mode 100644 new mode 100755 diff --git a/frontend/src/Pages/Arguments.elm b/frontend/src/Pages/Arguments.elm index 9a160d3..f422c49 100755 --- a/frontend/src/Pages/Arguments.elm +++ b/frontend/src/Pages/Arguments.elm @@ -64,6 +64,7 @@ import Html.Attributes as H exposing (style, title, wrap) import Layouts import List.Extra as L exposing (..) import Page exposing (Page) +import Ports import Route exposing (Route) import Shared import View exposing (View) @@ -75,7 +76,7 @@ page shared route = { init = init , update = update , subscriptions = subscriptions - , view = view + , view = view shared } |> Page.withLayout toLayout @@ -90,12 +91,12 @@ toLayout model = type alias Model = - { areArgsExpanded : List Bool } + { argHeights : List Int } init : () -> ( Model, Effect Msg ) init () = - ( { areArgsExpanded = List.repeat (List.length argumentList) False } + ( { argHeights = List.repeat (List.length argumentList) 30 } , Effect.none ) @@ -112,13 +113,13 @@ update : Msg -> Model -> ( Model, Effect Msg ) update msg model = case msg of ToggleExpandArg index -> - ( case getAt index model.areArgsExpanded of + ( case getAt index model.argHeights of Nothing -> model - Just isExpanded -> - { model | areArgsExpanded = setAt index (not isExpanded) model.areArgsExpanded } - , Effect.none + Just elHeight -> + { model | argHeights = setAt index elHeight model.argHeights } + , Effect.sendCmd <| Ports.getArgHeight () ) @@ -135,16 +136,21 @@ subscriptions model = -- VIEW -view : Model -> View Msg -view model = +view : Shared.Model -> Model -> View Msg +view shared model = { title = debateName , attributes = [] - , element = debateContainer model + , element = debateContainer shared model } -debateContainer : Model -> Element Msg -debateContainer model = +debateContainer : Shared.Model -> Model -> Element Msg +debateContainer shared model = + let + a : Device + a = + shared.device + in topLevelContainer <| debateList model @@ -153,11 +159,11 @@ debateList model = column pageList <| - List.map2 (argumentMaker ToggleExpandArg model.areArgsExpanded) + List.map2 (argumentMaker ToggleExpandArg model.argHeights) argumentList <| List.range 0 <| - List.length model.areArgsExpanded + List.length model.argHeights argumentList : List Argument diff --git a/frontend/src/Pages/Home_.elm b/frontend/src/Pages/Home_.elm index 7627311..0baaf61 100755 --- a/frontend/src/Pages/Home_.elm +++ b/frontend/src/Pages/Home_.elm @@ -5,7 +5,9 @@ import Config.Format as O exposing (..) import Config.Identity as I exposing (..) import Cuckery.Types exposing (..) import Effect exposing (Effect) -import Element exposing (..) +import Element as E exposing (..) +import Element.Background as D exposing (..) +import Element.Border as R exposing (..) import Html.Attributes as H exposing (style) import Layouts import Page exposing (Page) diff --git a/frontend/src/Ports.elm b/frontend/src/Ports.elm new file mode 100644 index 0000000..edb42b1 --- /dev/null +++ b/frontend/src/Ports.elm @@ -0,0 +1,7 @@ +port module Ports exposing (getArgHeight) + + +port getArgHeight : () -> Cmd msg + + +port gotArgHeight : (() -> msg) -> Sub msg diff --git a/frontend/src/Shared.elm b/frontend/src/Shared.elm new file mode 100644 index 0000000..69c6b6c --- /dev/null +++ b/frontend/src/Shared.elm @@ -0,0 +1,104 @@ +module Shared exposing + ( Flags, decoder + , Model, Msg + , init, update, subscriptions + ) + +{-| + +@docs Flags, decoder +@docs Model, Msg +@docs init, update, subscriptions + +-} + +import Effect exposing (Effect) +import Element as E exposing (..) +import Json.Decode exposing (..) +import Route exposing (Route) +import Route.Path +import Shared.Model +import Shared.Msg + + + +-- FLAGS + + +type alias Flags = + { height : Int + , width : Int + } + + +decoder : Json.Decode.Decoder Flags +decoder = + Json.Decode.map2 + (\height width -> + { height = height + , width = width + } + ) + (field "height" int) + (field "width" int) + + + +-- INIT + + +type alias Model = + Shared.Model.Model + + +init : Result Json.Decode.Error Flags -> Route () -> ( Model, Effect Msg ) +init flagsResult route = + ( modelFromFlagsResult flagsResult + , Effect.none + ) + + +modelFromFlagsResult : Result Error Flags -> Model +modelFromFlagsResult f = + case f of + Ok flags -> + { device = E.classifyDevice flags + , height = flags.height + , width = flags.width + } + + Err _ -> + { device = + E.classifyDevice + { height = 0 + , width = 0 + } + , height = 10 + , width = 10 + } + + + +-- UPDATE + + +type alias Msg = + Shared.Msg.Msg + + +update : Route () -> Msg -> Model -> ( Model, Effect Msg ) +update route msg model = + case msg of + Shared.Msg.NoOp -> + ( model + , Effect.none + ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Route () -> Model -> Sub Msg +subscriptions route model = + Sub.none diff --git a/frontend/src/Shared/Model.elm b/frontend/src/Shared/Model.elm new file mode 100644 index 0000000..9d82f50 --- /dev/null +++ b/frontend/src/Shared/Model.elm @@ -0,0 +1,10 @@ +module Shared.Model exposing (Model) + +import Element exposing (Device) + + +type alias Model = + { height : Int + , width : Int + , device : Device + } diff --git a/frontend/src/Shared/Msg.elm b/frontend/src/Shared/Msg.elm new file mode 100644 index 0000000..0277660 --- /dev/null +++ b/frontend/src/Shared/Msg.elm @@ -0,0 +1,14 @@ +module Shared.Msg exposing (Msg(..)) + +{-| -} + + +{-| Normally, this value would live in "Shared.elm" +but that would lead to a circular dependency import cycle. + +For that reason, both `Shared.Model` and `Shared.Msg` are in their +own file, so they can be imported by `Effect.elm` + +-} +type Msg + = NoOp diff --git a/frontend/src/interop.js b/frontend/src/interop.js new file mode 100644 index 0000000..ba5864d --- /dev/null +++ b/frontend/src/interop.js @@ -0,0 +1,30 @@ +// This is called BEFORE your Elm app starts up +// +// The value returned here will be passed as flags +// into your `Shared.init` function. +export const flags = ({ env }) => { + return { + height: window.innerHeight, + width: window.innerWidth + } +} + +// This is called AFTER your Elm app starts up +// +// Here you can work with `app.ports` to send messages +// to your Elm application, or subscribe to incoming +// messages from Elm +export const onReady = ({ app, env }) => { + app.ports.getArgHeight.subscribe(() => { + + setTimeout(() => { + const element = document.getElementById('arg1'); + + if (element) { + const height = element.offsetHeight; + console.log(`Height of the element: ${height}px`); + } else { + console.error('Element not found.'); + } + }, 0) + })} \ No newline at end of file