Skip to content

Commit

Permalink
Merge pull request #13 from IdealistCat/main
Browse files Browse the repository at this point in the history
V0.2.6 Modding Update
  • Loading branch information
sphis-Sinco authored Aug 21, 2024
2 parents d6d4b06 + deeec67 commit 93e42d4
Show file tree
Hide file tree
Showing 26 changed files with 348 additions and 75 deletions.
5 changes: 3 additions & 2 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</div>
</div>

<h1>DRAGGING 404</h1>
<p>This page doesn't exist!</p>
<h1 id="name">DRAGGING 404</h1>
<p id="nonexist">This page doesn't exist!</p>

<h1>Current Site Data</h1>
<pre id="version">Blog Version: 0.0.0</pre>
Expand All @@ -43,5 +43,6 @@ <h1>Recommended Action</h1>
<script type="module" src="/Blog/SP/404.js"></script>
<script type="module" src="/Blog/SP/issue-report-404.js"></script>
<script type="module" src="/Blog/SP/settings/themeSet.js"></script>
<script type="module" src="/Blog/SP/modding/templates/404.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# August 21st 2024
## v0.2.6
### Added
- ADDED (robust but working) SCRIPT PACKET MODDING
- Added Image Replacement System
- Added Text Replacement System
- Added Modding Api Markdown

# August 20th 2024
## v0.2.5
### Changed
Expand Down
Binary file added Content/Mod/Test/Site/WIP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Content/Mod/Test/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
1 change: 1 addition & 0 deletions Content/Mod/mod.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

9 changes: 0 additions & 9 deletions Content/Site/metadata.json

This file was deleted.

70 changes: 70 additions & 0 deletions MODDING_API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# DraggingBlog Modding API (v0.1)
## Explanation
The ``0.1`` version of the DraggingBlog Modding API is a robust system of image and text content replacement.

Using Modding Script Packets,
you are allowed to create simple mods to the DraggingBlog site.
Unfortunately through forks unless
we make a desktop website application, which would be a waste

# Setup
Setting up the Mod is simple as making a folder,
and having an image or some text to replace using script packets and if replacing an image,
have an image.

So basically, create a folder in the mod folder inside the Content folder.

Make sure it's with the mod name that you will set inside the SP modding folder's ``api.js`` script packet!

Don't forget to set MOD_ENABLED to true if you are using script packets!

# Production
## Nerdy Explanation Stuff for later
In the ``/Mod/Test`` folder.
There is the folder ``Site/`` and the text file ``version.txt``.

In the ``Site/`` folder, there is the ``WIP.png`` image.

When linking to the Test mod WIP.png image, the file path in the second quotation set will be ``Site/WIP.png``.

This is because the ``replaceImg()`` function uses the modding api's
file path of ``Mod/ MOD_NAME /``. Cause the function uses ``returnPath()`` from
``SP/util/files.js`` which uses the inital path of ``/Blog/Content/`` which makes
sure it works and we don't have to put in the path...
``/Blog/Content/Mod/Test/Site/WIP.png``

Because that would get annoying.

## Image Replacement
### Base Explanation
Image Replacement is probably the first thing you would wanna do, but hold your horses,
it's not going to be a "replicate the file location and just add file replacement".

You gotta go to the ``SP/modding/templates`` folder first!

### Script Packet Scripting
And go into the page script packet where you wanna replace the base image with the image you are going to replace it with.

Add the line: ``replaceImg("", "");``.

In the first quotation set you will put the class name of the image tag you are going to replace.

In the second quotation set you will put the file path of the image you have.

### Ending
After you inputted the needed data you should be good to go!

## Text Replacement
### Base Explanation
Text Replacement is as simple as finding the text you wanna replace, and input the text you wanna replace it WITH.

### Script Packet Scripting
Go to ``SP/modding/templates`` and go to the page packet you wanna edit.

Now add the line: ``replaceText('', '');``.

In the first quotation set you could put the text id, like ``name``

Now in the second quotation set you will put the text you want to use.

And your done :)
12 changes: 8 additions & 4 deletions Pages/Credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,27 @@
<div class="creditsBlurb" height='100'>
<marquee direction="up" id="text" height="710">
<h3>
Github my Beloved
<p id="beloved">Github my Beloved</p>
<br>
<img src="/Blog/Content/Site/GitNeon.png" width="100" alt="github">
<img class="git" src="/Blog/Content/Site/GitNeon.png" width="100" alt="github">
</h3>
<br>
<!-- TODO: Make Credits not agony to mod. -->
<h1>Blog Team</h1>
<p>IdealistCat - Lead Programming</p>
<p>Trippy - Testing</p>
<p>Drago Cuven - Lua Programming</p>
<br>
<h1>Discord Suggestors</h1>
<h1>Discord Suggestors/Assistants</h1>
<p>trippy.69 - Help Page</p>
<p>bit7 - Text Padding</p>
<p>drago_cuven - Wasmoon Implementation</p>
<p>pauleps - bean club idea</p>
<p>pauleps - bean club idea/unexpected token fix</p>
<br>
<h1>Special Thanks</h1>
<p>Hazel - Scrolling Text Code Taken from funkin.me</p>
<p>Funkin Crew Inc - funkin.me, the whole inspiration for this site</p>
<p>Tomas Kenzgaila - Replace Image Code used for MODDING</p>
</marquee>
</div>
</div>
Expand All @@ -48,6 +50,8 @@ <h1>Special Thanks</h1>

