Skip to content
Open
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
1 change: 1 addition & 0 deletions eduaid_desktop/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { app, BrowserWindow, Menu, shell, dialog, ipcMain } = require('electron');
app.disableHardwareAcceleration();
const path = require('path');
const fs = require('fs');
const config = require('./config');
Expand Down
19 changes: 18 additions & 1 deletion eduaid_web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,26 @@ code {
}

.border-gradient {
border-width: 2px;
border-width: 2px;
border-style: solid;
border-image: linear-gradient(to right, #ff005c, #7600f2, #00cbe7);
border-image-slice: 1;
border-radius: 2rem;
}

.gradient-text-base {
background: var(--gradient);
background-clip: text;
-webkit-background-clip: text;
color: transparent;
-webkit-text-fill-color: transparent;
display: inline-block;
}

.gradient-text {
--gradient: linear-gradient(to right, #FF005C, #7600F2);
}

.gradient-text-2 {
--gradient: linear-gradient(to right, #7600F2, #00CBE7);
}
20 changes: 10 additions & 10 deletions eduaid_web/src/pages/Output.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect, useMemo } from "react";
import React, { useState, useEffect, useMemo, useRef } from "react";
import "../index.css";
import logoPNG from "../assets/aossie_logo_transparent.png";
import { Link } from "react-router-dom";
Expand All @@ -15,14 +15,14 @@ const Output = () => {
const [editedQuestion, setEditedQuestion] = useState("");
const [editedAnswer, setEditedAnswer] = useState("");
const [editedOptions, setEditedOptions] = useState([]);
const [showDropdown, setShowDropdown] = useState(false);
const dropdownRef = useRef(null);

useEffect(() => {
const handleClickOutside = (event) => {
const dropdown = document.getElementById('pdfDropdown');
if (dropdown && !dropdown.contains(event.target) &&
!event.target.closest('button')) {
dropdown.classList.add('hidden');
}
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
setShowDropdown(false);
}
};

document.addEventListener('mousedown', handleClickOutside);
Expand Down Expand Up @@ -195,7 +195,7 @@ const Output = () => {
link.click();
document.body.removeChild(link);

document.getElementById('pdfDropdown').classList.add('hidden');
setShowDropdown(false);
worker.terminate();
};

Expand Down Expand Up @@ -383,17 +383,17 @@ const Output = () => {
Generate Google form
</button>

<div className="relative w-full sm:w-auto">
<div ref={dropdownRef} className="relative w-full sm:w-auto">
<button
className="bg-[#518E8E] items-center flex gap-1 w-full sm:w-auto font-semibold text-white px-4 sm:px-6 py-3 sm:py-2 rounded-xl text-sm sm:text-base hover:bg-[#3a6b6b] active:scale-95 active:bg-[#2f5555] transition-all justify-center"
onClick={() => document.getElementById('pdfDropdown').classList.toggle('hidden')}
onClick={() => setShowDropdown(prev => !prev)}
>
Generate PDF
</button>

<div
id="pdfDropdown"
className="hidden absolute bottom-full mb-1 left-0 sm:left-auto right-0 sm:right-auto bg-[#02000F] shadow-md text-white rounded-lg shadow-lg z-50 w-full sm:w-48"
className={`${showDropdown ? 'block' : 'hidden'} absolute bottom-full mb-1 left-0 sm:left-auto right-0 sm:right-auto bg-[#02000F] shadow-md text-white rounded-lg shadow-lg z-50 w-full sm:w-48`}
>
<button
className="block w-full text-left px-4 py-2 hover:bg-gray-500 active:bg-gray-600 active:scale-95 text-sm sm:text-base"
Expand Down