Skip to content

Instantly share code, notes, and snippets.

@iiLaurens
Created December 11, 2014 21:28
Show Gist options
  • Save iiLaurens/8ac69de5f6b6a5f21fb9 to your computer and use it in GitHub Desktop.
Save iiLaurens/8ac69de5f6b6a5f21fb9 to your computer and use it in GitHub Desktop.
designer
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-quizzes.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
}
#core_card {
width: 300px;
height: 300px;
padding: 16px;
border-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 4px, rgba(0, 0, 0, 0.0980392) 0px 0px 3px;
background-color: rgb(255, 255, 255);
}
#core_selector1 > * {
margin: 4px;
border-radius: 50%;
overflow: hidden;
}
#core_selector1 > .core-selected {
border: 3px solid blue;
}
#core_icon {
height: 64px;
width: 64px;
}
#core_icon1 {
height: 64px;
width: 64px;
}
#core_icon2 {
height: 64px;
width: 64px;
}
#core_animated_pages {
width: 100%;
height: 100%;
overflow: hidden;
left: 0px;
top: 0px;
position: absolute;
background-color: rgb(238, 238, 238);
}
#section4 {
box-sizing: border-box;
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
}
#div {
box-sizing: border-box;
height: 30%;
position: relative;
color: rgb(255, 255, 255);
padding: 48px;
font-size: 48px;
background-color: rgb(0, 187, 211);
}
#div1 {
padding-left: 3px;
height: 70%;
}
#div2 {
box-sizing: border-box;
float: left;
height: 30%;
width: 48%;
margin: 3px;
background-color: rgb(204, 204, 204);
}
#div3 {
padding: 8px;
color: rgb(255, 255, 255);
background-color: rgb(170, 170, 170);
}
#div4 {
box-sizing: border-box;
float: left;
height: 30%;
width: 48%;
margin: 3px;
background-color: rgb(255, 255, 141);
}
#div5 {
padding: 8px;
color: rgb(255, 255, 255);
background-color: rgb(255, 235, 59);
}
#div6 {
box-sizing: border-box;
float: left;
height: 30%;
width: 48%;
margin: 3px;
background-color: rgb(185, 246, 202);
}
#div7 {
padding: 8px;
color: rgb(255, 255, 255);
background-color: rgb(15, 157, 88);
}
#div8 {
box-sizing: border-box;
float: left;
height: 30%;
width: 48%;
margin: 3px;
background-color: rgb(255, 138, 128);
}
#div9 {
padding: 8px;
color: rgb(255, 255, 255);
background-color: rgb(219, 68, 55);
}
#div10 {
box-sizing: border-box;
float: left;
height: 30%;
width: 48%;
margin: 3px;
background-color: rgb(130, 177, 255);
}
#div11 {
padding: 8px;
color: rgb(255, 255, 255);
background-color: rgb(66, 133, 244);
}
#div12 {
box-sizing: border-box;
float: left;
height: 30%;
width: 48%;
margin: 3px;
background-color: rgb(179, 136, 255);
}
#div13 {
padding: 8px;
color: rgb(255, 255, 255);
background-color: rgb(126, 87, 194);
}
#core_icon3 {
height: 128px;
width: 128px;
}
#core_icon4 {
height: 128px;
width: 128px;
}
#core_icon5 {
height: 128px;
width: 128px;
}
#core_icon6 {
height: 128px;
width: 128px;
}
#core_icon7 {
height: 128px;
width: 128px;
}
#core_icon8 {
height: 128px;
width: 128px;
}
#topeka_quizzes {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
}
</style>
<core-animated-pages transitions="slide-up slide-down tile-cascade" selected="1" lastselected="0" selectedindex="1" notap id="core_animated_pages">
<section id="section1" layout horizontal center center-justified>
<core-card id="core_card" vertical layout slide-up>
<paper-input label="First Name" id="paper_input"></paper-input>
<paper-input label="Last Name" id="paper_input1" error="Only input letters!" validate="^[a-zA-Z]*$"></paper-input>
<core-selector selected="0" selectedindex="0" id="core_selector1" one flex>
<core-icon icon="avatars:avatar-1" id="core_icon" size="0" designmeta="topeka-avatar" active></core-icon>
<core-icon icon="avatars:avatar-2" id="core_icon1" size="0" designmeta="topeka-avatar"></core-icon>
<core-icon icon="avatars:avatar-3" id="core_icon2" size="0" designmeta="topeka-avatar"></core-icon>
</core-selector>
<section id="section" horizontal layout end-justified>
<paper-fab icon="av:play-arrow" id="paper_fab" on-tap="{{ transition }}"></paper-fab>
</section>
</core-card>
</section>
<section id="section2" active>
<section id="section4" layout vertical designmeta="quiz-demo-grid">
<div id="div" class="tall-toolbar categories" slide-down>
<span id="span">Quiz Demo</span>
</div>
<div id="div1" class="tiles-container" layout wrap horizontal around-justified center relative tile-cascade>
<div id="div2" class="tile" layout vertical relative on-tap="{{ transition2 }}">
<section id="section5" class="tile-top" flex layout horizontal center center-justified>
<core-icon icon="category-icons:music" id="core_icon4" size="0" designmeta="topeka-icon"></core-icon>
</section>
<div id="div3" class="tile-bottom">
Profile
</div>
</div>
<div id="div4" class="tile" hero layout vertical relative on-tap="{{ transition3 }}">
<section id="section6" class="tile-top" flex layout horizontal center center-justified>
<core-icon icon="category-icons:food" id="core_icon3" size="0" designmeta="topeka-icon"></core-icon>
</section>
<div id="div5" class="tile-bottom" hero>
<span id="span1">General Knowledge</span>
</div>
</div>
<div id="div6" class="tile" layout vertical relative>
<section id="section7" class="tile-top" flex layout horizontal center center-justified>
<core-icon icon="category-icons:sports" id="core_icon6" size="0" designmeta="topeka-icon"></core-icon>
</section>
<div id="div7" class="tile-bottom">
Category 2
</div>
</div>
<div id="div8" class="tile" layout vertical relative>
<section id="section8" class="tile-top" flex layout horizontal center center-justified>
<core-icon icon="category-icons:tvmovies" id="core_icon5" size="0" designmeta="topeka-icon"></core-icon>
</section>
<div id="div9" class="tile-bottom">
Category 3
</div>
</div>
<div id="div10" class="tile" layout vertical relative>
<section id="section9" class="tile-top" flex layout horizontal center center-justified>
<core-icon icon="category-icons:knowledge" id="core_icon8" size="0" designmeta="topeka-icon"></core-icon>
</section>
<div id="div11" class="tile-bottom">
Category 4
</div>
</div>
<div id="div12" class="tile" layout vertical relative>
<section id="section10" class="tile-top" flex layout horizontal center center-justified>
<core-icon icon="category-icons:history" id="core_icon7" size="0" designmeta="topeka-icon"></core-icon>
</section>
<div id="div13" class="tile-bottom">
Category 5
</div>
</div>
</div>
</section>
</section>
<section id="section3">
<topeka-quizzes id="topeka_quizzes" category="{{ category }}" vertical layout slide-up on-quiz-done="{{ transition }}"></topeka-quizzes>
</section>
</core-animated-pages>
</template>
<script>
Polymer({
category: {
"name": "General Knowledge",
"id": "knowledge",
"theme": "yellow",
"quizzes": [
{
"type": "fill-blank",
"question": "Mole is a popular paste in Mexico. Mole is a mixture of chilli’s and what other tasty ingredient?",
"answer": "Chocolate"
},
{
"type": "four-quarter",
"question": "What is the name of the famous art deco skyscraper in New York city?",
"options": [
"Trump Tower",
"Chrysler building",
"Empire State Building",
"The New York Times Building"
],
"answer": 1
},
{
"type": "multi-select",
"question": "Select the names of “The Three Musketeers.”",
"options": [
"Chevy",
"Topeka",
"Athos",
"Duke",
"Porthos",
"John Felton",
"Aramis"
],
"answer": "2,4,6"
},
{
"type": "toggle-translate",
"question": "Which is the correct Translation of Zorro?",
"options": [
[
"Zorro",
"Dog"
],
[
"Zorro",
"Sword"
],
[
"Zorro",
"Fox"
],
[
"Zorro",
"Coyote"
]
],
"answer": "2"
},
{
"type": "single-select-item",
"question": "Which 1971 film, known for its violence was the first to use Dolby sound?",
"options": [
"Straw Dogs",
"Dirty Harry",
"A Clockwork Orange",
"Play Misty for me"
],
"answer": 2
},
{
"type": "picker",
"question": "How many counters does a backgammon player have?",
"min": 0,
"max": 30,
"answer": 15
},
{
"type": "true-false",
"question": "There is a patron Saint of The Internet.",
"answer": true
},
{
"type": "alpha-picker",
"question": " Which letter other than X scores 8 in Scrabble?",
"answer": "J"
},
{
"type": "four-quarter",
"question": "Four of the worst 10 maritime disasters all took place in 1945. In which sea were all four ships sunk ?",
"options": [
"Mediterranean sea",
"Baltic Sea",
"The Bermuda Triangle",
"Black Sea"
],
"answer": 1
},
{
"type": "single-select",
"question": "What nut is used to flavour marzipan?",
"options": [
"Walnut",
"Almond",
"Cashew",
"Pistachio"
],
"answer": 2
}
]
},
transition: function () {
this.$.core_animated_pages.selected = 1;
},
transition2: function () {
this.$.core_animated_pages.selected = 0;
},
transition3: function () {
this.$.core_animated_pages.selected = 2;
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment