Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Implement screen ui #20

Merged
merged 15 commits into from
Aug 7, 2017
Merged
Show file tree
Hide file tree
Changes from 13 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
Binary file added assets/insignia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
177 changes: 157 additions & 20 deletions components/oku-circ.vue
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
<template>
<div class="oku-circ">
<h1>{{ locationUpper }}</h1>
<div class="oku-circ" v-bind:class="'oku-circ__' + location">
<h1>{{ location }}</h1>

<!-- <time>{{ dateNow }}</time> -->
<section class="device-type">

<section class="laptops">
<h2>Laptops:</h2>
<h2 class="device-type__header"><i class="fa fa-laptop device-type__header--icon-laptop" aria-hidden="true"></i> Laptops: </h2>

<ul>
<li><span>{{ laptops[location].windowsAvailable }}</span> PC available {{ laptops[location].windowsNextDue }}</li>
<li><span>{{ laptops[location].macAvailable }}</span> <i class="fa fa-apple" aria-hidden="true"></i> available {{ laptops[location].macNextDue }}</li>
<li class="device-type__info">
<span class="device-type__info--count">{{ laptops[location].windowsAvailable }}</span>
<i class="fa fa-apple device-type__info--icon" aria-hidden="true"></i>
available <!--{{ laptops[location].windowsNextDue }}-->
</li>

<li class="device-type__info">
<span class="device-type__info--count">{{ laptops[location].macAvailable }}</span>
<i class="fa fa-windows device-type__info--icon" aria-hidden="true"></i>
available <!--{{ laptops[location].macNextDue }}-->
</li>
</ul>
</section>

<section class="chargers">
<h2>Phone Chargers:</h2>
<section class="device-type">

<h2 class="device-type__header"><i class="fa fa-battery-quarter device-type__header--icon-charger" aria-hidden="true"></i> Phone Chargers: </h2>

<ul>
<li><span>{{ phoneChargers[location].iphone4Available }}</span> iPhone 4 available</li>
<li><span>{{ phoneChargers[location].iphoneAvailable}}</span> iPhone 5 &amp; up available</li>
<li><span>{{ phoneChargers[location].microUsbAvailable }}</span> Micro USB available</li>
<li><span>{{ phoneChargers[location].usbCAvailable }}</span> Micro USB-C available</li>
<li class="device-type__info">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ripe for DRYing up via loop, but we can save that for later improvement

<span class="device-type__info--count">{{ phoneChargers[location].iphone4Available }}</span> iPhone 4 available
</li>

<li class="device-type__info">
<span class="device-type__info--count">{{ phoneChargers[location].iphoneAvailable}}</span> iPhone 5 &amp; up available
</li>

<li class="device-type__info"><span class="device-type__info--count">{{ phoneChargers[location].microUsbAvailable }}</span> Micro USB available
</li>

<li class="device-type__info"><span class="device-type__info--count">{{ phoneChargers[location].usbCAvailable }}</span> USB-C available
</li>
</ul>
</section>
</div>
</template>

<script>
import _ from 'lodash'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well played 😄


