123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <template>
- <main
- class="home"
- :aria-labelledby="data.heroText !== null ? 'main-title' : null"
- >
- <header class="hero">
- <img
- v-if="data.heroImage"
- :src="$withBase(data.heroImage)"
- :alt="data.heroAlt || 'hero'"
- >
- <h1
- v-if="data.heroText !== null"
- id="main-title"
- >
- {{ data.heroText || $title || 'Hello' }}
- </h1>
- <p
- v-if="data.tagline !== null"
- class="description"
- >
- {{ data.tagline || $description || 'Welcome to your VuePress site' }}
- </p>
- <p class="action">
- <NavLink v-for="actionLink in data.actionLinks"
- v-if="actionLink.link && actionLink.text"
- :class="'action-button-' + actionLink.class"
- :item="actionLink"/>
- </p>
- </header>
- <div
- v-if="data.features && data.features.length"
- class="features"
- >
- <div
- v-for="(feature, index) in data.features"
- :key="index"
- class="feature"
- >
- <h2>{{ feature.title }}</h2>
- <p>{{ feature.details }}</p>
- </div>
- </div>
- <Content class="theme-default-content custom" />
- <div
- v-if="data.footer"
- class="footer"
- >
- <div class="content" v-html=data.footer></div>
- </div>
- <Content
- v-else
- slot-key="footer"
- class="footer"
- />
- </main>
- </template>
- <script>
- import NavLink from '@theme/components/NavLink.vue'
- export default {
- name: 'Home',
- components: { NavLink },
- computed: {
- data () {
- return this.$page.frontmatter
- }
- }
- }
- </script>
- <style lang="stylus">
- .home
- padding $navbarHeight 2rem 0
- max-width $homePageWidth
- margin 0px auto
- display block
- .hero
- text-align center
- img
- max-width: 100%
- max-height 280px
- display block
- margin 3rem auto 1.5rem
- h1
- font-size 3rem
- h1, .description, .action
- margin 1.8rem auto
- .description
- max-width 35rem
- font-size 1.6rem
- line-height 1.3
- color lighten($textColor, 40%)
- .action-button-primary
- display inline-block
- font-size 1.2rem
- color #fff
- background-color $accentColor
- padding 0.8rem 1.6rem
- border-radius 8px
- transition background-color .1s ease
- box-sizing border-box
- border 1px solid darken($accentColor, 10%)
- margin-right 20px;
- &:hover
- background-color lighten($accentColor, 10%)
- .action-button-secondary
- display inline-block
- font-size 1.2rem
- color $accentColor
- background-color #fff
- padding 0.8rem 1.6rem
- border-radius 8px
- transition background-color .1s ease
- box-sizing border-box
- border 1px solid darken($accentColor, 10%)
- &:hover
- background-color lighten($accentColor, 10%)
- color #fff
- .features
- border-top 1px solid $borderColor
- padding 1.2rem 0
- margin-top 2.5rem
- display flex
- flex-wrap wrap
- align-items flex-start
- align-content stretch
- justify-content space-between
- .feature
- flex-grow 1
- flex-basis 30%
- max-width 30%
- h2
- font-size 1.4rem
- font-weight 500
- border-bottom none
- padding-bottom 0
- color lighten($textColor, 10%)
- p
- color lighten($textColor, 25%)
- .footer
- padding 2.5rem
- border-top 1px solid $borderColor
- text-align center
- color lighten($textColor, 25%)
- @media (max-width: $MQMobile)
- .home
- .features
- flex-direction column
- .feature
- max-width 100%
- padding 0 2.5rem
- @media (max-width: $MQMobileNarrow)
- .home
- padding-left 1.5rem
- padding-right 1.5rem
- .hero
- img
- max-height 210px
- margin 2rem auto 1.2rem
- h1
- font-size 2rem
- h1, .description, .action
- margin 1.2rem auto
- .description
- font-size 1.2rem
- .action-button
- font-size 1rem
- padding 0.6rem 1.2rem
- .feature
- h2
- font-size 1.25rem
- </style>
|