Reconciliation of PBS KIDS edition splash page

This commit is contained in:
Tim Mickel 2016-02-02 18:19:06 -05:00
parent 1da87914cc
commit 1a0801b74d
3 changed files with 66 additions and 7 deletions

View file

@ -16,14 +16,24 @@
</head> </head>
<body style="margin:0px; background: black;"> <body style="margin:0px; background: black;">
<div class="frame" id="frame"> <div class="frame" id="frame">
<div class="topbar" id="topbar">
<div class="topbar-button" id="topbar-info"></div>
<div class="topbar-button" id="topbar-moreapps">
</div>
</div>
<div class="credits hide" id="authors"></div> <div class="credits hide" id="authors"></div>
<div class="creditsText hide" id="authorsText"></div> <div class="creditsText hide" id="authorsText"></div>
<div class="rays" id="rays"></div> <div class="rays" id="rays"></div>
<div class="catface"></div> <div class="catface" id="catface"></div>
<div class="jrlogo"></div> <div class="jrlogo"></div>
<div class="purple hide" id="purpleguy"></div> <div class="purple hide" id="purpleguy"></div>
<div class="red hide" id="redguy"></div> <div class="red hide" id="redguy"></div>
<div class="blue hide" id="blueguy"></div> <div class="blue hide" id="blueguy"></div>
<div class="startButton hide" id="startButton"></div>
<div class="pbschars hide" id="pbschars"></div>
<div class="gettings hide" id="gettings"></div> <div class="gettings hide" id="gettings"></div>
<div class="startcode hide" id="startcode"></div> <div class="startcode hide" id="startcode"></div>
</div> </div>

View file

@ -39,6 +39,8 @@ window.onload = () => {
preprocessAndLoadCss('css', 'css/base.css'); preprocessAndLoadCss('css', 'css/base.css');
preprocessAndLoadCss('css', 'css/start.css'); preprocessAndLoadCss('css', 'css/start.css');
preprocessAndLoadCss('css', 'css/thumbs.css'); preprocessAndLoadCss('css', 'css/thumbs.css');
/* For parental gate. These CSS properties should be refactored */
preprocessAndLoadCss('css', 'css/editor.css');
entryFunction = () => iOS.waitForInterface(indexMain); entryFunction = () => iOS.waitForInterface(indexMain);
break; break;
case 'home': case 'home':

View file

@ -1,6 +1,8 @@
import ScratchAudio from '../utils/ScratchAudio'; import ScratchAudio from '../utils/ScratchAudio';
import {gn, getUrlVars, isAndroid, isiOS} from '../utils/lib'; import {gn, getUrlVars, isAndroid, isiOS} from '../utils/lib';
import iOS from '../iPad/iOS'; import iOS from '../iPad/iOS';
import UI from '../editor/ui/UI';
import Localization from '../utils/Localization';
export function indexMain () { export function indexMain () {
gn('gettings').ontouchend = indexGettingstarted; gn('gettings').ontouchend = indexGettingstarted;
@ -12,6 +14,19 @@ export function indexMain () {
} else { } else {
indexFirstTime(); indexFirstTime();
} }
if (window.Settings.edition == 'PBS') {
gn('topbar-moreapps').textContent = Localization.localize('PBS_MORE_APPS');
gn('startButton').textContent = Localization.localize('PBS_START');
gn('gettings').textContent = Localization.localize('PBS_HOW_TO');
gn('startButton').ontouchend = indexGohome;
gn('pbschars').ontouchend = indexGohome;
gn('topbar-moreapps').ontouchstart = indexMoreApps;
gn('topbar-info').ontouchstart = indexInfo;
}
setTimeout(function () { setTimeout(function () {
gn('rays').className = 'rays spinme'; gn('rays').className = 'rays spinme';
}, 250); }, 250);
@ -20,9 +35,16 @@ export function indexMain () {
function indexFirstTime () { function indexFirstTime () {
gn('authors').className = 'credits show'; gn('authors').className = 'credits show';
gn('authorsText').className = 'creditsText show'; gn('authorsText').className = 'creditsText show';
gn('purpleguy').className = 'purple show'; if (window.Settings.edition == 'PBS') {
gn('blueguy').className = 'blue show'; gn('pbschars').className = 'characters hide';
gn('redguy').className = 'red show'; gn('startcode').className = 'catlogo show';
gn('topbar').className = 'topbar hide';
gn('startButton').className = 'startButton hide';
} else {
gn('purpleguy').className = 'purple show';
gn('blueguy').className = 'blue show';
gn('redguy').className = 'red show';
}
iOS.askpermission(); // ask for sound recording iOS.askpermission(); // ask for sound recording
setTimeout(function () { setTimeout(function () {
iOS.hidesplash(doit); iOS.hidesplash(doit);
@ -41,9 +63,16 @@ function indexFirstTime () {
function indexLoadOptions () { function indexLoadOptions () {
gn('authors').className = 'credits hide'; gn('authors').className = 'credits hide';
gn('authorsText').className = 'creditsText hide'; gn('authorsText').className = 'creditsText hide';
gn('purpleguy').className = 'purple hide';
gn('blueguy').className = 'blue hide'; if (window.Settings.edition == 'PBS') {
gn('redguy').className = 'red hide'; gn('pbschars').className = 'characters show';
gn('topbar').className = 'topbar show';
gn('startButton').className = 'startButton show';
} else {
gn('purpleguy').className = 'purple hide';
gn('blueguy').className = 'blue hide';
gn('redguy').className = 'red hide';
}
gn('gettings').className = 'gettings show'; gn('gettings').className = 'gettings show';
gn('startcode').className = 'startcode show'; gn('startcode').className = 'startcode show';
document.ontouchmove = function (e) { document.ontouchmove = function (e) {
@ -74,3 +103,21 @@ function indexGettingstarted () {
ScratchAudio.sndFX('tap.wav'); ScratchAudio.sndFX('tap.wav');
window.location.href = 'gettingstarted.html?place=home'; window.location.href = 'gettingstarted.html?place=home';
} }
// For PBS KIDS edition only
function indexInfo () {
ScratchAudio.sndFX('tap.wav');
window.location.href = 'home.html?place=book';
}
function indexMoreApps () {
ScratchAudio.sndFX('tap.wav');
UI.parentalGate(null, function () {
if (isiOS) {
window.location.href = 'https://itunes.apple.com/us/developer/pbs-kids/id324323339?mt=8';
} else {
window.location.href = 'http://to.pbs.org/ScJr_GPlay';
}
});
}