<script type="module" src="/Blog/SP/href-setup.js"></script>
<script type="module" src="/Blog/SP/settings/themeSet.js"></script>
<script type="module" src="/Blog/SP/modding/templates/credits.js"></script>

<script>
/*
// 1086.
Expand Down
51 changes: 26 additions & 25 deletions Pages/Help.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,56 @@
<pre id="version">Blog Version: 0.0.0</pre>

<p class="links">
<a href="https://github.com/DragginGroup/Blog/tree/main">Source Code</a>
<a id="so" href="https://github.com/DragginGroup/Blog/tree/main">Source Code</a>

<a href="https://github.com/IdealistCat/Blog/tree/main">Development Source</a>
<a id="devSo" href="https://github.com/IdealistCat/Blog/tree/main">Development Source</a>
</p>

<section class="Site">

<h1>Navigation</h1>
<p>Up above you should see atleast 3 or more buttons, those buttons are how you navigate this site as I am sure you figured out, right?</p>
<h1 id="navi">Navigation</h1>
<p id="above">Up above you should see atleast 3 or more buttons, those buttons are how you navigate this site as I am sure you figured out, right?</p>
<p align="center">
<img src="/Blog/Content/Site/help navigation.png" width="300" title="buttons">
<img class="navigate" src="/Blog/Content/Site/help navigation.png" width="300" title="buttons">
</p>

<h1>404 Screen</h1>
<p>Below this text is a 0.2.2-Dev version of the 404 screen for the site.</p>
<h1 id="40S">404 Screen</h1>
<p id="404img">Below this text is a 0.2.2-Dev version of the 404 screen for the site.</p>
<p align="center">
<img src="/Blog/Content/Site/help 404.png" width="300" title="404">
<img class="404" src="/Blog/Content/Site/help 404.png" width="300" title="404">
</p>
<a href="../404.html">this is a link to it.</a>
<p>When you reach that 404 screen, it will try to help you to the best of its ability.</p>
<p>Instead of the crusty one github gives you. Also Easier on the eyes unless your a madman.</p>
<p>The 404 screen will show you the file you've been sent too, it will give you a recommended course of action, a recommendation for reporting this issue.</p>
<p>This 404 screen is here to help.</p>
<a id="404" href="../404.html">this is a link to it.</a>
<p id="ability">When you reach that 404 screen, it will try to help you to the best of its ability.</p>
<p id="crusty">Instead of the crusty one github gives you. Also Easier on the eyes unless your a madman.</p>
<p id="file">The 404 screen will show you the file you've been sent too, it will give you a recommended course of action, a recommendation for reporting this issue.</p>
<p id="help">This 404 screen is here to help.</p>

</section>

<section class="Github">

<h1>Github</h1>
<p>On the github page for this site, public or developer site, they are always availible for a look through.</p>
<h1 id="git">Github</h1>
<p id="gitpage">On the github page for this site, public or developer site, they are always availible for a look through.</p>

<h1>Folders</h1>
<h1 id="store">Folders</h1>
<p align="center">
<img src="/Blog/Content/Site/help gitfiles.png" width="300" title="github file layout">
<img class="gitfiles" src="/Blog/Content/Site/help gitfiles.png" width="300" title="github file layout">
</p>

<p>The Content Folder is for assets like music, sound, data files, images, and whatever else needed.</p>
<p>The SP Folder is for the script files, which I call script packets for this project.</p>
<p>The Pages Folder is for different html files and the .css files for stylization which are in the Styles folder inside the Pages folder.</p>
<p id="assets">The Content Folder is for assets like music, sound, data files, images, and whatever else needed.</p>
<p id="sp">The SP Folder is for the script files, which I call script packets for this project.</p>
<p id="pages">The Pages Folder is for different html files and the .css files for stylization which are in the Styles folder inside the Pages folder.</p>

<h1>Contributing</h1>
<p>As long as you have Javascript, HTML, A dream and CSS experience. Even the bare minimum of knowledge of how they work. You can Contribute.</p>
<p>Just make a fork, code your changes, we review and if you have all the checkmarks, you have just added to the site and made your way into the credits!</p>
<h1 id="tribute">Contributing</h1>
<p id="bareMin">As long as you have Javascript, HTML, A dream and CSS experience. Even the bare minimum of knowledge of how they work. You can Contribute.</p>
<p id="fork">Just make a fork, code your changes, we review and if you have all the checkmarks, you have just added to the site and made your way into the credits!</p>

</section>

<p class="links">
<a href="https://github.com/DragginGroup/Blog/issues/new/choose">Public Issues</a>
<a id="issues" href="https://github.com/DragginGroup/Blog/issues/new/choose">Public Issues</a>

<a href="https://github.com/IdealistCat/Blog/issues/new/choose">Development Issues</a>
<a id="devIssues" href="https://github.com/IdealistCat/Blog/issues/new/choose">Development Issues</a>

</p>

Expand All @@ -78,6 +78,7 @@ <h1>Contributing</h1>
<script type="module" src="/Blog/SP/blog-version.js"></script>
<script type="module" src="/Blog/SP/href-setup.js"></script>
<script type="module" src="/Blog/SP/settings/themeSet.js"></script>
<script type="module" src="/Blog/SP/modding/templates/help.js"></script>

</body>
</html>
36 changes: 36 additions & 0 deletions Pages/Mod.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<html data-theme="dark">
<head>
<link rel="stylesheet" href="/Blog/Pages/Styles/base.css">
<link rel="stylesheet" href="/Blog/Pages/Styles/mod-page.css">
<title>DraggingBlog - Mod Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
</head>
<body class="color1" align="center">
<div class="color4" align="center">
<a href="/Blog/index.html" id="backBtn">Back</a>
<a href="/Blog/Pages/Help.html" id="HelpPage">Help</a>
<a href="/Blog/Pages/ComicList.html" id="ComicsPage">Comics</a>
<a href="/Blog/Pages/Settings.html" id="SettingsPage">Settings</a>
<a href="/Blog/Pages/Credits.html" id="CreditsPage">Credits</a>
</div>
<div class="color2">
<h1 id="name"></h1>
<div class="stick">
<p id="version"></p>
<p id="description"></p>
</div>
<button
class="settingsButton"
id="toggle"
toggle>
Mod Toggle
</button>
</div>
<br>

<script type="module" src="/Blog/SP/href-setup.js"></script>
<script type="module" src="/Blog/SP/mod-page.js"></script>
<script type="module" src="/Blog/SP/modding/templates/mod.js"></script>
<script type="module" src="/Blog/SP/settings/themeSet.js"></script>
</body>
</html>
4 changes: 3 additions & 1 deletion Pages/Settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
</div>

<fieldset class="color2">
<legend>Settings Page</legend>
<legend id="settingTab">Settings Page</legend>
<pre id="version">Blog Version: 0.0.0</pre>

<a>
<button onClick="themeSwitch"
type="button"
class="settingsButton"
id="themeToggle"
data-theme-toggle>
Theme Toggle
<ion-icon name="contrast-outline"></ion-icon>
Expand All @@ -44,5 +45,6 @@
<script type="module" src="/Blog/SP/settings/theme.js"></script>
<script type="module" src="/Blog/SP/settings/version-display.js"></script>
<script type="module" src="/Blog/SP/blog-version.js"></script>
<script type="module" src="/Blog/SP/modding/templates/settings.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions Pages/Styles/mod-page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.stick {
padding: -8;
}
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@ All things Dragging Related
</p>
<p align="center">
Work In Progress Blog Site!
<br><br>
<a align="center" href="CHANGELOG.md">
Check out the changelog here!
</a>
</p>

<h1 align="center">Modding</h1>

<p align="center">
With the 0.2.6 update there is a new robust modding support through script packets.
<br>
<a align="center" href="MODDING_API.md">
Check out the markdown here!
</a>
</p>
12 changes: 9 additions & 3 deletions SP/blog-version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { validVersion } from '/Blog/SP/util/version.js';
import { MOD_NAME, MOD_ENABLED } from '/Blog/SP/modding/api.js';

var string_ver = ""
string_ver = validVersion();
var string_ver = '';
string_ver = validVersion("version");

document.getElementById('version').innerHTML = "Blog Version: " + string_ver
var name = "Blog";

if (MOD_ENABLED == true)
name = MOD_NAME;

document.getElementById('version').innerHTML = name + " Version: " + string_ver
1 change: 1 addition & 0 deletions SP/href-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO: redo this in v0.2.7 or later
44 changes: 44 additions & 0 deletions SP/modding/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export let API_VERSION = '0.1.8';

export let MOD_NAME = "Test";
export let MOD_VERSION = "0.1.0";

export let MOD_ENABLED = false;

export function replaceImg(id, replacement, ignore_enable) {
// https://stackoverflow.com/a/48344753
// Tomas Kenzgaila

var path = "/Blog/Content/Mod/" + MOD_NAME + '/' + replacement;

var imgReplace = document.getElementsByClassName(id)[0];

if (MOD_ENABLED == true || ignore_enable == true){
if (replacement != "")
imgReplace.src = path;

imgReplace.style.visibility = "visible";
}
}

export function replaceText(id, replacement, ignore_enable) {
var txtReplace = document.getElementById(id);

if (MOD_ENABLED == true || ignore_enable == true){
if (replacement != "")
txtReplace.innerHTML = replacement;
}
}

export function toggleMod() {
if (MOD_ENABLED == true)
MOD_ENABLED = false;
else
MOD_ENABLED = true;

return MOD_ENABLED;
}

export function returnModStats() {
return MOD_ENABLED;
}
5 changes: 5 additions & 0 deletions SP/modding/templates/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { replaceImg, replaceText } from '/Blog/SP/modding/api.js';

// Text
replaceText('name', '');
replaceText('nonexist', '');
Loading

0 comments on commit 93e42d4

Please sign in to comment.