Suppose you have an app like this, and your bundler turns .css files into strings:
// main.js
import './x-foo.js';
import './x-bar.js';
document.body.innerHTML = ``;| /** | |
| * useScroll React custom hook | |
| * Usage: | |
| * const { scrollX, scrollY, scrollDirection } = useScroll(); | |
| */ | |
| import { useState, useEffect } from "react"; | |
| export function useScroll() { | |
| const [lastScrollTop, setLastScrollTop] = useState(0); |
Suppose you have an app like this, and your bundler turns .css files into strings:
// main.js
import './x-foo.js';
import './x-bar.js';
document.body.innerHTML = ``;I'm procrastinating instead of working on a conference talk, so I decided to implement this component in Svelte to see which framework is most expressive:
Here's the original, with the addition of an import for dataUriAsSrc (and updated per @chriskrycho's comment):
Responding to https://mobile.twitter.com/Sawtaytoes/status/1120478565454307328:
Here's an example component representing a work-in-progress screen for a concert ticket sales website, built for a recent demo:
<script>
let type;
let count = 1;
let seconds = 300;| This glitch has returned with team names: https://i.imgur.com/vVaQvH9.png | |
| Patched on 1.48 though. | |
| All credit goes to Sparkette, she was the one who found that glitch! | |
| !!!! | |
| New album, way better organized | |
| ALL sprays, player icons, achievement icons, and other stuff! | |
| https://imgur.com/a/HJoeHy1 |
| /** | |
| * Converts an ArrayBuffer to a String. | |
| * | |
| * @param buffer - Buffer to convert. | |
| * @returns String. | |
| */ | |
| export default function arrayBufferToString(buffer: ArrayBuffer): string { | |
| return String.fromCharCode.apply(null, Array.from(new Uint16Array(buffer))); | |
| } |
| import puppeteer from 'puppeteer' | |
| import puppeteerExtra from 'puppeteer-extra' | |
| import pluginStealth from 'puppeteer-extra-plugin-stealth' | |
| import cloudscraper from 'cloudscraper' | |
| import {User} from "../domain/user"; | |
| import {accessing} from "../handlers/nasHandler"; | |
| let scraper: any = cloudscraper | |
| let browser; |
| { | |
| "์์ธํน๋ณ์/๊ฐ๋จ๊ตฌ": { | |
| "lat": "37.4951", | |
| "long": "127.06278" | |
| }, | |
| "์์ธํน๋ณ์/๊ฐ๋๊ตฌ": { | |
| "lat": "37.55274", | |
| "long": "127.14546" | |
| }, | |
| "์์ธํน๋ณ์/๊ฐ๋ถ๊ตฌ": { |
| import matcher from 'matcher' | |
| import CORS from 'cors' | |
| let corsOptions = { | |
| origin: (origin, callback) => { | |
| let allow = false | |
| for (let allowAccessDomain of settingsData.allowAccessDomains) { // [ "*.mydomain.com"] | |
| if (matcher.isMatch(origin, allowAccessDomain)) { | |
| allow = true | |
| break |
| import moment from 'moment' | |
| import 'moment-duration-format' | |
| let currentMoment = moment() | |
| let currentMinuteNum = Number(currentMoment.format('mm')) | |
| let nextMin = 1 | |
| let _nextContractTime = moment(currentMoment) | |
| .add(nextMin, 'minute') |