Skip to content

Commit 52f5bce

Browse files
committed
GH-202: Add 3NF transitions
1 parent 4a3b2b3 commit 52f5bce

File tree

3 files changed

+99
-23
lines changed

3 files changed

+99
-23
lines changed

src/_static/scss/presentation-common.scss

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
}
4242
}
4343

44+
/* transitions */
45+
$transition-default: 2000ms;
46+
4447
/* colors */
4548
// todo: adjust colors
4649
$background: #212121;
@@ -137,11 +140,15 @@ $step-width: 1800px;
137140
.db-table {
138141
width: 75%;
139142

140-
margin: auto auto 20px;
143+
margin-bottom: 20px;
141144

142145
font-family: Monospaced, monospace;
143146
font-size: $base-font-size * 0.75;
144147

148+
.primary-key {
149+
background-color: rgba(125, 125, 125, 0.1);
150+
}
151+
145152
th, td {
146153
padding: 1svh 3svw;
147154
}
@@ -161,3 +168,36 @@ $step-width: 1800px;
161168
padding: 0 20px;
162169
}
163170
}
171+
172+
/* 4th dimension */
173+
#impress {
174+
.future {
175+
.fade-in {
176+
opacity: 0.0;
177+
}
178+
.fly-in {
179+
opacity: 0.0;
180+
transform: translateY(2200px);
181+
}
182+
}
183+
184+
.present {
185+
.fade-in {
186+
opacity: 1.0;
187+
transition: $transition-default;
188+
}
189+
.fly-in {
190+
opacity: 1.0;
191+
transform: translateY(0px);
192+
transition: $transition-default;
193+
}
194+
}
195+
196+
.past {
197+
.fade-out {
198+
opacity: 0.0;
199+
transition: $transition-default;
200+
}
201+
}
202+
203+
}

src/_static/scss/presentation-normalization.scss

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
.requirements {
1010
h3 {
1111
@extend .text-start;
12+
text-decoration: underline;
1213
}
1314
}
1415

@@ -34,5 +35,40 @@
3435
grid-template-columns: repeat(2, 1fr);
3536
grid-column-gap: 20px;
3637
align-items: start;
38+
39+
table {
40+
margin: 30px auto;
41+
}
42+
}
43+
44+
#table--3nf.future {
45+
section:first-of-type {
46+
.fly-in {
47+
transform: translateY(-2200px);
48+
}
49+
}
50+
51+
section:last-of-type {
52+
.fly-in {
53+
transform: translateY(2200px);
54+
}
55+
}
56+
57+
section {
58+
.fly-in {
59+
opacity: 0.0;
60+
}
61+
}
62+
}
63+
64+
#table--3nf.present {
65+
section {
66+
.fly-in {
67+
transform: translateY(0px);
68+
opacity: 1.0;
69+
transition: $transition-default;
70+
transition-delay: 1000ms;
71+
}
72+
}
3773
}
3874
}

src/pres/normalization/index.html

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,12 @@ <h2>Requirements</h2>
633633
data-x="-3000"
634634
data-y="750"
635635
data-rotate-z="15">
636-
<h2>Third normal form</h2>
637-
<section>
636+
<h2 class="fade-in">Third normal form</h2>
637+
<section class="fly-in">
638638
<h3>Requirements</h3>
639639
<ul>
640640
<li>
641-
Every non-key attribute in a table should depend on the key, the whole key, and nothing but the key
641+
Every non-key attribute in a table should depend on the key, the whole key, and nothing but the key.
642642
</li>
643643
</ul>
644644
</section>
@@ -648,7 +648,7 @@ <h3>Requirements</h3>
648648
data-rel-position="relative"
649649
data-rel-x="0"
650650
data-rel-y="2000">
651-
<section>
651+
<section class="fade-in fade-out">
652652
<table class="db-table" aria-label="data">
653653
<caption>Player Level</caption>
654654
<thead>
@@ -683,7 +683,7 @@ <h3>Requirements</h3>
683683
data-rel-position="relative"
684684
data-rel-x="0"
685685
data-rel-y="-1000">
686-
<div>
686+
<section class="fade-in">
687687
<div class="text-center fly-in">
688688
<i class="i-fail"></i><code>{ username } <-- { level }</code>
689689
</div>
@@ -698,20 +698,20 @@ <h3>Requirements</h3>
698698
<tbody>
699699
<tr id="table--3nf__prombery87">
700700
<td class="primary-key">prombery87</td>
701-
<td>7</td>
701+
<td class="text-center">7</td>
702702
</tr>
703703
<tr id="table--3nf__wheed1997">
704704
<td class="primary-key">wheed1997</td>
705-
<td>6</td>
705+
<td class="text-center">6</td>
706706
</tr>
707707
<tr id="table--3nf__acen1999">
708708
<td class="primary-key">acen1999</td>
709-
<td>1</td>
709+
<td class="text-center">1</td>
710710
</tr>
711711
</tbody>
712712
</table>
713-
</div>
714-
<div>
713+
</section>
714+
<section class="fade-in">
715715
<table class="db-table" aria-label="data">
716716
<caption>Level Ranking</caption>
717717
<thead>
@@ -722,54 +722,54 @@ <h3>Requirements</h3>
722722
</thead>
723723
<tbody>
724724
<tr id="table--3nf__level-1">
725-
<td>1</td>
725+
<td class="primary-key">1</td>
726726
<td>Beginner</td>
727727
</tr>
728728
<tr id="table--3nf__level-2">
729-
<td>2</td>
729+
<td class="primary-key">2</td>
730730
<td>Beginner</td>
731731
</tr>
732732
<tr id="table--3nf__level-3">
733-
<td>3</td>
733+
<td class="primary-key">3</td>
734734
<td>Beginner</td>
735735
</tr>
736736
<tr id="table--3nf__level-4">
737-
<td>4</td>
737+
<td class="primary-key">4</td>
738738
<td>Intermediate</td>
739739
</tr>
740740
<tr id="table--3nf__level-5">
741-
<td>5</td>
741+
<td class="primary-key">5</td>
742742
<td>Intermediate</td>
743743
</tr>
744744
<tr id="table--3nf__level-6">
745-
<td>6</td>
745+
<td class="primary-key">6</td>
746746
<td>Intermediate</td>
747747
</tr>
748748
<tr id="table--3nf__level-7">
749-
<td>7</td>
749+
<td class="primary-key">7</td>
750750
<td>Advanced</td>
751751
</tr>
752752
<tr id="table--3nf__level-8">
753-
<td>8</td>
753+
<td class="primary-key">8</td>
754754
<td>Advanced</td>
755755
</tr>
756756
<tr id="table--3nf__level-9">
757-
<td>9</td>
757+
<td class="primary-key">9</td>
758758
<td>Advanced</td>
759759
</tr>
760760
</tbody>
761761
</table>
762762
<div class="text-center fly-in">
763763
<i class="i-pass"></i><code>{ level } <-- { rank }</code>
764764
</div>
765-
</div>
765+
</section>
766766
</div>
767767

768768
<div class="step overview" id="overview--3nf"
769769
data-rel-position="relative"
770770
data-rel-x="0"
771-
data-rel-y="450"
772-
data-scale="3">
771+
data-rel-y="-350"
772+
data-scale="2">
773773
</div>
774774
<!-- overview -->
775775
<div class="step overview" id="overview" data-rel-position="absolute" data-x="0" data-y="0" data-scale="7"></div>

0 commit comments

Comments
 (0)