Skip to content

Commit

Permalink
Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LoydOsborne committed Mar 16, 2024
1 parent 523dd8b commit 9c73c44
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Shows
Content
</a>
<div class="navbar-dropdown has-background-black is-left">
<a class="navbar-item {% if page.type == 'show' %}is-active{% endif %}"
href="{{site.url}}{{site.baseurl}}/shows">Show List</a>
href="{{site.url}}{{site.baseurl}}/shows">Shows</a>
<a class="navbar-item {% if page.type == 'schedule' %}is-active{% endif %}"
href="{{site.url}}{{site.baseurl}}/schedule">Schedule</a>
</a>
Expand Down
2 changes: 1 addition & 1 deletion _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!-- <a class="navbar-item {% if page.type == 'discussion' %}is-active{% endif %}"
href="{{site.url}}{{site.baseurl}}/discussions">DISCUSSIONS [beta]</a> -->
{% include cast-dropdown.html %}
{% include releases-dropdown.html %}
{% include content-dropdown.html %}
<a class="navbar-item {% if page.type == 'blog' %}is-active{% endif %}"
href="{{site.url}}{{site.baseurl}}/blog">Blog</a>
</div>
Expand Down
47 changes: 47 additions & 0 deletions reads/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Reads
layout: page
type: reads
---
<style>
hr.has-background-black {
display: none;
}

h1.title {
display: none;
}
</style>
<link rel="stylesheet" href="https://api.scyted.tv/wave-development/dashboard/scytedtv-resources.css">
<!-- <link rel="stylesheet" href="https://api.scyted.tv/wave-development/dashboard/mobile-lock.css"> -->
<body>

<!-- <div class="mobile-error">
<div id="error-message" style="color: red;">
ScytedTV Resources isn't currently available to mobile users at this time.
</div>
</div> -->

<style>

.banner h1 {
margin-top: 20px;
}

</style>

<div class="banner">
<h1>ScytedTV Reads</h1>
<input type="text" class="search-bar" placeholder="Search stories...">
</div>

<div class="grid" id="resource-grid">
<!-- Resources will be dynamically added here -->
</div>

<script src="script.js"></script>

<!-- <script src="https://api.scyted.tv/wave-development/dashboard/page-loading-script.js"></script> -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-LF3ZTHGQHE"></script>

</body>
114 changes: 114 additions & 0 deletions reads/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
document.addEventListener("DOMContentLoaded", function() {
// Fetch resource data from JSON file (Assuming resources.json is the name)
fetch('stories.json')
.then(response => response.json())
.then(data => {
const grid = document.getElementById('resource-grid');
const searchInput = document.querySelector('.search-bar');
const noResultsMessage = document.createElement('div');
noResultsMessage.classList.add('no-results');
noResultsMessage.textContent = "We can't find what you're looking for.";

// Function to filter resources based on search input
function filterResources(searchText) {
const filteredData = data.filter(resource =>
resource.title.toLowerCase().includes(searchText.toLowerCase()) ||
resource.description.toLowerCase().includes(searchText.toLowerCase())
);

// Sort filteredData alphabetically by resource title
filteredData.sort((a, b) => a.title.localeCompare(b.title));

// Animate removal of items
grid.classList.add('fadeOut');

// Remove previous no results message
const prevNoResultsMessage = grid.querySelector('.no-results');
if (prevNoResultsMessage) {
prevNoResultsMessage.remove();
}

setTimeout(() => {
// Clear existing resources
grid.innerHTML = '';

// Render filtered resources if any, otherwise show no results message
if (filteredData.length > 0) {
filteredData.forEach(resource => {
const resourceItem = document.createElement('div');
resourceItem.classList.add('resource-item');

const imageLink = document.createElement('a');
imageLink.href = resource.resourceUrl;
imageLink.classList.add('image-link');

const image = document.createElement('img');
image.classList.add('resource-image');
image.src = resource.imageUrl;
image.alt = resource.title;
imageLink.appendChild(image);

const details = document.createElement('div');
details.classList.add('resource-details');

const title = document.createElement('div');
title.classList.add('resource-title');
title.textContent = resource.title;

const description = document.createElement('div');
description.classList.add('description');
description.textContent = resource.description;

details.appendChild(title);
details.appendChild(description);

if (resource.description && resource.description.length > 100) {
const moreDetails = document.createElement('div');
moreDetails.classList.add('more-details');
moreDetails.innerHTML = `More details <span class="arrow">&#9660;</span>`;
moreDetails.addEventListener('click', function() {
if (!description.classList.contains('expanded')) {
description.classList.add('expanded');
moreDetails.innerHTML = `Less details <span class="arrow">&#9650;</span>`;
description.style.maxHeight = description.scrollHeight + 'px';
} else {
description.classList.remove('expanded');
moreDetails.innerHTML = `More details <span class="arrow">&#9660;</span>`;
description.style.maxHeight = '100px';
}
});
details.appendChild(moreDetails);
}

resourceItem.appendChild(imageLink);
resourceItem.appendChild(details);

grid.appendChild(resourceItem);
});

// Adjust size of grid items if there's only one item
if (filteredData.length === 1) {
grid.classList.add('single-item');
} else {
grid.classList.remove('single-item');
}
} else {
grid.appendChild(noResultsMessage);
}

// Animate addition of items
grid.classList.remove('fadeOut');
grid.classList.add('fadeIn');
}, 200); // Wait for removal animation to finish before adding new items
}

// Event listener for input in search bar
searchInput.addEventListener('input', function() {
filterResources(this.value);
});

// Initial rendering of resources
filterResources('');
})
.catch(error => console.error('Error fetching resources:', error));
});
9 changes: 9 additions & 0 deletions reads/stories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"imageUrl": "https://cdn.scyted.tv/website-assets/stories-covers/the-universe.jpg",
"title": "The Universe",
"description": "",
"resourceUrl": "the-universe"
}
]

