diff --git a/examples/alan-turing-portal/components/Header.jsx b/examples/alan-turing-portal/components/Header.jsx index 3d438dc9..d55e0eeb 100644 --- a/examples/alan-turing-portal/components/Header.jsx +++ b/examples/alan-turing-portal/components/Header.jsx @@ -1,8 +1,41 @@ -import { useRef } from 'react' +import { Fragment, useEffect, useRef } from 'react' +import Image from 'next/image' +import Link from 'next/link' import { useRouter } from 'next/router' +import { Popover, Transition } from '@headlessui/react' +import clsx from 'clsx' import { Container } from '../components/Container' +function CloseIcon(props) { + return ( + + ) +} + +function ChevronDownIcon(props) { + return ( + + ) +} + function SunIcon(props) { return ( + ) +} + +function MobileNavItem({ href, children }) { + return ( +
  • + + {children} + +
  • + ) +} + +function MobileNavigation(props) { + return ( + + + Menu + + + + + + + + +
    + + + +

    + Navigation +

    +
    + +
    +
    +
    +
    + ) +} + +function NavItem({ href, children }) { + let isActive = useRouter().pathname === href + + return ( +
  • + + {children} + {isActive && ( + + )} + +
  • + ) +} + +function DesktopNavigation(props) { + return ( + + ) +} + function ModeToggle() { function disableTransitionsTemporarily() { document.documentElement.classList.add('[&_*]:!transition-none') @@ -45,8 +197,16 @@ function ModeToggle() { function toggleMode() { disableTransitionsTemporarily() + + let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)') + let isSystemDarkMode = darkModeMediaQuery.matches let isDarkMode = document.documentElement.classList.toggle('dark') - window.localStorage.isDarkMode = isDarkMode + + if (isDarkMode === isSystemDarkMode) { + delete window.localStorage.isDarkMode + } else { + window.localStorage.isDarkMode = isDarkMode + } } return ( @@ -62,11 +222,13 @@ function ModeToggle() { ) } +function clamp(number, a, b) { + let min = Math.min(a, b) + let max = Math.max(a, b) + return Math.min(Math.max(number, min), max) +} + export function Header() { - let isHomePage = useRouter().pathname === '/' - - let headerRef = useRef() - return ( <>
    @@ -86,6 +247,10 @@ export function Header() { style={{ position: 'var(--header-inner-position)' }} >
    +
    + + +
    @@ -95,7 +260,6 @@ export function Header() {
    - {isHomePage &&
    } ) } diff --git a/examples/alan-turing-portal/content/index.mdx b/examples/alan-turing-portal/content/index.mdx index a0458de9..6490f507 100644 --- a/examples/alan-turing-portal/content/index.mdx +++ b/examples/alan-turing-portal/content/index.mdx @@ -4,17 +4,19 @@ title: Hate Speech Dataset Catalogue This page catalogues datasets annotated for hate speech, online abuse, and offensive language. They may be useful for e.g. training a natural language processing system to detect this language. -The list is maintained by Leon Derczynski, Bertie Vidgen, Hannah Rose Kirk, Pica Johansson, Yi-Ling Chung, Mads Guldborg Kjeldgaard Kongsbak, Laila Sprejer, and Philine Zeinert. +The list is maintained by [Leon Derczynski](https://www.derczynski.com/), [Bertie Vidgen](https://www.turing.ac.uk/people/researchers/bertie-vidgen), [Hannah Rose Kirk](https://www.hannahrosekirk.com/), Pica Johansson, [Yi-Ling Chung](https://yilingchung.github.io/), Mads Guldborg Kjeldgaard Kongsbak, [Laila Sprejer](https://www.turing.ac.uk/people/researchers/laila-sprejer), and Philine Zeinert. -We provide a list of datasets and keywords. If you would like to contribute to our catalogue or add your dataset, please see the instructions for contributing. +We provide a list of [datasets](#Datasets-header) and [keywords](#Keywords-header). If you would like to contribute to our catalogue or add your dataset, please see the [instructions for contributing](#Contributing-header). -If you use these resources, please cite (and read!) our paper: Directions in Abusive Language Training Data: Garbage In, Garbage Out. And if you would like to find other resources for researching online hate, visit The Alan Turing Institute’s Online Hate Research Hub or read The Alan Turing Institute’s Reading List on Online Hate and Abuse Research. +If you use these resources, please cite (and read!) our paper: [Directions in Abusive Language Training Data: Garbage In, Garbage Out](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0243300). And if you would like to find other resources for researching online hate, visit The Alan Turing Institute's [Online Hate Research Hub](https://www.turing.ac.uk/research/research-programmes/public-policy/online-hate-research-hub) or read The Alan Turing Institute's [Reading List on Online Hate and Abuse Research](https://docs.google.com/document/d/1WVkVGp29Jt6d-4fBnZ5OWVYuFn_03rzz-KBqPsu6gTM/edit?usp=sharing). -If you’re looking for a good paper on online hate training datasets (beyond our paper, of course!) then have a look at ‘Resources and benchmark corpora for hate speech detection: a systematic review’ by Poletto et al. in Language Resources and Evaluation. +If you're looking for a good paper on online hate training datasets (beyond our paper, of course!) then have a look at ['Resources and benchmark corpora for hate speech detection: a systematic review'](https://link.springer.com/article/10.1007/s10579-020-09502-8) by Poletto et al. in *Language Resources and Evaluation*. -See the datasets +Accompanying [data statements](https://www.mitpressjournals.org/doi/abs/10.1162/tacl_a_00041) preferred for all corpora. -## How to contribute +See the datasets + +

    How to contribute

    We accept entries to our catalogue based on pull requests to the content folder. The dataset must be avaliable for download to be included in the list. If you want to add an entry, follow these steps! diff --git a/examples/alan-turing-portal/markdown.db b/examples/alan-turing-portal/markdown.db index 9909701c..0237379c 100644 Binary files a/examples/alan-turing-portal/markdown.db and b/examples/alan-turing-portal/markdown.db differ diff --git a/examples/alan-turing-portal/pages/index.jsx b/examples/alan-turing-portal/pages/index.jsx index 4a5d118f..3683a58a 100644 --- a/examples/alan-turing-portal/pages/index.jsx +++ b/examples/alan-turing-portal/pages/index.jsx @@ -13,7 +13,9 @@ import { MDXRemote } from 'next-mdx-remote' function DatasetCard({ dataset }) { return ( - {dataset.title} + + {dataset.title} + Link to publication: {' '} - {list.title} + + {list.title} + {list.description && ( List Description: {' '} @@ -139,17 +143,23 @@ export default function Home({

    {indexText.frontmatter.title}

    -
    +
    - +
    -

    +

    Datasets

    -
    reset())} className="rounded-2xl border border-zinc-100 px-4 py-6 dark:border-zinc-700/40 sm:p-6"> + reset())} + className="rounded-2xl border border-zinc-100 px-4 py-6 dark:border-zinc-700/40 sm:p-6" + >

    Search for datasets

    @@ -198,7 +208,12 @@ export default function Home({ ))} - +
    @@ -225,7 +240,7 @@ export default function Home({
    -

    +

    Lists of Abusive Keywords