Skip to content

Instantly share code, notes, and snippets.

View shinokada's full-sized avatar

Shinichi Okada shinokada

View GitHub Profile
@shinokada
shinokada / ArchiveBox.svelte
Created November 6, 2024 06:05
Working example with draw
<script lang="ts">
import { draw } from 'svelte/transition';
import { getContext } from 'svelte';
import type { Props } from './types.ts'
let {
size = 24,
role = 'img',
color = 'currentColor',
strokeWidth = 1.5,
@shinokada
shinokada / +page.svelte
Created November 5, 2024 16:16
svelte-animate home
<script lang="ts">
import { ArrowLeft, AtSign, BadgeCheck, Bell, AcademicCap, Wrapper, ArrowDownLeft, Animate, ArrowBigUp, ArrowDownLeft2, ArrowDownOnSquare } from "$lib";
import { draw } from 'svelte/transition';
</script>
<div class="container">
<h1>Svelte Animate for Svelte 5</h1>
<h2>Click to see animation</h2>
<AtSign size={50} color="purple"/>
@shinokada
shinokada / package.json
Created November 5, 2024 16:15
latest svelte lib/project package.json, remove postcss & tslib
{
"name": "svelte-icons",
"version": "0.0.1",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",
"preview": "vite preview",
"package": "svelte-kit sync && svelte-package && publint",
"prepublishOnly": "npm run package",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
@shinokada
shinokada / +server.ts
Created May 22, 2024 05:10
SvelteKit simple sitemap component
// src/routes/sitemap.xml/+server.ts
import { generateSitemap } from '$lib'
/** @type {import('./$types').RequestHandler} */
interface Page {
loc: string;
changefreq?: string;
priority?: string;
lastmod?: string;
}
@shinokada
shinokada / vim-note.txt
Last active February 28, 2024 14:10
vim notes
# vim
cw change word
dw delete word
d3w delete 3 words
dd delete line
dfa delete forward (including) a
dtu delete til u
d$ delete from the cursor to the end of the line
ctrl-u scrolling upwards
@shinokada
shinokada / AcademicCap.svelte
Created December 15, 2023 16:06
AcademicCap.svelte for Svelte 5
<script lang="ts">
interface CtxType {
size: string;
role?: string;
color?: string;
variation?: 'solid' | 'outline';
viewBox?: string;
}
interface Props {
size?: string;
@shinokada
shinokada / 70s.json
Created November 26, 2023 05:57
Terminal radio favorite lists.
[
{
"changeuuid": "6cddacaf-f2c1-11e8-a471-52543be04c81",
"stationuuid": "6cddaca1-f2c1-11e8-a471-52543be04c81",
"name": "- 0 N - 70s on Radio ON 70s",
"url": "http://0n-70s.radionetz.de/0n-70s.mp3",
"url_resolved": "http://0n-70s.radionetz.de/0n-70s.mp3",
"homepage": "http://www.0nradio.com/",
"favicon": "http://www.0nradio.com/images/favicon/mstile-144x144.png",
"tags": "classic rock,rock,pop,disco,goldies,oldies,70er,1970s,70s",
@shinokada
shinokada / gist:9b84198703ed6cf6169486de6309b5a1
Created August 21, 2023 12:33
Ultimate Prompt Engineering Secret.txt
From https://twitter.com/cj_zZZz/status/1678795785650200578
1st Step:
Give it a role. "You are Spartacus, a pro copywriter,"
2nd Step:
Define its job "Your job is to write copy for online media brands"
Third step:
Give ChatGPT the control: "Now ask me all the questions that you need to know to write a perfect copy that'd align with my brand."
layout title breadcrumb_title component_title dir description thumnailSize
componentLayout
Svelte Rating - Flowbite
Svelte Rating
Rating
Components
Use the rating component to show reviews and testimonials from your users using stars and scores based on multiple styles and sizes
w-64
import type { SvelteComponent } from 'svelte';
export interface ActivityType {
title: HTMLElement | string;
date: Date | string;
src: string;
alt: string;
text?: HTMLElement | string;
}