Skip to content

Commit

Permalink
Add ability to place social badge inside code window
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Oct 20, 2024
1 parent 0ef0811 commit 478b6b9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/SocialBadge.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="p-1 flex items-center border">
<div class="p-1 flex items-center">
<SocialBadgeIcon class="w-8" :type="type" />

<div class="px-2 space-y-0.5">
Expand Down
20 changes: 13 additions & 7 deletions components/Window.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,30 @@

<div
v-if="settings.showSocialBadge"
class="absolute flex w-full"
class="absolute flex w-full h-fit"
:class="{
'justify-start': settings.socialPosition === 'bottom-left',
'justify-center': settings.socialPosition === 'bottom-center',
'justify-end': settings.socialPosition === 'bottom-right',
'bottom-2': settings.socialPosition.includes('inside'),
'mt-2': settings.socialPosition.includes('bottom'),
'left-2': settings.socialPosition.includes('inside-left'),
'right-2': settings.socialPosition.includes('inside-right'),
'justify-start': settings.socialPosition.includes('left'),
'justify-center': settings.socialPosition.includes('center'),
'justify-end': settings.socialPosition.includes('right'),
}"
>
<SocialBadge
class="mt-4"
:type="settings.socialType"
:username="settings.socialUsername"
:display-name="settings.socialDisplayName"
:style="{
color: fontColor,
borderColor: borderColor,
boxShadow: boxShadowWithAccent,
borderColor: `rgba(${borderColorRgba})`,
backgroundColor: settings.themeBackground,
borderRadius: `${settings.socialBorderRadius}px`,
borderWidth: settings.showBorder ? borderWidth : 0,
boxShadow: settings.showBorder ? boxShadow : boxShadowWithAccent,
}"
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions composables/useSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default function (defaults = {}) {
socialDisplayName: preferences.socialDisplayName,
socialPosition: preferences.socialPosition,
socialBorderRadius: 25,
socialLocation: 'outside',
};

const settings = reactive(applyDefaults(cloneDeep(defaults), settingsDefaults));
Expand Down
10 changes: 7 additions & 3 deletions composables/useSocials.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ export default function () {
];

const positions = [
{ title: 'Left', name: 'bottom-left' },
{ title: 'Center', name: 'bottom-center' },
{ title: 'Right', name: 'bottom-right' },
{ title: 'Inside Left', name: 'inside-left' },
{ title: 'Inside Center', name: 'inside-center' },
{ title: 'Inside Right', name: 'inside-right' },

{ title: 'Bottom Left', name: 'bottom-left' },
{ title: 'Bottom Center', name: 'bottom-center' },
{ title: 'Bottom Right', name: 'bottom-right' },
];

return {
Expand Down

0 comments on commit 478b6b9

Please sign in to comment.