Skip to content

Commit

Permalink
first go at intro
Browse files Browse the repository at this point in the history
  • Loading branch information
jadiehm committed Aug 27, 2024
1 parent 0e4c220 commit 1271838
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 38 deletions.
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
},
"browserslist": "> 0.5%, last 4 versions, not ie <= 11, not ie_mob <= 11",
"dependencies": {
"@leveluptuts/svelte-fit": "^1.0.3",
"axios": "^1.6.7",
"fs": "^0.0.1-security",
"image-download": "^2.1.0",
Expand Down
8 changes: 6 additions & 2 deletions src/components/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import wordmark from "$svg/wordmark.svg";
import wordmark from "$svg/wordmark-blackletter.svg";
</script>

<header>
Expand Down Expand Up @@ -27,7 +27,11 @@
background-color: transparent;
}
:global(.wordmark svg) {
width: 100%;
}
:global(.wordmark svg path) {
fill: currentColor;
fill: var(--wine-tan);
}
</style>
68 changes: 35 additions & 33 deletions src/components/Index.svelte
Original file line number Diff line number Diff line change
@@ -1,56 +1,57 @@
<script>
import { getContext } from "svelte";
import { animalSelect, metricSelect } from "$stores/misc.js";
import PhotoTest from "$components/PhotoTest.svelte";
import Distribution from "$components/Distribution.svelte";
import Select from "$components/helpers/Select.svelte";
import Intro from "$components/Intro.svelte";
// import PhotoTest from "$components/PhotoTest.svelte";
// import Distribution from "$components/Distribution.svelte";
// import Select from "$components/helpers/Select.svelte";
import wineData_summary from "$data/wineData_summary.csv";
import wineData_catSummary from "$data/wineData_catSummary.csv";
import wineData_birdSummary from "$data/wineData_birdSummary.csv";
// import wineData_summary from "$data/wineData_summary.csv";
// import wineData_catSummary from "$data/wineData_catSummary.csv";
// import wineData_birdSummary from "$data/wineData_birdSummary.csv";
// import WIP from "$components/helpers/WIP.svelte";
// import Footer from "$components/Footer.svelte";
// const copy = getContext("copy");
// const data = getContext("data");
let optionsMetric = ["price", "rating"];
let optionsAnimal = ["all", "cats", "birds"];
// let optionsMetric = ["price", "rating"];
// let optionsAnimal = ["all", "cats", "birds"];
function setData($animalSelect, $metricSelect) {
if ($animalSelect == "birds") {
if ($metricSelect == "price") {
return wineData_birdSummary.filter((d) => d.category == "price");
} else if ($metricSelect == "rating") {
return wineData_birdSummary.filter((d) => d.category == "rating");
}
} else if ($animalSelect == "cats") {
if ($metricSelect == "price") {
return wineData_catSummary.filter((d) => d.category == "price");
} else if ($metricSelect == "rating") {
return wineData_catSummary.filter((d) => d.category == "rating");
}
} else {
if ($metricSelect == "price") {
return wineData_summary.filter((d) => d.category == "price");
} else if ($metricSelect == "rating") {
return wineData_summary.filter((d) => d.category == "rating");
}
}
}
// function setData($animalSelect, $metricSelect) {
// if ($animalSelect == "birds") {
// if ($metricSelect == "price") {
// return wineData_birdSummary.filter((d) => d.category == "price");
// } else if ($metricSelect == "rating") {
// return wineData_birdSummary.filter((d) => d.category == "rating");
// }
// } else if ($animalSelect == "cats") {
// if ($metricSelect == "price") {
// return wineData_catSummary.filter((d) => d.category == "price");
// } else if ($metricSelect == "rating") {
// return wineData_catSummary.filter((d) => d.category == "rating");
// }
// } else {
// if ($metricSelect == "price") {
// return wineData_summary.filter((d) => d.category == "price");
// } else if ($metricSelect == "rating") {
// return wineData_summary.filter((d) => d.category == "rating");
// }
// }
// }
$: dataSet = setData($animalSelect, $metricSelect)
// $: dataSet = setData($animalSelect, $metricSelect)
// $: dataSet = $animalSelect == "all"
// ? wineData_summary
// : $animalSelect == "cats"
// ? wineData_catSummary
// : wineData_birdSummary;
$: console.log(dataSet)
// $: console.log(dataSet)
</script>

