pineafan | 15b813d | 2022-02-13 10:06:09 +0000 | [diff] [blame] | 1 | import Header from '../Components/Header' |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 2 | import Marquee from 'react-fast-marquee' |
| 3 | import { AutoLayout, Panel, Title, Subtitle, Text, Divider } from '../Components/Panels'; |
| 4 | import { Component } from 'react'; |
| 5 | import Image from 'next/image'; |
| 6 | import { Popover } from 'react-tiny-popover'; |
| 7 | |
| 8 | class Supporter extends Component { |
| 9 | constructor(props) { |
| 10 | super(props); |
| 11 | this.state = { |
| 12 | isPopoverOpen: false, |
| 13 | }; |
| 14 | } |
| 15 | |
| 16 | clicked() { |
pineafan | aa9c4fd | 2022-06-10 19:58:10 +0100 | [diff] [blame] | 17 | let content = this.props.children |
| 18 | navigator.clipboard.writeText(content) |
| 19 | this.setState({isPopoverOpen: true}) |
| 20 | setTimeout(() => { |
| 21 | this.setState({isPopoverOpen: false}) |
| 22 | }, 2500) |
| 23 | } |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 24 | |
| 25 | render() { |
| 26 | if ( this.props.clickable === false) { |
pineafan | aa9c4fd | 2022-06-10 19:58:10 +0100 | [diff] [blame] | 27 | return <div style={{ |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 28 | display: 'flex', flexDirection: 'column', alignItems: 'center', |
| 29 | justifyContent: 'center', backgroundColor: '#6576CC', color: '#FFFFFF', |
| 30 | paddingInline: '20px', paddingBlock: '0.25rem', |
| 31 | borderRadius: '10px', boxShadow: '0px -3px 10px 2px #424242' |
| 32 | }}>{this.props.children}</div> |
pineafan | aa9c4fd | 2022-06-10 19:58:10 +0100 | [diff] [blame] | 33 | } else { |
| 34 | return <Popover |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 35 | isOpen={this.state.isPopoverOpen} |
| 36 | positions={['top', 'bottom', 'left', 'right']} // preferred positions by priority |
| 37 | content={<Supporter colour={this.props.colour} clickable={false}>{this.props.sub}</Supporter>} |
| 38 | > |
| 39 | <div onClick={() => this.clicked()} style={{ |
| 40 | display: 'flex', flexDirection: 'column', alignItems: 'center', |
| 41 | justifyContent: 'center', backgroundColor: '#6576CC', color: '#FFFFFF', |
| 42 | paddingInline: '20px', paddingBlock: '0.25rem', marginInline: '5px', |
| 43 | borderRadius: '10px' |
| 44 | }}>{this.props.children}</div> |
| 45 | </Popover> |
pineafan | aa9c4fd | 2022-06-10 19:58:10 +0100 | [diff] [blame] | 46 | } |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 47 | } |
| 48 | } |
| 49 | |
| 50 | |
pineafan | 15b813d | 2022-02-13 10:06:09 +0000 | [diff] [blame] | 51 | |
| 52 | export default function Home() { |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 53 | const groups = [ |
| 54 | { // Devs and testers |
| 55 | "TheCodedProf": "Programmer", |
| 56 | "Minion3665": "Programmer", |
| 57 | "PineappleFan": "Programmer", |
| 58 | "Eek": "Programmer", |
| 59 | "Dilythion": "Programmer", |
| 60 | "Tani": "Programmer", |
| 61 | "CocoboloDesk": "Legal", |
| 62 | "GenElectrovise": "Plugins" |
| 63 | }, |
| 64 | { // Packages |
| 65 | "react-tiny-popover": "React popovers", |
| 66 | "react-in-viewport": "Scroll in effects", |
| 67 | "hcaptcha": "RSM Verify captchas", |
| 68 | "react-fast-marquee": "These scrolling sections", |
| 69 | "theme-ui": "Checked out the opposite theme?", |
| 70 | "Nextjs": "It's all built in Next" |
| 71 | }, |
| 72 | { // Programs |
| 73 | "Figma": "Designing - Thanks for staying free <3", |
| 74 | "Discord": "Chatting", |
| 75 | "Flaticon": "Icons" |
| 76 | }, |
| 77 | { // Special thanks |
| 78 | "InternetMetro": "Minecraft server building", |
| 79 | "RetroEvelyne": "Minecraft server command blocks", |
| 80 | "Eddy": "Minecraft server building", |
| 81 | } |
| 82 | ] |
pineafan | 15b813d | 2022-02-13 10:06:09 +0000 | [diff] [blame] | 83 | return ( |
| 84 | <> |
| 85 | <Header |
| 86 | name="Supporters" |
| 87 | subtext="The people who help Clicks function" |
| 88 | gradient={["71AFE5", "6576CC"]} |
| 89 | wave="web/waves/header/clicksforms" |
| 90 | buttons={[]} |
| 91 | /> |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 92 | <AutoLayout> |
| 93 | <Panel halfSize={false}> |
| 94 | <Title>Supporters</Title> |
| 95 | <Text>People and packages who have helped and are helping Clicks</Text> |
| 96 | { |
| 97 | groups.map((group, index) => { |
| 98 | return ( |
| 99 | <div key={index} style={{width: "100%"}}> |
| 100 | <Marquee |
| 101 | gradient={false} |
| 102 | style={{width: "100%", height: "30px"}} |
| 103 | speed={Math.floor(Math.random() * (40) + 20)} |
| 104 | direction={"right"} |
| 105 | > |
| 106 | { |
| 107 | Object.keys(groups[index]).map((supporter, index2) => { |
| 108 | return ( |
| 109 | <Supporter key={index} sub={groups[index][supporter]}>{supporter}</Supporter> |
| 110 | ) |
| 111 | }) |
| 112 | } |
| 113 | </Marquee> |
| 114 | </div> |
| 115 | ) |
| 116 | }) |
| 117 | } |
pineafan | 1de9876 | 2022-02-13 13:35:30 +0000 | [diff] [blame] | 118 | <Image src="/heart.svg" width={100} height={100} alt="<3"/> |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 119 | </Panel> |
| 120 | </AutoLayout> |
pineafan | 15b813d | 2022-02-13 10:06:09 +0000 | [diff] [blame] | 121 | </> |
| 122 | ) |
| 123 | } |