Last active
November 20, 2015 13:59
-
-
Save aarongustafson/372271534c78cf11d4a6 to your computer and use it in GitHub Desktop.
Code samples from my Responsive Day Out talk Where Do We Go From Here?
This file contains 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
@media (hover:hover) { | |
/* hover-related interactions are A-OK */ | |
} | |
@media (hover:on-demand) { | |
/* hover-related interactions are potentially difficult, | |
maybe do something else instead */ | |
} | |
@media (hover:none) { | |
/* No hover possible :-( */ | |
} |
This file contains 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
@media (pointer:fine) { | |
/* Smaller links and buttons are ok */ | |
} | |
@media (pointer:coarse) { | |
/* Larger links and buttons are probably a good idea */ | |
} |
This file contains 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 detectType( event ) { | |
switch( event.pointerType ) { | |
case "mouse": | |
/* mouse input detected */ | |
break; | |
case "pen": | |
/* pen/stylus input detected */ | |
break; | |
case "touch": | |
/* touch input detected */ | |
break; | |
default: | |
/* pointerType is empty (could not be detected) or UA-specific custom type */ | |
} | |
} |
This file contains 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
if ( window.PointerEvent ) { | |
window.addEventListener( "pointerdown", detectType, false ); | |
} |
This file contains 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
<meta name="msapplication-cortanavcd" content="http://myapp.io/vcd.xml"> |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> | |
<CommandSet xml:lang="en-us" Name="groupPost"> | |
<CommandPrefix>Group Post</CommandPrefix> | |
<Example>Group Post add note</Example> | |
<Command Name="addNote"> | |
<Example>add a note {message} using group post</Example> | |
<ListenFor RequireAppName="BeforeOrAfterPhrase">[please] add a note [that] {noteSubject}</ListenFor> | |
<Feedback>adding {noteSubject} to Group Post</Feedback> | |
<Navigate Target="/addNote.htm"/> | |
</Command> | |
<PhraseTopic Label="noteSubject" Scenario="Dictation"></PhraseTopic> | |
</CommandSet> | |
</VoiceCommands> |
This file contains 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
body { | |
max-width: 64em; | |
} | |
@media screen and (min-width: 64em) { | |
body { | |
font-size: 1.5625vw; /* ( 1em / 64em ) * 100 */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Missing closing " on pointer-event.js switch cases :)