<div class="selects">
<!-- <div class="selects">
<Select options={optionsAnimal} id={"id-animalSelect"}/>
<Select options={optionsMetric} id={"id-metricSelect"}/>
</div>
Expand All @@ -60,10 +61,11 @@
{/key}
{/if}
<PhotoTest />
<PhotoTest /> -->
<!-- <WIP />
<Demo /> -->
<!-- <Footer /> -->
<Intro />

<style>
.selects {
Expand Down
111 changes: 111 additions & 0 deletions src/components/Intro.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<script>
import { getContext, onMount } from "svelte";
import { fit, parent_style } from "@leveluptuts/svelte-fit";
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
const copy = getContext("copy");
let textFade = false;
onMount(async () => {
setTimeout(() => {
textFade = true;
}, 1000);
});
</script>

<section id='intro'>
<div class="bg-text-container">
<div class="bg-text" style={parent_style}>
<h1 use:fit={{min_size: 12, max_size:400 }}>Wine Animals</h1>
</div>
</div>
<div class="wine-bottle-container">
<img src="./assets/images/bottles/wine-opener-1.png" />
</div>
<div class="text-container">
{#each copy.intro as text, i}
{#if textFade}
<p
transition:fly={{ delay: 500*i, duration: 1000, y: 100, opacity: 0, easing: quintOut }}
>{text.value}</p>
{/if}
{/each}
</div>
</section>

<style>
#intro {
width: 100%;
height: calc(100vh - 4rem);
position: relative;
}
.bg-text-container {
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
.bg-text h1 {
font-family: "Manuka";
text-transform: uppercase;
color: var(--wine-dark-gray);
line-height: 0.8;
text-align: center;
}
.wine-bottle-container {
height: 100%;
width: 100%;
position: absolute;
display: flex;
/* align-items: center; */
justify-content: center;
z-index: 800;
padding: 3rem 0;
}
.wine-bottle-container img {
height: 100%;
}
.text-container {
height: 100%;
width: 100%;
position: absolute;
z-index: 999;
}
.text-container p {
font-size: var(--20px);
max-width: 300px;
position: absolute;
}
.text-container p:first-of-type {
top: 10%;
left: 10%;
}
.text-container p:nth-of-type(2) {
top: 30%;
right: 10%;
}
.text-container p:nth-of-type(3) {
top: 50%;
left: 10%;
}
.text-container p:nth-of-type(4) {
top: 70%;
right: 10%;
}
</style>
2 changes: 1 addition & 1 deletion src/data/copy.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"title":"Title TK","description":"Description tk."}
{"intro":[{"type":"text","value":"You’re on the hunt for a cheap bottle of wine."},{"type":"text","value":"This label with the gilded lion crest catches your eye."},{"type":"text","value":"It looks fancy, so it’s probably expensive."},{"type":"text","value":"But is it?"}]}
3 changes: 3 additions & 0 deletions src/data/test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name,value
test,2
more,3
9 changes: 9 additions & 0 deletions src/styles/font.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,13 @@
font-style: normal;
font-stretch: normal;
font-display: swap;
}

@font-face {
font-family: "Manuka";
src: url("https://pudding.cool/assets/fonts/manuka/Manuka-Bold.woff2") format("woff2");
font-weight: 700;
font-style: normal;
font-stretch: normal;
font-display: swap;
}
4 changes: 2 additions & 2 deletions src/styles/reset.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

body {
background-color: var(--color-bg, white);
color: var(--color-fg, black);
background-color: var(--wine-black, #181A1F);
color: var(--wine-tan, #CFCABF);
line-height: 1.4;
font-family: var(--font-body, serif);
font-feature-settings: 'kern' 1, 'onum' 0, 'liga' 0, 'tnum' 1;
Expand Down
3 changes: 3 additions & 0 deletions src/styles/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*/

:root {
--wine-black: #181A1F;
--wine-dark-gray: #202329;
--wine-tan: #CFCABF;
--category-blue: #4477AA;
--category-red: #EE6677;
--category-green: #228833;
Expand Down
Loading

0 comments on commit 1271838

Please sign in to comment.