mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix news page
This commit is contained in:
+6
-3
@@ -2297,7 +2297,10 @@ async function loadHomePage() {
|
|||||||
currentSelectedDate = new Date()
|
currentSelectedDate = new Date()
|
||||||
|
|
||||||
// Creates the root of the home page added to the main div
|
// Creates the root of the home page added to the main div
|
||||||
let homeContainer = stringToHTML('<div class="home-root"><div class="home-container" id="home-container"></div></div>')
|
let homeContainer = stringToHTML(/* html */`
|
||||||
|
<div class="home-root">
|
||||||
|
<div class="home-container" id="home-container"></div>
|
||||||
|
</div>`)
|
||||||
|
|
||||||
// Appends the html file to main div
|
// Appends the html file to main div
|
||||||
// Note: firstChild of html is done due to needing to grab the body from the stringToHTML function
|
// Note: firstChild of html is done due to needing to grab the body from the stringToHTML function
|
||||||
@@ -2307,12 +2310,12 @@ async function loadHomePage() {
|
|||||||
const date = new Date()
|
const date = new Date()
|
||||||
|
|
||||||
// Creates the shortcut container into the home container
|
// Creates the shortcut container into the home container
|
||||||
const Shortcut = stringToHTML('<div class="shortcut-container border"><div class="shortcuts border" id="shortcuts"></div></div>')
|
const Shortcut = stringToHTML('<div class="shortcut-container border" style="opacity: 0;"><div class="shortcuts border" id="shortcuts"></div></div>')
|
||||||
// Appends the shortcut container into the home container
|
// Appends the shortcut container into the home container
|
||||||
document.getElementById('home-container')?.append(Shortcut?.firstChild!)
|
document.getElementById('home-container')?.append(Shortcut?.firstChild!)
|
||||||
|
|
||||||
// Creates the container div for the timetable portion of the home page
|
// Creates the container div for the timetable portion of the home page
|
||||||
const Timetable = stringToHTML('<div class="timetable-container border"><div class="home-subtitle"><h2 id="home-lesson-subtitle">Today\'s Lessons</h2><div class="timetable-arrows"><svg width="24" height="24" viewBox="0 0 24 24" style="transform: scale(-1,1)" id="home-timetable-back"><g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g></svg><svg width="24" height="24" viewBox="0 0 24 24" id="home-timetable-forward"><g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g></svg></div></div><div class="day-container" id="day-container"></div></div>')
|
const Timetable = stringToHTML('<div class="timetable-container border" style="opacity: 0;"><div class="home-subtitle"><h2 id="home-lesson-subtitle">Today\'s Lessons</h2><div class="timetable-arrows"><svg width="24" height="24" viewBox="0 0 24 24" style="transform: scale(-1,1)" id="home-timetable-back"><g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g></svg><svg width="24" height="24" viewBox="0 0 24 24" id="home-timetable-forward"><g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g></svg></div></div><div class="day-container" id="day-container"></div></div>')
|
||||||
// Appends the timetable container into the home container
|
// Appends the timetable container into the home container
|
||||||
document.getElementById('home-container')?.append(Timetable?.firstChild!)
|
document.getElementById('home-container')?.append(Timetable?.firstChild!)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -117,7 +117,7 @@ browser.runtime.onMessage.addListener((request: any, _sender: any, sendResponse:
|
|||||||
'-' +
|
'-' +
|
||||||
(date.getMonth() + 1) +
|
(date.getMonth() + 1) +
|
||||||
'-' +
|
'-' +
|
||||||
(date.getDate() - 1);
|
(date.getDate() - 5);
|
||||||
|
|
||||||
const url = `https://newsapi.org/v2/everything?domains=abc.net.au&from=${from}&apiKey=17c0da766ba347c89d094449504e3080`;
|
const url = `https://newsapi.org/v2/everything?domains=abc.net.au&from=${from}&apiKey=17c0da766ba347c89d094449504e3080`;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { memo } from "react";
|
import { memo } from "react";
|
||||||
import { useSettingsContext } from "../SettingsContext";
|
|
||||||
import "./Slider.css";
|
import "./Slider.css";
|
||||||
|
|
||||||
interface SliderProps {
|
interface SliderProps {
|
||||||
@@ -8,7 +7,6 @@ interface SliderProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Slider: React.FC<SliderProps> = ({ state, onChange }) => {
|
const Slider: React.FC<SliderProps> = ({ state, onChange }) => {
|
||||||
const { settingsState } = useSettingsContext();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative w-full max-w-lg py-8 mx-auto">
|
<div className="relative w-full max-w-lg py-8 mx-auto">
|
||||||
@@ -18,8 +16,7 @@ const Slider: React.FC<SliderProps> = ({ state, onChange }) => {
|
|||||||
max="100"
|
max="100"
|
||||||
value={state}
|
value={state}
|
||||||
onChange={(e) => onChange(Number(e.target.value))}
|
onChange={(e) => onChange(Number(e.target.value))}
|
||||||
className="w-full h-1 rounded-full appearance-none cursor-pointer slider"
|
className="w-full h-1 rounded-full appearance-none cursor-pointer slider dark:bg-[#38373D] bg-[#DDDDDD]"
|
||||||
style={{ background: `${settingsState.customThemeColor}` }}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user