12 changes: 12 additions & 0 deletions reads/the-universe/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: The Universe
layout: page
type: reads
---

### [ScytedTV Reads](../) / The Universe

<body>
<div id="story-content"></div>
<script src="script.js"></script>
</body>
39 changes: 39 additions & 0 deletions reads/the-universe/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Function to load and display the text file
function loadTxtFile(filePath) {
fetch(filePath)
.then(response => response.text())
.then(text => {
const formattedText = formatText(text);
document.getElementById('story-content').innerHTML = formattedText;
})
.catch(error => console.error('Error:', error));
}

// Function to format the text with markdown-like styling and line breaks
function formatText(text) {
// Replace headers (e.g., # Header)
text = text.replace(/^# (.*$)/mg, '<h1>$1</h1>');
text = text.replace(/^## (.*$)/mg, '<h2>$1</h2>');
text = text.replace(/^### (.*$)/mg, '<h3>$1</h3>');

// Replace lists (e.g., - List item)
text = text.replace(/^\s*-\s(.*)$/mg, '<li>$1</li>');
text = text.replace(/^\s*1\.\s(.*)$/mg, '<li>$1</li>');

// Replace bold (e.g., **Bold**)
text = text.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');

// Replace italics (e.g., *Italic*)
text = text.replace(/\*(.*?)\*/g, '<em>$1</em>');

// Replace inline code (e.g., `code`)
text = text.replace(/`(.*?)`/g, '<code>$1</code>');

// Replace line breaks
text = text.replace(/\n/g, '<br>');

return text;
}

// Call the function with the path to your text file
loadTxtFile('story.txt');
21 changes: 21 additions & 0 deletions reads/the-universe/story.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The earth is so soft , no one ever tells you that , not until your hands are dug into the soil budrended to stay in its womb when your body is urging you to leave . Only because ; *it's suffering* . I wish I could recall my childhood but I only remember certain memories . I feel like they aren't mine though , maybe they belong to someone else ? I don't know . My ears are ringing , why does the sensation feel like pain ? turn it off . Stop . Please-

" Hey dork , you good ? "

He tilted his head with curiosity apparent , his pretty eyes finding my nervousness adorable , my face on fire and immediately turned away from him . But it's like I can feel his gaze soften on me , he extends his arm and I didn't even feel his hand on the side of my cheek comforting me either , his thumb brushed over my cheekbone with my eyes slowly closing a hot tear ran down my cheek and pillowed his thumb that brushed it away .

" Please don't punish me , is it those dreams again ? "

My eyes maybe irritated and red but they looked into his genuine warmth with softness ,

*" I genuinely feel like I've lived my life before , I know you're tired of me talking about them , but they're so vivid . Like I was there in that moment just in someone else's body ? I never came to realize that you were in love with me either . You bent all your rules to make sure I was happy and you made sure I felt safe . "*

I pause , am I crying *again ?* my heart is heavy like I'm grieving him , why ? He's in front of me . It's so difficult to talk , why ? God , why did I think it was a good idea to stop taking my meds ? This would've never happened if . . . *What ? But I don't understand .* And it's like he vanished , black ink was found on my hands , maybe I busted my pen and he left to get me a handkerchief ? I stupidly and subconsciously wiped my hands on my sleeve , my heart fell , my eyes went wide because of this . This isn't ink , this is my house , so why can't I recall being here before . Fuck , I'm so damn scared , I shut my eyes really hard squeezing them so hard that I can see green and blue spots . I open them and suddenly I am in a white room , I called out in anger and frantically threaten the footsteps I hear now approaching me ,

*" Stay away ! Did you kill him ? ! What- "*

My tears silenced me , then there was this person , *this angel* . They walked over . I was too weak to push them away , everything in the room was hard to tell the difference from , everything in this room had the same shade of white especially any furniture of any kind . And , whatever they'd been wearing had the same color and pulled me into a hug , I tried pushing them off but I knew in my heart they mean me no harm and like honey from a tree in a hickory forest of lush leaves and a cold calming breeze the color of pure thick golden fell onto a broken and breaking leaf . Their words were allowed in my walls and held the source of my grief , *my poor heart* , it'd been given the sweet feeling of being treated like that honey on that leaf that brought the bough of that tree's attention to it . But what was said next broke me beyond repair ,

***" I will recognize you in this life and the next . You're my soulmate , my stopping point , and I am so sorry that getting to you meant you were torn away from your life . Dork . "***

That hug tightened around him and I screamed like someone was killing me , hot tears spilled quickly , a soft sigh as if my last breath to say goodbye to that life was taken . All my fears began to melt away , I want to be here , in your arms and in your space . *As you are my air , my body and my house , you are everything I need all rolled up into one . You are mine and I am yours , our souls are intertwined and **I don't fear my death , had it means , you'd know my scent even then .***

0 comments on commit 9c73c44

Please sign in to comment.