Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Taking a closer look, wombat!

Kazuya Matsumoto kazuooooo

:octocat:
Taking a closer look, wombat!
View GitHub Profile
@kazuooooo
kazuooooo / SimpleCarousel.vue
Created Oct 25, 2020
Simple carousel implementation Vue3
View SimpleCarousel.vue
<template>
<div class="container">
<!-- ページをクリッピングするコンテナ -->
<div class="clipping-container">
<!-- ページ全体、このleftをtransitionでスライドさせてページを動かす -->
<div class="pages" :style="{left: currentLeft}">
<div class="page">
1
</div>
<div class="page">
View Counter.swift
import SwiftUI
struct CounterView: View {
// Data binding with CounterView Model
@EnvironmentObject var counterViewModel: CounterViewModel
var body: some View {
return VStack {
// count value updated automatically by data binding
Text(String(self.counterViewModel.count))
View sample.swift
import Foundation
import SwiftUI
import PositionScrollView
/// Extended ScrollView which can controll position
public struct MinimalHorizontalExample: View, PositionScrollViewDelegate {
/// Page size of Scroll
var pageSize = CGSize(width: 200, height: 300)
// Create PositionScrollViewModel
View sample.swift
import Foundation
import SwiftUI
/// Extended ScrollView which can controll position
public struct MinimalHorizontalExample: View, PositionScrollViewDelegate {
/// Page size of Scroll
var pageSize = CGSize(width: 200, height: 300)
// Create PositionScrollViewModel
// (Need to create in parent view to bind the state between this view and PositionScrollView)
@kazuooooo
kazuooooo / swift
Created Sep 4, 2020
PositionScrollViewSample.swift
View swift
import Foundation
import SwiftUI
/// Extended ScrollView which can controll position
public struct MinimalHorizontalExample: View, PositionScrollViewDelegate {
/// Page size of Scroll
var pageSize = CGSize(width: 200, height: 300)
// Create PositionScrollViewModel
// (Need to create in parent view to bind the state between this view and PositionScrollView)
View index.ts
const webhook = new IncomingWebhook("https://hooks.slack.com/services/your_web_hook_url");
View .firebaserc
{
"projects": {
"default": "your_project_id_here"
}
}
View form.tsx
import React from "react"
import { ContactForm } from '@kazuwombat/fire-form'
import config from '../firebaseConfig'
const ContactPage = () => {
return (
<ContactForm
config={config}
successCallback={() => {
alert("success :)") /* You need to handle success */
View Contactform.tsx
import React from "react"
import { ContactForm } from '@kazuwombat/fire-form'
import config from '../firebaseConfig'
const ContactPage = () => {
return (
<ContactForm
config={config}
successCallback={() => { alert("success :)") /* You need to handle success. */
}}
View firebaseConfig.ts
export default {
apiKey: "xxxxxxx",
authDomain: "xxxxxxx",
databaseURL: "xxxxxxx",
projectId: "xxxxxxx",
storageBucket: "xxxxxxx",
messagingSenderId: "xxxxxxx",
appId: "xxxxxxx",
measurementId: "xxxxxxx"
};
You can’t perform that action at this time.