Add hover link to contact element
This commit is contained in:
parent
c9f14cd078
commit
73003b5b17
5 changed files with 33 additions and 22 deletions
|
|
@ -14,7 +14,10 @@ export const Contact = ({
|
||||||
lastEditText: string;
|
lastEditText: string;
|
||||||
}): html => `
|
}): html => `
|
||||||
<section id="contact">
|
<section id="contact">
|
||||||
<h2>${title}</h2>
|
|
||||||
|
<h2>
|
||||||
|
<a href="#contact">${title}</a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
<div class="links">
|
<div class="links">
|
||||||
${links.join('')}
|
${links.join('')}
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,18 @@
|
||||||
|
|
||||||
#contact {
|
#contact {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: var(--large-margin);
|
margin: var(--large-margin) auto 0 auto;
|
||||||
|
|
||||||
> h2 {
|
> h2 {
|
||||||
@include title-font();
|
margin-bottom: var(--normal-margin);
|
||||||
|
|
||||||
|
> a {
|
||||||
|
@include title-font();
|
||||||
|
@include title-fragment-link();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .links {
|
> .links {
|
||||||
margin: var(--normal-margin) 0 0 var(--normal-margin);
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ export const generate = (
|
||||||
{ date, title, description, more, links }: TimelineElementParameters,
|
{ date, title, description, more, links }: TimelineElementParameters,
|
||||||
showMore: string
|
showMore: string
|
||||||
): html => `
|
): html => `
|
||||||
<article id="${titleToFragment(title).replace('#', '')}" class="timeline-element">
|
<section id="${titleToFragment(title).replace('#', '')}" class="timeline-element">
|
||||||
<div class="line-container">
|
<div class="line-container">
|
||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
<p class="date">${date}</p>
|
<p class="date">${date}</p>
|
||||||
|
|
@ -44,5 +44,5 @@ export const generate = (
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</section>
|
||||||
`;
|
`;
|
||||||
|
|
|
||||||
|
|
@ -113,22 +113,7 @@
|
||||||
|
|
||||||
> a {
|
> a {
|
||||||
@include sub-title-font();
|
@include sub-title-font();
|
||||||
text-decoration: none;
|
@include title-fragment-link();
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
content: '#';
|
|
||||||
position: absolute;
|
|
||||||
left: -0.5ch;
|
|
||||||
top: 0;
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(-100%);
|
|
||||||
transition: opacity var(--transition-time);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover:before {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,25 @@ $breakpoint-width: 925px !default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin title-fragment-link() {
|
||||||
|
text-decoration: none;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '#';
|
||||||
|
position: absolute;
|
||||||
|
left: -0.5ch;
|
||||||
|
top: 0;
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-100%);
|
||||||
|
transition: opacity var(--transition-time);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover:before {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@mixin center-children() {
|
@mixin center-children() {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue