-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve selection type documentation
- Refine tooltip documentation with clearer information. - Introduce privacy ranking indicator for intuitive user guidance. - Adopt a consistent format throughout documentation. - Switch from emojis to icons to maintain visual uniformity.
- Loading branch information
1 parent
d67100a
commit 7af8daa
Showing
12 changed files
with
633 additions
and
18 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/presentation/components/Scripts/Menu/Selector/Rating/CircleRating.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<span class="circle-rating"> | ||
<RatingCircle | ||
v-for="i in maxRating" | ||
:key="i" | ||
:filled="i <= rating" | ||
/> | ||
</span> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import RatingCircle from './RatingCircle.vue'; | ||
const minRating = 0; | ||
const maxRating = 4; | ||
export default defineComponent({ | ||
components: { | ||
RatingCircle, | ||
}, | ||
props: { | ||
rating: { | ||
type: Number, | ||
required: true, | ||
validator: (value: number) => { | ||
return value >= minRating && value <= maxRating; | ||
}, | ||
}, | ||
}, | ||
setup() { | ||
return { | ||
maxRating, | ||
}; | ||
}, | ||
}); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.circle-rating { | ||
display: inline-flex; | ||
gap: 0.2em; | ||
} | ||
</style> |
72 changes: 72 additions & 0 deletions
72
src/presentation/components/Scripts/Menu/Selector/Rating/RatingCircle.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<template> | ||
<svg | ||
:style="{ | ||
'--circle-stroke-width': `${circleStrokeWidthInPx}px`, | ||
}" | ||
:viewBox="viewBox" | ||
> | ||
<circle | ||
:cx="circleRadiusInPx" | ||
:cy="circleRadiusInPx" | ||
:r="circleRadiusWithoutStrokeInPx" | ||
:class="{ | ||
filled, | ||
}" | ||
/> | ||
</svg> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, computed } from 'vue'; | ||
const circleDiameterInPx = 20; | ||
const circleStrokeWidthInPx = 2; | ||
export default defineComponent({ | ||
props: { | ||
filled: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
setup() { | ||
const circleRadiusInPx = computed(() => { | ||
return circleDiameterInPx / 2; | ||
}); | ||
const circleRadiusWithoutStrokeInPx = computed(() => { | ||
return circleRadiusInPx.value - (circleStrokeWidthInPx / 2); | ||
}); | ||
const viewBox = computed(() => { | ||
const minX = -circleStrokeWidthInPx / 2; | ||
const minY = -circleStrokeWidthInPx / 2; | ||
const width = circleDiameterInPx + circleStrokeWidthInPx; | ||
const height = circleDiameterInPx + circleStrokeWidthInPx; | ||
return `${minX} ${minY} ${width} ${height}`; | ||
}); | ||
return { | ||
circleRadiusInPx, | ||
circleDiameterInPx, | ||
circleStrokeWidthInPx, | ||
circleRadiusWithoutStrokeInPx, | ||
viewBox, | ||
}; | ||
}, | ||
}); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
$circleColor: currentColor; | ||
$circleHeight: 0.8em; | ||
$circleStrokeWidth: var(--circle-stroke-width); | ||
svg { | ||
height: $circleHeight; | ||
circle { | ||
stroke: $circleColor; | ||
stroke-width: $circleStrokeWidth; | ||
&.filled { | ||
fill: $circleColor; | ||
} | ||
} | ||
} | ||
</style> |
141 changes: 141 additions & 0 deletions
141
src/presentation/components/Scripts/Menu/Selector/SelectionTypeDocumentation.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<template> | ||
<div> | ||
<p class="privacy-rating"> | ||
Privacy: <CircleRating :rating="privacyRating" /> | ||
</p> | ||
<hr /> | ||
<div class="sections"> | ||
<section> | ||
{{ description }} | ||
</section> | ||
<section class="recommendation"> | ||
<AppIcon icon="lightbulb" class="icon" /> | ||
<span class="text">{{ recommendation }}</span> | ||
</section> | ||
<section | ||
v-if="includes?.length > 0" | ||
class="includes" | ||
> | ||
<AppIcon icon="square-check" class="icon" /> | ||
<span class="text"> | ||
Includes: | ||
<ul> | ||
<li | ||
v-for="inclusionItem in includes" | ||
:key="inclusionItem" | ||
> | ||
{{ inclusionItem }} | ||
</li> | ||
</ul> | ||
</span> | ||
</section> | ||
<section | ||
v-if="considerations?.length > 0" | ||
class="considerations" | ||
> | ||
<AppIcon icon="triangle-exclamation" class="icon" /> | ||
<span class="text"> | ||
Considerations: | ||
<ul> | ||
<li | ||
v-for="considerationItem in considerations" | ||
:key="considerationItem" | ||
> | ||
{{ considerationItem }} | ||
</li> | ||
</ul> | ||
</span> | ||
</section> | ||
</div> | ||
</div> | ||
</template> | ||
<script lang="ts"> | ||
import { PropType, defineComponent } from 'vue'; | ||
import AppIcon from '@/presentation/components/Shared/Icon/AppIcon.vue'; | ||
import CircleRating from './Rating/CircleRating.vue'; | ||
export default defineComponent({ | ||
components: { | ||
CircleRating, | ||
AppIcon, | ||
}, | ||
props: { | ||
privacyRating: { | ||
type: Number, | ||
required: true, | ||
}, | ||
description: { | ||
type: String, | ||
required: true, | ||
}, | ||
recommendation: { | ||
type: String, | ||
required: true, | ||
}, | ||
includes: { | ||
type: Array as PropType<ReadonlyArray<string>>, | ||
default: () => [], | ||
}, | ||
considerations: { | ||
type: Array as PropType<ReadonlyArray<string>>, | ||
default: () => [], | ||
}, | ||
}, | ||
}); | ||
</script> | ||
<style scoped lang="scss"> | ||
@use "@/presentation/assets/styles/main" as *; | ||
.privacy-rating { | ||
margin: 0.5em; | ||
text-align: center; | ||
} | ||
hr { | ||
margin: 1em 0; | ||
opacity: 0.6; | ||
} | ||
ul { | ||
@include reset-ul; | ||
padding-left: 0em; | ||
margin-top: 0.25em; | ||
list-style: disc; | ||
li { | ||
line-height: 1.2em; | ||
} | ||
} | ||
.sections { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.75em; | ||
margin-bottom: 0.75em; | ||
.includes { | ||
display: flex; | ||
gap: 0.5em; | ||
font-weight: 500; | ||
.icon { | ||
color: $color-success; | ||
} | ||
} | ||
.considerations { | ||
display: flex; | ||
gap: 0.5em; | ||
.text { | ||
font-weight: 500; | ||
} | ||
.icon { | ||
color: $color-danger; | ||
} | ||
} | ||
.recommendation { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5em; | ||
.icon { | ||
color: $color-caution; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.