mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2024-11-25 09:08:28 -05:00
Match the homepage comp more closely
This commit is contained in:
parent
1384bda68a
commit
48121a694f
5 changed files with 256 additions and 212 deletions
|
@ -1184,7 +1184,8 @@ footer, main header {
|
||||||
body > main > header {
|
body > main > header {
|
||||||
display: block;
|
display: block;
|
||||||
height: 3.75em;
|
height: 3.75em;
|
||||||
line-height: 3.75em; }
|
line-height: 3.75em;
|
||||||
|
position: relative; }
|
||||||
body > main > header::after {
|
body > main > header::after {
|
||||||
clear: both;
|
clear: both;
|
||||||
content: "";
|
content: "";
|
||||||
|
@ -1195,7 +1196,8 @@ body > main > article {
|
||||||
margin-top: -3.75em; }
|
margin-top: -3.75em; }
|
||||||
|
|
||||||
.scratchx-logo {
|
.scratchx-logo {
|
||||||
float: left; }
|
float: left;
|
||||||
|
margin-bottom: 0; }
|
||||||
.scratchx-logo span {
|
.scratchx-logo span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-indent: 101%;
|
text-indent: 101%;
|
||||||
|
@ -1213,9 +1215,19 @@ body > main > article {
|
||||||
margin-left: 50px; }
|
margin-left: 50px; }
|
||||||
|
|
||||||
/* Homepage */
|
/* Homepage */
|
||||||
|
body.page-home > main > header {
|
||||||
|
background-color: transparent; }
|
||||||
|
body.page-home > main > header > div {
|
||||||
|
border-bottom: 1px solid #c5c5c5; }
|
||||||
|
body.page-home > main > header a {
|
||||||
|
color: #fff; }
|
||||||
|
|
||||||
|
#home {
|
||||||
|
padding-top: 0; }
|
||||||
#home > header {
|
#home > header {
|
||||||
background: url(../images/editor.png);
|
background: url(../images/editor.png);
|
||||||
background-size: cover; }
|
background-size: cover;
|
||||||
|
padding-top: 3.75em; }
|
||||||
#home > header h1 {
|
#home > header h1 {
|
||||||
font-weight: normal; }
|
font-weight: normal; }
|
||||||
#home > header > section {
|
#home > header > section {
|
||||||
|
@ -1474,7 +1486,8 @@ body > main > article {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: block; }
|
display: block; }
|
||||||
.featured-extension > a img {
|
.featured-extension > a img {
|
||||||
display: block; }
|
display: block;
|
||||||
|
height: 107px; }
|
||||||
.featured-extension > a .tryit {
|
.featured-extension > a .tryit {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -311,6 +311,7 @@ function showPage(path, force) {
|
||||||
$(toHide).filter(":visible").hide();
|
$(toHide).filter(":visible").hide();
|
||||||
if (!showEditor && editorShown) $(document.getElementById(editorId)).css({top: "-9999px"});
|
if (!showEditor && editorShown) $(document.getElementById(editorId)).css({top: "-9999px"});
|
||||||
$("body > main, body > main > article").has($toShow).show();
|
$("body > main, body > main > article").has($toShow).show();
|
||||||
|
setBodyClass(path);
|
||||||
$toShow.show();
|
$toShow.show();
|
||||||
|
|
||||||
if (showEditor) $toShow.css({top: 0});
|
if (showEditor) $toShow.css({top: 0});
|
||||||
|
@ -320,6 +321,17 @@ function showPage(path, force) {
|
||||||
$(document).trigger("page:show", path);
|
$(document).trigger("page:show", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setBodyClass(path) {
|
||||||
|
var pageClassPrefix = "page-";
|
||||||
|
var currentPageClasses = ($("body").attr("class") || "").split(" ");
|
||||||
|
for (c in currentPageClasses) {
|
||||||
|
if (currentPageClasses[c].indexOf(pageClassPrefix) != -1) {
|
||||||
|
$("body").removeClass(currentPageClasses[c]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$("body").addClass(pageClassPrefix + path);
|
||||||
|
}
|
||||||
|
|
||||||
/* URL Shortening */
|
/* URL Shortening */
|
||||||
function shorten(url, done) {
|
function shorten(url, done) {
|
||||||
var data = {longUrl: url};
|
var data = {longUrl: url};
|
||||||
|
@ -454,6 +466,7 @@ function initPage() {
|
||||||
initialPage = window.location.hash.substr(1);
|
initialPage = window.location.hash.substr(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setBodyClass(initialPage);
|
||||||
showPage(initialPage, true);
|
showPage(initialPage, true);
|
||||||
loadFromURLParameter(window.location.search, true);
|
loadFromURLParameter(window.location.search, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,24 @@
|
||||||
/* Homepage */
|
/* Homepage */
|
||||||
|
|
||||||
|
body.page-home > main > header {
|
||||||
|
background-color: transparent;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
border-bottom: $base-border;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#home {
|
#home {
|
||||||
|
padding-top: 0;
|
||||||
|
|
||||||
> header {
|
> header {
|
||||||
background: url(../images/editor.png);
|
background: url(../images/editor.png);
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
padding-top: $vertical-base * 10;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
@ -222,6 +237,7 @@
|
||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
|
height: 107px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tryit {
|
.tryit {
|
||||||
|
|
|
@ -191,6 +191,7 @@ body > main > header {
|
||||||
@include row();
|
@include row();
|
||||||
height: $vertical-base * 10;
|
height: $vertical-base * 10;
|
||||||
line-height: $vertical-base * 10;
|
line-height: $vertical-base * 10;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
body > main > article {
|
body > main > article {
|
||||||
|
@ -200,6 +201,7 @@ body > main > article {
|
||||||
|
|
||||||
.scratchx-logo {
|
.scratchx-logo {
|
||||||
float: left;
|
float: left;
|
||||||
|
margin-bottom: 0;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
@include hide-text;
|
@include hide-text;
|
||||||
|
|
Loading…
Reference in a new issue