pixelfed/resources/assets/components/landing/sections/nav.vue

47 lines
1.6 KiB
Vue
Raw Normal View History

2023-04-08 04:35:51 +00:00
<template>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<div class="container" style="max-width: 600px;">
<router-link to="/" class="navbar-brand">
2024-07-06 23:37:17 +00:00
<img src="/img/pixelfed-icon-color.svg" width="40" height="40" alt="Logo">
<span class="mr-3">{{ name }}</span>
</router-link>
<ul class="navbar-nav mr-auto">
</ul>
<div class="my-2 my-lg-0">
2024-07-06 23:37:17 +00:00
<a class="btn btn-outline-light btn-sm rounded-pill font-weight-bold px-4" href="/login">{{ $t('landing.auth.login') }}</a>
2023-04-08 04:35:51 +00:00
2024-07-06 23:37:17 +00:00
<a v-if="config.open_registration || config.curated_onboarding" class="ml-2 btn btn-primary btn-primary-alt btn-sm rounded-pill font-weight-bold px-4" :href="regLink">{{ $t('landing.auth.signup') }}</a>
</div>
</div>
</nav>
2023-04-08 04:35:51 +00:00
</template>
<script type="text/javascript">
export default {
data() {
return {
config: window.pfl,
name: window.pfl.name,
}
},
computed: {
regLink: {
get() {
if(this.config.open_registration) {
return '/register';
}
if(this.config.curated_onboarding) {
return '/auth/sign_up';
}
}
}
},
mounted() {
$(window).scroll(function(){
$('nav').toggleClass('bg-black', $(this).scrollTop() > 20);
});
}
}
2023-04-08 04:35:51 +00:00
</script>