Added project 1 - Embedded YouTube Video.

This commit is contained in:
jme9
2024-12-06 17:14:11 -08:00
parent 08c3537ef3
commit 827926820c
4 changed files with 140 additions and 10 deletions
+118 -2
View File
@@ -112,7 +112,7 @@ We should use classes to make things easier later.
<section id="projects" class="projects-section">
<h2 class="section-title">Projects</h2>
</section>
<section id="contact" class="contact-section">
<h2 class="section-title">Contact</h2>
</section>
@@ -402,6 +402,122 @@ document.addEventListener("scroll", () => {
For the projects section I want to highlight two personal projects, maybe include this website as a third. I want to organize each project similarly to how I did the previous section except with multiple stacked sections. I should just be able to copy the main components from the about section and repurpose them. I'll have text on the left and an interactive component on the right. That said, The interactive coponent will differ with each section.
To accomplish stacking the different projet sections I am going to introduce some grid organization into the projects section. Withe simple CSS we can achieve a nice staked layout within our projects section.
**CSS**
```
.grid-container {
display: grid;
grid-template-columns: 1fr;
gap: 2rem;
width: 100%;
}
.grid-item {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
background: rgba(42, 15, 59, 0.8);
padding: 2rem;
border-radius: 20px;
color: #ffe8e8;
align-items: center;
}
```
**HTML**
```
<section id="projects" class="projects-section">
<div class="project-box">
<div class="grid-container">
<h1 class="project-box-title">Personal Projects</h1>
<!-- Project 1 -->
<section class="grid-item">
<!-- Project 1 First Column: Project Overview Text -->
<div class="project-text">
<h1 class="project-title">LunaLight - A Retro Game Project,</h1>
<p id="project1-paragraph" class="project-paragraph">
Loading...
</p>
</div>
<!-- Project 1 Second Column: Video -->
<div class="project1-video-container">
<h1 class="project-title">LunaLight - Teaser</h1>
</div>
</section>
<!-- Project 2 -->
<section class="grid-item">
<!-- Project 2 First Column: Project Overview Text -->
<div class="project-text">
<h1 class="project-title">
EightBiterator - A Retro Game Melody Generator,
</h1>
<p id="project2-paragraph" class="project-paragraph">
Loading...
</p>
</div>
<!-- Project 2 Second Column: Images -->
<div class="project2-form-container">
<h1 class="project-title">EightBiterator</h1>
</div>
</section>
</div>
</div>
</section>
```
Now let's get into the interactive project components
**Project 1 - My Retro Game**
The first project highlight will be for my personal retro game project and include an imbedded you tube video as the interactive component.
The first project highlight will be for my personal retro game project and include an imbedded you tube video as the interactive component. To help with this I'll be referencing som eof the infomation here: [HTML YouTube Videos](https://www.w3schools.com/html/html_youtube.asp).
So we'll be using a component called `iframe` which allows us to embed video and set many useful attributes.
As it turns out, if you click share on a YouTube video there is on option for "embed"! You can simply copy and paste it into your HTML!
Let's break down some of the less obvious attributes we are copying and embedding, for starters, it does use iframe.
```
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/J_KjVaEGNk4?si=O0-429xP-P2r7JSx&autoplay=1&loop=1&playlist=J_KjVaEGNk4&mute=1"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
```
Ok, firstly the I have set some important functionality within the URL itself,
**Source URL** `src="https://www.youtube.com/embed/J_KjVaEGNk4?si=O0-429xP-P2r7JSx&autoplay=1&loop=1&playlist=J_KjVaEGNk4&mute=1"`
- `autoplay=1`: Makes the video play automatically.
- `loop=1`: Enables continuous looping of the video.
- `playlist=OUR_VIDEO_ID`: Ensures looping by identifying the video as a playlist of one.
- `mute=1`: Starts the video muted to satisfy browser autoplay policies.
**Allow list** `allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"`
- `accelerometer`: Allows device motion data (e.g., for interactive videos).
- `autoplay`: Enables automatic playback of the video.
- `clipboard-write`: Allows the iframe to write to the clipboard.
- `encrypted-media`: Permits encrypted content to play.
- `gyroscope`: Allows access to gyroscope data for interactive experiences.
- `picture-in-picture`: Allows the video to play in a smaller floating window outside the iframe.
- `web-share`: Supports web sharing features.
**Referrer Policy** `referrerpolicy="strict-origin-when-cross-origin"`
- `strict-origin-when-cross-origin`: Sends only the origin (not the full URL) as the referrer when navigating cross-origin, enhancing privacy.
**Project 2 - EightBiterator**
In this section I want to showcase a really cool program I built that generates eight-bit retro game music melody samples. A user can input various attributes to customize the meody and EightBiterator will generate a melody based on those parameters.
To showcase this I would like to create a user form that allows the user to input the parameters and the hit a button that says "generate". As the program runs it will give some indication as to what it is doing and play each waveform. It will then prompt the user if they woudl like to save the generated wav file.
+1 -3
View File
@@ -1,5 +1,3 @@
Hey! This section is about my retro game project!
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+13 -3
View File
@@ -88,9 +88,19 @@
Loading...
</p>
</div>
<!-- Project 1 Second Column: Images -->
<!-- Project 1 Second Column: Video -->
<div class="project1-video-container">
<h1 class="project-title">LunaLight - Teaser</h1>
<h1 class="project-title">LunaLight - First Look</h1>
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/J_KjVaEGNk4?si=O0-429xP-P2r7JSx&autoplay=1&loop=1&playlist=J_KjVaEGNk4&mute=1"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
></iframe>
</div>
</section>
@@ -105,7 +115,7 @@
Loading...
</p>
</div>
<!-- Project 2 Second Column: Images -->
<!-- Project 2 Second Column: Form -->
<div class="project2-form-container">
<h1 class="project-title">EightBiterator</h1>
</div>
+8 -2
View File
@@ -257,13 +257,19 @@ button:hover {
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 520px;
height: 100%;
width: 100%;
overflow: hidden;
border-radius: 10px;
position: relative;
}
.project1-video {
width: 100%;
height: 100%;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
/* Project 2 */
.project2-form-container {