Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
67ecb60f
Commit
67ecb60f
authored
Jul 19, 2016
by
Ray Schamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make registration styles reusable
parent
2065bc91
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
370 additions
and
342 deletions
+370
-342
src/components/card/card.scss
src/components/card/card.scss
+107
-0
src/components/deck/deck.jsx
src/components/deck/deck.jsx
+1
-1
src/components/deck/deck.scss
src/components/deck/deck.scss
+2
-126
src/components/registration/steps.jsx
src/components/registration/steps.jsx
+12
-10
src/components/registration/steps.scss
src/components/registration/steps.scss
+227
-0
src/components/slide/slide.scss
src/components/slide/slide.scss
+21
-0
src/views/teacherregistration/teacherregistration.scss
src/views/teacherregistration/teacherregistration.scss
+0
-205
No files found.
src/components/card/card.scss
View file @
67ecb60f
...
...
@@ -5,4 +5,111 @@
border-radius
:
8px
/
$em
;
box-shadow
:
0
0
0
.125rem
$active-gray
;
background-color
:
$ui-white
;
.card-button
{
display
:
block
;
border-radius
:
.5rem
;
border-top-left-radius
:
0
;
border-top-right-radius
:
0
;
box-shadow
:
none
;
background-color
:
$ui-aqua
;
width
:
23
.75rem
;
height
:
4rem
;
&
:hover
{
box-shadow
:
none
;
}
}
.form
{
padding
:
3rem
4rem
;
.card-button
{
margin
:
0
0
-3rem
-4rem
;
}
.form-group
{
margin-bottom
:
1
.2rem
;
&
.has-error
{
.input
{
border
:
1px
solid
$ui-orange
;
}
}
}
}
.help-block
{
$arrow-border-width
:
1rem
;
display
:
block
;
position
:
absolute
;
margin-left
:
$arrow-border-width
;
border
:
1px
solid
$active-gray
;
border-radius
:
5px
;
background-color
:
$ui-orange
;
padding
:
1rem
;
max-width
:
18
.75rem
;
min-height
:
1rem
;
max-height
:
3rem
;
overflow
:
visible
;
color
:
$type-white
;
&
:before
{
display
:
block
;
position
:
absolute
;
top
:
1rem
;
left
:
-
$arrow-border-width
/
2
;
transform
:
rotate
(
45deg
);
border-bottom
:
1px
solid
$active-gray
;
border-left
:
1px
solid
$active-gray
;
border-radius
:
5px
;
background-color
:
$ui-orange
;
width
:
$arrow-border-width
;
height
:
$arrow-border-width
;
content
:
""
;
}
}
}
@media
only
screen
and
(
max-width
:
$mobile
-
1
)
{
.card
{
width
:
22
.5rem
;
.form
{
text-align
:
left
;
.button
{
width
:
22
.5rem
;
}
}
}
}
@media
only
screen
and
(
max-width
:
$tablet
-
1
)
{
.card
{
.input
{
width
:
90%
;
}
}
}
@media
only
screen
and
(
max-width
:
$desktop
-
1
)
{
.card
{
.help-block
{
position
:
relative
;
transform
:
none
;
margin
:
inherit
;
width
:
100%
;
height
:
inherit
;
&
:before
{
display
:
none
;
}
}
}
}
src/components/deck/deck.jsx
View file @
67ecb60f
...
...
@@ -10,7 +10,7 @@ var Deck = React.createClass({
<
div
className=
{
classNames
([
'
deck
'
,
this
.
props
.
className
])
}
>
<
div
className=
"inner"
>
<
a
href=
"/"
aria
-
label=
"Scratch"
>
<
img
src=
"/images/logo_sm.png"
/>
<
img
className=
"logo"
src=
"/images/logo_sm.png"
/>
</
a
>
{
this
.
props
.
children
}
</
div
>
...
...
src/components/deck/deck.scss
View file @
67ecb60f
...
...
@@ -6,146 +6,22 @@
.deck
{
min-height
:
100vh
;
img
{
.logo
{
margin-left
:
2px
;
padding
:
12px
0
;
width
:
76px
;
}
.step-navigation
{
margin-top
:
2rem
;
text-align
:
center
;
}
.slide
{
max-width
:
28
.75rem
;
h2
,
.description
{
text-align
:
center
;
color
:
$type-white
;
}
.description
{
margin-top
:
0
;
margin-bottom
:
2rem
;
}
}
.card
{
margin
:
0
auto
;
width
:
23
.75rem
;
}
.form
{
padding
:
3rem
4rem
;
.form-group
{
margin-bottom
:
1
.2rem
;
&
.has-error
{
.input
{
border
:
1px
solid
$ui-orange
;
}
}
}
.button
{
margin
:
0
0
-3rem
-4rem
;
border-radius
:
.5rem
;
box-shadow
:
none
;
width
:
23
.75rem
;
height
:
4rem
;
&
.card-button
{
display
:
block
;
border-top-left-radius
:
0
;
border-top-right-radius
:
0
;
background-color
:
$ui-aqua
;
}
&
:hover
{
box-shadow
:
none
;
}
}
width
:
23
.75rem
;
}
.input
{
width
:
$cols5
;
}
.help-block
{
$arrow-border-width
:
1rem
;
display
:
block
;
position
:
absolute
;
margin-left
:
$arrow-border-width
;
border
:
1px
solid
$active-gray
;
border-radius
:
5px
;
background-color
:
$ui-orange
;
padding
:
1rem
;
max-width
:
18
.75rem
;
min-height
:
1rem
;
max-height
:
3rem
;
overflow
:
visible
;
color
:
$type-white
;
&
:before
{
display
:
block
;
position
:
absolute
;
top
:
1rem
;
left
:
-
$arrow-border-width
/
2
;
transform
:
rotate
(
45deg
);
border-bottom
:
1px
solid
$active-gray
;
border-left
:
1px
solid
$active-gray
;
border-radius
:
5px
;
background-color
:
$ui-orange
;
width
:
$arrow-border-width
;
height
:
$arrow-border-width
;
content
:
""
;
}
}
}
@media
only
screen
and
(
max-width
:
$mobile
-
1
)
{
.deck
{
.card
{
width
:
22
.5rem
;
}
.form
{
text-align
:
left
;
.button
{
width
:
22
.5rem
;
}
}
}
}
@media
only
screen
and
(
max-width
:
$tablet
-
1
)
{
.deck
{
.input
{
width
:
90%
;
}
}
}
@media
only
screen
and
(
max-width
:
$desktop
-
1
)
{
.deck
{
.help-block
{
position
:
relative
;
transform
:
none
;
margin
:
inherit
;
width
:
100%
;
height
:
inherit
;
&
:before
{
display
:
none
;
}
}
}
}
src/components/registration/steps.jsx
View file @
67ecb60f
...
...
@@ -23,6 +23,8 @@ var StepNavigation = require('../../components/stepnavigation/stepnavigation.jsx
var
TextArea
=
require
(
'
../../components/forms/textarea.jsx
'
);
var
Tooltip
=
require
(
'
../../components/tooltip/tooltip.jsx
'
);
require
(
'
./steps.scss
'
);
var
DEFAULT_COUNTRY
=
'
us
'
;
var
NextStepButton
=
React
.
createClass
({
...
...
@@ -96,8 +98,8 @@ module.exports = {
render
:
function
()
{
var
formatMessage
=
this
.
props
.
intl
.
formatMessage
;
return
(
<
Slide
className=
"username-step"
>
<
h2
><
intl
.
FormattedMessage
id=
"teacherRegistration.usernameStepTitle"
/></
h2
>
<
Slide
className=
"registration-step username-step"
>
<
p
className=
"description"
>
<
intl
.
FormattedMessage
id=
"teacherRegistration.usernameStepDescription"
/>
</
p
>
...
...
@@ -191,7 +193,7 @@ module.exports = {
render
:
function
()
{
var
formatMessage
=
this
.
props
.
intl
.
formatMessage
;
return
(
<
Slide
className=
"demographics-step"
>
<
Slide
className=
"
registration-step
demographics-step"
>
<
h2
>
<
intl
.
FormattedMessage
id=
"teacherRegistration.personalStepTitle"
/>
</
h2
>
...
...
@@ -251,7 +253,7 @@ module.exports = {
render
:
function
()
{
var
formatMessage
=
this
.
props
.
intl
.
formatMessage
;
return
(
<
Slide
className=
"name-step"
>
<
Slide
className=
"
registration-step
name-step"
>
<
h2
>
<
intl
.
FormattedHTMLMessage
id=
"teacherRegistration.nameStepTitle"
/>
</
h2
>
...
...
@@ -297,7 +299,7 @@ module.exports = {
render
:
function
()
{
var
formatMessage
=
this
.
props
.
intl
.
formatMessage
;
return
(
<
Slide
className=
"phone-step"
>
<
Slide
className=
"
registration-step
phone-step"
>
<
h2
>
<
intl
.
FormattedMessage
id=
"teacherRegistration.phoneStepTitle"
/>
</
h2
>
...
...
@@ -373,7 +375,7 @@ module.exports = {
render
:
function
()
{
var
formatMessage
=
this
.
props
.
intl
.
formatMessage
;
return
(
<
Slide
className=
"organization-step"
>
<
Slide
className=
"
registration-step
organization-step"
>
<
h2
>
<
intl
.
FormattedMessage
id=
"teacherRegistration.orgStepTitle"
/>
</
h2
>
...
...
@@ -487,7 +489,7 @@ module.exports = {
return
0
;
}.
bind
(
this
));
return
(
<
Slide
className=
"address-step"
>
<
Slide
className=
"
registration-step
address-step"
>
<
h2
>
<
intl
.
FormattedMessage
id=
"teacherRegistration.addressStepTitle"
/>
</
h2
>
...
...
@@ -558,7 +560,7 @@ module.exports = {
var
textAreaClass
=
(
this
.
state
.
characterCount
>
this
.
props
.
maxCharacters
)
?
'
fail
'
:
''
;
return
(
<
Slide
className=
"usescratch-step"
>
<
Slide
className=
"
registration-step
usescratch-step"
>
<
h2
>
<
intl
.
FormattedMessage
id=
"teacherRegistration.useScratchStepTitle"
/>
</
h2
>
...
...
@@ -625,7 +627,7 @@ module.exports = {
render
:
function
()
{
var
formatMessage
=
this
.
props
.
intl
.
formatMessage
;
return
(
<
Slide
className=
"email-step"
>
<
Slide
className=
"
registration-step
email-step"
>
<
h2
>
<
intl
.
FormattedMessage
id=
"teacherRegistration.emailStepTitle"
/>
</
h2
>
...
...
@@ -669,7 +671,7 @@ module.exports = {
},
render
:
function
()
{
return
(
<
Slide
className=
"last-step"
>
<
Slide
className=
"
registration-step
last-step"
>
<
h2
>
<
intl
.
FormattedMessage
id=
"registration.lastStepTitle"
/>
</
h2
>
...
...
@@ -710,7 +712,7 @@ module.exports = {
RegistrationError
:
intl
.
injectIntl
(
React
.
createClass
({
render
:
function
()
{
return
(
<
Slide
className=
"error-step"
>
<
Slide
className=
"
registration-step
error-step"
>
<
h2
>
Something went wrong
</
h2
>
<
Card
>
<
h4
>
There was an error while processing your registration
</
h4
>
...
...
src/components/registration/steps.scss
0 → 100644
View file @
67ecb60f
@import
"../../colors"
;
@import
"../../frameless"
;
.registration-step
{
.demographics-checkbox-is-robot
{
display
:
none
;
}
.invite-avatar
{
display
:
block
;
margin
:
0
auto
1rem
auto
;
border
:
2px
solid
$ui-white
;
border-radius
:
8px
;
}
.gender-input
,
.other-input
{
float
:
right
;
width
:
90%
;
.row
{
margin-left
:
.5rem
;
}
}
&
.class-invite-step
,
&
.class-welcome-step
{
.card
{
text-align
:
center
;
.contents
{
padding
:
2rem
0
;
}
}
}
&
.username-step
,
&
.name-step
,
&
.address-step
,
&
.email-step
{
.help-block
{
transform
:
translate
(
15
.75rem
,
-4rem
);
}
}
&
.demographics-step
{
.gender-input
{
margin-top
:
-5
.5rem
;
}
.help-block
{
transform
:
translate
(
13rem
,
-2rem
);
}
.radio
{
margin-right
:
2
.5rem
;
line-height
:
3rem
;
input
{
margin-right
:
1rem
;
}
}
}
&
.phone-step
{
.form-group
{
margin-bottom
:
2rem
;
}
input
{
&
[
type
=
checkbox
]
{
margin-bottom
:
1
.25rem
;
}
}
.help-block
{
margin-top
:
.5rem
;
}
.checkbox-row
{
.help-block
{
margin-top
:
0
;
}
}
}
&
.organization-step
{
.help-block
{
transform
:
translate
(
16rem
,
-4rem
);
}
.checkbox-group
{
.help-block
{
transform
:
translate
(
16rem
,
-16rem
);
}
}
.organization-type
,
.url-input
{
p
{
margin
:
.25rem
0
;
text-align
:
left
;
color
:
$ui-dark-gray
;
}
}
input
{
&
[
value
=
"8"
]
{
margin
:
1rem
0
;
}
}
.other-input
{
margin-top
:
-5
.75rem
;
}
}
&
.address-step
{
.select
{
.help-block
{
transform
:
translate
(
0
,
.5rem
);
}
}
}
&
.usescratch-step
{
.form
{
.form-group
{
margin-bottom
:
0
;
&
.has-error
{
.textarea
{
border
:
1px
solid
$ui-orange
;
}
}
}
}
.help-block
{
margin-top
:
.75rem
;
}
p
{
&
.char-count
{
margin-top
:
0
;
margin-bottom
:
1rem
;
text-align
:
right
;
}
}
}
&
.last-step
,
&
.error-step
{
&
.slide
{
max-width
:
38
.75rem
;
}
.card
{
margin
:
1rem
auto
;
padding
:
1
.5rem
;
width
:
initial
;
h4
,
p
{
text-align
:
left
;
}
p
{
margin
:
0
;
}
}
}
}
@media
only
screen
and
(
max-width
:
$mobile
-
1
)
{
.registration-step
{
&
.demographics-step
{
.radio
{
width
:
100%
;
text-align
:
left
;
}
}
&
.last-step
,
&
.error-step
{
.card
{
margin
:
0
auto
;
width
:
18
.75rem
;
}
}
}
}
@media
only
screen
and
(
max-width
:
$desktop
-
1
)
{
.registration-step
{
.form
{
text-align
:
left
;
}
&
.username-step
,
&
.demographics-step
,
&
.name-step
{
.help-block
{
transform
:
none
;
}
}
&
.phone-step
{
.checkbox
,
.help-block
{
text-align
:
left
;
}
.checkbox
{
margin-bottom
:
1rem
;
}
}
&
.organization-step
{
.checkbox-group
{
text-align
:
left
;
}
}
}
}
src/components/slide/slide.scss
View file @
67ecb60f
@import
"../../frameless"
;
@import
"../../colors"
;
.slide
{
padding
:
10px
;
>
h2
,
>
.description
{
text-align
:
center
;
color
:
$type-white
;
}
>
.description
{
margin-top
:
0
;
margin-bottom
:
2rem
;
}
.card
{
margin
:
0
auto
;
}
.step-navigation
{
margin-top
:
2rem
;
text-align
:
center
;
}
}
@media
only
screen
and
(
max-width
:
$tablet
-
1
)
{
...
...
src/views/teacherregistration/teacherregistration.scss
View file @
67ecb60f
...
...
@@ -10,209 +10,4 @@ body {
.teacher-registration
{
background-color
:
$ui-purple
;
.demographics-checkbox-is-robot
{
display
:
none
;
}
.gender-input
,
.other-input
{
float
:
right
;
width
:
90%
;
.row
{
margin-left
:
.5rem
;
}
}
.username-step
,
.name-step
,
.address-step
,
.email-step
{
.help-block
{
transform
:
translate
(
15
.75rem
,
-4rem
);
}
}
.demographics-step
{
.gender-input
{
margin-top
:
-5
.5rem
;
}
.help-block
{
transform
:
translate
(
13rem
,
-2rem
);
}
.radio
{
margin-right
:
2
.5rem
;
line-height
:
3rem
;
input
{
margin-right
:
1rem
;
}
}
}
.phone-step
{
.form-group
{
margin-bottom
:
2rem
;
}
input
{
&
[
type
=
checkbox
]
{
margin-bottom
:
1
.25rem
;
}
}
.help-block
{
margin-top
:
.5rem
;
}
.checkbox-row
{
.help-block
{
margin-top
:
0
;
}
}
}
.organization-step
{
.help-block
{
transform
:
translate
(
16rem
,
-4rem
);
}
.checkbox-group
{
.help-block
{
transform
:
translate
(
16rem
,
-16rem
);
}
}
.organization-type
,
.url-input
{
p
{
margin
:
.25rem
0
;
text-align
:
left
;
color
:
$ui-dark-gray
;
}
}
input
{
&
[
value
=
"8"
]
{
margin
:
1rem
0
;
}
}
.other-input
{
margin-top
:
-5
.75rem
;
}
}
.address-step
{
.select
{
.help-block
{
transform
:
translate
(
0
,
.5rem
);
}
}
}
.usescratch-step
{
.form
{
.form-group
{
margin-bottom
:
0
;
&
.has-error
{
.textarea
{
border
:
1px
solid
$ui-orange
;
}
}
}
}
.help-block
{
margin-top
:
.75rem
;
}
p
{
&
.char-count
{
margin-top
:
0
;
margin-bottom
:
1rem
;
text-align
:
right
;
}
}
}
.last-step
,
.error-step
{
&
.slide
{
max-width
:
38
.75rem
;
}
.card
{
margin
:
1rem
auto
;
padding
:
1
.5rem
;
width
:
initial
;
h4
,
p
{
text-align
:
left
;
}
p
{
margin
:
0
;
}
}
}
}
@media
only
screen
and
(
max-width
:
$mobile
-
1
)
{
.teacher-registration
{
.demographics-step
{
.radio
{
width
:
100%
;
text-align
:
left
;
}
}
.last-step
,
.error-step
{
.card
{
margin
:
0
auto
;
width
:
18
.75rem
;
}
}
}
}
@media
only
screen
and
(
max-width
:
$desktop
-
1
)
{
.teacher-registration
{
.form
{
text-align
:
left
;
}
.username-step
,
.demographics-step
,
.name-step
{
.help-block
{
transform
:
none
;
}
}
.phone-step
{
.checkbox
,
.help-block
{
text-align
:
left
;
}
.checkbox
{
margin-bottom
:
1rem
;
}
}
.organization-step
{
.checkbox-group
{
text-align
:
left
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment