2024-02-29 04:08:54 +00:00
< template >
2024-03-26 03:14:42 +00:00
< div class = "page" >
< div class = "profile" >
< div class = "profile-header" >
< div class = "user" >
< img
v - if = "profile.avatar"
: src = "profile.avatar"
class = "avatar"
>
< h2 class = "username ellipsis" > { { profile . username } } < / h2 >
< / div >
2024-03-03 01:33:35 +00:00
2024-03-26 23:06:03 +00:00
< span class = "age" > { { formatDistanceStrict ( Date . now ( ) , profile . createdAt ) } } < / span >
2024-03-26 03:14:42 +00:00
< / div >
2024-08-31 23:30:45 +00:00
< nav
2024-05-19 03:07:35 +00:00
v - if = "profile.id === user?.id"
2024-08-31 23:30:45 +00:00
class = "domains"
2024-09-01 00:54:03 +00:00
@ click = "confirmUnsaved"
2024-05-19 03:07:35 +00:00
>
2024-08-31 23:30:45 +00:00
< a
: href = "`/user/${profile.username}/stashes`"
class = "domain nolink"
: class = "{ active: domain === 'stashes' }"
> Stashes < / a >
< a
: href = "`/user/${profile.username}/alerts`"
class = "domain nolink"
: class = "{ active: domain === 'alerts' }"
> Alerts < / a >
2024-09-01 00:54:03 +00:00
< a
: href = "`/user/${profile.username}/summaries`"
class = "domain nolink"
: class = "{ active: domain === 'summaries' }"
> Summaries < / a >
2024-08-31 23:30:45 +00:00
< / nav >
< Stashes v -if = " domain = = = ' stashes ' " / >
< Alerts v -if = " domain = = = ' alerts ' & & profile.id = = = user ? .id " / >
2024-09-01 00:54:03 +00:00
< Summaries
v - if = "domain === 'summaries' && profile.id === user?.id"
: release = "mockupRelease"
@ changed = "(changed) => summaryChanged = changed"
/ >
2024-03-26 03:14:42 +00:00
< / div >
2024-02-29 04:08:54 +00:00
< / div >
< / template >
< script setup >
2024-03-26 02:00:50 +00:00
import { ref , inject } from 'vue' ;
2024-03-26 03:14:42 +00:00
import { formatDistanceStrict } from 'date-fns' ;
2024-03-26 02:00:50 +00:00
2024-08-31 23:30:45 +00:00
import Stashes from '#/components/stashes/stashes.vue' ;
import Alerts from '#/components/alerts/alerts.vue' ;
2024-09-01 00:54:03 +00:00
import Summaries from '#/components/scenes/summaries.vue' ;
2024-03-26 03:14:42 +00:00
2024-02-29 04:08:54 +00:00
const pageContext = inject ( 'pageContext' ) ;
2024-08-31 23:30:45 +00:00
const domain = pageContext . routeParams . domain ;
2024-04-02 03:55:53 +00:00
const user = pageContext . user ;
2024-03-26 02:00:50 +00:00
const profile = ref ( pageContext . pageProps . profile ) ;
2024-09-01 00:54:03 +00:00
const summaryChanged = ref ( false ) ;
const mockupRelease = {
id : 1 ,
title : 'Nut For Human Consumption' ,
effectiveDate : new Date ( ) ,
actors : [
{
name : 'Chanel Chakra' ,
gender : 'female' ,
} ,
{
name : 'Mo The Fucker' ,
gender : 'male' ,
} ,
] ,
tags : [
{ name : 'anal' } ,
{ name : 'facefucking' } ,
{ name : 'deepthroat' } ,
{ name : 'blowjob' } ,
{ name : 'facial' } ,
] ,
movies : [ {
title : 'Best Of Traxxx 23' ,
} ] ,
channel : {
name : 'Traxxxed' ,
} ,
network : {
name : 'Traxxx' ,
} ,
} ;
function confirmUnsaved ( event ) {
if ( summaryChanged . value && ! confirm ( 'You have unchanged changes in your summary editor, are you sure you want to leave the page?' ) ) { // eslint-disable-line no-restricted-globals, no-alert
event . preventDefault ( ) ;
}
}
2024-08-31 23:30:45 +00:00
< / script >
2024-03-26 02:00:50 +00:00
2024-08-31 23:30:45 +00:00
< style >
. profile - section {
. section - header {
display : flex ;
align - items : center ;
justify - content : space - between ;
padding : .5 rem .5 rem .5 rem .5 rem ;
2024-05-19 03:07:35 +00:00
2024-08-31 23:30:45 +00:00
. button {
margin - left : 1 rem ;
}
2024-05-19 03:07:35 +00:00
}
2024-08-31 23:30:45 +00:00
. heading {
margin : 0 ;
font - size : 1.1 rem ;
color : var ( -- primary ) ;
}
}
2024-05-19 03:07:35 +00:00
2024-08-31 23:30:45 +00:00
@ media ( -- small - 30 ) {
. profile - section . section - header {
padding : .5 rem .5 rem .5 rem .5 rem ;
2024-05-19 03:07:35 +00:00
}
}
2024-08-31 23:30:45 +00:00
< / style >
2024-02-29 04:08:54 +00:00
< style scoped >
2024-03-26 03:14:42 +00:00
. page {
display : flex ;
flex - grow : 1 ;
justify - content : center ;
background : var ( -- background - base - 10 ) ;
}
. profile {
2024-09-01 00:54:03 +00:00
display : flex ;
flex - direction : column ;
2024-03-26 03:14:42 +00:00
width : 1200 px ;
max - width : 100 % ;
2024-09-01 00:54:03 +00:00
margin : 0 1 rem ;
2024-03-26 03:14:42 +00:00
}
2024-02-29 04:08:54 +00:00
. profile - header {
display : flex ;
2024-03-26 03:14:42 +00:00
justify - content : space - between ;
2024-02-29 04:08:54 +00:00
align - items : center ;
padding : .5 rem 1 rem ;
color : var ( -- highlight - strong - 30 ) ;
2024-06-10 01:24:48 +00:00
background : var ( -- shadow - strong - 30 ) ;
2024-03-26 03:14:42 +00:00
border - radius : 0 0 .5 rem .5 rem ;
}
. user {
display : flex ;
overflow : hidden ;
2024-02-29 04:08:54 +00:00
}
. username {
margin : 0 ;
2024-03-26 02:00:50 +00:00
font - size : 1.25 rem ;
2024-02-29 04:08:54 +00:00
}
2024-03-26 03:14:42 +00:00
. age {
display : flex ;
flex - shrink : 0 ;
2024-03-26 23:06:03 +00:00
font - size : .9 rem ;
2024-03-26 03:14:42 +00:00
. icon {
2024-03-26 23:06:03 +00:00
width : .9 rem ;
2024-03-26 03:14:42 +00:00
fill : var ( -- highlight - strong - 20 ) ;
margin - right : .75 rem ;
transform : translateY ( - 1 px ) ;
}
}
2024-02-29 04:08:54 +00:00
. avatar {
2024-03-26 02:00:50 +00:00
width : 1.5 rem ;
height : 1.5 rem ;
2024-02-29 04:08:54 +00:00
border - radius : .25 rem ;
margin - right : 1 rem ;
}
2024-03-03 01:33:35 +00:00
2024-08-31 23:30:45 +00:00
. domains {
2024-05-28 03:49:28 +00:00
display : flex ;
gap : .5 rem ;
2024-08-31 23:30:45 +00:00
padding : .5 rem 0 ;
2024-09-01 00:54:03 +00:00
margin - top : .25 rem ;
2024-08-31 22:43:21 +00:00
}
2024-08-31 23:30:45 +00:00
. domain {
color : var ( -- glass - strong - 20 ) ;
background : var ( -- background - dark - 20 ) ;
padding : .5 rem 1 rem ;
border - radius : 1 rem ;
2024-05-28 03:49:28 +00:00
font - size : .9 rem ;
2024-08-31 23:30:45 +00:00
font - weight : bold ;
2024-05-19 03:07:35 +00:00
2024-08-31 23:30:45 +00:00
& . active {
background : var ( -- primary ) ;
color : var ( -- text - light ) ;
2024-08-31 22:43:21 +00:00
}
}
2024-03-26 03:14:42 +00:00
@ media ( -- small - 30 ) {
2024-09-01 00:54:03 +00:00
. profile {
margin : 0 .5 rem ;
}
2024-03-26 03:14:42 +00:00
. age . icon {
display : none ;
}
}
@ media ( -- small - 50 ) {
. age {
display : none ;
}
}
2024-02-29 04:08:54 +00:00
< / style >