Merge branch 'release/hoc-nov-21' of https://github.com/LLK/scratch-www into develop

* 'release/hoc-nov-21' of https://github.com/LLK/scratch-www:
  Match tutorial ordering to ttt top row
  Turn off related videos in embed
  Move margin to flex-row element
  Add finalized video
  Add event row text
  Add temporary video for testing
  Add windows device manager url
  Add `ignoreUrls` to max-len lint rules
  switch to column in tablet
  Add hoc event row
  Update wedo2 text for new Windows deploy
  Add “open” string to l10n.json
  Add link to TTT page to educators page
  Add hoc banner
  Move padding to splash element
  trello-ize title banner h1,p styling

# Conflicts:
#	src/views/explore/explore.jsx
#	src/views/search/search.jsx
This commit is contained in:
Matthew Taylor 2016-12-02 10:55:38 -05:00
commit 6309c30667
26 changed files with 451 additions and 44 deletions

View file

@ -5,7 +5,7 @@
"eol-last": [2],
"indent": [2, 4],
"linebreak-style": [2, "unix"],
"max-len": [2, 120, 4],
"max-len": [2, 120, 4, {"ignoreUrls": true}],
"no-trailing-spaces": [2, { "skipBlankLines": true }],
"no-unused-vars": [2, {"args": "after-used", "varsIgnorePattern": "^_"}],
"quotes": [2, "single"],

View file

