storj/web/satellite/src/components/common/PagesBlock.vue

81 lines
1.9 KiB
Vue
Raw Normal View History

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
<template>
<div class="pages-container">
<span
class="pages-container__pages"
v-for="page in pages"
:class="{'selected': isSelected(page.index)}"
@click="page.select()"
:key="page.index">{{page.index}}</span>
</div>
</template>
<script lang="ts">
2019-09-09 11:33:39 +01:00
import { Component, Prop, Vue } from 'vue-property-decorator';
2019-09-09 11:33:39 +01:00
import { Page } from '@/types/pagination';
@Component
export default class PagesBlock extends Vue {
@Prop({default: () => []})
public readonly pages: Page[];
@Prop({default: () => false})
public readonly isSelected: CheckSelected;
2019-09-09 11:33:39 +01:00
}
</script>
<style scoped lang="scss">
.pages-container {
display: flex;
&__pages {
font-family: 'font_medium', sans-serif;
font-size: 16px;
margin-right: 15px;
width: auto;
text-align: center;
cursor: pointer;
display: block;
position: relative;
transition: all 0.2s ease;
&:hover {
color: #2379ec;
&:after {
content: '';
display: block;
position: absolute;
bottom: -4px;
left: 0;
width: 100%;
height: 2px;
background-color: #2379ec;
}
}
&:last-child {
margin-right: 0;
}
}
}
.selected {
color: #2379ec;
font-family: 'font_bold', sans-serif;
&:after {
content: '';
display: block;
position: absolute;
bottom: -4px;
left: 0;
width: 100%;
height: 2px;
background-color: #2379ec;
}
}
</style>