Skip to content

Commit

Permalink
Range understands colors
Browse files Browse the repository at this point in the history
Limits the max size of the range on calendars
Starts code to support the page on smaller screens

Related to Issue #38
  • Loading branch information
BobChao87 committed Nov 24, 2021
1 parent c5a1f70 commit df5c0a1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assets/table/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '~bulmaswatch/solar/variables' as solar;
@use '~bulma/sass/utilities/functions' as bulma;

// Colors are designed to take advantage of playing of the background. Theme neutral
// Colors are designed to take advantage of playing off the background. Theme neutral
$neutral-color: rgba(255, 255, 255, 0.1) !default;
$light-color: rgba(255, 255, 255, 0.05) !default;
$dark-color: rgba(0, 0, 0, 0.1) !default;
Expand Down
8 changes: 7 additions & 1 deletion components/calendar/view/Row.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ElementTableRow>
<ElementTableCell class="duration">
<ElementRange class="is-primary" :min="0" :max="24" :start="start" :end="end" />
<ElementRange class="duration-range" :min="0" :max="24" :start="start" :end="end" />
</ElementTableCell>
<ElementTableCell class="name">
<ElementLink :to="`/marathon/${marathon.id}`">
Expand Down Expand Up @@ -61,3 +61,9 @@ export default Vue.extend({
},
});
</script>

<style lang="scss" scoped>
.duration-range {
width: 100px;
}
</style>
4 changes: 3 additions & 1 deletion components/calendar/view/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ export default Vue.extend({
@use '~assets/table';
.marathon-calendar-table {
@include table.shrink(3);
@include table.shrink(3, (
500px '.links' 2,
));
> .day,
> .day-range {
Expand Down
21 changes: 16 additions & 5 deletions components/element/Range.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="element-range" :style="rangeCutoffs">
<div class="element-range" :style="rangeCutoffs" :aria-valuemin="min" :aria-valuemax="max" :aria-valuetext="`${start} - ${end}`">
<div class="selected-range" />
</div>
</template>
Expand Down Expand Up @@ -56,17 +56,28 @@ export default Vue.extend({
width: 100%;
background-color: bulma.$grey-lightest;
.selected-range {
> .selected-range {
position: absolute;
border: none;
border-radius: bulma.$radius-rounded;
border-radius: solar.$radius;
display: block;
height: 100%;
overflow: hidden;
left: var(--start-range);
right: var(--end-range);
// TODO Make with the colors
background-color: solar.$primary;
}
$colors:
'primary' solar.$primary,
'info' solar.$info,
'success' solar.$green,
'warning' solar.$warning,
'danger' solar.$red;
@each $name, $color in $colors {
&.is-#{$name} > .selected-range {
background-color: $color;
}
}
}
</style>

0 comments on commit df5c0a1

Please sign in to comment.