@ -23,7 +23,9 @@ var InformationPage = React.createClass({
<div className="information-page">
<TitleBanner className="masthead">
<div className="inner">
<h1>{this.props.title}</h1>
<h1 className="title-banner-h1">
{this.props.title}
</h1>
</div>
</TitleBanner>
<div className={classes}>

View file

@ -39,7 +39,10 @@ var TeacherBanner = React.createClass({
{this.props.messages['teacherbanner.greeting']},{' '}
{this.props.session.session.user.username}
</h3>,
<p key="subgreeting">
<p
key="subgreeting"
className="title-banner-p"
>
{this.props.messages['teacherbanner.subgreeting']}
</p>
] : []

View file

@ -7,7 +7,7 @@
&.title-banner {
transition: none;
margin-bottom: 20px;
margin-bottom: 0;
text-align: left;
h3,

View file

@ -9,21 +9,21 @@
background-size: cover;
padding: 20px 0;
width: 100%;
h1,
p {
margin: 0 auto;
padding: 5px 0;
text-align: center;
color: $type-white;
}
p {
max-width: 500px;
}
// On windows strong gets reset to font-weight 500, so make sure to override for banners
strong {
font-weight: 700;
}
}
.title-banner-h1,
.title-banner-p {
margin: 0 auto;
padding: 5px 0;
text-align: center;
color: $type-white;
}
.title-banner-p {
max-width: 500px;
}
// On windows strong gets reset to font-weight 500, so make sure to override for banners
.title-banner-strong {
font-weight: 700;
}

View file

@ -26,7 +26,7 @@ var TTTTile = React.createClass({
<div className="ttt-tile-image">
<img className="ttt-tile-image-img" src={this.props.thumbUrl} alt="" />
<div className="ttt-tile-image-try">
<div className="button mod-ttt-tile-image-try-button">
<div className="button mod-ttt-try-button">
<FormattedMessage id="ttt.tryIt" />
</div>
</div>

View file

@ -54,10 +54,10 @@
left: 50%;
transform: translate(-50%, 0);
text-align: center;
color: $ui-white;
color: $type-white;
}
.mod-ttt-tile-image-try-button {
.mod-ttt-try-button {
border: 1px solid $ui-white;
background-color: transparent;
}

View file

@ -18,8 +18,10 @@ var Developers = React.createClass({
<div className="developers">
<TitleBanner className="masthead">
<div className="inner">
<h1><FormattedMessage id='developers.title' /></h1>
<p className="intro">
<h1 className="title-banner-h1">
<FormattedMessage id='developers.title' />
</h1>
<p className="title-banner-p intro">
<FormattedHTMLMessage id='developers.intro' />
</p>
</div>

View file

@ -137,7 +137,7 @@ var Explore = injectIntl(React.createClass({
<div className='outer'>
<TitleBanner className="masthead">
<div className="inner">
<h1><FormattedMessage id='general.explore' /></h1>
<h1 className="title-banner-h1"><FormattedMessage id='general.explore' /></h1>
</div>
</TitleBanner>
<Tabs>

View file

@ -103,7 +103,7 @@ var Search = injectIntl(React.createClass({
<div className='outer'>
<TitleBanner className="masthead">
<div className="inner">
<h1><FormattedMessage id="general.search" /></h1>
<h1 className="title-banner-h1"><FormattedMessage id="general.search" /></h1>
<div className="search">
<Form onSubmit={this.onSearchSubmit}>
<Button type="submit" className="btn-search" />

View file

@ -0,0 +1,115 @@
var FormattedMessage = require('react-intl').FormattedMessage;
var injectIntl = require('react-intl').injectIntl;
var MediaQuery = require('react-responsive');
var React = require('react');
var FlexRow = require('../../../components/flex-row/flex-row.jsx');
var TitleBanner = require('../../../components/title-banner/title-banner.jsx');
var TTTModal = require('../../../components/modal/ttt/modal.jsx');
var TTTTile = require('../../../components/ttt-tile/ttt-tile.jsx');
var frameless = require('../../../lib/frameless');
var tiles = require('../../thingstotry/ttt');
require('../../../components/forms/button.scss');
require('./hoc-banner.scss');
var HocBanner = injectIntl(React.createClass({
getInitialState: function () {
return {
currentTile: tiles[1],
TTTModalOpen: false
};
},
showTTTModal: function (tile) {
return this.setState({
currentTile: tile,
TTTModalOpen: true
});
},
hideTTTModal: function () {
return this.setState({TTTModalOpen: false});
},
renderTTTTiles: function () {
var formatMessage = this.props.intl.formatMessage;
var tileObjects = {
nameTile: {
title: formatMessage({id: tiles[0].title}),
description: formatMessage({id: tiles[0].description}),
tutorialLoc: tiles[0].tutorialLoc,
activityLoc: formatMessage({id: tiles[0].activityLoc}),
guideLoc: formatMessage({id: tiles[0].guideLoc}),
thumbUrl: tiles[0].thumbUrl,
bannerUrl: tiles[0].bannerUrl
},
flyTile: {
title: formatMessage({id: tiles[1].title}),
description: formatMessage({id: tiles[1].description}),
tutorialLoc: tiles[1].tutorialLoc,
activityLoc: formatMessage({id: tiles[1].activityLoc}),
guideLoc: formatMessage({id: tiles[1].guideLoc}),
thumbUrl: tiles[1].thumbUrl,
bannerUrl: tiles[1].bannerUrl
},
musicTile: {
title: formatMessage({id: tiles[2].title}),
description: formatMessage({id: tiles[2].description}),
tutorialLoc: tiles[2].tutorialLoc,
activityLoc: formatMessage({id: tiles[2].activityLoc}),
guideLoc: formatMessage({id: tiles[2].guideLoc}),
thumbUrl: tiles[2].thumbUrl,
bannerUrl: tiles[2].bannerUrl
}
};
return [
<TTTTile
key={0}
className="mod-banner"
onGuideClick={this.showTTTModal.bind(this, tileObjects.nameTile)}
{...tileObjects.nameTile}
/>,
<TTTTile
key={1}
className="mod-banner"
onGuideClick={this.showTTTModal.bind(this, tileObjects.flyTile)}
{...tileObjects.flyTile}
/>,
<TTTTile
key={2}
className="mod-banner"
onGuideClick={this.showTTTModal.bind(this, tileObjects.musicTile)}
{...tileObjects.musicTile}
/>
];
},
render: function () {
return (
<TitleBanner className="mod-splash-hoc">
<div className="hoc-banner inner">
<FlexRow className="mod-hoc-banner-header">
<h1 className="hoc-banner-header-h1">
<FormattedMessage id="hoc-banner.header" />
</h1>
<a href="/go" className="button mod-ttt-try-button">
<FormattedMessage id="hoc-banner.ttt" />
</a>
</FlexRow>
<MediaQuery minWidth={frameless.desktop}>
<FlexRow className="mod-hoc-banner-tiles">
{this.renderTTTTiles()}
</FlexRow>
<TTTModal
isOpen={this.state.TTTModalOpen}
onRequestClose={this.hideTTTModal}
{...this.state.currentTile}
/>
</MediaQuery>
</div>
</TitleBanner>
);
}
}));
module.exports = HocBanner;

View file

@ -0,0 +1,48 @@
@import "../../../colors";
@import "../../../frameless";
.title-banner.mod-splash-hoc {
background: url("/images/blocks-pattern.png");
background-color: $ui-blue;
background-repeat: repeat;
background-size: 180px 180px;
}
.flex-row.mod-hoc-banner-header,
.flex-row.mod-hoc-banner-tiles {
justify-content: space-between;
}
.flex-row.mod-hoc-banner-header {
margin-bottom: 1.25rem;
}
.hoc-banner-header-h1 {
color: $type-white;
}
.button.mod-ttt-try-button {
padding: .75rem 2rem;
}
.button.mod-ttt-try-button,
.button.mod-ttt-try-button:hover {
box-shadow: none;
}
.button.mod-ttt-try-button:link,
.button.mod-ttt-try-button:visited,
.button.mod-ttt-try-button:active
.button.mod-ttt-try-button:hover {
color: $type-white;
}
.ttt-tile.mod-banner {
background-color: $background-color;
}
@media only screen and (min-width: $tablet) and (max-width: $desktop - 1) {
.flex-row.mod-hoc-banner-header {
flex-direction: column;
}
}

View file

@ -0,0 +1,54 @@
var FormattedMessage = require('react-intl').FormattedMessage;
var React = require('react');
var Button = require('../../../components/forms/button.jsx');
var FlexRow = require('../../../components/flex-row/flex-row.jsx');
require('./hoc-event-row.scss');
var HocEventRow = React.createClass({
type: 'HocEventRow',
propTypes: {
onDismiss: React.PropTypes.func
},
render: function () {
return (
<div className="hoc-event">
<Button
className="mod-hoc-event-dismiss"
onClick={this.props.onDismiss}
>
<FormattedMessage id="hocevent.dismiss" />
<img
className="hoc-event-dismiss-icon"
src="/svgs/modal/close-x.svg"
alt="close-icon"
/>
</Button>
<FlexRow className="mod-hoc-event">
<div className="hoc-event-studio">
<h1 className="hoc-event-studio-h1">
<FormattedMessage id="hocevent.title" />
</h1>
<a href="/studios/3600717/" className="button white mod-hoc-event">
<FormattedMessage id="hocevent.studioLink" />
</a>
</div>
<div className="hoc-event-video">
<iframe
className="hoc-event-video-iframe"
title="Design a Character Studio"
src="https://www.youtube-nocookie.com/embed/_srMcH7oB3Y?rel=0"
frameborder="0"
webkitAllowFullScreen
mozallowfullscreen
allowFullScreen
/>
</div>
</FlexRow>
</div>
);
}
});
module.exports = HocEventRow;

View file

@ -0,0 +1,127 @@
@import "../../../colors";
@import "../../../frameless";
.hoc-event {
position: relative;
opacity: .9;
margin: 0 auto 20px;
border-radius: 1rem;
background-color: $ui-blue;
width: $cols12;
}
.hoc-event:after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: .5;
z-index: -1;
border-radius: 1rem;
background: url("/images/splash/hoc-event-bg.jpg");
background-size: cover;
content: "";
}
.flex-row.mod-hoc-event {
padding: 3rem 5rem;
}
.button.mod-hoc-event-dismiss {
position: absolute;
top: .5rem;
right: .5rem;
margin: 0;
border: 1px solid $type-white;
border-radius: 2rem;
box-shadow: none;
background-color: transparent;
padding: .25rem .75rem;
color: $type-white;
font-weight: 300;
}
.hoc-event-dismiss-icon {
margin-left: .25rem;
width: .8rem;
vertical-align: middle;
}
.hoc-event-studio-h1 {
margin-bottom: 1.5rem;
line-height: 2.5rem;
color: $type-white;
}
.button.mod-hoc-event {
padding: .75rem 1.75rem;
}
.hoc-event-studio,
.hoc-event-video-iframe {
width: 23.75rem;
}
.hoc-event-video-iframe {
border: 3px solid $ui-border;
border-radius: 5px;
height: 13.75rem;
}
@media only screen and (max-width: $mobile - 1) {
.hoc-event {
width: $cols4;
}
.flex-row.mod-hoc-event {
padding: 3rem 2rem 2rem;
}
.hoc-event-studio,
.hoc-event-video-iframe {
width: 13.75rem;
}
.hoc-event-studio {
margin-bottom: 1rem;
}
.hoc-event-video-iframe {
height: 8.75rem;
}
}
@media only screen and (min-width: $mobile) and (max-width: $tablet - 1) {
.hoc-event {
width: $cols6;
}
.flex-row.mod-hoc-event {
padding: 2.5rem 2.5rem 1.5rem;
}
.hoc-event-studio {
margin-bottom: 1rem;
}
}
@media only screen and (min-width: $tablet) and (max-width: $desktop - 1) {
.hoc-event {
width: $cols8;
}
.flex-row.mod-hoc-event {
padding: 1.875rem;
}
.hoc-event-studio {
width: 14.625rem;
text-align: left;
}
.hoc-event-video-iframe {
width: 18.375rem;
height: 10rem;
}
}

View file

@ -0,0 +1,8 @@
{
"ttt.MakeItFlyActivityLoc": "/pdfs/cards/FlyCards.pdf",
"ttt.MakeItFlyGuideLoc": "/pdfs/guides/FlyGuide.pdf",
"ttt.AnimateYourNameActivityLoc": "/pdfs/cards/AnimateYourNameCards.pdf",
"ttt.AnimateYourNameGuideLoc": "/pdfs/guides/NameGuide.pdf",
"ttt.MakeMusicActivityLoc": "/pdfs/cards/MusicCards.pdf",
"ttt.MakeMusicGuideLoc": "/pdfs/guides/MusicGuide.pdf"
}

View file

@ -28,6 +28,27 @@
"teacherbanner.classesButton": "My Classes",
"teacherbanner.faqButton": "Teacher Account FAQ",
"hoc-banner.header": "Get Creative with Coding",
"hoc-banner.ttt": "See things to try",
"ttt.tutorialTitle": "Tutorial",
"ttt.tutorialSubtitle": "Find out how to make this project using a step-by-step tutorial in Scratch.",
"ttt.activityTitle": "Activity Cards",
"ttt.activitySubtitle": "Explore new coding ideas using this set of illustrated cards you can print out.",
"ttt.educatorTitle": "Educator Guide",
"ttt.educatorSubtitle": "Use this educator guide to plan and lead a one-hour Scratch workshop.",
"ttt.tryIt": "Try It",
"ttt.open": "Open",
"ttt.download": "Download",
"ttt.MakeItFlyTitle": "Make It Fly",
"ttt.MakeItFlyDescription": "Animate the Scratch Cat, The Powerpuff Girls, or even a taco!",
"ttt.AnimateYourNameTitle": "Animate Your Name",
"ttt.AnimateYourNameDescription": "Animate the letters of your name, initials, or favorite word.",
"ttt.MakeMusicTitle": "Make Music",
"ttt.MakeMusicDescription": "Choose instruments, add sounds, and press keys to play music.",
"hocevent.dismiss": "Dismiss",
"hocevent.title": "Design and share your own character",
"hocevent.studioLink": "See the studio",
"welcome.welcomeToScratch": "Welcome to Scratch!",
"welcome.learn": "Learn how to make a project in Scratch",
"welcome.tryOut": "Try out starter projects",

View file

@ -14,6 +14,8 @@ var DropdownBanner = require('../../components/dropdown-banner/banner.jsx');
var Box = require('../../components/box/box.jsx');
var Button = require('../../components/forms/button.jsx');
var Carousel = require('../../components/carousel/carousel.jsx');
var HocBanner = require('./hoc-banner/hoc-banner.jsx');
var HocEventRow = require('./hoc-event-row/hoc-event-row.jsx');
var Intro = require('../../components/intro/intro.jsx');
var IframeModal = require('../../components/modal/iframe/modal.jsx');
var News = require('../../components/news/news.jsx');
@ -207,6 +209,14 @@ var Splash = injectIntl(React.createClass({
</Box>
];
if (this.props.session.session.user && this.props.session.session.flags.show_hoc_studio) {
rows.push(
<HocEventRow
onDismiss={this.handleDismiss.bind(this, 'show_hoc_studio')}
/>
);
}
if (this.state.featuredGlobal.curator_top_projects &&
this.state.featuredGlobal.curator_top_projects.length > 4) {
@ -366,7 +376,8 @@ var Splash = injectIntl(React.createClass({
{this.props.permissions.educator ? [
<TeacherBanner key="teacherbanner" messages={messages} />
] : []}
<div key="inner" className="inner">
<HocBanner />
<div key="inner" className="inner mod-splash">
{this.props.session.status === sessionActions.Status.FETCHED ? (
this.props.session.session.user ? [
<div key="header" className="splash-header">

View file

@ -1,5 +1,13 @@
@import "../../frameless";
#view {
padding: 0;
}
.inner.mod-splash {
margin-top: 20px;
}
.splash {
.splash-header {
display: flex;
@ -33,10 +41,6 @@
}
}
.teacher-banner {
margin-top: -20px;
}
.box {
margin-bottom: 20px;
}

View file

@ -13,8 +13,8 @@
"teacherlanding.meetupTitle": "In-Person Gatherings",
"teacherlanding.meetupDescription": "<a href=\"http://www.meetup.com/pro/scratched/\">Scratch Educator Meetups</a> are gatherings of Scratch Educators who want to learn with and from each other, sharing their ideas and strategies for supporting computational creativity in all its forms.",
"teacherlanding.guidesTitle": "Guides & Tutorials",
"teacherlanding.helpPage": "On the <a href=\"/help\">Help Page</a>, you can find workshop guides, Scratch Cards, videos, and other resources.",
"teacherlanding.tipsWindow" : "The <a href=\"/projects/editor/?tip_bar=home\">Tips Window</a> features step-by-step tutorials for getting started in Scratch.",
"teacherlanding.tttPage": "The <a href=\"/go\">Things to Try page</a> offers a variety of tutorials, activity cards, and educator guides.",
"teacherlanding.tipsWindow" : "The <a href=\"/projects/editor/?tip_bar=home\">Tips Window</a> provides help for creating projects in Scratch.",
"teacherlanding.creativeComputing": "The <a href=\"http://scratched.gse.harvard.edu/guide/\">Creative Computing Curriculum Guide</a> provides plans, activities, and strategies for introducing creative computing.",
"teacherlanding.accountsTitle": "Teacher Accounts in Scratch",
"teacherlanding.accountsDescription": "As an educator, you can request a Scratch Teacher Account, which makes it easier to create accounts for groups of students and to manage your students projects and comments. To learn more, see the <a href=\"/educators/faq\">Teacher Account FAQ page</a>.",

View file

@ -19,9 +19,11 @@ var Landing = injectIntl(React.createClass({
<div className="educators">
<TitleBanner className="masthead">
<div className="inner">
<h1><FormattedMessage id="teacherlanding.title" /></h1>
<h1 className="title-banner-h1">
<FormattedMessage id="teacherlanding.title" />
</h1>
<FlexRow className="masthead-info">
<p className="intro">
<p className="title-banner-p intro">
<FormattedMessage id="teacherlanding.intro" />
</p>
<div className="ted-talk">
@ -82,11 +84,11 @@ var Landing = injectIntl(React.createClass({
<h3 id="guides-header"><FormattedMessage id="teacherlanding.guidesTitle" /></h3>
<FlexRow className="guides-and-tutorials">
<div>
<a href="/help">
<a href="/go">
<img src="/svgs/teachers/resources.svg" alt="resources icon" />
</a>
<p>
<FormattedHTMLMessage id="teacherlanding.helpPage" />
<FormattedHTMLMessage id="teacherlanding.tttPage" />
</p>
</div>
<div>

View file

@ -1,7 +1,7 @@
{
"ttt.placeholder": "Placeholder text",
"ttt.title": "Things to Try",
"ttt.subTitle": "You can get started with Scratch in a variety of ways. Click a picture to try the <strong>Tutorial</strong>. You can also download a set of <strong>Activity Cards</strong> and <strong>Educator Guide</strong> for each theme.",
"ttt.subTitle": "You can get started with Scratch in a variety of ways. Click a picture to try the <strong className=\"title-banner-strong\">Tutorial</strong>. You can also download a set of <strong className=\"title-banner-strong\">Activity Cards</strong> and <strong className=\"title-banner-strong\">Educator Guide</strong> for each theme.",
"tile.tutorial": "Tutorial",
"tile.guides": "See Cards and Guides",
"ttt.tutorialTitle": "Tutorial",

View file

@ -61,10 +61,10 @@ var ThingsToTry = injectIntl(React.createClass({
<section className="ttt-section">
<img className="ttt-banner-image" src="/svgs/ttt/resources.svg" alt=""/>
</section>
<h1>
<h1 className="title-banner-h1">
<FormattedMessage id="ttt.title" />
</h1>
<p className="intro">
<p className="intro title-banner-p">
<FormattedHTMLMessage id="ttt.subTitle" />
</p>
</TitleBanner>

View file

@ -1,9 +1,11 @@
{
"wedo2.intro": "The LEGO® Education WeDo 2.0 is an introductory invention kit you can use to build your own interactive machines. You can snap together Scratch programming blocks to interact with your LEGO WeDo creations and add animations on the screen.",
"wedo2.requirement": "The LEGO WeDo 2.0 extension is currently only available for Mac OSX. We plan to release a Windows version later in 2016.",
"wedo2.requirement": "The LEGO WeDo 2.0 extension is available for Mac OSX and Windows 10+.",
"wedo2.getStarted": "Getting Started with LEGO WeDo 2.0",
"wedo2.installTitle": "1. Install Device Manager",
"wedo2.installText": "The Device Manager lets you connect WeDo 2.0 to Scratch using Bluetooth <a href=\"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1084869222&mt=12\">Download Here</a>",
"wedo2.installText": "The Device Manager lets you connect WeDo 2.0 to Scratch using Bluetooth",
"wedo2.downloadMac": "Download for Mac OSX",
"wedo2.downloadWin": "Download for Windows 10+",
"wedo2.setupTitle": "2. Setup & Help",
"wedo2.setupText": "Connect your WeDo 2.0 by following the steps in the <a href=\"/projects/editor/?tip_bar=ext2\">Tips Window</a>",
"wedo2.createTitle": "3. Create",

View file

@ -44,6 +44,14 @@ var Wedo2 = React.createClass({
</h4>
<p>
<FormattedHTMLMessage id='wedo2.installText' />
<br />
<a href="https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1084869222&mt=12">
<FormattedMessage id='wedo2.downloadMac' />
</a>
<br />
<a href="https://downloads.scratch.mit.edu/device-manager/ScratchDeviceManager-1.1.0.exe">
<FormattedMessage id='wedo2.downloadWin' />
</a>
</p>
</div>
<div className="column">

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB