-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{% define home-subtitle %} | ||
<h2 class="page-subtitle">GMO-free!</h2> | ||
<script> | ||
function setSubtitle() { | ||
const nouns = [ | ||
['GMO', 'GMOs'], | ||
['Pesticide', 'Pesticides'], | ||
['Asbestos', 'Asbestos'], | ||
['Lead', 'Lead'], | ||
['Mercury', 'Mercury'], | ||
['Cadmium', 'Cadmium'], | ||
['Arsenic', 'Arsenic'], | ||
['Dioxin', 'Dioxin'], | ||
['PCB', 'PCBs'], | ||
['DDT', 'DDT'], | ||
['BPA', 'BPA'], | ||
['Phthalate', 'Phthalates'], | ||
['Paraben', 'Parabens'], | ||
['Sulfate', 'Sulfates'], | ||
['Sulfite', 'Sulfites'], | ||
['Nitrate', 'Nitrates'], | ||
['Nitrite', 'Nitrites'], | ||
['BHA', 'BHAs'], | ||
['MSG', 'MSG'], | ||
['HFCS', 'HFCS'], | ||
['PFAS', 'PFAS'], | ||
['Micronutrient', 'Micronutrients'], | ||
] | ||
const modifiers = [ | ||
[(noun) => `Now With 30% Less ${noun}!`, 1], | ||
[(noun) => `Now With 30% More ${noun}!`, 1], | ||
[(noun) => `${noun}-Free!`, 0], | ||
[(noun) => `Full of ${noun}!`, 1], | ||
]; | ||
const noun = nouns[Math.floor(Math.random() * nouns.length)]; | ||
const modifier = modifiers[Math.floor(Math.random() * modifiers.length)]; | ||
console.log(noun, modifier); | ||
const subtitle = modifier[0](noun[modifier[1]]); | ||
document.querySelector('.page-subtitle').textContent = subtitle; | ||
} | ||
window.onload = setSubtitle(); | ||
</script> | ||
{% end home-subtitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters