ButtonExpand.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <b-button
  3. v-on="$listeners"
  4. v-bind="$attrs"
  5. variant="depart"
  6. class="btn-expand on-hover"
  7. :aria-label="expanded ? 'Réduire' : 'Agrandir'"
  8. >
  9. <svg aria-hidden="true" viewBox="0 0 75 70">
  10. <path v-if="expanded" d="M20,30 h10 v-10 M45,20 v10 h10 M55,40 h-10 v10 M30,50 v-10 h-10" />
  11. <path v-else d="M20,30 v-10 h10 M45,20 h10 v10 M55,40 v10 h-10 M30,50 h-10 v-10" />
  12. </svg>
  13. <span v-if="artwork" class="btn-artwork">Voir l'œuvre</span>
  14. </b-button>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'ButtonExpand',
  19. props: {
  20. expanded: { type: Boolean, default: false },
  21. artwork: { type: Boolean, default: false }
  22. }
  23. }
  24. </script>
  25. <style lang="scss" scoped>
  26. $light-black: lighten($black, 20%);
  27. .btn-expand {
  28. padding: 0;
  29. width: 75px;
  30. height: 70px;
  31. border: 0;
  32. border-radius: 0 !important;
  33. line-height: 0;
  34. &:hover,
  35. &:focus {
  36. path {
  37. stroke: $black;
  38. }
  39. .btn-artwork {
  40. border-color: $black;
  41. box-shadow: 3px 5px 0 $black;
  42. }
  43. }
  44. svg {
  45. width: 100%;
  46. height: 100%;
  47. pointer-events: none;
  48. }
  49. path {
  50. fill: none;
  51. stroke: $light-black;
  52. stroke-width: 4px;
  53. stroke-linejoin: round;
  54. stroke-linecap: round;
  55. }
  56. .btn-artwork {
  57. position: absolute;
  58. bottom: -35px;
  59. left: -22.5px;
  60. width: 120px;
  61. height: 30px;
  62. line-height: 1.5;
  63. background-color: $white;
  64. border: 2px solid $light-black;
  65. border-radius: 50em;
  66. box-shadow: 3px 5px 0 $light-black;
  67. }
  68. }
  69. </style>