export default {
data () {
return {
locationUpper: _.upperFirst(this.location)
}
},
computed: {
laptops () {
return this.$store.state.laptops.locations
Expand All @@ -49,5 +61,130 @@ export default {
}
</script>

<style>
<style lang="scss">

@import '~susy';
@import '~font-awesome/css/font-awesome.min.css';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once Nuxt v1.0 is released, we should be able to switch over to the Font Awesome module


// ==========
// CSS VARIABLES
// ==========
$light-blue: #3C96D2;
$red: #D0011B;

.oku-circ {

h1 {
text-transform: capitalize;
font-weight: normal;
font-size: 50px;
margin: 0;
font-weight: 400;
}

.laptops, .chargers {
padding-top: 20px;
margin-bottom: 150px;
}

li {
width: span(4 of 8);
float: left;
font-size: 30px;
}
}

.oku-circ.oku-circ__uris {

h1 {
font-size: 30px;
}

li {
font-size: 23px;
}
}

.device-type {
padding-top: 20px;
margin-bottom: 150px;
}

.device-type__header {
font-size: 40px;
margin: 0;
vertical-align: middle;
padding-bottom: 20px;
}

.device-type__header--icon-laptop {
font-size: 80px;
vertical-align: middle;
}

.device-type__header--icon-charger {
font-size: 60px;
vertical-align: middle;
}

.device-type__info {
width: span(4 of 8);
float: left;
font-size: 30px;
color: $light-blue;
padding-bottom: 20px;
}

.device-type__info--count {
padding: 10px;
color: $light-blue;
border-radius: 50%;
background-color: #fff;
width: 60px;
height: 60px;
display: inline-block;
text-align: center;
font-size: 30px;
vertical-align: middle;
margin-right: 10px;
}

.device-type__info--icon {
color: #fff;
}

.oku-circ.oku-circ__uris {

h1 {
font-size: 30px;
}

li {
font-size: 23px;
}

.device-type__header {
font-size: 30px;
}

.device-type__header--icon-laptop {
font-size: 70px;
}

.device-type__header--icon-charger {
font-size: 60px;
}

.device-type__info {
font-size: 24px;
}

.device-type__info--count {
padding: 10px;
width: 50px;
height: 50px;
font-size: 26px;
margin-right: 10px;
}
}
</style>
111 changes: 111 additions & 0 deletions layouts/oku.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<template>
<nuxt/>
</template>

<style lang="scss">

@import '~susy';

// ==========
// CSS VARIABLES
// ==========
$bg-dark-blue: rgba(18,29,46,.8);
$bg-medium-blue: rgba(33,43,57,.3);

// ==========
// CSS MIXINS
// ==========
@mixin border($color) {
border: 1px solid $color;
}

// ==========
// CSS LAYOUT
// ==========
$susy:(
columns: 12,
container: auto,
global-box-sizing: border-box,
gutters: 0
);

@include border-box-sizing;

body {
color: #fff;
background-color: #121D2E;
background: #121D2E url('~assets/insignia.png') no-repeat bottom right;
background-size: contain;
font-family: Montserrat, sans-serif;
font-weight: 200;
}

ul {
list-style: none;
margin: 0;
}
time {
position: absolute;
width: 66%;
top: 30px;
color: #fff;
padding-right: 20px;
text-align: right;
z-index: 9999;
color: #3C96D2;
}

.oku-circ {
position: relative;
}

.oku-circ__olin {
width: span(8 of 12);
padding: 20px;
padding-left: 30px;
float: left;
background-color: $bg-dark-blue;
}

.oku-circ__uris {
width: span(4 of 12);
background-color: $bg-medium-blue;
height: 100vh;
float: right;
border-left: 1px solid rgba(255,255,255,.2);
padding-left: 3%;
}

.oku-circ.uris {

display: flex;
flex-flow: column;

time {
width: 100%;
}

.oku-circ__olin {
padding: 20px;
padding-left: 30px;
background-color: $bg-medium-blue;
height: auto;
width: 100%;
padding-top: 40px;
order: 2;
}

.oku-circ__uris {
background-color: $bg-dark-blue;
border-bottom: 1px solid rgba(255,255,255,.2);
border-left: none;
padding-left: 30px;
padding-top: 20px;
padding-bottom: 40px;
height: 100%;
width: 100%;
order: 1;
}
}

</style>
5 changes: 2 additions & 3 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ module.exports = NuxtHelpers([
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Montserrat:200,400' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Droid+Sans:400,700' },
{ rel: 'javascript', href: 'https://use.fontawesome.com/393a6fea12.js' }
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Droid+Sans:400,700' }
]
},
/*
Expand All @@ -41,6 +40,6 @@ module.exports = NuxtHelpers([
})
}
},
vendor: ['lodash']
vendor: ['lodash', 'moment']
}
})
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
],
"private": true,
"dependencies": {
"add": "^2.0.6",
"axios": "^0.16.1",
"lodash": "^4.17.4",
"nuxt": "latest",
"nuxt-helpers": "^0.10.0"
"nuxt-helpers": "^0.10.0",
"susy": "^2.2.12",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Susy should be a devDependency

"yarn": "^0.24.5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary to include Yarn as a dependency

},
"scripts": {
"dev": "nuxt",
Expand All @@ -29,6 +32,8 @@
"eslint-plugin-html": "^2.0.0",
"eslint-plugin-promise": "^3.4.1",
"eslint-plugin-standard": "^2.0.1",
"font-awesome": "^4.7.0",
"moment": "^2.18.1",
"node-sass": "^4.5.3",
"sass-loader": "^6.0.5"
}
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>

<script>
export default {}

</script>

<style lang="scss">
Expand Down
Loading