This repository was archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4a48c4
commit 0bd137c
Showing
8 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bower_components | ||
build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "deepspace-browser", | ||
"description": "A material design version of a broswer using iframes.", | ||
"main": "index.html", | ||
"dependencies": { | ||
"polymer": "Polymer/polymer#^1.4.0", | ||
"iron-input": "^1.0.10" | ||
}, | ||
"devDependencies": { | ||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", | ||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", | ||
"web-component-tester": "^4.0.0", | ||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!doctype html> | ||
|
||
<html> | ||
<head> | ||
<title>deepspace-browser</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="manifest" href="/manifest.json"> | ||
<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="/src/deepspace-browser/deepspace-browser.html"> | ||
<style type="text/css"> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
height: 100vh; | ||
width: 100vw; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<deepspace-browser></deepspace-browser> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "deepspace-browser", | ||
"short_name": "deepspace-browser", | ||
"description": "A material design version of a broswer using iframes.", | ||
"start_url": "/", | ||
"display": "standalone" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"entrypoint": "index.html", | ||
"shell": "src/deepspace-browser/deepspace-browser.html", | ||
"fragments": [ | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
<link rel="import" href="../../bower_components/polymer/polymer.html"> | ||
<link rel="import" href="../../bower_components/iron-input/iron-input.html"> | ||
<link rel="import" href="../../bower_components/iron-icon/iron-icon.html"> | ||
<link rel="import" href="../../bower_components/iron-icons/iron-icons.html"> | ||
<link href='https://fonts.googleapis.com/css?family=Roboto:500' rel='stylesheet' type='text/css'> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | ||
|
||
<dom-module id="deepspace-browser"> | ||
<template> | ||
<style> | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
height: 100%; | ||
font-family: 'Roboto', sans-serif; | ||
} | ||
#urlbar { | ||
height: 64px; | ||
text-align: center; | ||
background: #eee; | ||
box-shadow: 0 0 4px rgba(0,0,0,.4); | ||
} | ||
iron-icon { | ||
margin-top: 16px; | ||
} | ||
#urlfield { | ||
display: inline-block; | ||
height: 40px; | ||
width: 500px; | ||
background: #fff; | ||
border-radius: 4px; | ||
margin: auto; | ||
transform: translateY(10px); | ||
padding: 0 8px; | ||
} | ||
input { | ||
border: none; | ||
background: none; | ||
width: 100%; | ||
height: 100%; | ||
font-family: 'Roboto', sans-serif; | ||
} | ||
input:focus { | ||
outline: none; | ||
} | ||
#desktop { | ||
/*flex: 1 1 auto;*/ | ||
width: 85vw; | ||
height: calc(85vw * 0.5625); | ||
margin: auto; | ||
display: block; | ||
position: relative; | ||
} | ||
#desktop:after { | ||
/* 16:9 ratio */ | ||
display: block; | ||
content: ''; | ||
} | ||
#frame { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
right: 0; | ||
left: 0; | ||
background: #7e7e7e; | ||
display: flex; | ||
margin: 32px; | ||
margin-bottom: 56px; | ||
padding: 16px; | ||
border-radius: 8px; | ||
} | ||
#frame:before { | ||
content: ''; | ||
position: absolute; | ||
top: 3px; | ||
left: 50%; | ||
margin-left: -5px; | ||
height: 10px; | ||
width: 10px; | ||
background: #525151; | ||
border-radius: 50%; | ||
} | ||
#frame:after { | ||
content: ''; | ||
background: -webkit-linear-gradient(top, #7e7e7e 0%,#535353 100%); | ||
position: absolute; | ||
width: calc(100% + 200px); | ||
height: 32px; | ||
bottom: -24px; | ||
right: -100px; | ||
border-radius: 0 0 6px 6px; | ||
} | ||
iframe { | ||
border: none; | ||
width: 100%; | ||
background: #fff; | ||
} | ||
</style> | ||
<div id="urlbar"> | ||
<iron-icon icon="arrow-back"></iron-icon> | ||
<div id="urlfield"> | ||
<input id="urlInput" value="[[url]]" on-keypress="_keyPressed"> | ||
</div> | ||
<iron-icon icon="arrow-forward"></iron-icon> | ||
</div> | ||
<div id="desktop"> | ||
<div id="frame"> | ||
<iframe id="iFrame" src$="{{url}}"></iframe> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
(function() { | ||
'use strict'; | ||
|
||
var DEVICE_DESKTOP = "desktop"; | ||
|
||
Polymer({ | ||
|
||
is: 'deepspace-browser', | ||
|
||
properties: { | ||
url: { | ||
type: String, | ||
value: 'https://deepspace.onl/' | ||
}, | ||
device: { | ||
type: String, | ||
value: DEVICE_DESKTOP, | ||
observer: '_deviceChanged' | ||
} | ||
}, | ||
|
||
_keyPressed: function(e) { | ||
if (e.key === 'Enter') | ||
this.url = this.$.urlInput.value; | ||
}, | ||
|
||
_deviceChanged: function(device) { | ||
|
||
} | ||
}); | ||
})(); | ||
</script> | ||
</dom-module> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!doctype html> | ||
|
||
<html> | ||
<head> | ||
<title>deepspace-browser test</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> | ||
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<script src="../../../web-component-tester/browser.js"></script> | ||
|
||
<link rel="import" href="../../src/deepspace-browser/deepspace-browser.html"> | ||
</head> | ||
<body> | ||
|
||
<test-fixture id="basic"> | ||
<template> | ||
<deepspace-browser></deepspace-browser> | ||
</template> | ||
</test-fixture> | ||
|
||
<script> | ||
suite('deepspace-browser', function() { | ||
|
||
test('instantiating the element works', function() { | ||
let element = fixture('basic'); | ||
assert.equal(element.is, 'deepspace-browser'); | ||
}); | ||
|
||
}); | ||
</script> | ||
</body> | ||
</html> |