Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/core/CSH Calendar.md → docs/core/csh_calendar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Overview

This core component is used for all the fetching, formatting and structuring for the CSH calendar portion of Jumpstart.

---
Expand Down
2 changes: 0 additions & 2 deletions docs/core/Slack.md → docs/core/slack.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Overview

This component handles the Slack Bot and it's related functions. Such as responding to announcments, requesting to upload to Jumpstart, and the other handles with Slack.

---
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions docs/endpoints/slack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

::: api.endpoints.get_announcement
::: api.endpoints.slack_events
::: api.endpoints.message_actions
Empty file removed docs/getting-started/setup.md
Empty file.
22 changes: 22 additions & 0 deletions docs/themes/how_to.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Jumpstart has many different themes displayed on the website, this is a step by step process on how to implement your own!

**Any images that need to be added should be put in src/static/img**

### Adding Background

1. Go to the file: **src/static/js/main.js**
2. In the function long update, figure out the day, month, and hour of your theme.
- hour is in 24H format
3. Add it into the if statement (please change this in the future)
- Make sure it follows the bgImage = "url(../static/img/{**YOUR FILE HERE**})"

### Adding CSS Theme
1. Go to the file **src/static/css/style.css**
2. Add a new class for the colors **MAKE SURE IT STARTS WITH {theme-}!!!**
3. Change the colors in this new class
4. Repeat the steps in the "Adding Background"
5. Add a new index into "allThemes" with your css theme, along with any changes to weatherwidget or datadog
6. change the themeToLoad in the if statement to load your new index



30 changes: 30 additions & 0 deletions docs/themes/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Jumpstart has many different themes displayed on the website. Ranging from the light - dark mode, to full background and color shifts fo events.

### All Themes
- Light Mode
- Default theme between 9 AM and 6 PM
- Dark Mode
- Default theme between 6 PM and 9 AM
- Valentine's Day
- Feburary 12th, 13th and 14th
- Changes title to "Constantly Smooching House"
- Adds decorative hearts around the logo
- BANG!
- March 13th
- Changes title to "BANG! Science"
- Gives an orange gradient to the background
- CSH 50th Anniversary
- April 9th, 10th, 11th, and 12
- Replaces title with the CSH 50th Anniversary logo
- Replaces color scheme with a Golden / Black theme
- Halloween
- October 29th, 30th, and 31st
- Changes title to "Computer Spooky House"
- Logo is given orange and purple colors
- Duck!
- November 2nd
- Duck
- Winter
- November and December
- Changes title to "Christmas Season"
- Gives a red and green logo with a bright blue background
16 changes: 9 additions & 7 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ nav:
- Home: index.md
- Getting Started: getting-started/getting-started.md
- Backend:
- Calendar: core/CSH Calendar.md
- Slack Bot: core/Slack.md
- Wiki Thoughts: core/Wiki-thoughts.md
- Calendar: core/csh_calendar.md
- Slack: core/slack.md
- Wikithoughts: core/wikithoughts.md
- Endpoints:
- Calendar: endpoints/calendar_endpoint.md
- Announcements: endpoints/announcements.md
- Slack Bot: endpoints/slack_bot.md
- Wiki Thoughts: endpoints/wikithoughts.md
- Calendar: endpoints/csh_calendar.md
- Slack: endpoints/slack.md
- Wikithoughts: endpoints/wikithoughts.md
- Themes:
- Themes: themes/overview.md
- Adding Your Own: themes/how_to.md

plugins:
- search
Expand Down
12 changes: 6 additions & 6 deletions src/core/wikithoughts.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@


# Precompile all the Regex operations
RE_LINK: Pattern[str] = re.compile(r'\[https?://[^\s"]+\s+"?([^\]"]+)"?\]')
RE_FILE: Pattern[str] = re.compile(r"\[\[File:[^\]]*\]\]", re.IGNORECASE)
RE_IMAGE: Pattern[str] = re.compile(r"\[\[Image:[^\]]*\]\]", re.IGNORECASE)
RE_LINK: Pattern[str] = re.compile(
r'\[https?://[^\s"]+\s+"?([^\]"]+)"?\]'
) # Https Links
RE_FILE_IMAGE = re.compile(r"\[\[(?:File|Image):[^\[\]]*\]\]", re.IGNORECASE)
RE_PAGE_TEXT: Pattern[str] = re.compile(r"\[\[[^\|\]]*\|([^\]]+)\]\]")
RE_PAGE: Pattern[str] = re.compile(r"\[\[([^\]]+)\]\]")
RE_CSH: Pattern[str] = re.compile(r"\^\^([^^]+)\^\^")
Expand All @@ -69,11 +70,10 @@ def clean_wikitext(text: str) -> str:
"""

reg_operations: tuple[Pattern[str]] = (
RE_PAGE,
RE_FILE_IMAGE,
RE_LINK,
RE_FILE,
RE_IMAGE,
RE_PAGE_TEXT,
RE_PAGE,
RE_CSH,
RE_TEMPLATE,
RE_HTML,
Expand Down
18 changes: 6 additions & 12 deletions src/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ async function longUpdate() {
const day = date.getDate();
const isDay = (hour > 9 && hour < 18);

let is_golden = (month === 4 && [9, 10, 11, 12].includes(day));
let bgImage = "url(../static/img/darkmodeF.png)";

let bgImage = "url(../static/img/darkmodeF.png)";
let themeToLoad = "dark";
if (month === 2 && [12, 13, 14].includes(day)) {
bgImage = "url(../static/img/valentinemode.png)";
} else if (month === 3 && day === 13) {
bgImage = "url(../static/img/jumpstartbang.png)";
} else if (is_golden) {
} else if (month === 4 && [9, 10, 11, 12].includes(day)) {
themeToLoad = "golden";
bgImage = "url(../static/img/goldenmode.png)";
} else if (month === 10 && [29, 30, 31].includes(day)) {
bgImage = "url(../static/img/spookymode.png)";
Expand All @@ -94,19 +95,12 @@ async function longUpdate() {
} else if ([11, 12].includes(month)) {
bgImage = "url(../static/img/wintermode.png)";
} else if (isDay) {
themeToLoad = "light";
bgImage = "url(../static/img/lightmodeF.png)";
}
$("body").css("background-image", bgImage);

try {

let themeToLoad = "dark";
if (is_golden){
themeToLoad = "golden";
} else if (isDay) {
themeToLoad = "light";
}

setNewPageTheme(allThemes[themeToLoad].page);
setDatadogTheme(allThemes[themeToLoad].datadog);
setWeatherTheme(allThemes[themeToLoad].weather);
Expand Down
Loading