Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions editor/client/app/components/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
@import "ui-route/projects/index/style";
@import "ui-route/projects/new/style";
@import "ui-route/projects/project/index/style";
@import "ui-route/emulators/hex/style";
14 changes: 14 additions & 0 deletions editor/client/app/components/ui-route/emulators/hex/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Component from '@ember/component';
import { computed } from '@ember/object';

let base = 'https://felipemanga.github.io/ProjectABE/?skin=BareFit&color=FFFFFF&url='

export default Component.extend({
classNameBindings: [ ':ui-route-emulators-hex' ],

url: computed('model.url', function() {
let { model: { url } } = this;
return `${base}${encodeURIComponent(url)}`;
}).readOnly(),

});
17 changes: 17 additions & 0 deletions editor/client/app/components/ui-route/emulators/hex/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.ui-route-emulators-hex {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
> .content {
display: flex;
flex-direction: column;
border: 1px solid fade-out(#000, 0.7);
box-shadow: 0 1px 5px fade-out(#000, 0.7);
> .iframe {
width: 512px;
height: 256px;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="content">
<iframe src={{url}} class="iframe"></iframe>
</div>
5 changes: 5 additions & 0 deletions editor/client/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ Router.map(function() {
});
});

this.route('emulators', function() {
this.route('hex', { path: ':hex_id' }, function() {
});
});

this.route('users', function() {
this.route('new');
});
Expand Down
29 changes: 29 additions & 0 deletions editor/client/app/routes/emulators/hex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Route from '@ember/routing/route';
import { route } from 'ember-cli-zuglet/lifecycle';
import { BreadcrumbsMixin, breadcrumb } from '../-breadcrumbs';

export default Route.extend(BreadcrumbsMixin, {

model: route().inline({

breadcrumb: breadcrumb({
title: "Emulator"
}),

id: null,
url: null,

prepare(route, { hex_id }) {
this.setProperties({ id: hex_id });
},

async load() {
let ref = this.store.storage.ref(`builds/${this.id}.hex`);
await ref.url.load();
let url = ref.url.value;
this.setProperties({ url });
}

})

});
1 change: 1 addition & 0 deletions editor/client/app/templates/emulators/hex.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ui-route/emulators/hex model=model}}
3 changes: 2 additions & 1 deletion editor/firebase/rules/storage.rules
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
allow read: if true;
allow write: if false;
}
}
}