<% var hash = window.location.hash; var queryStr = hash.split('?')[1] || ''; var queryParams = queryStr.split('&'); var activeTab = 'home'; for (var param of queryParams) { if (param.includes('tab')) { activeTab = param.split('tab=')[1]; } } var vaultHeader = { home: 'Welcome to the Bitsbox Vault!', videos: '', surveys: '', challenges: '' }; var vaultHomeOptions = [ { classes: '', iconClasses: 'fas fa-play-circle', label: 'Watch Videos', href: '#vault?tab=videos' }, { classes: '', iconClasses: 'fas fa-comment-alt-lines', label: 'Take Surveys', href: '#vault?tab=surveys' }, { classes: '', iconClasses: 'fas fa-swords', label: 'Coding Challenges', href: '#vault?tab=challenges' }, { classes: 'coming-soon', iconClasses: 'fas fa-certificate', label: 'Achievement Badges' }, { classes: 'coming-soon', iconClasses: 'fas fa-lightbulb-on', label: 'Tips & Tricks' } ]; %> <% if (vaultHeader[activeTab].length) { %>
<%-vaultHeader[activeTab]-%>
<% } %>
<% if (activeTab === 'home') { for (var i = 0; i < vaultHomeOptions.length; i++) { var option = vaultHomeOptions[i]; %> <%-option.label-%> <% } } else if (activeTab === 'videos') { %> <% var videoWidth = 640; var videoHeight = 360; var hash = window.location.hash; var videoId = hash.split('videoId=')[1] || false; var jQueryLoaded = window.jQuery; %>
<% if (!videoId) { %> <% } else { %> <% if (jQueryLoaded) { %>
Watch the video while you code!
<% } %> <% } %>
<% } else if (activeTab === 'surveys') { %> <% var surveyId = '002'; var singlePageSurvey = true; var pageContent = [ { header: 'What kinds of stamps should we add to our library?', options: [ { name: 'Animals', icon: 'fas fa-paw' }, { name: 'Sports', icon: 'fas fa-basketball-ball' }, { name: 'People', icon: 'fas fa-walking' }, { name: 'Space', icon: 'fas fa-rocket-launch' }, { name: 'Vehicles', icon: 'fas fa-car' }, { name: 'Symbols', icon: 'fas fa-icons' }, { name: 'Food', icon: 'fas fa-burger-soda' }, { name: 'I have a better idea', class: 'custom' } ], optionsClass: 'single-survey-option', question: 'kinds-of-stamps', optionsOnClick: 'c123.selectSingleAnswerSurveyOption(this)' }, { header: 'Thanks for taking our survey!', subheader: 'Check back soon for more :)' } ]; var userPrefs = $_page.userPreferences_; var surveys = userPrefs.survey; var vaultSurveyTaken = false; if (surveys) { vaultSurveyTaken = surveys[surveyId] || false; } var hash = window.location.hash; var surveyIndex = hash.split('page=')[1] - 1 || 0; var lastPageIndex = 1; if (vaultSurveyTaken) { surveyIndex = lastPageIndex; } var currentPage = pageContent[surveyIndex]; var lastPage = surveyIndex === lastPageIndex; %>
<%- currentPage.header %>
<% if (currentPage.subheader) { %>
<%- currentPage.subheader %>
<% } %>
<% if (currentPage.options) { for (var i = 0; i < currentPage.options.length; i++) { %>

<%-currentPage.options[i].name%>

<% } } %>
<% if (!lastPage) { %>
<% if (!singlePageSurvey) { %> <% } %> <% if (surveyIndex == lastPageIndex - 1) { %> <% } else { %> <% } %>
<% } %> <% } else if (activeTab === 'challenges') { %> <% var hash = window.location.hash; var activePage = hash.split('page=')[1] || 'main'; %> <% if (activePage === 'main') { %>
Bitsbox's Coding Challenge is…
Create a Custom App!
Anything goes! Time to code your dream app! Build a flying taco game, a talking cat quiz, or an alien dance party. Whatever you imagine, Bitsbox can help bring it to life. Show us your creativity for a chance to be showcased!
  1. Code your app in Bitsbox.
  2. Feel free to use your own custom stamps!
  3. Share your app when it's done!

We feature some of the apps that kids share with us in the Challenge App Showcase. Showcase apps appear at the bottom of this tab for a few weeks.

Read this article about the Challenge App Showcase if you'd like to know more : )

Challenge App
SHOWCASE
<% } else if (activePage === 'shareapp') { %> Share this app with the Bitsbox team:
by

We'll use this name to label your app.

We'll use this name to label your app.

We'll use this email address to contact you.

We'll use this email address to contact you. Heads up! We might put your app on the Challenge App Showcase after you send it to us : )
<% } else if (activePage === 'thankyou') { %>
Thanks for sharing your app!
Watch for an email from us in the next few days : )
<% } %> <% } %>