-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send to device follow-ups #393
Changes from 11 commits
361fbc6
373703d
f92237f
6c9e9a8
31293a9
6b423f9
8dca8aa
40a8b57
9f5eca3
8a4328f
db8493e
d67e70b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,16 +57,20 @@ body { | |
min-height: 90px; | ||
height: 90px; | ||
display: flex; | ||
border-bottom: 2px solid #242424; | ||
border-bottom: 1px solid #242424; | ||
|
||
&__title { | ||
flex: 10; | ||
display: flex; | ||
width: 350px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you want to make this a variable? |
||
|
||
@media (max-width: 768px) { | ||
justify-content: center; | ||
} | ||
|
||
@media (max-width: 1024px) { | ||
flex: 1 1 350px; | ||
} | ||
|
||
&__name { | ||
width: 200px; | ||
} | ||
|
@@ -77,12 +81,32 @@ body { | |
} | ||
} | ||
|
||
&__entry-code { | ||
@media (max-width: 1024px) { | ||
display: none; | ||
} | ||
|
||
flex: 10; | ||
text-align: center; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
&__link { | ||
color: white; | ||
text-decoration-color: $light-grey; | ||
} | ||
} | ||
|
||
&__experiment { | ||
text-align: right; | ||
flex: 1 1 350px; | ||
width: 350px; | ||
color: $grey-text; | ||
font-size: 1.0em; | ||
font-weight: lighter; | ||
white-space: nowrap; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit; want to do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't think this will ever overflow because once the width is reduced we just stop showing it altogether |
||
|
||
@media (max-width: 768px) { | ||
display: none; | ||
|
@@ -117,6 +141,26 @@ body { | |
} | ||
} | ||
|
||
.header-subtitle { | ||
@media (min-width: 1024px) { | ||
display: none; | ||
} | ||
|
||
padding: 0.5em; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: intentional usage of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah px seems better |
||
background-color: rgba(0, 0, 0, 0.85); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, refactored and flipped everything to 0.9 alpha |
||
text-align: center; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
border-bottom: 2px solid #242424; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably again makes sense here to use a constant variable (as used above too) |
||
|
||
&__link { | ||
color: white; | ||
text-decoration-color: $light-grey; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this 👍 |
||
} | ||
} | ||
|
||
.hero-content { | ||
flex: 10; | ||
min-height: 740px; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
<link rel="shortcut icon" type="image/png" href="/favicon.ico"/> | ||
<title>Enter Code | Hubs by Mozilla</title> | ||
<link href="https://fonts.googleapis.com/css?family=Zilla+Slab:300,300i,400,400i,700" rel="stylesheet"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand the usage is appropriate here to make the onboarding feel app-y, but usually on principle, regardless of the UI design, can you use the related reading: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
</head> | ||
|
||
<body> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,13 @@ class HomeRoot extends Component { | |
<img className="header-content__title__name" src="../assets/images/logo.svg" /> | ||
<div className="header-content__title__preview">preview</div> | ||
</div> | ||
<div className="header-content__entry-code"> | ||
<div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these inner There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep not sure about why that was there |
||
<a className="header-content__entry-code__link" href="/link"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<FormattedMessage id="home.have_entry_code" /> | ||
</a> | ||
</div> | ||
</div> | ||
<div className="header-content__experiment"> | ||
<div className="header-content__experiment__container"> | ||
<img src="../assets/images/webvr_cube.svg" className="header-content__experiment__icon" /> | ||
|
@@ -132,6 +139,13 @@ class HomeRoot extends Component { | |
</div> | ||
</div> | ||
</div> | ||
<div className="header-subtitle"> | ||
<div> | ||
<a className="header-subtitle__link" href="/link"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<FormattedMessage id="home.have_entry_code" /> | ||
</a> | ||
</div> | ||
</div> | ||
<div className="hero-content"> | ||
<div className="hero-content__attribution"> | ||
Medieval Fantasy Book by{" "} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,12 @@ import en from "react-intl/locale-data/en"; | |
import { lang, messages } from "../utils/i18n"; | ||
import classNames from "classnames"; | ||
import styles from "../assets/stylesheets/link.scss"; | ||
import { disableiOSZoom } from "../utils/disable-ios-zoom"; | ||
|
||
const MAX_DIGITS = 4; | ||
|
||
addLocaleData([...en]); | ||
disableiOSZoom(); | ||
|
||
class LinkRoot extends Component { | ||
static propTypes = { | ||
|
@@ -78,8 +80,11 @@ class LinkRoot extends Component { | |
} | ||
}) | ||
.catch(e => { | ||
console.error(e); | ||
this.setState({ failedAtLeastOnce: true, enteredDigits: "" }); | ||
|
||
if (!(e instanceof Error && (e.message === "in_use" || e.message === "failed"))) { | ||
throw e; | ||
} | ||
}); | ||
}; | ||
|
||
|
@@ -106,7 +111,8 @@ class LinkRoot extends Component { | |
<div className={styles.enteredDigits}> | ||
<input | ||
className={styles.digitInput} | ||
type="number" | ||
type="tel" | ||
pattern="[0-9]*" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. feels awkward to use do you know how this works with internationalisation (i.e., non-Arabic numerals)? is Firefox the only browser affected in your experience? Chrome, Safari seemed fine in my testing. can you add a comment somewhere linking to this relevant Firefox bug? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah interesting, i didn't realize this was considered a bug. it seemed logical that a "0001" entry for a |
||
value={this.state.enteredDigits} | ||
onChange={ev => { | ||
this.setState({ enteredDigits: ev.target.value }); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import MobileDetect from "mobile-detect"; | ||
const mobiledetect = new MobileDetect(navigator.userAgent); | ||
|
||
export function disableiOSZoom() { | ||
if (!mobiledetect.is("iPhone") && !mobiledetect.is("iPad")) return; | ||
|
||
let lastTouchAtMs = 0; | ||
|
||
document.addEventListener("touchmove", ev => { | ||
if (ev.scale === 1) return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this is an iOS specific hack since iOS 11 disabled recognizing |
||
|
||
ev.preventDefault(); | ||
}); | ||
|
||
document.addEventListener("touchend", ev => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you want to handle the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure, I don't have a device to test :/ I'll do a fast-follow if this doesn't resolve the issue we were seeing (mis-zooming on the keypad page) |
||
const now = new Date().getTime(); | ||
const isDoubleTouch = now - lastTouchAtMs <= 300; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure, but not certain, you could use iOS' from Safari's Handling Events docs:
(there's also There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah the double tapping is the main issue for the link page, and the zooming is the main issue for the hub page. this implementation "cleanly" fixes both (I don't like it either) :/ |
||
lastTouchAtMs = now; | ||
|
||
if (isDoubleTouch) { | ||
ev.preventDefault(); | ||
} | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this is
rgb(36, 36, 36)
, which is slightly darker than$darker-grey
is. do you want to make a$darkest-grey
, heh?