Hero.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <section
  3. class="hero is-black is-medium">
  4. <div class="hero-body">
  5. <div
  6. class="hero-img"
  7. :style="{ background : `url(${image}) no-repeat center center`}">
  8. </div>
  9. <div class="container">
  10. <h1 class="title">
  11. {{title}}
  12. </h1>
  13. <h2 class="subtitle">
  14. {{subtitle}}
  15. </h2>
  16. <a target="_" :href="promoLink" class="button is-danger">Learn More!</a>
  17. </div>
  18. </div>
  19. </section>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. title: {
  25. type: String,
  26. default: 'Super Amazing Promo'
  27. },
  28. subtitle: {
  29. type: String,
  30. default: 'Super Amazing Promo Subtitle'
  31. },
  32. image: {
  33. type: String,
  34. default: 'https://images.unsplash.com/photo-1510519138101-570d1dca3d66?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1631&q=80'
  35. },
  36. promoLink: {
  37. type: String,
  38. default: '#'
  39. },
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .hero-body {
  45. position: relative;
  46. }
  47. .hero-img {
  48. opacity: 0.8;
  49. position: absolute;
  50. height: 100%;
  51. width: 100%;
  52. top: 0;
  53. left: 0;
  54. -webkit-background-size: cover;
  55. -moz-background-size: cover;
  56. -o-background-size: cover;
  57. background-size: cover;
  58. }
  59. .user-avatar {
  60. display: inline-block;
  61. }
  62. .is-black {
  63. background-color: black;
  64. }
  65. .title {
  66. font-weight: bold;
  67. font-size: 45px;
  68. }
  69. .subtitle {
  70. /*font-weight: bold;*/
  71. font-size: 25px;
  72. }
  73. .author-name {
  74. font-size: 20px;
  75. font-weight: bold;
  76. }
  77. </style>