Skip to content

Commit

Permalink
Merge pull request #69 from project-callisto/content-and-flow
Browse files Browse the repository at this point in the history
general frontend implementation
  • Loading branch information
coilysiren authored Mar 8, 2018
2 parents 1f127e1 + a95b9c1 commit ba0858b
Show file tree
Hide file tree
Showing 15 changed files with 172 additions and 356 deletions.
2 changes: 2 additions & 0 deletions client/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { FourthStepComponent } from "./fourth-step.component";
import { GraphComponent } from "./graph.component";
import { HeaderComponent } from "./header.component";
import { IntroComponent } from "./intro.component";
import { NavComponent } from "./nav.component";
import { SecondStepComponent } from "./second-step.component";
import { CryptoService } from "./services/crypto.service";
import { SixthStepComponent } from "./sixth-step.component";
Expand All @@ -29,6 +30,7 @@ import { ThirdStepComponent } from "./third-step.component";
GraphComponent,
IntroComponent,
SummaryStepComponent,
NavComponent,
],
imports: [
BrowserModule,
Expand Down
26 changes: 26 additions & 0 deletions client/app/nav.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Component, Input } from "@angular/core";

@Component({
selector: "step-nav",
templateUrl: "./templates/nav.component.html",
styleUrls: [
"./styles/base.scss",
"./styles/nav.scss",
],
})
export class NavComponent {
@Input() public sectionStep: number = 0;
private maxSteps: number = 6;
private Array: ArrayConstructor = Array; // angular templates dont have Array by default

private stepToID(key: number): string {
return "#" + [
"first-step",
"second-step",
"third-step",
"fourth-step",
"fifth-step",
"sixth-step",
][key];
}
}
4 changes: 2 additions & 2 deletions client/app/styles/_meta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ $palette-dark-blue: #385C6C;

// specific purpose colors
$color-step-headers: #4F4F4F;
$color-explainer-text: gray(79);
$color-section-background: #F1F3F4;
$color-paragraph-text: gray(79);
$color-article-background: #F1F3F4;
$color-header-background: gray(62);
$color-code-background: gray(238);
$color-code-border: gray(204);
Expand Down
52 changes: 52 additions & 0 deletions client/app/styles/nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@import "_meta";

.step-display {
list-style: none;
display: flex;
justify-content: center;
margin: 0 0 20px;
padding: 0;
}

a {
text-transform: uppercase;
text-decoration: none;
white-space: nowrap;
padding: 10px;
color: $palette-dark-blue;
background-color: $palette-white;
font-size: 0.85rem;
letter-spacing: 1px;
border: 1px solid $palette-dark-blue;
}

.activated-step a {
color: $palette-white;
background-color: $palette-dark-blue;
}

.activated-step a:hover,
.activated-step a:active,
.activated-step a:focus,
a:hover,
a:active,
a:focus {
color: $palette-dark-blue;
background-color: $color-step-hover-background;
border-color: $color-step-hover-border;
}

li {
margin: 15px 0;
}

li:not(:last-child) {
margin-right: 20px;
}


.step-explainer {
@media (max-width: $breakpoint-md) {
display: none;
}
}
62 changes: 4 additions & 58 deletions client/app/styles/step.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,15 @@ code {
font-family: "Courier New", monospace;
}

.rid-display {
text-align: center;
}

.subtext {
font-size: 0.85rem;
color: $color-text-faded;
letter-spacing: 1px;
}

