Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vulnerability-indicators
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Water Mission Area
VizLab
vulnerability-indicators
Commits
2eabdd94
Commit
2eabdd94
authored
10 months ago
by
Cee Nell
Browse files
Options
Downloads
Plain Diff
Merge branch 'hero-style' into 'main'
Hero style See merge request
!20
parents
2c4cb443
5d2c7549
No related branches found
No related tags found
1 merge request
!20
Hero style
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/App.vue
+23
-20
23 additions, 20 deletions
src/App.vue
src/components/VizTitle.vue
+106
-27
106 additions, 27 deletions
src/components/VizTitle.vue
with
129 additions
and
47 deletions
src/App.vue
+
23
−
20
View file @
2eabdd94
...
...
@@ -42,6 +42,8 @@
/* Fonts */
@import
url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@200;300;400;500;600;700;800&display=swap')
;
$SourceSans
:
'Source Sans Pro'
,
sans-serif
;
@import
url('https://fonts.googleapis.com/css2?family=Dosis:wght@200..800&family=Inter+Tight:ital,wght@0,100..900;1,100..900&display=swap')
;
$Dosis
:
'Inter Tight'
,
sans-serif
;
$textcolor
:
#000000
;
$linkcolor
:
#d66853
;
...
...
@@ -87,28 +89,29 @@ iframe, video {
}
body
{
height
:
100%
;
background-color
:
white
;
margin
:
0
;
padding
:
0
;
line-height
:
1
.35
;
font-size
:
1
.9rem
;
font-weight
:
400
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
width
:
100%
;
@media
screen
and
(
max-width
:
600px
)
{
font-size
:
1
.6rem
;
}
height
:
100%
;
background-color
:
white
;
margin
:
0
;
padding
:
0
;
line-height
:
1
.2
;
font-size
:
1
.75rem
;
font-weight
:
400
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
width
:
100%
;
@media
screen
and
(
max-width
:
600px
)
{
font-size
:
1
.6rem
;
}
}
h1
{
font-size
:
6
rem
;
font-size
:
9
rem
;
font-weight
:
700
;
font-family
:
$
SourceSan
s
;
font-family
:
$
Dosi
s
;
line-height
:
1
;
padding-top
:
0
.25em
;
text-align
:
left
;
//text-shadow:
1
px
1
px
1
px rgba(0,0,0,.
8
);
color
:
$textcolor
;
//text-shadow:
2
px
2
px
2
px rgba(0,0,0,.
1
);
color
:
$textcolor
;
@media
screen
and
(
max-width
:
600px
)
{
font-size
:
4
.75rem
;
}
...
...
@@ -128,10 +131,10 @@ h2{
}
h3
{
font-size
:
3rem
;
padding-top
:
1
em
;
padding-top
:
0
.5
em
;
padding-bottom
:
.25em
;
font-family
:
$
SourceSan
s
;
font-weight
:
6
00
;
font-family
:
$
Dosi
s
;
font-weight
:
4
00
;
color
:
$textcolor
;
@media
screen
and
(
max-width
:
600px
)
{
font-size
:
3
.2rem
;
...
...
This diff is collapsed.
Click to expand it.
src/components/VizTitle.vue
+
106
−
27
View file @
2eabdd94
<
template
>
<header
id=
"grid-container"
>
<div
id=
"
titl
e-container"
:class=
"
{ mobile: mobileView }"
>
<div
id=
"
imag
e-container"
>
<img
ref=
"heroImage"
id=
"title-image"
:class=
"
{ mobile: mobileView }"
src="@/assets/images/hero_img_cutout_less-stylized_feather.png"
alt="Social vulnerability and water insecurity"
@load="updateSvgDimensions"
/>
<img
ref=
"bwHeroImage"
id=
"bw-title-image"
:class=
"
{ mobile: mobileView }"
src="@/assets/images/hero_img_cutout_less-stylized_feather.png"
alt="Social vulnerability and water insecurity (grayscale)"
/>
<!-- Using svg masks with a circle shape to reveal color image where circles are on top of bw -->
<svg
ref=
"overlay"
id=
"overlay"
xmlns=
"http://www.w3.org/2000/svg"
>
<defs>
<mask
id=
"circleMask"
>
<rect
width=
"100%"
height=
"100%"
fill=
"white"
/>
<circle
cx=
"100"
cy=
"100"
r=
"50"
fill=
"black"
/>
<circle
cx=
"200"
cy=
"150"
r=
"30"
fill=
"black"
/>
<circle
cx=
"300"
cy=
"250"
r=
"90"
fill=
"black"
/>
<circle
cx=
"600"
cy=
"200"
r=
"50"
fill=
"black"
/>
<circle
cx=
"700"
cy=
"550"
r=
"100"
fill=
"black"
/>
<circle
cx=
"800"
cy=
"200"
r=
"70"
fill=
"black"
/>
<circle
cx=
"70"
cy=
"310"
r=
"50"
fill=
"black"
/>
<circle
cx=
"500"
cy=
"450"
r=
"130"
fill=
"black"
/>
<circle
cx=
"420"
cy=
"180"
r=
"40"
fill=
"black"
/>
<circle
cx=
"600"
cy=
"200"
r=
"75"
fill=
"black"
/>
<circle
cx=
"700"
cy=
"350"
r=
"130"
fill=
"black"
/>
<circle
cx=
"800"
cy=
"20"
r=
"110"
fill=
"black"
/>
</mask>
</defs>
</svg>
</div>
<div
id=
"text-container"
>
<h1>
Unequal access to water
</h1>
<h3>
How societal factors shape
exposure to water-related hazards, likelihood to suffer harm, and ability to cope and recover from losses
How societal factors shape
vulnerability to water insecurity
</h3>
</div>
</div>
</header>
</
template
>
<
script
setup
>
import
{
ref
}
from
'
vue
'
;
import
{
ref
,
onMounted
,
watch
}
from
'
vue
'
;
import
{
isMobile
}
from
'
mobile-device-detect
'
;
const
mobileView
=
ref
(
isMobile
);
const
heroImage
=
ref
(
null
);
const
bwHeroImage
=
ref
(
null
);
const
overlay
=
ref
(
null
);
const
updateSvgDimensions
=
()
=>
{
if
(
heroImage
.
value
&&
bwHeroImage
.
value
&&
overlay
.
value
)
{
const
{
width
,
height
}
=
heroImage
.
value
.
getBoundingClientRect
();
overlay
.
value
.
setAttribute
(
'
width
'
,
width
);
overlay
.
value
.
setAttribute
(
'
height
'
,
height
);
bwHeroImage
.
value
.
style
.
width
=
`
${
width
}
px`
;
bwHeroImage
.
value
.
style
.
height
=
`
${
height
}
px`
;
bwHeroImage
.
value
.
style
.
top
=
'
0
'
;
bwHeroImage
.
value
.
style
.
left
=
'
0
'
;
}
};
onMounted
(()
=>
{
updateSvgDimensions
();
window
.
addEventListener
(
'
resize
'
,
updateSvgDimensions
);
});
watch
(
mobileView
,
()
=>
{
updateSvgDimensions
();
});
</
script
>
<
style
lang=
"scss"
scoped
>
#grid-container
{
display
:
grid
;
padding
:
0px
0
;
gap
:
0px
;
grid-template-columns
:
1fr
;
grid-template-areas
:
"title"
;
grid-template-rows
:
auto
auto
;
width
:
100vw
;
justify-content
:
center
;
margin
:
auto
;
@media
screen
and
(
max-width
:
600px
)
{
padding
:
0
0
20px
;
grid-template-columns
:
100%
;
grid-template-rows
:
max-content
max-content
;
}
}
#title-container
{
grid-area
:
title
;
text-align
:
center
;
#image-container
{
position
:
relative
;
width
:
100%
;
}
#title-image
,
#bw-title-image
{
width
:
100%
;
}
#title-image
{
width
:
100vw
;
max-width
:
100%
;
margin
:
auto
;
display
:
block
;
}
#bw-title-image
{
filter
:
grayscale
(
100%
);
position
:
absolute
;
top
:
0
;
left
:
0
;
pointer-events
:
none
;
/* Ensure the grayscale image doesn't interfere with other interactions */
mask
:
url(#circleMask)
;
/* Apply the SVG mask */
}
h1
,
h3
{
margin-left
:
50px
;
margin-right
:
50px
;
margin-top
:
20px
;
text-align
:
left
;
#overlay
{
position
:
absolute
;
top
:
0
;
left
:
0
;
pointer-events
:
none
;
/* Ensure the SVG overlay doesn't interfere with other interactions */
}
#text-container
{
width
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
0
.95
);
color
:
black
;
padding
:
20px
;
box-sizing
:
border-box
;
}
#image-container
{
color
:
black
;
background
:
rgba
(
0
,
0
,
0
,
0
.95
);
}
h1
{
margin
:
-20px
20px
;
color
:
white
;
text-align
:
left
;
/* Optional: Align text to the left */
}
h3
{
margin
:
20px
20px
0px
20px
;
color
:
white
;
text-align
:
left
;
/* Optional: Align text to the left */
}
</
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment