\n \n );\n }\n}\n\nexport default JukeBox;","import React from 'react';\nimport Window from './Window';\nimport { BsBellFill, BsFillEnvelopeFill, BsHeartFill, BsPeopleFill } from 'react-icons/bs';\nimport { IoReloadSharp } from 'react-icons/io5';\n\nconst POSTS = [\n \"Hello world! #myfirstcontent ðĨ°\", //silcon valley floats gently into our introductions\n \"Today's net art should capture the totality of the internet, by any memes possible.\",\n \"When consuming content, we lose our sense of self and become a part of the internet machine.\",\n \"The most important product tech companies develop is your attachment.\",\n \"The early web was made by its users, the modern web is passive.\",\n \"On Twitter, your life is reduced to series of tweets.\",\n \"Demands on your attention remove your ability to attend\",\n `Go online / Abandon thought\n Lose yourself / In one and nought #poetry`,\n \"I'm so many moves ahead of you I've wandered off to the pub and I've ordered a pint :)\",\n \"Offending others is bad, and if that offends you I don't care ð\",\n \"#poetry #poetry #poetry #poetry #poetry #poetry ... sometimes it just hits different.\",\n \"Online content overconsumed physically hurts us, if we acknowledge the headache.\",\n \"Young content producers operate on a whole new level of tiredness; crypt-status.\",\n \"Be five things at once! No, wait - be EVERYTHING at once! ... but don't be yourself.\",\n \"Behold! The democracy of numbers on a screen, as alotted by the general populus.\",\n \"Coded, conditioned, part of the algorithm. Where does the internet end and the user begin?\",\n `\"Maybe I'm just an algorithm with a given name\" #content @Joywave`,\n \"The user only exists online. Their sole purpose, to unfold the designs we've created.\",\n \"Most net art is fundamentally broken, because our humanity is broken as we engage with it.\",\n \"Our presence is reduced to intrigue, button pressing, breif enjoyment of colour.\",\n \"This is why creative websites often don't fit the 'art' description.\",\n `\"This is a distraction, from what is really happening\" #fake @ThatHandsomeDevil`,\n \"Our hidden discomforts call us closer, they echo of past intimacy.\",\n \"We're all looking for security. For love from others, and ourselves.\",\n \"Life has always been more beautiful and engaging than anything I've found online.\",\n \"The longer you stay the worse it gets.\",\n];\n\nclass Social extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n post: \"\",\n postFinished: false,\n refreshReady: false,\n postsSubmitted: 0,\n postCharacterIndex: 0,\n postNumber: 0,\n showHint: true,\n notificationTab: null,\n notifications: {\n general: 0,\n messages: 0,\n hearts: 0,\n followers: 0\n },\n socialCapital: {\n influence: 0,\n demands: 0,\n adoration: 0,\n watchers: 0\n }\n \n }\n\n this.attemptToClose = this.attemptToClose.bind(this);\n this.textInput = this.textInput.bind(this);\n this.submitPost = this.submitPost.bind(this);\n this.handleSubmitButton = this.handleSubmitButton.bind(this);\n this.handleRefreshButton = this.handleRefreshButton.bind(this);\n this.getLotteryNumbers = this.getLotteryNumbers.bind(this);\n this.toggleFollowerNotifications = this.toggleFollowerNotifications.bind(this);\n this.toggleGeneralNotifications = this.toggleGeneralNotifications.bind(this);\n this.toggleMessageNotifications = this.toggleMessageNotifications.bind(this);\n this.toggleHeartNotifications = this.toggleHeartNotifications.bind(this);\n }\n\n attemptToClose(){\n\n this.props.callAlert({\n title: \"Wait!\",\n message: \"What if someone needs you?\",\n dismissal: \"I'll stay online\",\n });\n\n }\n\n handleSubmitButton(event){\n\n if (this.state.postFinished){\n const boundingRectangle = event.currentTarget.getBoundingClientRect();\n const xOffset = -80 + Math.random() * 160;\n const effectSpawnPosition = {x: boundingRectangle.x + xOffset, y: boundingRectangle.y - 30}\n\n this.props.addExperience(1, effectSpawnPosition);\n this.submitPost();\n }\n\n }\n\n handleRefreshButton(){\n\n if (this.state.refreshReady && (this.state.postsSubmitted > 0)){\n\n const generalNotifications = Math.floor(Math.random() * 3 + Math.random() * 4 * this.state.postsSubmitted);\n const messageNotifications = Math.floor(Math.random() * 1 + Math.random() * 1 * this.state.postsSubmitted);\n const heartNotifications = Math.floor(Math.random() * 8 + Math.random() * 10 * this.state.postsSubmitted);\n const followerNotifications = Math.floor(Math.random() * 2 + Math.random() * 2 * this.state.postsSubmitted);\n\n this.setState(state => ({\n refreshReady: false,\n postsSubmitted: 0,\n notificationTab: null,\n notifications: {\n general: state.notifications.general + generalNotifications,\n messages: state.notifications.messages + messageNotifications,\n hearts: state.notifications.hearts + heartNotifications,\n followers: state.notifications.followers + followerNotifications\n }\n }));\n\n }\n\n }\n\n submitPost(){\n\n this.setState(state => ({\n refreshReady: true,\n showHint: true,\n postFinished: false,\n post: \"\",\n postNumber: (state.postNumber + 1) % POSTS.length,\n postsSubmitted: state.postsSubmitted + 1,\n postCharacterIndex: 0,\n }))\n\n }\n\n textInput = event => {\n event.preventDefault();\n\n if (this.state.showHint) {\n this.setState({\n showHint: false,\n })\n }\n\n if (this.state.postCharacterIndex < POSTS[this.state.postNumber].length){\n this.setState(state => ({\n post: state.post + POSTS[state.postNumber].substring(state.postCharacterIndex, state.postCharacterIndex + 1),\n postCharacterIndex: state.postCharacterIndex + 1,\n }))\n } \n\n if (this.state.postCharacterIndex >= POSTS[this.state.postNumber].length - 1){\n this.setState({\n postFinished: true\n })\n }\n\n if (event.key === \"Enter\" && this.state.postFinished){\n const boundingRectangle = event.currentTarget.getBoundingClientRect();\n const xOffset = Math.random() * 160;\n const effectSpawnPosition = {x: boundingRectangle.x + xOffset, y: boundingRectangle.y + 40}\n\n this.props.addExperience(this.props.level, effectSpawnPosition);\n this.submitPost();\n }\n\n }\n\n getLotteryNumbers(result){\n\n let lotteryNumbers = [result.toString()];\n\n for (let i = 0; i < 9; i++){\n let number = Math.floor(Math.random() * 10).toString();\n if (result > 9) number = number + Math.floor(1 + Math.random() * 9).toString();\n if (result > 99) number = number + Math.floor(1 + Math.random() * 9).toString();\n\n lotteryNumbers.push(number);\n }\n lotteryNumbers.push(result.toString());\n\n let classNames = \"social__notification__bubble__lottery-number \";\n\n //Resets the CSS animation, spinning the numbers again.\n //See codegraveyard.js for other attempts\n if (!this.state.refreshReady) {\n classNames += \"social__notification__bubble__lottery-spin\";\n }\n\n const lotteryDivs = lotteryNumbers.map((number) => \n