Skip to content

Commit

Permalink
Fixed responsivenes a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mgibas committed Sep 1, 2017
1 parent 386af28 commit 76dba03
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/layouts/fragment-layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
--paper-icon-button-ink-color: var(--text-primary-color);
}

@media (max-width: 425px) {
@media (max-width: 479px) {
.content {
padding: 0;
}
Expand Down
35 changes: 10 additions & 25 deletions src/player/player-details.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<link rel="import" href="../../bower_components/polymer/polymer-element.html">
<link rel="import" href="../../bower_components/iron-label/iron-label.html">
<link rel="import" href="../../bower_components/paper-fab/paper-fab.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-document.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-query.html">
<link rel="import" href="../imports/d3-import.html">
Expand Down Expand Up @@ -49,13 +48,17 @@
@apply --paper-font-caption;
color: var(--secondary-text-color);
}
@media (max-width: 767px) {
match-item + match-item {
border-top: 1px solid var(--divider-color);
@media (max-width: 479px) {
.ranking {
font-size: 2rem;
}
.totals {
font-size: 2rem;
}
player-avatar {
margin-left: 0;
margin-right: 1rem;
}
}
paper-fab[hidden] {
display: none;
}
</style>

Expand Down Expand Up @@ -91,9 +94,6 @@ <h2>Matches Summary</h2>
</header>
<player-matches-summary player-uid="[[playerUid]]"></player-matches-summary>
</section>

<paper-fab icon="corpopong:paddles" hidden="[[_samePlayer(playerUid, userUid)]]" on-tap="_createMatch"></paper-fab>

</template>
<script>
class PlayerDetails extends Polymer.Element {
Expand Down Expand Up @@ -134,21 +134,6 @@ <h2>Matches Summary</h2>
_computeNoData (length) {
return !length
}
_samePlayer (uid1, uid2) {
return uid1 === uid2
}
_createMatch () {
this.$.fb.data = {
player1Uid: this.userUid,
player2Uid: this.playerUid
}
this.$.fb.saveValue(`/users/${this.userUid}/open-matches`)
.then(() => {
this.$.fb.reset()
window.history.pushState({}, null, '/')
window.dispatchEvent(new CustomEvent('location-changed'))
})
}
}

window.customElements.define(PlayerDetails.is, PlayerDetails)
Expand Down
11 changes: 2 additions & 9 deletions src/player/player-matches-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
<dom-module id="player-matches-summary">
<template>
<style include="app-styles"></style>
<style>
.stats {
text-align: right;
}
</style>
<firebase-query
path="/players"
data="{{_players}}"
Expand Down Expand Up @@ -43,10 +38,8 @@
[[item.rating]]
</span>
</paper-item-body>
<div class="stats flex">
<span>
[[_getWinsCount(item)]] / [[_getLossesCount(item)]] / [[item.matches.length]]
</span>
<div class="stats">
[[_getWinsCount(item)]] / [[_getLossesCount(item)]] / [[item.matches.length]]
</div>
</div>
</paper-icon-item>
Expand Down

0 comments on commit 76dba03

Please sign in to comment.