Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

(WIP) Fixes #856 new homepage #943

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
96cda43
(WIP) new homepage. missing blog section
mmmavis May 22, 2015
a9c909a
added blog section with hardcoded content
mmmavis May 25, 2015
271e8fa
hooked up with google feed api, removed hardcoded data
mmmavis May 26, 2015
9c4ce6e
small code cleanup and tweaks
mmmavis May 26, 2015
280c772
Added moment.js & updated Twitter link
mmmavis May 27, 2015
bf01bcb
ui tweaks
mmmavis May 27, 2015
08a6199
blog post excerpt, hero unit buttons
mmmavis May 27, 2015
ba352d3
fixed error thrown by tests
mmmavis May 27, 2015
b8988aa
forgot to include a module in package.json
mmmavis May 27, 2015
c55112e
code cleanup & update CHANAGE LOG
mmmavis May 27, 2015
809171e
an attempt at refactoring blog feed loader code into a separate modul…
mmmavis May 27, 2015
5152a87
Add stub-blog-feed-loader.js and use it for now.
toolness May 27, 2015
86fb847
remove 'Data' suffix from state keys too.
toolness May 27, 2015
7f591c6
Merge pull request #3 from toolness/decouple-new-homepage-from-googs
mmmavis May 27, 2015
26068a0
some code cleanup & wrapped sections in <main> with <section> tags
mmmavis May 28, 2015
57b7799
undo some css rules
mmmavis May 28, 2015
ea31f73
Revert "undo some css rules" - this fix doesn't work on larger screen…
mmmavis May 28, 2015
991d62d
fixed moment date parsing warning
mmmavis May 28, 2015
5f450ff
styling tweaks - long button text should be wrapped
mmmavis May 28, 2015
fb796d3
styling tweaks
mmmavis May 28, 2015
95c4622
undo early css changes made to make the full width coloured section w…
mmmavis May 28, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ to [Semantic Versioning](http://semver.org/).
new releases of the site.
- The dev version modal now links to the latest release
of the site if the current git revision is unavailable.
- New homepage design
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this is something I'm kind of a curmudgeon about--please use complete sentences in the changelog 😁

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the new homepage design is a BIG DEAL so you should put it at the very top of the list 💃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


### Removed
- `gulp-html-prettify` is no longer listed as a dependency
Expand All @@ -42,15 +43,15 @@ to [Semantic Versioning](http://semver.org/).
- Added environment variables `MAILINGLIST_URL`
and `MAILINGLIST_PRIVACY_NAME`.
- The site now generates `index.html` files for redirects. This
was done so that `/clubs/curriculum/` redirects to
was done so that `/clubs/curriculum/` redirects to
`/activities/web-lit-basics/`.
- `lib/changelog.js` can be used as a node script to help
update `CHANGELOG.md`.
- Aspects of the structure and accuracy of this
changelog are now verified by the automated test suite.

### Changed
- The Clubs Curriculum page has been renamed to
- The Clubs Curriculum page has been renamed to
Web Literacy Basics, and is now available at
`/activities/web-lit-basics/`. It's no longer accessible
through the sidebar, but is instead listed as the
Expand All @@ -64,7 +65,7 @@ to [Semantic Versioning](http://semver.org/).
collapsed area becomes focused, improving navigation for
sighted users who can only use the keyboard for navigation.
- Signing up for the Maker Party mailing list now shows
a "Thank you" modal when the user is returned to the
a "Thank you" modal when the user is returned to the
site from BSD.
- Moved all documentation about manual testing to
`CONTRIBUTING.md`.
Expand Down
5 changes: 2 additions & 3 deletions components/blockquote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var Blockquote = React.createClass({
className: React.PropTypes.string,
imgSrc: React.PropTypes.string.isRequired,
imgSrc2x: React.PropTypes.string,
imgAlt: React.PropTypes.string.isRequired,
imgWidth: React.PropTypes.number,
imgHeight: React.PropTypes.number,
children: React.PropTypes.object.isRequired,
Expand All @@ -15,12 +14,12 @@ var Blockquote = React.createClass({
render: function() {
return (
<blockquote className={this.props.className}>
{this.props.children}
<figure>
<ImageTag src1x={this.props.imgSrc} src2x={this.props.imgSrc2x}
alt={this.props.imgAlt}
alt=""
width={this.props.imgWidth || 148} height={this.props.imgHeight || 148} />
</figure>
{this.props.children}
<small>{this.props.author}</small>
</blockquote>
);
Expand Down
10 changes: 7 additions & 3 deletions components/hero-unit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ var HeroUnit = React.createClass({
}

return (
<div className="row">
<div className="row hero-unit-row">
<div className="col-md-12 hero-unit" style={{
backgroundImage: 'url(' + this.state.image + ')'
}}>
{marquee}
{this.props.children}
<div>
<div className="inner-container">
{marquee}
{this.props.children}
</div>
</div>
</div>
</div>
);
Expand Down
51 changes: 51 additions & 0 deletions components/icon-button.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
var React = require('react');
var Router = require('react-router');
var Link = Router.Link;
var ImageTag = require('./imagetag.jsx');

var LinkSwap = React.createClass({
render: function() {
var classes = "btn btn-awsm";
// Swap out Link or a simple anchor depending on the props we have.
if (this.props.linkTo) {
return (
<Link to={this.props.linkTo} className={classes}>
{this.props.children}
</Link>
)
}
return (
<a href={this.props.href} className={classes}>
{this.props.children}
</a>
)
}
});

var IconButton = React.createClass({
propTypes: {
linkTo: React.PropTypes.string,
href: React.PropTypes.string,
imgSrc: React.PropTypes.string.isRequired,
imgSrc2X: React.PropTypes.string,
head: React.PropTypes.string.isRequired,
subhead: React.PropTypes.string
},
render: function() {
return (
<div className="icon-button">
<LinkSwap linkTo={this.props.linkTo} href={this.props.href}>
<figure>
<ImageTag className="image" src1x={this.props.imgSrc} src2x={this.props.imgSrc2x}
alt="" height={50} />
<figcaption>
<p className="link-text">{this.props.head}</p>
</figcaption>
</figure>
</LinkSwap>
</div>
);
}
});

module.exports = IconButton;
21 changes: 21 additions & 0 deletions components/icon-buttons.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var React = require('react');

var IconButtons = React.createClass({
render: function() {
var links = Array.isArray(this.props.children) ? this.props.children : [this.props.children];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than creating this and mapping over it, maybe use React.Children.map()?

var classes;
return (
<div className="row icon-buttons">
{
links.map(function(link, i){
return(
<div className="col-sm-4 col-md-4 col-lg-4" key={i}>{link}</div>
)
})
}
</div>
);
}
});

module.exports = IconButtons;
Binary file modified img/pages/home/hero-unit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/pages/home/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions img/pages/home/svg/icon-hostanevent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions img/pages/home/svg/icon-startamozillaclub.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions img/pages/home/svg/icon-teachanactivity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/pages/home/values.jpg
Binary file not shown.
14 changes: 14 additions & 0 deletions less/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ a.bold-link {
white-space: pre;
}

a.more {
font-weight: 600;
&:after {
content: "\f30f";
font-family: "Ionicons";
margin: 0 .5rem;
}
}

.teach-tabzilla#tabzilla {
display: none;
@media screen and (min-width: @screen-md-min) {
Expand Down Expand Up @@ -113,6 +122,11 @@ html.no-js .no-js-warning {
border-top: 0.2rem solid @white;
}

#content {
padding-left: 0;
padding-right: 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, unfortunately this seems to break other pages. For instance, in /about/, the heading "About Mozilla Learning Networks" bleeds all the way to the very edge of the screen on mobile, whereas there's normally 15px of padding being applied from bootstrap's .col-* rules. 😢

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arghhh, if #content does have left/right padding we won't be able to have a full width section with background colour (e.g., the quote section on the new homepage). I probably have to go through all the pages and make sure things are being wrapped within extra inner containers... 😭

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, can you set negative margin to offset the padding? I actually did that with the hero unit for the original site, way back in February: https://github.com/mozilla/teach.webmaker.org/blob/8804e410ce96df5d2983fe829b6a81c335e94d74/styles.less#L23-L26

I'm not sure if that CSS has actually survived to present-day or not, hehe.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, I tried the following on that full width coloured section

margin-left: -(@grid-gutter-width / 2);
padding-left: (@grid-gutter-width / 2);

This leaves a gap to the right due to the negative offset on the left.

Adding margin-right: -(@grid-gutter-width / 2); simply just makes the section wider but the gap is still there, which introduces a horizontal scrollbar to the page.

Also, this approach won't work on larger screen either as we can't specify how much offset we want to move. (see https://github.com/mmmavis/teach.webmaker.org/blob/develop/less/components/page.less#L21-L23)

😭


.video-container {
position: relative;
width: 100%;
Expand Down
4 changes: 4 additions & 0 deletions less/components/blockquote.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ blockquote {
font-size: 3rem;
font-style: italic;
text-align: center;
margin-bottom: 0;
img {
display: block;
margin: 0 auto 1rem;
Expand All @@ -14,4 +15,7 @@ blockquote {
font-weight: 300;
margin-top: 1rem;
}
p {
font-size: 2.5rem;
}
}
7 changes: 6 additions & 1 deletion less/components/hero-unit.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.hero-unit-row {
margin-left: 0;
margin-right: 0;
}

.hero-unit {
background-position: right top;
background-repeat: no-repeat;
Expand All @@ -6,7 +11,7 @@
color: white;
display: flex;
flex-direction: column;
height: 45rem;
min-height: 45rem;
justify-content: center;
text-align: center;
@media (min-width: @screen-md-min) {
Expand Down
21 changes: 21 additions & 0 deletions less/components/icon-button.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.icon-button {
a.btn.btn-awsm {
width: 100%;
color: @blueSidebarColor;
background-color: @paleBlue;
box-shadow: 0px 0.4rem 0px @blueSidebarColor,
0px 0.1rem 0px rgba(255, 255, 255, 0.5) inset;
&:hover {
color: @bodyTextColor;
background-color: @awsmBtnColor;
top: 0;
box-shadow: 0px 0.4rem 0px #C4A74F,
0px 0.1rem 0px rgba(255, 255, 255, 0.5) inset;
}
}
.link-text {
font-size: 1.5rem;
font-weight: 700;
margin: 1rem 0 0 0;
}
}
7 changes: 7 additions & 0 deletions less/components/icon-buttons.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.icon-buttons {
margin-top: 5rem;
margin-bottom: 2rem;
@media screen and (min-width: @screen-md-min) {
margin-top: 12rem;
}
}
2 changes: 2 additions & 0 deletions less/components/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@import "expander";
@import "footer";
@import "hero-unit";
@import "icon-buttons";
@import "icon-button";
@import "icon-link";
@import "icon-links";
@import "illustration";
Expand Down
1 change: 1 addition & 0 deletions less/components/page.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ a.skip-to-content:focus {
@media screen and (min-width: @screen-md-min) {
margin: 0px 0px 0px 2.5rem;
max-width: 1200px;
padding: 0 (@grid-gutter-width / 2);
}
@media screen and (min-width: 1800px) {
margin: 0 auto;
Expand Down
Loading