-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
523dd8b
commit 9c73c44
Showing
8 changed files
with
245 additions
and
3 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
_includes/releases-dropdown.html → _includes/content-dropdown.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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">▼</span>`; | ||
moreDetails.addEventListener('click', function() { | ||
if (!description.classList.contains('expanded')) { | ||
description.classList.add('expanded'); | ||
moreDetails.innerHTML = `Less details <span class="arrow">▲</span>`; | ||
description.style.maxHeight = description.scrollHeight + 'px'; | ||
} else { | ||
description.classList.remove('expanded'); | ||
moreDetails.innerHTML = `More details <span class="arrow">▼</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)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 .*** |