Skip to content

Commit

Permalink
Added a little onboarding when you install the extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
GabeDuarteM committed Dec 17, 2017
1 parent 09ccb1e commit e44faa2
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ function OpenDefaultPlayer() {
chrome.tabs.create({ url: defaultPlayer.url })
}
}

chrome.runtime.onInstalled.addListener(details => {
chrome.tabs.create({ url: chrome.runtime.getURL("first-time/index.html") })
})
98 changes: 98 additions & 0 deletions src/first-time/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Webplayer Hotkeys</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
}

header {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
margin-top: 40px;
}

section {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}

h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 300;
}


.divider {
width: 320px;
height: 1px;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.divider.bottom {
margin-top: 24px;
}

section h2 {
margin-top: 24px;
}

code {
font-size: 11px;
display: inline-flex;
align-items: center;
justify-content: center;
}

figcaption {
justify-content: center;
display: flex;
}
</style>
</head>

<body>
<header>
<h1>Webplayer Hotkeys</h1>
<span class="divider" />
</header>
<section>
<h2>Getting Started</h3>
<div>
To start using the extension, you need to set the hotkeys for it. You can do it by going to the extensions configuration
page
<code>(Click more <img src="http://storage.googleapis.com/support-kms-prod/5C6FB52C8BBB2C12DC89B5F42F16B9B5E9CF"> > More tools > Extensions)</code> and, on the bottom of the list, click
<code>Keyboard Shortcuts</code>.
<br>On the list that opens up, find the Webplayer Hotkeys section, and there you can assign wherever hotkeys you want
for play, pause and next/previous song.
</div>
<span class="divider bottom" />
</section>
<section>
<h2>Images</h3>
<figure>
<img src="/first-time/keyboard-shortcuts.jpg">
<figcaption>Keyboard shortcuts location</figcaption>
</figure>
<figure>
<img src="/first-time/shortcuts.jpg">
<figcaption>Shortcuts</figcaption>
</figure>
</section>
</body>

</html>
Binary file added src/first-time/keyboard-shortcuts.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/first-time/shortcuts.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Webplayer Hotkeys",
"version": "1.0",
"version": "1.1",
"description": "Assign hotkeys to play/pause, and switch music. Works with Spotify, Deezer, SoundCloud and Youtube.",
"icons": {
"128": "icon.png"
Expand Down
6 changes: 5 additions & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ function getMergedConfig({ env }: IMergedConfigParams): webpack.Configuration {
}

function getPatterns(): IPattern[] {
return [{ from: join("src", "icon.png") }, { from: join("src", "manifest.json") }]
return [
{ from: join("src", "icon.png") },
{ from: join("src", "manifest.json") },
{ from: join("src", "first-time"), to: "first-time" },
]
}

function getBaseConfig(): webpack.Configuration {
Expand Down

0 comments on commit e44faa2

Please sign in to comment.