Skip to content

Commit 5ced7b8

Browse files
committed
first round of codekit
1 parent a6ab64a commit 5ced7b8

File tree

8 files changed

+3111
-924
lines changed

8 files changed

+3111
-924
lines changed

config.codekit3

Lines changed: 3022 additions & 0 deletions
Large diffs are not rendered by default.

css/site.css

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 9 additions & 891 deletions
Large diffs are not rendered by default.

js/partials/_vue.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ var app = new Vue({
116116
},
117117

118118
diagnosis: {
119+
sanityScore: -1,
119120
showHow: false
120121
}
121122
},
@@ -400,6 +401,17 @@ var app = new Vue({
400401
}
401402

402403
},
404+
405+
determineSanity() {
406+
const self = this;
407+
const sanityBarrier = 50; // const yourScore = Math.floor(Math.random() * 100);
408+
self.ui.diagnosis.sanityScore = Math.floor(Math.random() * 100);
409+
if (self.ui.diagnosis.sanityScore < sanityBarrier) {
410+
current.diagnosis = "INSANE";
411+
} else {
412+
current.diagnosis = "SANE";
413+
}
414+
},
403415

404416

405417
showHow() {
@@ -618,6 +630,8 @@ var app = new Vue({
618630
return 0;
619631
});
620632

633+
self.determineSanity();
634+
621635
// self.ui.sortCities.cities.forEach(function(element, key) {
622636
// element.score = 0;
623637
// });

js/site.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@
22
//@prepros-append partials/_variables.js
33
//@prepros-append partials/_questions.js
44

5-
//@prepros-append partials/_vue.js
5+
//@prepros-append partials/_vue.js
6+
7+
8+
// function calculateSanity() {
9+
// const sanityBarrier = 50;
10+
// const yourScore = Math.floor(Math.random() * 100);
11+
// // self.ui.diagnosis.sanityScore = Math.floor(Math.random() * 100);
12+
13+
// if (yourScore < sanityBarrier) {
14+
// current.diagnosis = "INSANE";
15+
// } else {
16+
// current.diagnosis = "SANE";
17+
// }
18+
// }

pug/index.pug

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ html(lang="en")
2222
p In an effort to make our determination, we will ask you a series of questions. We will not make it easy to answer. Expect things to get uncomfortable.
2323
p When you are ready, click the button below.
2424
.button-holder
25-
button.begin(type="button" @click="current.interface = 'questions'") BEGIN
25+
button.begin(type="button" @click="current.interface = 'questions'") Begin The Exam
2626

2727
main.questions(v-if="current.interface == 'questions'" style="min-height:100vh; display:flex; align-items:end; justify-content:center; padding:4rem;")
2828
.inner
@@ -70,30 +70,6 @@ html(lang="en")
7070
template(v-if="current.question == 20")
7171
include questions/_sort-cities.pug
7272

73-
main.outro(v-if="current.interface == 'outro'")
74-
75-
.inner
76-
section.diagnosis
77-
dl.diagnosis
78-
dt Your diagnosis
79-
dd
80-
.sticker-holder
81-
.sticker {{current.diagnosis}}
82-
.button-holder(v-if="!ui.diagnosis.showHow")
83-
button(type="button" @click="showHow()") How was this determined?
84-
85-
section.how(v-if="ui.diagnosis.showHow")
86-
dl
87-
dt Q: How was this determined?
88-
dd A: Randomly.
89-
pre
90-
code(class="language-js").
91-
const sanityBarrier = 50;
92-
const yourScore = Math.floor(Math.random() * 100);
93-
if (yourScore < sanityBarrier) {
94-
current.diagnosis = "INSANE";
95-
} else {
96-
current.diagnosis = "SANE";
97-
}
73+
include screens/_outro.pug
9874

9975
include partials/_javascripts

pug/screens/_outro.pug

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.outro(v-if="current.interface == 'outro'")
2+
3+
header.diagnosis-header
4+
.sticker {{current.diagnosis}}
5+
.diagnosis-text
6+
.text #[strong {{answers.yourName}}], our scientific algorith has determined that you are #[code {{ui.diagnosis.sanityScore +'%' }}] sane.
7+
.button-holder
8+
a.button Buy A Sticker
9+
main
10+
.inner
11+
//- section.diagnosis
12+
//- dl.diagnosis
13+
//- dt Your diagnosis:
14+
//- dd
15+
//- .sticker-holder
16+
//- .sticker
17+
//- .button-holder(v-if="!ui.diagnosis.showHow")
18+
//- button(type="button" @click="showHow()") How was this determined?
19+
20+
section.how(v-if="ui.diagnosis.showHow")
21+
dl
22+
dt Q: How was this determined?
23+
dd
24+
p A: #[strong Randomly].
25+
p
26+
| After completing the exam, you were randomly assigned a #[code sanityScore] of #[code {{ui.diagnosis.sanityScore +'%' }}]. This assigned you the ranking of #[strong {{current.diagnosis}}].
27+
p
28+
| None of your exam questions were considered when assigning your #[code sanityScore].
29+
//- p Matter of fact, your sanity was scored like this...
30+
pre
31+
code(class="language-js").
32+
function calculateSanity() {
33+
const sanityBarrier = 50;
34+
const sanityScore = Math.floor(Math.random() * 100);
35+
if (sanityScore < sanityBarrier) {
36+
current.diagnosis = "INSANE";
37+
} else {
38+
current.diagnosis = "SANE";
39+
}
40+
}
41+
p If you'd like, you can recalculate your score.

scss/screens/_outro.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
main.outro { min-height: 100vh; background:white; color:black; min-height:100vh; display:flex; align-items:center; justify-content:center; padding:4rem;
1+
.outro { min-height: 100vh; background:white; color:black; min-height:100vh; display:flex; align-items:center; justify-content:center; padding:4rem;
22

3-
dl {
4-
dt { text-transform: uppercase; font-weight: $semibold; letter-spacing: 0.1em; }
3+
header.outro { @include position(fixed,0,0,null,0); }
4+
dl { font-size:1.25rem;
5+
dt { text-transform: uppercase; font-weight: $semibold; letter-spacing: 0.1em; font-size:110%; }
56
.sticker-holder { text-align: center; }
7+
p { margin-bottom: 1.5em;
8+
code { background:rgba(0,0,0,0.1); color:#c31111; padding-left: 0.25em; padding-right: 0.25em; }
9+
}
610
}
711

812
.button-holder { text-align: center; padding-top:$gap;
@@ -15,5 +19,5 @@ main.outro { min-height: 100vh; background:white; color:black; min-height:100vh;
1519

1620

1721
.sticker { background: red; font-size:10vw; color:white; text-shadow: 1px 1px 1px black, -1px -1px 1px black; display: inline-block; padding:0 0.25em; line-height: 100%; font-weight: 900; }
18-
code { font-size: 2.25em;}
22+
// code { font-size: 2.25em;}
1923
}

0 commit comments

Comments
 (0)