This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<link rel="import" href="path/to/x-foo.html"> | |
</head> | |
<body> | |
<x-foo></x-foo> | |
<script> | |
window.addEventListener('polymer-ready', function(e) { | |
var xFoo = document.querySelector('x-foo'); | |
xFoo.barProperty = 'baz'; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header> | |
<h1>article header h1</h1> | |
<p>This web app takes advantage of Web Components and Polymer to enable new HTML features in the browser.</p> | |
<p> | |
In this particular case, we are using <a href="https://github.com/passy/x-pokemon"> | |
the x-pokemon web component </a> to pull the images from a database, as well as the | |
<a href="http://zenorocha.github.io/voice-elements/">voice-elements web component</a> to speak the name of the pokemon we entered. | |
</p> | |
<h2>Change the accent</h2> | |
<x-radial-buttons id="radial-button-template"></x-radial-buttons> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (pokemonApp) { | |
// Grab inputs and button for speech-to-text | |
var form = document.querySelector('#player-form'), | |
input = document.querySelector('#player-input'), | |
playerElement = document.querySelector('#player-element'), | |
xPokemon = document.querySelector('#x-pokemon'), | |
btnChangeAccent = document.querySelector('#btn-change-accent'), | |
radialButtonTemplate = document.querySelector("#radial-button-template"), | |
playerAccent = playerElement.getAttribute("accent"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="bower_components/polymer/polymer.html" rel="import"> | |
<link rel="import" href="../paper-radio-group/paper-radio-group.html"> | |
<link rel="import" href="../paper-radio-button/paper-radio-button.html"> | |
<polymer-element name="x-radial-buttons"> | |
<!-- Shadow DOM --> | |
<template> | |
<style> | |
#paper_radio_group { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../paper-radio-group/paper-radio-group.html"> | |
<link rel="import" href="../paper-radio-button/paper-radio-button.html"> | |
<polymer-element name="x-radial-buttons"> | |
<template> | |
<style> | |
#paper_radio_group { | |
left: 690px; | |
top: 380px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
(function () { | |
console.log("HomePageController loaded"); | |
angular.module('app') | |
.controller('HomePageController', thingsandstuff); | |
function thingsandstuff() { | |
var vm = this; | |
vm.Title = "FSharp Web Kit"; | |
vm.GitHubID = "GitHubID"; //TODO: set this w/ a Get call to retrieve GitHub ID from user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="btn_submit" data-win-control="WinJS.UI.Tooltip" data-win-options="{innerHTML: 'Submit your Order'}"> | |
{{HomePage.GitHubID}} | |
</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Declare a Prepose program named “soccer” | |
APP soccer: | |
// We are building the “ola” or “wave” gesture | |
// An app can have multiple gestures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Switch to the next weapon in our inventory | |
/// </summary> | |
private void NextWeapon() | |
{ | |
// Store the value of the next weapon | |
currentWeaponIndex ++; | |
// Reached the end of the array, start from the beginning | |
if (currentWeaponIndex >= weaponInventory.Length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Check for pickup type and set powerup effect on the player | |
/// Play a particle effect when touching a player, and despawn afterwards | |
/// </summary> | |
/// <param name="other">What are we colliding with? Should only check for player</param> | |
private void OnTriggerEnter(Collider other) | |
{ | |
if (!other.gameObject.CompareTag("Player")) return; | |
SpawnTextWhenTouched(); |