Skip to content

Commit

Permalink
mar 14 soft push
Browse files Browse the repository at this point in the history
  • Loading branch information
AHY123 committed Mar 14, 2024
1 parent 20f1c19 commit a06c5b7
Show file tree
Hide file tree
Showing 12 changed files with 5,136 additions and 261 deletions.
3,052 changes: 3,052 additions & 0 deletions python_notebooks/.ipynb_checkpoints/transistors-checkpoint.ipynb

Large diffs are not rendered by default.

1,843 changes: 1,733 additions & 110 deletions python_notebooks/transistors.ipynb

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
<style>
html {
overflow: auto;
scroll-snap-type: y mandatory;
}
</style>
121 changes: 121 additions & 0 deletions src/components/GenericLabelText.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<script>
import * as d3 from "d3";
import { fade } from "svelte/transition";
export let index;
export let fadeIn;
export let fadeOut;
export let title = "";
export let left = "";
export let right = "";
export let left_title = "";
export let right_title = "";
let startFadeIn = true;
let startFadeOut = false;
let remove = false;
$: {
console.log(index)
if (index > fadeOut) {
remove = true;
startFadeIn = false;
startFadeOut = false;
}
else {
remove = false;
if (index == fadeIn) {
console.log('start fade in')
startFadeIn = true;
startFadeOut = false;
}
if (index == fadeOut) {
console.log('start fade out')
startFadeIn = false;
startFadeOut = true;
}
}
}
</script>

<div class="container" class:fadeIn={startFadeIn} class:fadeOut={startFadeOut} class:remove={remove}>
<h1>{title}</h1>
<div class="body">
<div class="col left">
<h2>{left_title}</h2>
<p>{left}</p>
</div>
<div class="col mid" />
<div class="col right">
<h2>{right_title}</h2>
<p>{right}</p>
</div>
</div>
</div>

<style>
h1 {
font-size: 36px;
}
h2 {
font-size: 24px;
height: 10%;
}
p {
font-size: 18px;
height: 90%;
}
.body {
display: flex;
height: 100vh;
width: 100%;
}
.col {
padding: 20px;
width: 20%;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
/* outline: magenta solid 3px; */
}
.col.mid {
width: 60%;
}
.container {
width: 100%;
height: 100%;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
visibility: visible;
}
.container.fadeIn {
animation: fadeIn 1s;
animation-fill-mode: forwards;
}
.container.fadeOut {
animation: fadeOut 1s;
animation-fill-mode: forwards;
}
.container.remove {
display: none;
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
</style>
30 changes: 30 additions & 0 deletions src/components/GenericSubtitle.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<script>
export let text;
</script>

<div class='container'>
<h1>
{text.subtitle}
</h1>
<h2>
{text.text}
</h2>
</div>

<style>
h1 {
font-size: 90px;
}
h2 {
font-size: 50px;
}
.container {
width: 100%;
height: 80%;
display: flex;
flex-flow: column wrap;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
visibility: visible;
}
</style>
120 changes: 12 additions & 108 deletions src/components/GenericText.svelte
Original file line number Diff line number Diff line change
@@ -1,121 +1,25 @@
<script>
import * as d3 from "d3";
import { fade } from "svelte/transition";
export let index;
export let fadeIn;
export let fadeOut;
export let title = "";
export let left = "";
export let right = "";
export let left_title = "";
export let right_title = "";
let startFadeIn = true;
let startFadeOut = false;
let remove = false;
$: {
console.log(index)
if (index > fadeOut) {
remove = true;
startFadeIn = false;
startFadeOut = false;
}
else {
remove = false;
if (index == fadeIn) {
console.log('start fade in')
startFadeIn = true;
startFadeOut = false;
}
if (index == fadeOut) {
console.log('start fade out')
startFadeIn = false;
startFadeOut = true;
}
}
}
export let text;
</script>

<div class="container" class:fadeIn={startFadeIn} class:fadeOut={startFadeOut} class:remove={remove}>
<h1>{title}</h1>
<div class="body">
<div class="col left">
<h2>{left_title}</h2>
<p>{left}</p>
</div>
<div class="col mid" />
<div class="col right">
<h2>{right_title}</h2>
<p>{right}</p>
</div>
</div>
<div class='container'>
<p>
{text.text}
</p>
</div>

<style>
h1 {
font-size: 36px;
}
h2 {
font-size: 24px;
height: 10%;
}
p {
font-size: 18px;
height: 90%;
}
.body {
display: flex;
height: 100vh;
width: 100%;
}
.col {
padding: 20px;
width: 20%;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
/* outline: magenta solid 3px; */
}
.col.mid {
width: 60%;
font-size: 32px;
text-wrap: balance;
}
.container {
width: 100%;
height: 100%;
height: 80%;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
flex-flow: column wrap;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
visibility: visible;
}
.container.fadeIn {
animation: fadeIn 1s;
animation-fill-mode: forwards;
}
.container.fadeOut {
animation: fadeOut 1s;
animation-fill-mode: forwards;
}
.container.remove {
display: none;
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
</style>
</style>
83 changes: 83 additions & 0 deletions src/components/ScrollyTester.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<script>
import Scroller from "@sveltejs/svelte-scroller";
let count,
index,
offset,
progress = 0;
let lol = [0, 1, 2, 3, 4, 5]
</script>

<main>
<Scroller
top={0.0}
bottom={1}
threshold={0.55}
bind:count
bind:index
bind:offset
bind:progress
>
<div class="foreground" slot="foreground">
<!-- <div> -->
{#each lol as i}
<section>{i}</section>
{/each}
<!-- </div> -->
</div>
<div class="background" slot="background">
<div class="progress-bars">
<p>current section: <strong>{index + 1}/{count}</strong></p>
<progress value={count ? (index + 1) / count : 0} />
<p>offset in current section</p>
<progress value={offset || 0} />
<p>total progress</p>
<progress value={progress || 0} />
</div>
</div>
</Scroller>
</main>
<style>
main {
font-family: "Lato", sans-serif;
}
.foreground {
height: 100vh;
width: 70%;
margin: 0 auto;
/* height: auto; */
/* position: relative; */
/* overflow: auto;
scroll-snap-type: y mandatory; */
}
.background {
width: 100%;
height: 100vh;
position: relative;
display: flex;
justify-content: center;
align-items: center;
flex-flow: column wrap;
}
section {
height: 99vh;
background-color: rgba(0, 0, 0, 0);
color: white;
text-align: center;
max-width: 1000%;
color: black;
padding: 1em;
margin: 0 0 2em 0;
align-items: center;
position: sticky;
top: 10%;
outline: magenta solid 3px;
}
section {
scroll-snap-align: start;
}
</style>
Loading

0 comments on commit a06c5b7

Please sign in to comment.