2019-11-30 04:55:32 +00:00
|
|
|
<template>
|
|
|
|
<div class="networks">
|
2020-01-22 21:25:58 +00:00
|
|
|
<input
|
|
|
|
:placeholder="`Find ${siteCount} sites in ${networks.length} networks`"
|
|
|
|
class="search"
|
|
|
|
>
|
|
|
|
|
|
|
|
<div class="network-tiles">
|
|
|
|
<Network
|
|
|
|
v-for="network in networks"
|
|
|
|
:key="`network-tile-${network.slug}`"
|
|
|
|
:network="network"
|
|
|
|
/>
|
|
|
|
</div>
|
2019-11-30 04:55:32 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Network from '../tile/network.vue';
|
|
|
|
|
|
|
|
async function mounted() {
|
|
|
|
this.networks = await this.$store.dispatch('fetchNetworks');
|
2020-01-30 23:12:58 +00:00
|
|
|
this.pageTitle = 'Networks';
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
|
|
|
|
2020-01-22 21:25:58 +00:00
|
|
|
function siteCount() {
|
|
|
|
return this.networks.map(network => network.sites).flat().length;
|
|
|
|
}
|
|
|
|
|
2019-11-30 04:55:32 +00:00
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Network,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
networks: [],
|
2020-01-30 23:12:58 +00:00
|
|
|
pageTitle: null,
|
2019-11-30 04:55:32 +00:00
|
|
|
};
|
|
|
|
},
|
2020-01-22 21:25:58 +00:00
|
|
|
computed: {
|
|
|
|
siteCount,
|
|
|
|
},
|
2019-11-30 04:55:32 +00:00
|
|
|
mounted,
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-01-06 04:19:38 +00:00
|
|
|
@import 'theme';
|
|
|
|
|
2020-01-31 01:01:30 +00:00
|
|
|
.networks {
|
|
|
|
padding: 0 1rem;
|
|
|
|
}
|
|
|
|
|
2020-01-22 21:25:58 +00:00
|
|
|
.search {
|
2020-01-31 01:01:30 +00:00
|
|
|
width: 100%;
|
|
|
|
max-width: 40rem;
|
2020-01-22 21:25:58 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 1rem;
|
|
|
|
border: none;
|
2020-01-31 01:01:30 +00:00
|
|
|
box-sizing: border-box;
|
2020-01-22 21:25:58 +00:00
|
|
|
box-shadow: 0 0 3px $shadow-weak;
|
2020-01-31 01:01:30 +00:00
|
|
|
margin: 1rem 0;
|
2020-01-22 21:25:58 +00:00
|
|
|
font-size: 1rem;
|
|
|
|
outline: none;
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
box-shadow: 0 0 3px $primary;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.network-tiles {
|
2019-11-30 04:55:32 +00:00
|
|
|
display: grid;
|
2019-12-04 20:58:08 +00:00
|
|
|
grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
|
2019-11-30 04:55:32 +00:00
|
|
|
grid-gap: 1rem;
|
2020-01-31 01:01:30 +00:00
|
|
|
padding: 1rem 0;
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
2020-01-06 04:19:38 +00:00
|
|
|
|
|
|
|
@media(max-width: $breakpoint) {
|
|
|
|
.networks {
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
|
|
|
|
}
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
</style>
|