Add tag manager container for link click tracking #6
@@ -21,6 +21,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon-layout:hover {
|
.icon-layout:hover {
|
||||||
color: #0FA0CE;
|
color: var(--nord12);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,19 +3,19 @@
|
|||||||
<h2>Social Media</h2>
|
<h2>Social Media</h2>
|
||||||
|
|
||||||
<div style="display: flex; justify-content: center; width: 100%">
|
<div style="display: flex; justify-content: center; width: 100%">
|
||||||
<div class="icon-layout" (click)="linkedInClicked()">
|
<div class="icon-layout" (click)="linkedInClicked()" (keydown.enter)="linkedInClicked()" tabindex="0">
|
||||||
<img src="../../assets/linked-in.png" class="icon" alt="LinkedIn">
|
<img src="../../assets/linked-in.png" class="icon" alt="LinkedIn" tabindex="-1">
|
||||||
<span class="icon-text">LinkedIn</span>
|
<span class="icon-text" tabindex="-1">LinkedIn</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="icon-layout" (click)="githubClicked()">
|
<div class="icon-layout" (click)="githubClicked()" (keydown.enter)="githubClicked()" tabindex="0">
|
||||||
<img src="../../assets/github.png" class="icon" alt="Github">
|
<img src="../../assets/github.png" class="icon" alt="Github" tabindex="-1">
|
||||||
<span class="icon-text">GitHub</span>
|
<span class="icon-text" tabindex="-1">GitHub</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="icon-layout" (click)="emailClicked()">
|
<div class="icon-layout" (click)="emailClicked()" (keydown.enter)="emailClicked()" tabindex="0">
|
||||||
<img src="../../assets/gmail.png" class="icon" alt="GMail">
|
<img src="../../assets/gmail.png" class="icon" alt="GMail" tabindex="-1">
|
||||||
<span class="icon-text">Email</span>
|
<span class="icon-text" tabindex="-1">Email</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="subtitle mt-2">Contact me to connect, collaborate or just to chat.</p>
|
<p class="subtitle mt-2">Contact me to connect, collaborate or just to chat.</p>
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import {RouterTestingModule} from '@angular/router/testing';
|
||||||
|
|
||||||
import { ContactComponent } from './contact.component';
|
import { ContactComponent } from './contact.component';
|
||||||
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
describe('ContactComponent', () => {
|
describe('ContactComponent', () => {
|
||||||
let component: ContactComponent;
|
let component: ContactComponent;
|
||||||
let fixture: ComponentFixture<ContactComponent>;
|
let fixture: ComponentFixture<ContactComponent>;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
|
const analytics = jasmine.createSpyObj('piwik', ['startTracking']);
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [ ContactComponent ]
|
imports: [
|
||||||
|
RouterTestingModule,
|
||||||
|
],
|
||||||
|
declarations: [ ContactComponent ],
|
||||||
|
providers: [
|
||||||
|
{ provide: Angulartics2, useValue: analytics },
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {AfterContentInit, Component, OnInit} from '@angular/core';
|
import {AfterContentInit, Component, OnInit} from '@angular/core';
|
||||||
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-contact',
|
selector: 'app-contact',
|
||||||
@@ -7,21 +8,34 @@ import {AfterContentInit, Component, OnInit} from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class ContactComponent implements AfterContentInit {
|
export class ContactComponent implements AfterContentInit {
|
||||||
|
|
||||||
constructor() {
|
constructor(private analytics: Angulartics2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterContentInit(): void {
|
ngAfterContentInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
linkedInClicked() {
|
linkedInClicked() {
|
||||||
|
this.analytics.eventTrack.next(this.linkClickEvent('LinkedIn'));
|
||||||
window.open('https://www.linkedin.com/in/cameron-cordes-3b166583/');
|
window.open('https://www.linkedin.com/in/cameron-cordes-3b166583/');
|
||||||
}
|
}
|
||||||
|
|
||||||
githubClicked() {
|
githubClicked() {
|
||||||
|
this.analytics.eventTrack.next(this.linkClickEvent('GitHub'));
|
||||||
window.open('https://github.com/Stampede10343');
|
window.open('https://github.com/Stampede10343');
|
||||||
}
|
}
|
||||||
|
|
||||||
emailClicked() {
|
emailClicked() {
|
||||||
|
this.analytics.eventTrack.next(this.linkClickEvent('Email'));
|
||||||
window.open('mailto:cameronc.dev@gmail.com');
|
window.open('mailto:cameronc.dev@gmail.com');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private linkClickEvent(label: String): object {
|
||||||
|
return {
|
||||||
|
action: 'LinkClick',
|
||||||
|
properties: {
|
||||||
|
category: 'Contact',
|
||||||
|
label: label
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
span {
|
a {
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
-webkit-transition: color 300ms;
|
-webkit-transition: color 300ms;
|
||||||
@@ -8,13 +8,20 @@ span {
|
|||||||
transition: color 300ms;
|
transition: color 300ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
span:hover {
|
a:hover {
|
||||||
color: var(--nord7);
|
color: var(--nord13);
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 425px) {
|
@media (max-width: 425px) {
|
||||||
span {
|
a {
|
||||||
font-size: 14px;
|
font-size: 15px;
|
||||||
|
margin-left: .8em;
|
||||||
|
margin-right: .8em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--nord4);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<mat-sidenav-container>
|
|
||||||
<mat-toolbar>
|
<mat-toolbar>
|
||||||
<span routerLink="/home" routerLinkActive="active">Home</span>
|
<mat-toolbar-row>
|
||||||
<span routerLink="/resume" routerLinkActive="active">Resume</span>
|
<a routerLink="/home" routerLinkActive="active">Home</a>
|
||||||
<span routerLink="/projects" routerLinkActive="active">Projects</span>
|
<a routerLink="/resume" routerLinkActive="active">Resume</a>
|
||||||
<span routerLink="/contact" routerLinkActive="active">Contact</span>
|
<a routerLink="/projects" routerLinkActive="active">Projects</a>
|
||||||
|
<a routerLink="/contact" routerLinkActive="active">Contact</a>
|
||||||
|
</mat-toolbar-row>
|
||||||
</mat-toolbar>
|
</mat-toolbar>
|
||||||
</mat-sidenav-container>
|
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ describe('ToolbarComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a material toolbar', () => {
|
it('should contain a material toolbar', () => {
|
||||||
expect(fixture.debugElement.children[0].nativeElement.className).toBe('mat-drawer-container mat-sidenav-container');
|
expect(fixture.debugElement.children[0].nativeElement.className).toBe('mat-toolbar mat-toolbar-multiple-rows');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain 4 links, Home, Resume, Projects, Contact', () => {
|
it('should contain 4 links, Home, Resume, Projects, Contact', () => {
|
||||||
const debugElements = fixture.debugElement.queryAll((element) => {
|
const debugElements = fixture.debugElement.queryAll((element) => {
|
||||||
return element.nativeElement.className.indexOf('mat-toolbar') !== -1;
|
return element.nativeElement.className.indexOf('mat-toolbar-row') !== -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(debugElements[0].children.length).toBe(4);
|
expect(debugElements[0].children.length).toBe(4);
|
||||||
|
|||||||
@@ -26,6 +26,12 @@
|
|||||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var _mtm = window._mtm = window._mtm || [];
|
||||||
|
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
|
||||||
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
|
g.type='text/javascript'; g.async=true; g.src='https://matomo.cameroncordes.me/js/container_mhU560vd.js'; s.parentNode.insertBefore(g,s);
|
||||||
|
</script>
|
||||||
<!-- End Piwik Code -->
|
<!-- End Piwik Code -->
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
@import "~@angular/material/prebuilt-themes/pink-bluegrey.css";
|
@import "~@angular/material/prebuilt-themes/pink-bluegrey.css";
|
||||||
|
|
||||||
h1, h2, h3, p, span {
|
h1, h2, h3, p, span, a {
|
||||||
font-family: Roboto, "Helvetica Neue", sans-serif;
|
font-family: Roboto, "Helvetica Neue", sans-serif;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
@@ -114,5 +114,5 @@ html, body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
color: var(--nord7);
|
color: var(--nord7) !important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user