diff --git a/.gitignore b/.gitignore index 28cde21f..3996e833 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ node_modules + .env -.DS_Store \ No newline at end of file +.DS_Store + diff --git a/frontend/app/src/components/ChallengeGrid/ChallengeItem.js b/frontend/app/src/components/ChallengeGrid/ChallengeItem.js index 861e9a61..fa446ea2 100644 --- a/frontend/app/src/components/ChallengeGrid/ChallengeItem.js +++ b/frontend/app/src/components/ChallengeGrid/ChallengeItem.js @@ -5,129 +5,127 @@ import Markdown from '../Markdown' import { requirePropFactory } from '@material-ui/core' const ChallengeItem = ({ item }) => { - //Animation duration - const aDur = 0.6 - const { - name, - company, - shorttext, - long_text, - thechallenge, - insights, - price, - judging, - aboutcompany, - insightimage, - tags, - key, - } = item - var { cardbackground, icon } = item - if (!cardbackground) { - cardbackground = { url: '' } - } - if (!icon) { - icon = { url: '' } - } - const [open, toggleOpen] = useState(false) - const [clicable, toggleClicable] = useState(true) - - const flipStyle = (e, state) => { - e.currentTarget.classList.toggle('flip', state) - e.currentTarget.doneAnimating = !state - } - const flipCard = (e) => { - console.log('===', clicable) - if (!clicable) { - return + //Animation duration + const aDur = 0.6 + const { + name, + company, + shorttext, + long_text, + thechallenge, + insights, + price, + judging, + aboutcompany, + insightimage, + tags, + key, + } = item + var { cardbackground, icon } = item + if (!cardbackground) { + cardbackground = { url: '' } + } + if (!icon) { + icon = { url: '' } } - let duration = aDur * 1000 - flipStyle(e, true) - setTimeout(() => toggleOpen(!open), duration / 2) - } + const [open, toggleOpen] = useState(false) + const [clicable, toggleClicable] = useState(true) + var blurStyle = "" + var isFirefox = typeof InstallTrigger !== 'undefined' - if (open) { + const flipStyle = (e, state) => { + e.currentTarget.classList.toggle('flip', state) + e.currentTarget.doneAnimating = !state + } + const flipCard = (e) => { + console.log('===', clicable) + if (!clicable) { + return + } + let duration = aDur * 1000 + flipStyle(e, true) + setTimeout(() => toggleOpen(!open), duration / 2) + } + if (isFirefox) { + blurStyle = "FirefoxBlur" + } else { + blurStyle = "Blur" + } + console.log(blurStyle) + if (open) { + return ( +
flipCard(e)}> +
flipStyle(e, false)} + onMouseEnter={(e) => { + toggleClicable(false) + }} + onMouseLeave={(e) => { + toggleClicable(true) + }} + > +
+ + { + toggleClicable(true) + }} + onMouseLeave={(e) => { + toggleClicable(false) + }} + > + {name} +

{shorttext}

+

{long_text}

+
+

The Challenge

+

{thechallenge}

+
+
+

Insights

+

{insights}

+
+ {insightimage && } +
+

The Prize

+

{price}

+
+
+

Judging Criteria

+

{judging}

+
+
+

About the company

+

{aboutcompany}

+
+
+
+
+ ) + } return ( -
flipCard(e)}>
flipStyle(e, false)} - onMouseEnter={(e) => { - toggleClicable(false) - }} - onMouseLeave={(e) => { - toggleClicable(true) - }} + className="ChallengeItem closed flip" + style={{ + backgroundImage: 'url(' + cardbackground.url + ')', + animationDuration: aDur + 's', + }} + onAnimationEnd={(e) => flipStyle(e, false)} + onClick={(e) => flipCard(e)} > -
- - { - toggleClicable(true) - }} - onMouseLeave={(e) => { - toggleClicable(false) - }} - > - {name} -

{shorttext}

- -
-

The Challenge

- -
-
-

Insights

- -
- {insightimage && } -
-

The Prize

- -
-
-

Judging Criteria

- +
+
-
-

About the company

- +
+ {name} +

{shorttext}

-
-
) - } - return ( -
flipStyle(e, false)} - onClick={(e) => flipCard(e)} - > -
- -
-
- {name} -

{shorttext}

-
-
- ) } export default ChallengeItem diff --git a/frontend/app/src/components/ChallengeGrid/style.scss b/frontend/app/src/components/ChallengeGrid/style.scss index 07547dd5..427f427d 100644 --- a/frontend/app/src/components/ChallengeGrid/style.scss +++ b/frontend/app/src/components/ChallengeGrid/style.scss @@ -13,6 +13,15 @@ top: 0px; left: 0px; } +.FirefoxBlur { + width: 100%; + height: 100%; + position: fixed; + background-color: rgba(105,105,105, 0.90); + z-index: 99; + top: 0px; + left: 0px; +} .FilterButtons { width: 100%;