.explainer, p {
p {
font-family: $font-body;
color: $color-explainer-text;
color: $color-paragraph-text;
letter-spacing: 2px;
line-height: 30px;
margin: 20px 0;
Expand All @@ -71,10 +67,10 @@ input {
border: 1px solid $color-code-border;
}

section {
article {
margin: 60px 15%;
padding: 40px;
background-color: $color-section-background;
background-color: $color-article-background;

@media (max-width: $breakpoint-sm) {
margin-left: 0;
Expand All @@ -92,56 +88,6 @@ section {
}
}

.step-explainer {
@media (max-width: $breakpoint-sm) {
display: none;
}
}

.step-display {
list-style: none;
display: flex;
justify-content: center;
margin: 0 0 20px;
padding: 0;

a {
text-transform: uppercase;
text-decoration: none;
white-space: nowrap;
padding: 10px;
color: $palette-dark-blue;
background-color: $palette-white;
font-size: 0.85rem;
letter-spacing: 1px;
border: 1px solid $palette-dark-blue;
}

.activated-step a {
color: $palette-white;
background-color: $palette-dark-blue;
}

.activated-step a:hover,
.activated-step a:active,
.activated-step a:focus,
a:hover,
a:active,
a:focus {
color: $palette-dark-blue;
background-color: $color-step-hover-background;
border-color: $color-step-hover-border;
}

li {
margin: 15px 0;
}

li:not(:last-child) {
margin-right: 20px;
}
}

.input-row {
display: flex;
align-items: center;
Expand Down
25 changes: 3 additions & 22 deletions client/app/templates/fifth-step.component.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
<section *ngIf="shown" id='fifth-step'>
<article *ngIf="shown" id='fifth-step'>
<h2 class="main-header text-centered">Matching</h2>
<ul class="step-display">
<li class="activated-step">
<a href="#first-step"><span class="step-explainer">STEP</span> 1</a>
</li>
<li class="activated-step">
<a href="#second-step"><span class="step-explainer">STEP</span> 2</a>
</li>
<li class="activated-step">
<a href="#third-step"><span class="step-explainer">STEP</span> 3</a>
</li>
<li class="activated-step">
<a href="#fourth-step"><span class="step-explainer">STEP</span> 4</a>
</li>
<li class="activated-step">
<a href="#fifth-step"><span class="step-explainer">STEP</span> 5</a>
</li>
<li>
<a href="#sixth-step"><span class="step-explainer">STEP</span> 6</a>
</li>
</ul>
<step-nav [sectionStep]=5></step-nav>

<p>Over time, different users will enter their information into Callisto. When two H(H(RID))s in the database match, the Options Counselor decrypts the secret values and uses those two shares to interpolate the line and reveal the y-intercept (the RID).</p>
<p>
Expand All @@ -46,4 +27,4 @@ <h2 class="main-header text-centered">Matching</h2>
<div class="align-right-on-large">
<button class="advance-button btn" (click)="advanceStep.emit();">next</button>
</div>
</section>
</article>
71 changes: 15 additions & 56 deletions client/app/templates/first-step.component.html
Original file line number Diff line number Diff line change
@@ -1,66 +1,25 @@
<section *ngIf="shown" id='first-step'>
<h2 class="main-header text-centered">User Inputs</h2>
<ul class="step-display">
<li class="activated-step">
<a href="#first-step"><span class="step-explainer">STEP</span> 1</a>
</li>
<li>
<a href="#second-step"><span class="step-explainer">STEP</span> 2</a>
</li>
<li>
<a href="#third-step"><span class="step-explainer">STEP</span> 3</a>
</li>
<li>
<a href="#fourth-step"><span class="step-explainer">STEP</span> 4</a>
</li>
<li>
<a href="#fifth-step"><span class="step-explainer">STEP</span> 5</a>
</li>
<li>
<a href="#sixth-step"><span class="step-explainer">STEP</span> 6</a>
</li>
</ul>

<article *ngIf="shown" id='first-step'>
<h2 id='first-step-h2' class="main-header text-centered">User Inputs</h2>
<step-nav [sectionStep]=1></step-nav>
<p>Our encryption method uses four key techniques: client-side encryption, oblivious pseudorandom function over an elliptic curve, secure multi-cloud key federation, and linear secret sharing. Our white paper explains these techniques in more detail. This demo focuses on highlighting client-side encryption and linear secret sharing. Data inputs will not be stored.</p>
<p>To begin, enter a user name and a perpetrator name.</p>

<form
class="perp-name-form"
action="#"
>
<p>To begin, enter a user name and a perpetrator name.</p>

<form class="perp-name-form" action="#">
<div class='input-row'>
<div>
<span class="subtext">ENTER USER NAME</span>
<input
#userInput
required
type="text"
id="userInput"
/>
<input #userInput required type="text" id="userInput" />
</div>
<div>
<span class="subtext">ENTER PERP NAME</span>
<input
#perpInput
required
type="text"
id="perpInput"
/>
<input #perpInput required type="text" id="perpInput" />
</div>
</div>

<p class="subtext">K<sub>RECORD</sub>, a randomly generated key to encrypt user name and perp name</p>
<code class='rid-display calc-display-value calc-display' id="calc-rid">{{ recordKey }}</code>

<div class="align-right-on-large">
<input
class="btn advance-button"
value="next"
type="submit"
(click)="perpSubmit($event, perpInput.value, userInput.value);"
/>
</div>

</div>
<p class="subtext">K<sub>RECORD</sub>, a randomly generated key to encrypt user name and perp name</p>
<code class='calc-display-value' id="calc-rid">{{ recordKey }}</code>
<div class="align-right-on-large">
<input class="btn advance-button" value="next" type="submit" (click)="perpSubmit($event, perpInput.value, userInput.value);" />
</div>
</form>
</section>

</article>
26 changes: 3 additions & 23 deletions client/app/templates/fourth-step.component.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
<section *ngIf="shown" id='fourth-step'>
<article *ngIf="shown" id='fourth-step'>
<h2 class="main-header text-centered">Encrypted Values</h2>
<ul class="step-display">
<li class="activated-step">
<a href="#first-step"><span class="step-explainer">STEP</span> 1</a>
</li>
<li class="activated-step">
<a href="#second-step"><span class="step-explainer">STEP</span> 2</a>
</li>
<li class="activated-step">
<a href="#third-step"><span class="step-explainer">STEP</span> 3</a>
</li>
<li class="activated-step">
<a href="#fourth-step"><span class="step-explainer">STEP</span> 4</a>
</li>
<li>
<a href="#fifth-step"><span class="step-explainer">STEP</span> 5</a>
</li>
<li>
<a href="#sixth-step"><span class="step-explainer">STEP</span> 6</a>
</li>
</ul>

<step-nav [sectionStep]=4></step-nav>
<p>The following values are now encrypted using the corresponding methods.</p>
<p>
<code>H(H(RID))</code>
Expand All @@ -46,4 +26,4 @@ <h2 class="main-header text-centered">Encrypted Values</h2>
<div class="align-right-on-large">
<button class="advance-button btn" (click)="advanceStep.emit();">next</button>
</div>
</section>
</article>
4 changes: 2 additions & 2 deletions client/app/templates/intro.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<section id='first-step'>
<article id='first-step'>
<h2 class="main-header text-centered">Introduction</h2>
<p><a href="https://projectcallisto.org">Callisto</a> is a nonprofit organization that detects serial predators of sexual assault and harassment. We do this by creating a reporting platform that allows victims to submit the identity of their perpetrators into a matching escrow; this information can only be decrypted by a Callisto Options Counselor (a lawyer) if another victim names the same perpetrator. If there is a match, the Options Counselor will decrypt the identity of the serial predator and matched victims, and will reach out to the victims to discuss their options towards pursuing justice. Information about these victims are also protected under attorney-client privilege.</p>
<p>It is critical that any reporting tool for sexual assault and harassment protects the data of both the victims and the accused. This demo application aims to show the advanced cryptographic techniques that Callisto uses to ensure a safe and trusted reporting experience.</p>
<p><b>For more details about our cryptography approach, read <a href="#">our technical white paper.</a></b></p>
<div class="align-right-on-large">
<button class="advance-button btn" (click)="advanceStep.emit();">next</button>
</div>
</section>
</article>
14 changes: 14 additions & 0 deletions client/app/templates/nav.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
navStep is 0 indexed
sectionStep is 1 indexed
stepToID is 0 indexed
user display is 1 indexed
-->
<ul class="step-display">
<li
*ngFor="let navStep of Array.from(Array(maxSteps).keys())"
[ngClass]="{'activated-step': (navStep + 1)===sectionStep}"
>
<a [href]="stepToID(navStep)"><span class="step-explainer">STEP</span> {{navStep + 1}}</a>
</li>
</ul>
Loading

0 comments on commit ba0858b

Please sign in to comment.