code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose.sample.mainpage import com.tencent.compose.sample.Vertical2Vertical import com.tencent.compose.sample.data.DisplayItem import composesample.composeapp.generated.resources.Res import composesample.composeapp.generated.resources.swipedown import org.jetbrains.compose.resources.ExperimentalResourceApi @OptIn(ExperimentalResourceApi::class) internal actual fun platformSections(): List<DisplayItem> { return listOf( DisplayItem("嵌套原生滑动", Res.drawable.swipedown) { Vertical2Vertical() } ) }
2201_76010299/kmptpc_compose_sample
composeApp/src/iosMain/kotlin/com/tencent/compose/sample/mainpage/DisplaySections.ios.kt
Kotlin
apache-2.0
1,281
#ifndef GLOBAL_RAW_FILE_H #define GLOBAL_RAW_FILE_H #ifdef __cplusplus extern "C" { #endif struct RawFile; typedef struct RawFile RawFile; int OH_ResourceManager_ReadRawFile(const RawFile *rawFile, void *buf, size_t length); long OH_ResourceManager_GetRawFileSize(RawFile *rawFile); void OH_ResourceManager_CloseRawFile(RawFile *rawFile); #ifdef __cplusplus }; #endif /** @} */ #endif // GLOBAL_RAW_FILE_H
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/cinterop/include/raw_file.h
C
apache-2.0
414
#ifndef GLOBAL_NATIVE_RESOURCE_MANAGER_H #define GLOBAL_NATIVE_RESOURCE_MANAGER_H #include "napi/native_api.h" #include "raw_file.h" #ifdef __cplusplus extern "C" { #endif struct NativeResourceManager; typedef struct NativeResourceManager NativeResourceManager; NativeResourceManager *OH_ResourceManager_InitNativeResourceManager(napi_env env, napi_value jsResMgr); void OH_ResourceManager_ReleaseNativeResourceManager(NativeResourceManager *resMgr); RawFile *OH_ResourceManager_OpenRawFile(const NativeResourceManager *mgr, const char *fileName); #ifdef __cplusplus }; #endif /** @} */ #endif // GLOBAL_NATIVE_RESOURCE_MANAGER_H
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/cinterop/include/raw_file_manager.h
C
apache-2.0
639
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/App.ohosArm64.kt
Kotlin
apache-2.0
764
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose import androidx.compose.ui.window.ComposeArkUIViewController import com.tencent.compose.sample.NativeResourceManager import com.tencent.compose.sample.mainpage.MainPage import com.tencent.compose.sample.nativeResourceManager import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.coroutines.initMainHandler import platform.ohos.napi_env import platform.ohos.napi_value import kotlin.experimental.ExperimentalNativeApi @OptIn(ExperimentalNativeApi::class, ExperimentalForeignApi::class) @CName("MainArkUIViewController") fun MainArkUIViewController(env: napi_env): napi_value { initMainHandler(env) return ComposeArkUIViewController(env) { MainPage() } } @OptIn(ExperimentalForeignApi::class) fun initResourceManager(resourceManager: NativeResourceManager) { nativeResourceManager = resourceManager }
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/MainArkUIViewController.kt
Kotlin
apache-2.0
1,599
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.toKString import platform.ohos.OH_GetOSFullName internal class OHOSPlatform : Platform { @OptIn(ExperimentalForeignApi::class) override val name: String = OH_GetOSFullName()?.toKString().orEmpty() } internal actual fun getPlatform(): Platform = OHOSPlatform()
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/Platform.ohos.kt
Kotlin
apache-2.0
1,105
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose.sample import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.arkui.ArkUIView import androidx.compose.ui.graphics.Color import androidx.compose.ui.interop.AdaptiveParams import androidx.compose.ui.interop.InteropContainer import androidx.compose.ui.napi.JsObject import androidx.compose.ui.napi.js private val NoOp: Any.() -> Unit = {} @Composable internal fun ArkUIView( name: String, modifier: Modifier, parameter: JsObject = js(), update: (JsObject) -> Unit = NoOp, background: Color = Color.Unspecified, updater: (ArkUIView) -> Unit = NoOp, onCreate: (ArkUIView) -> Unit = NoOp, onRelease: (ArkUIView) -> Unit = NoOp, interactive: Boolean = true, adaptiveParams: AdaptiveParams? = null, tag: String? = null, container: InteropContainer = InteropContainer.BACK ) = androidx.compose.ui.interop.ArkUIView( name = name, modifier = modifier, parameter = parameter, update = update, background = background, updater = updater, onCreate = onCreate, onRelease = onRelease, interactive = interactive, adaptiveParams = adaptiveParams, tag = tag, container = container, )
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/sample/ArkUIView.kt
Kotlin
apache-2.0
1,978
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ @file:OptIn(ExperimentalForeignApi::class, ExperimentalResourceApi::class) package com.tencent.compose.sample import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.toComposeImageBitmap import kotlinx.cinterop.CPointer import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.addressOf import kotlinx.cinterop.usePinned import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.IO import kotlinx.coroutines.withContext import org.jetbrains.compose.resources.DrawableResource import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.skia.Image import platform.resource.OH_ResourceManager_CloseRawFile import platform.resource.OH_ResourceManager_GetRawFileSize import platform.resource.OH_ResourceManager_OpenRawFile import platform.resource.OH_ResourceManager_ReadRawFile typealias NativeResourceManager = CPointer<cnames.structs.NativeResourceManager>? var nativeResourceManager: NativeResourceManager = null private val emptyImageBitmap: ImageBitmap by lazy { ImageBitmap(1, 1) } @Composable internal actual fun rememberLocalImage(id: DrawableResource): ImageBitmap { var imageBitmap: ImageBitmap by remember { mutableStateOf(emptyImageBitmap) } LaunchedEffect(Unit) { withContext(Dispatchers.IO) { val rawFile = OH_ResourceManager_OpenRawFile(nativeResourceManager, id.resourceItemPath()) val size = OH_ResourceManager_GetRawFileSize(rawFile) val buffer = ByteArray(size.toInt()) buffer.usePinned { pinnedBuffer -> OH_ResourceManager_ReadRawFile(rawFile, pinnedBuffer.addressOf(0), size.toULong()) } OH_ResourceManager_CloseRawFile(rawFile) imageBitmap = Image.makeFromEncoded(buffer).toComposeImageBitmap() } } return imageBitmap }
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/sample/Images.ohosArm64.kt
Kotlin
apache-2.0
2,846
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose.sample import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material.Button import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.napi.js import androidx.compose.ui.unit.dp @Composable internal fun InteropListNested() { Box { Column(Modifier.background(Color.LightGray)) { LazyColumn(Modifier.background(Color.Red)) { items(80) { index -> when (index) { 1 -> { ArkUIView( name = "verticalList", modifier = Modifier.width(250.dp).height(300.dp), parameter = js { "text"("ArkUI Button $index") "backgroundColor"("#FF0000FF") } ) } 3 -> { ArkUIView( name = "horizontalList", modifier = Modifier.width(250.dp).height(300.dp), parameter = js { "text"("ArkUI Button $index") "backgroundColor"("#FFFF00FF") } ) } else -> { Button({ println("Compose Button $index clicked") }, modifier = Modifier.height(50.dp).fillMaxWidth()) { Text("Compose Button $index") } } } } } } } }
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/sample/InteropListNested.kt
Kotlin
apache-2.0
3,005
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose.sample import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material.Button import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.napi.js import androidx.compose.ui.unit.dp @Composable internal fun InteropListSimple() { Box { Column(Modifier.background(Color.LightGray).fillMaxSize()) { LazyColumn(Modifier.background(Color.Red).fillMaxSize()) { items(80) { index -> Column { ArkUIView( name = "label", modifier = Modifier.width(250.dp).height(100.dp), parameter = js { "text"("ArkUI Button $index") "backgroundColor"("#FF0000FF") }, ) Button({ println("Compose Button $index clicked") }, modifier = Modifier.height(30.dp).fillMaxWidth()) { Text("Compose Button $index") } } } } } } }
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/sample/InteropListSimple.kt
Kotlin
apache-2.0
2,425
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose.sample import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width import androidx.compose.material.Button import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.napi.js import androidx.compose.ui.unit.dp @Composable internal fun InteropRenderOrder() { var interLayer by remember { mutableStateOf(false) } Column { Box { ArkUIView( "layer", Modifier.width(400.dp).height(300.dp), js { "text"("1") "backgroundColor"("#FF0000FF") }, ) ArkUIView( "layer", Modifier.width(350.dp).height(250.dp), js { "text"("2") "backgroundColor"("#FF00FF00") }, ) if (interLayer) { ArkUIView( "layer", Modifier.width(300.dp).height(200.dp), js { "text"("3") "backgroundColor"("#FFFF0000") }, ) } ArkUIView( "layer", Modifier.width(250.dp).height(150.dp), js { "text"("4") "backgroundColor"("#FF00FFFF") }, ) ArkUIView( "layer", Modifier.width(200.dp).height(100.dp), js { "text"("5") "backgroundColor"("#FFFFFF00") }, ) } Button({ interLayer = !interLayer }) { Text("Show / Hide") } } }
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/sample/InteropRenderOrder.kt
Kotlin
apache-2.0
2,798
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose.sample import androidx.compose.foundation.border import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.material.Button import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.napi.asString import androidx.compose.ui.napi.js import androidx.compose.ui.unit.dp import kotlinx.cinterop.ExperimentalForeignApi @OptIn(ExperimentalForeignApi::class) @Composable internal fun InteropTextInput() { Column(Modifier.fillMaxWidth().fillMaxHeight().padding(30.dp)) { var inputText by remember { mutableStateOf("混排状态变量双向通信 输入文本...") } val state = remember(inputText) { js { "text"(inputText) } } ArkUIView( name = "textInput", modifier = Modifier.width(450.dp).wrapContentHeight(), parameter = state, update = { inputText = it["text"].asString().toString() } ) Spacer(modifier = Modifier.height(50.dp)) Text(text = "Compose组件更新:", color = Color.Gray) Text( text = inputText, modifier = Modifier.fillMaxWidth() .border(width = 1.dp, color = Color.Gray) .padding(10.dp) ) Button(onClick = { inputText += "[文本]" }) { Text("Append Text") } } }
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/sample/InteropTextInput.kt
Kotlin
apache-2.0
2,777
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose.sample.backhandler import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.rememberUpdatedState import androidx.compose.ui.platform.LocalArkUIViewController @Composable internal actual fun BackHandler(enable: Boolean, onBack: () -> Unit) { val onBackPressedDispatcher = LocalArkUIViewController.current.onBackPressedDispatcher val enableState by rememberUpdatedState(enable) DisposableEffect(Unit) { val cancel = onBackPressedDispatcher.addOnBackPressedCallback { if (enableState) { onBack() true } else { false } } onDispose(cancel) } }
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/sample/backhandler/BackHandler.ohosArm64.kt
Kotlin
apache-2.0
1,536
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencent.compose.sample.mainpage import com.tencent.compose.sample.InteropListNested import com.tencent.compose.sample.InteropListSimple import com.tencent.compose.sample.InteropRenderOrder import com.tencent.compose.sample.InteropTextInput import com.tencent.compose.sample.data.DisplayItem import composesample.composeapp.generated.resources.Res import composesample.composeapp.generated.resources.interop_list import composesample.composeapp.generated.resources.interop_nested_scroll import composesample.composeapp.generated.resources.interop_state import composesample.composeapp.generated.resources.layers import org.jetbrains.compose.resources.ExperimentalResourceApi @OptIn(ExperimentalResourceApi::class) internal actual fun platformSections(): List<DisplayItem> { return listOf( DisplayItem("混排层级", Res.drawable.layers) { InteropRenderOrder() }, DisplayItem("混排滑动", Res.drawable.interop_list) { InteropListSimple() }, DisplayItem("混排嵌滑", Res.drawable.interop_nested_scroll) { InteropListNested() }, DisplayItem("混排状态", Res.drawable.interop_state) { InteropTextInput() } ) }
2201_76010299/kmptpc_compose_sample
composeApp/src/ohosArm64Main/kotlin/com/tencent/compose/sample/mainpage/DisplaySections.ohosArm64.kt
Kotlin
apache-2.0
1,904
#!/bin/bash echo '✅ start build skiko #' cd /Users/peaceful_black/kn/skiko-ohrender/skiko ./gradlew clean echo "✅ waiting cleaning skiko..." ./build-with-local-skia.sh echo "✅ waiting building skiko..." echo '✅ start build compose #' cd /Users/peaceful_black/kn/ovCompose-multiplatform-core ./gradlew clean echo "✅ waiting cleaning compose..." ./gradlew :mpp:publishComposeJbToMavenLocal -Pcompose.platforms=ohosArm64 echo "✅ waiting building compose..." echo "✅ waiting building compose-arkts..." cd /Users/peaceful_black/kn/ovCompose-multiplatform-core/compose/ui/ui-arkui/src/ohosArm64Main/cpp/composeApp hvigorw --mode module -p product -p module=compose assembleHar MULTIPLATFORM_CORE_DIR="/Users/peaceful_black/kn/ovCompose-multiplatform-core" SAMPLE_DIR="/Users/peaceful_black/kn/ovCompose-sample" echo "✅ copy compose.har" cp "$MULTIPLATFORM_CORE_DIR/compose/ui/ui-arkui/src/ohosArm64Main/cpp/compose/build/default/outputs/default/compose.har" "/Users/peaceful_black/kn/ovCompose-sample/harmonyApp/entry/libs" echo '✅ start build compose-sample #' cd /Users/peaceful_black/kn/ovCompose-sample ./gradlew clean echo "✅ waiting cleaning compose-sample..." ./gradlew linkDebugSharedOhosArm64 echo "✅ waiting building compose-sample..." echo "✅ copy" cp "$SAMPLE_DIR/composeApp/build/bin/ohosArm64/debugShared/libkn.so" "$SAMPLE_DIR/harmonyApp/entry/libs/arm64-v8a" cp "$SAMPLE_DIR/composeApp/build/bin/ohosArm64/debugShared/libkn_api.h" "$SAMPLE_DIR/harmonyApp/entry/src/main/cpp/include/" echo "✅ finish"
2201_76010299/kmptpc_compose_sample
harmonyApp/buildTest.sh
Shell
apache-2.0
1,547
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { hapTasks } from '@ohos/hvigor-ohos-plugin'; export default { system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ }
2201_76010299/kmptpc_compose_sample
harmonyApp/entry/hvigorfile.ts
TypeScript
apache-2.0
970
# the minimum version of CMake. cmake_minimum_required(VERSION 3.5.0) project(harmonyApp) set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) if(DEFINED PACKAGE_FIND_FILE) include(${PACKAGE_FIND_FILE}) endif() include_directories(${NATIVERENDER_ROOT_PATH} ${NATIVERENDER_ROOT_PATH}/include) add_library(entry SHARED napi_init.cpp) target_link_libraries(entry PUBLIC libace_napi.z.so) target_link_libraries(entry PUBLIC libdeviceinfo_ndk.z.so) target_link_libraries(entry PUBLIC librawfile.z.so) target_link_libraries(entry PUBLIC libhilog_ndk.z.so) target_link_libraries(entry PUBLIC libace_ndk.z.so) target_link_libraries(entry PUBLIC ${NATIVERENDER_ROOT_PATH}/../../../libs/arm64-v8a/libkn.so) target_link_libraries(entry PUBLIC ${EGL-lib} ${GLES-lib} ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libuv-lib} libc++_shared.so)
2201_76010299/kmptpc_compose_sample
harmonyApp/entry/src/main/cpp/CMakeLists.txt
CMake
apache-2.0
858
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "libkn_api.h" #include "napi/native_api.h" #include <rawfile/raw_file_manager.h> #include <hilog/log.h> static napi_value Add(napi_env env, napi_callback_info info) { size_t argc = 2; napi_value args[2] = {nullptr}; napi_get_cb_info(env, info, &argc, args , nullptr, nullptr); napi_valuetype valuetype0; napi_typeof(env, args[0], &valuetype0); napi_valuetype valuetype1; napi_typeof(env, args[1], &valuetype1); double value0; napi_get_value_double(env, args[0], &value0); double value1; napi_get_value_double(env, args[1], &value1); napi_value sum; napi_create_double(env, value0 + value1, &sum); return sum; } static napi_value MainArkUIViewController(napi_env env, napi_callback_info info) { return reinterpret_cast<napi_value>(MainArkUIViewController(env)); } static napi_value InitResourceManager(napi_env env, napi_callback_info info) { size_t argc = 1; napi_value args[1] = {nullptr}; napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); auto manager = OH_ResourceManager_InitNativeResourceManager(env, args[0]); auto kt = libkn_symbols(); kt->kotlin.root.com.tencent.compose.initResourceManager(manager); napi_value result; napi_create_int32(env, 0, &result); return result; } static napi_value nativeCreateRootNode(napi_env env, napi_callback_info info) { size_t argc = 2; napi_value argv[2]; napi_get_cb_info(env, info, &argc, argv, NULL, NULL); return reinterpret_cast<napi_value>(createRootRenderNode()); } static napi_value nativeOHRenderNodeDraw(napi_env env, napi_callback_info info) { size_t argc = 2; napi_value argv[2]; napi_status status; status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); if (status != napi_ok || argc < 2) { napi_throw_type_error(env, nullptr, "Expected canvas argument"); return nullptr; } renderNodeDraw(env, argv[0], argv[1]); return nullptr; } static napi_value nativeOHRenderNotifyRedraw(napi_env env, napi_callback_info info) { size_t argc = 1; napi_value argv[1]; napi_status status; status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); if (status != napi_ok || argc < 1) { napi_throw_type_error(env, nullptr, "Expected renderNode argument"); return nullptr; } renderNodeNotifyRedraw(env, argv[0]); return nullptr; } static napi_value nativeRegisterNodeConstructor(napi_env env, napi_callback_info info) { size_t argc = 1; napi_value argv[1]; napi_get_cb_info(env, info, &argc, argv, NULL, NULL); if (argc < 1) { return nullptr; } setNodeConstructor(env, argv[0]); return nullptr; } static napi_value nativeSetPixelRatio(napi_env env, napi_callback_info info) { size_t argc = 1; napi_value argv[1]; napi_get_cb_info(env, info, &argc, argv, NULL, NULL); double ratio = 1.0; napi_get_value_double(env, argv[0], &ratio); setPixelRatio(ratio); return nullptr; } static napi_value nativeRegisterNodeStatusModifyConstructor(napi_env env, napi_callback_info info) { size_t argc = 1; napi_value argv[1]; napi_get_cb_info(env, info, &argc, argv, NULL, NULL); if (argc < 1) { return nullptr; } buildInstance(env, argv[0]); return nullptr; } EXTERN_C_START static napi_value Init(napi_env env, napi_value exports) { androidx_compose_ui_arkui_init(env, exports); napi_property_descriptor desc[] = { {"add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr}, {"initResourceManager", nullptr, InitResourceManager, nullptr, nullptr, nullptr, napi_default, nullptr}, {"MainArkUIViewController", nullptr, MainArkUIViewController, nullptr, nullptr, nullptr, napi_default, nullptr}, {"nativeCreateRootNode", nullptr, nativeCreateRootNode, nullptr, nullptr, nullptr, napi_default, nullptr}, {"nativeOHRenderNodeDraw", nullptr, nativeOHRenderNodeDraw, nullptr, nullptr, nullptr, napi_default, nullptr}, {"nativeOHRenderNotifyRedraw", nullptr, nativeOHRenderNotifyRedraw, nullptr, nullptr, nullptr, napi_default, nullptr}, {"nativeRegisterNodeConstructor", nullptr, nativeRegisterNodeConstructor, nullptr, nullptr, nullptr, napi_default, nullptr}, {"nativeRegisterNodeStatusModifyConstructor", nullptr, nativeRegisterNodeStatusModifyConstructor, nullptr, nullptr, nullptr, napi_default, nullptr }, {"nativeSetPixelRatio", nullptr, nativeSetPixelRatio, nullptr, nullptr, nullptr, napi_default, nullptr}, }; napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); return exports; } EXTERN_C_END static napi_module demoModule = { .nm_version = 1, .nm_flags = 0, .nm_filename = nullptr, .nm_register_func = Init, .nm_modname = "entry", .nm_priv = ((void*)0), .reserved = { 0 }, }; extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); }
2201_76010299/kmptpc_compose_sample
harmonyApp/entry/src/main/cpp/napi_init.cpp
C++
apache-2.0
5,803
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { appTasks } from '@ohos/hvigor-ohos-plugin'; export default { system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ }
2201_76010299/kmptpc_compose_sample
harmonyApp/hvigorfile.ts
TypeScript
apache-2.0
970
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import UIKit import SwiftUI import ComposeApp struct ComposeView: UIViewControllerRepresentable { func makeUIViewController(context: Context) -> UIViewController { MainViewControllerKt.MainViewController() } func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} } struct ComposeSkiaView: UIViewControllerRepresentable { func makeUIViewController(context: Context) -> UIViewController { MainViewControllerKt.SkiaRenderViewController() } func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} } struct ContentView: View { var body: some View { TabView { // UIKit 渲染 ComposeView() .ignoresSafeArea(.keyboard) .tabItem { Label("Compose", systemImage: "rectangle.3.group.fill") } // Skia 渲染 ComposeSkiaView() .ignoresSafeArea(.keyboard) .tabItem { Label("Skia", systemImage: "s.circle.fill") } } } }
2201_76010299/kmptpc_compose_sample
iosApp/iosApp/ContentView.swift
Swift
apache-2.0
1,872
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import UIKit @objc class ImagesScrollView: UIScrollView { // MARK: - Initialization override init(frame: CGRect) { super.init(frame: frame) commonInit() } required init?(coder: NSCoder) { super.init(coder: coder) commonInit() } // MARK: - Setup private func commonInit() { configureAppearance() addImageViews() } private func configureAppearance() { backgroundColor = .systemGray5 showsVerticalScrollIndicator = true showsHorizontalScrollIndicator = true } private func addImageViews() { let imageViews = (1...6).map { index -> UIImageView in let imageName = "img-type-\(index)" let image = UIImage(named: imageName) let imageView = UIImageView(frame: CGRect( x: index * 80 + 20, y: index * 80 + 20, width: 80, height: 80 )) imageView.image = image imageView.contentMode = .scaleAspectFit imageView.clipsToBounds = true return imageView } imageViews.forEach { addSubview($0) } let maxX = imageViews.map { $0.frame.maxX }.max() ?? 0 let maxY = imageViews.map { $0.frame.maxY }.max() ?? 0 contentSize = CGSize( width: maxX + 20, height: maxY + 20 ) } }
2201_76010299/kmptpc_compose_sample
iosApp/iosApp/Views/ImagesScrollView.swift
Swift
apache-2.0
2,223
/* * Tencent is pleased to support the open source community by making ovCompose available. * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import SwiftUI @main struct iOSApp: App { var body: some Scene { WindowGroup { ContentView() } } }
2201_76010299/kmptpc_compose_sample
iosApp/iosApp/iOSApp.swift
Swift
apache-2.0
872
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; var _adapter_factory = require('./adapter_factory.js'); var adapter = (0, _adapter_factory.adapterFactory)({ window: window }); module.exports = adapter; // this is the difference from adapter_core. },{"./adapter_factory.js":2}],2:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.adapterFactory = adapterFactory; var _utils = require('./utils'); var utils = _interopRequireWildcard(_utils); var _chrome_shim = require('./chrome/chrome_shim'); var chromeShim = _interopRequireWildcard(_chrome_shim); var _edge_shim = require('./edge/edge_shim'); var edgeShim = _interopRequireWildcard(_edge_shim); var _firefox_shim = require('./firefox/firefox_shim'); var firefoxShim = _interopRequireWildcard(_firefox_shim); var _safari_shim = require('./safari/safari_shim'); var safariShim = _interopRequireWildcard(_safari_shim); var _common_shim = require('./common_shim'); var commonShim = _interopRequireWildcard(_common_shim); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } // Shimming starts here. /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ function adapterFactory() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, window = _ref.window; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { shimChrome: true, shimFirefox: true, shimEdge: true, shimSafari: true }; // Utils. var logging = utils.log; var browserDetails = utils.detectBrowser(window); var adapter = { browserDetails: browserDetails, commonShim: commonShim, extractVersion: utils.extractVersion, disableLog: utils.disableLog, disableWarnings: utils.disableWarnings }; // Shim browser if found. switch (browserDetails.browser) { case 'chrome': if (!chromeShim || !chromeShim.shimPeerConnection || !options.shimChrome) { logging('Chrome shim is not included in this adapter release.'); return adapter; } logging('adapter.js shimming chrome.'); // Export to the adapter global object visible in the browser. adapter.browserShim = chromeShim; chromeShim.shimGetUserMedia(window); chromeShim.shimMediaStream(window); chromeShim.shimPeerConnection(window); chromeShim.shimOnTrack(window); chromeShim.shimAddTrackRemoveTrack(window); chromeShim.shimGetSendersWithDtmf(window); chromeShim.shimGetStats(window); chromeShim.shimSenderReceiverGetStats(window); chromeShim.fixNegotiationNeeded(window); commonShim.shimRTCIceCandidate(window); commonShim.shimConnectionState(window); commonShim.shimMaxMessageSize(window); commonShim.shimSendThrowTypeError(window); commonShim.removeAllowExtmapMixed(window); break; case 'firefox': if (!firefoxShim || !firefoxShim.shimPeerConnection || !options.shimFirefox) { logging('Firefox shim is not included in this adapter release.'); return adapter; } logging('adapter.js shimming firefox.'); // Export to the adapter global object visible in the browser. adapter.browserShim = firefoxShim; firefoxShim.shimGetUserMedia(window); firefoxShim.shimPeerConnection(window); firefoxShim.shimOnTrack(window); firefoxShim.shimRemoveStream(window); firefoxShim.shimSenderGetStats(window); firefoxShim.shimReceiverGetStats(window); firefoxShim.shimRTCDataChannel(window); commonShim.shimRTCIceCandidate(window); commonShim.shimConnectionState(window); commonShim.shimMaxMessageSize(window); commonShim.shimSendThrowTypeError(window); break; case 'edge': if (!edgeShim || !edgeShim.shimPeerConnection || !options.shimEdge) { logging('MS edge shim is not included in this adapter release.'); return adapter; } logging('adapter.js shimming edge.'); // Export to the adapter global object visible in the browser. adapter.browserShim = edgeShim; edgeShim.shimGetUserMedia(window); edgeShim.shimGetDisplayMedia(window); edgeShim.shimPeerConnection(window); edgeShim.shimReplaceTrack(window); // the edge shim implements the full RTCIceCandidate object. commonShim.shimMaxMessageSize(window); commonShim.shimSendThrowTypeError(window); break; case 'safari': if (!safariShim || !options.shimSafari) { logging('Safari shim is not included in this adapter release.'); return adapter; } logging('adapter.js shimming safari.'); // Export to the adapter global object visible in the browser. adapter.browserShim = safariShim; safariShim.shimRTCIceServerUrls(window); safariShim.shimCreateOfferLegacy(window); safariShim.shimCallbacksAPI(window); safariShim.shimLocalStreamsAPI(window); safariShim.shimRemoteStreamsAPI(window); safariShim.shimTrackEventTransceiver(window); safariShim.shimGetUserMedia(window); commonShim.shimRTCIceCandidate(window); commonShim.shimMaxMessageSize(window); commonShim.shimSendThrowTypeError(window); commonShim.removeAllowExtmapMixed(window); break; default: logging('Unsupported browser!'); break; } return adapter; } // Browser shims. },{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.shimGetDisplayMedia = exports.shimGetUserMedia = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _getusermedia = require('./getusermedia'); Object.defineProperty(exports, 'shimGetUserMedia', { enumerable: true, get: function get() { return _getusermedia.shimGetUserMedia; } }); var _getdisplaymedia = require('./getdisplaymedia'); Object.defineProperty(exports, 'shimGetDisplayMedia', { enumerable: true, get: function get() { return _getdisplaymedia.shimGetDisplayMedia; } }); exports.shimMediaStream = shimMediaStream; exports.shimOnTrack = shimOnTrack; exports.shimGetSendersWithDtmf = shimGetSendersWithDtmf; exports.shimGetStats = shimGetStats; exports.shimSenderReceiverGetStats = shimSenderReceiverGetStats; exports.shimAddTrackRemoveTrackWithNative = shimAddTrackRemoveTrackWithNative; exports.shimAddTrackRemoveTrack = shimAddTrackRemoveTrack; exports.shimPeerConnection = shimPeerConnection; exports.fixNegotiationNeeded = fixNegotiationNeeded; var _utils = require('../utils.js'); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function shimMediaStream(window) { window.MediaStream = window.MediaStream || window.webkitMediaStream; } function shimOnTrack(window) { if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && !('ontrack' in window.RTCPeerConnection.prototype)) { Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', { get: function get() { return this._ontrack; }, set: function set(f) { if (this._ontrack) { this.removeEventListener('track', this._ontrack); } this.addEventListener('track', this._ontrack = f); }, enumerable: true, configurable: true }); var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { var _this = this; if (!this._ontrackpoly) { this._ontrackpoly = function (e) { // onaddstream does not fire when a track is added to an existing // stream. But stream.onaddtrack is implemented so we use that. e.stream.addEventListener('addtrack', function (te) { var receiver = void 0; if (window.RTCPeerConnection.prototype.getReceivers) { receiver = _this.getReceivers().find(function (r) { return r.track && r.track.id === te.track.id; }); } else { receiver = { track: te.track }; } var event = new Event('track'); event.track = te.track; event.receiver = receiver; event.transceiver = { receiver: receiver }; event.streams = [e.stream]; _this.dispatchEvent(event); }); e.stream.getTracks().forEach(function (track) { var receiver = void 0; if (window.RTCPeerConnection.prototype.getReceivers) { receiver = _this.getReceivers().find(function (r) { return r.track && r.track.id === track.id; }); } else { receiver = { track: track }; } var event = new Event('track'); event.track = track; event.receiver = receiver; event.transceiver = { receiver: receiver }; event.streams = [e.stream]; _this.dispatchEvent(event); }); }; this.addEventListener('addstream', this._ontrackpoly); } return origSetRemoteDescription.apply(this, arguments); }; } else { // even if RTCRtpTransceiver is in window, it is only used and // emitted in unified-plan. Unfortunately this means we need // to unconditionally wrap the event. utils.wrapPeerConnectionEvent(window, 'track', function (e) { if (!e.transceiver) { Object.defineProperty(e, 'transceiver', { value: { receiver: e.receiver } }); } return e; }); } } function shimGetSendersWithDtmf(window) { // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack. if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && !('getSenders' in window.RTCPeerConnection.prototype) && 'createDTMFSender' in window.RTCPeerConnection.prototype) { var shimSenderWithDtmf = function shimSenderWithDtmf(pc, track) { return { track: track, get dtmf() { if (this._dtmf === undefined) { if (track.kind === 'audio') { this._dtmf = pc.createDTMFSender(track); } else { this._dtmf = null; } } return this._dtmf; }, _pc: pc }; }; // augment addTrack when getSenders is not available. if (!window.RTCPeerConnection.prototype.getSenders) { window.RTCPeerConnection.prototype.getSenders = function getSenders() { this._senders = this._senders || []; return this._senders.slice(); // return a copy of the internal state. }; var origAddTrack = window.RTCPeerConnection.prototype.addTrack; window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { var sender = origAddTrack.apply(this, arguments); if (!sender) { sender = shimSenderWithDtmf(this, track); this._senders.push(sender); } return sender; }; var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack; window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { origRemoveTrack.apply(this, arguments); var idx = this._senders.indexOf(sender); if (idx !== -1) { this._senders.splice(idx, 1); } }; } var origAddStream = window.RTCPeerConnection.prototype.addStream; window.RTCPeerConnection.prototype.addStream = function addStream(stream) { var _this2 = this; this._senders = this._senders || []; origAddStream.apply(this, [stream]); stream.getTracks().forEach(function (track) { _this2._senders.push(shimSenderWithDtmf(_this2, track)); }); }; var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { var _this3 = this; this._senders = this._senders || []; origRemoveStream.apply(this, [stream]); stream.getTracks().forEach(function (track) { var sender = _this3._senders.find(function (s) { return s.track === track; }); if (sender) { // remove sender _this3._senders.splice(_this3._senders.indexOf(sender), 1); } }); }; } else if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && 'getSenders' in window.RTCPeerConnection.prototype && 'createDTMFSender' in window.RTCPeerConnection.prototype && window.RTCRtpSender && !('dtmf' in window.RTCRtpSender.prototype)) { var origGetSenders = window.RTCPeerConnection.prototype.getSenders; window.RTCPeerConnection.prototype.getSenders = function getSenders() { var _this4 = this; var senders = origGetSenders.apply(this, []); senders.forEach(function (sender) { return sender._pc = _this4; }); return senders; }; Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', { get: function get() { if (this._dtmf === undefined) { if (this.track.kind === 'audio') { this._dtmf = this._pc.createDTMFSender(this.track); } else { this._dtmf = null; } } return this._dtmf; } }); } } function shimGetStats(window) { if (!window.RTCPeerConnection) { return; } var origGetStats = window.RTCPeerConnection.prototype.getStats; window.RTCPeerConnection.prototype.getStats = function getStats() { var _this5 = this; var _arguments = Array.prototype.slice.call(arguments), selector = _arguments[0], onSucc = _arguments[1], onErr = _arguments[2]; // If selector is a function then we are in the old style stats so just // pass back the original getStats format to avoid breaking old users. if (arguments.length > 0 && typeof selector === 'function') { return origGetStats.apply(this, arguments); } // When spec-style getStats is supported, return those when called with // either no arguments or the selector argument is null. if (origGetStats.length === 0 && (arguments.length === 0 || typeof selector !== 'function')) { return origGetStats.apply(this, []); } var fixChromeStats_ = function fixChromeStats_(response) { var standardReport = {}; var reports = response.result(); reports.forEach(function (report) { var standardStats = { id: report.id, timestamp: report.timestamp, type: { localcandidate: 'local-candidate', remotecandidate: 'remote-candidate' }[report.type] || report.type }; report.names().forEach(function (name) { standardStats[name] = report.stat(name); }); standardReport[standardStats.id] = standardStats; }); return standardReport; }; // shim getStats with maplike support var makeMapStats = function makeMapStats(stats) { return new Map(Object.keys(stats).map(function (key) { return [key, stats[key]]; })); }; if (arguments.length >= 2) { var successCallbackWrapper_ = function successCallbackWrapper_(response) { onSucc(makeMapStats(fixChromeStats_(response))); }; return origGetStats.apply(this, [successCallbackWrapper_, selector]); } // promise-support return new Promise(function (resolve, reject) { origGetStats.apply(_this5, [function (response) { resolve(makeMapStats(fixChromeStats_(response))); }, reject]); }).then(onSucc, onErr); }; } function shimSenderReceiverGetStats(window) { if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender && window.RTCRtpReceiver)) { return; } // shim sender stats. if (!('getStats' in window.RTCRtpSender.prototype)) { var origGetSenders = window.RTCPeerConnection.prototype.getSenders; if (origGetSenders) { window.RTCPeerConnection.prototype.getSenders = function getSenders() { var _this6 = this; var senders = origGetSenders.apply(this, []); senders.forEach(function (sender) { return sender._pc = _this6; }); return senders; }; } var origAddTrack = window.RTCPeerConnection.prototype.addTrack; if (origAddTrack) { window.RTCPeerConnection.prototype.addTrack = function addTrack() { var sender = origAddTrack.apply(this, arguments); sender._pc = this; return sender; }; } window.RTCRtpSender.prototype.getStats = function getStats() { var sender = this; return this._pc.getStats().then(function (result) { return ( /* Note: this will include stats of all senders that * send a track with the same id as sender.track as * it is not possible to identify the RTCRtpSender. */ utils.filterStats(result, sender.track, true) ); }); }; } // shim receiver stats. if (!('getStats' in window.RTCRtpReceiver.prototype)) { var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers; if (origGetReceivers) { window.RTCPeerConnection.prototype.getReceivers = function getReceivers() { var _this7 = this; var receivers = origGetReceivers.apply(this, []); receivers.forEach(function (receiver) { return receiver._pc = _this7; }); return receivers; }; } utils.wrapPeerConnectionEvent(window, 'track', function (e) { e.receiver._pc = e.srcElement; return e; }); window.RTCRtpReceiver.prototype.getStats = function getStats() { var receiver = this; return this._pc.getStats().then(function (result) { return utils.filterStats(result, receiver.track, false); }); }; } if (!('getStats' in window.RTCRtpSender.prototype && 'getStats' in window.RTCRtpReceiver.prototype)) { return; } // shim RTCPeerConnection.getStats(track). var origGetStats = window.RTCPeerConnection.prototype.getStats; window.RTCPeerConnection.prototype.getStats = function getStats() { if (arguments.length > 0 && arguments[0] instanceof window.MediaStreamTrack) { var track = arguments[0]; var sender = void 0; var receiver = void 0; var err = void 0; this.getSenders().forEach(function (s) { if (s.track === track) { if (sender) { err = true; } else { sender = s; } } }); this.getReceivers().forEach(function (r) { if (r.track === track) { if (receiver) { err = true; } else { receiver = r; } } return r.track === track; }); if (err || sender && receiver) { return Promise.reject(new DOMException('There are more than one sender or receiver for the track.', 'InvalidAccessError')); } else if (sender) { return sender.getStats(); } else if (receiver) { return receiver.getStats(); } return Promise.reject(new DOMException('There is no sender or receiver for the track.', 'InvalidAccessError')); } return origGetStats.apply(this, arguments); }; } function shimAddTrackRemoveTrackWithNative(window) { // shim addTrack/removeTrack with native variants in order to make // the interactions with legacy getLocalStreams behave as in other browsers. // Keeps a mapping stream.id => [stream, rtpsenders...] window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { var _this8 = this; this._shimmedLocalStreams = this._shimmedLocalStreams || {}; return Object.keys(this._shimmedLocalStreams).map(function (streamId) { return _this8._shimmedLocalStreams[streamId][0]; }); }; var origAddTrack = window.RTCPeerConnection.prototype.addTrack; window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { if (!stream) { return origAddTrack.apply(this, arguments); } this._shimmedLocalStreams = this._shimmedLocalStreams || {}; var sender = origAddTrack.apply(this, arguments); if (!this._shimmedLocalStreams[stream.id]) { this._shimmedLocalStreams[stream.id] = [stream, sender]; } else if (this._shimmedLocalStreams[stream.id].indexOf(sender) === -1) { this._shimmedLocalStreams[stream.id].push(sender); } return sender; }; var origAddStream = window.RTCPeerConnection.prototype.addStream; window.RTCPeerConnection.prototype.addStream = function addStream(stream) { var _this9 = this; this._shimmedLocalStreams = this._shimmedLocalStreams || {}; stream.getTracks().forEach(function (track) { var alreadyExists = _this9.getSenders().find(function (s) { return s.track === track; }); if (alreadyExists) { throw new DOMException('Track already exists.', 'InvalidAccessError'); } }); var existingSenders = this.getSenders(); origAddStream.apply(this, arguments); var newSenders = this.getSenders().filter(function (newSender) { return existingSenders.indexOf(newSender) === -1; }); this._shimmedLocalStreams[stream.id] = [stream].concat(newSenders); }; var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { this._shimmedLocalStreams = this._shimmedLocalStreams || {}; delete this._shimmedLocalStreams[stream.id]; return origRemoveStream.apply(this, arguments); }; var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack; window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { var _this10 = this; this._shimmedLocalStreams = this._shimmedLocalStreams || {}; if (sender) { Object.keys(this._shimmedLocalStreams).forEach(function (streamId) { var idx = _this10._shimmedLocalStreams[streamId].indexOf(sender); if (idx !== -1) { _this10._shimmedLocalStreams[streamId].splice(idx, 1); } if (_this10._shimmedLocalStreams[streamId].length === 1) { delete _this10._shimmedLocalStreams[streamId]; } }); } return origRemoveTrack.apply(this, arguments); }; } function shimAddTrackRemoveTrack(window) { if (!window.RTCPeerConnection) { return; } var browserDetails = utils.detectBrowser(window); // shim addTrack and removeTrack. if (window.RTCPeerConnection.prototype.addTrack && browserDetails.version >= 65) { return shimAddTrackRemoveTrackWithNative(window); } // also shim pc.getLocalStreams when addTrack is shimmed // to return the original streams. var origGetLocalStreams = window.RTCPeerConnection.prototype.getLocalStreams; window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { var _this11 = this; var nativeStreams = origGetLocalStreams.apply(this); this._reverseStreams = this._reverseStreams || {}; return nativeStreams.map(function (stream) { return _this11._reverseStreams[stream.id]; }); }; var origAddStream = window.RTCPeerConnection.prototype.addStream; window.RTCPeerConnection.prototype.addStream = function addStream(stream) { var _this12 = this; this._streams = this._streams || {}; this._reverseStreams = this._reverseStreams || {}; stream.getTracks().forEach(function (track) { var alreadyExists = _this12.getSenders().find(function (s) { return s.track === track; }); if (alreadyExists) { throw new DOMException('Track already exists.', 'InvalidAccessError'); } }); // Add identity mapping for consistency with addTrack. // Unless this is being used with a stream from addTrack. if (!this._reverseStreams[stream.id]) { var newStream = new window.MediaStream(stream.getTracks()); this._streams[stream.id] = newStream; this._reverseStreams[newStream.id] = stream; stream = newStream; } origAddStream.apply(this, [stream]); }; var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { this._streams = this._streams || {}; this._reverseStreams = this._reverseStreams || {}; origRemoveStream.apply(this, [this._streams[stream.id] || stream]); delete this._reverseStreams[this._streams[stream.id] ? this._streams[stream.id].id : stream.id]; delete this._streams[stream.id]; }; window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { var _this13 = this; if (this.signalingState === 'closed') { throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.', 'InvalidStateError'); } var streams = [].slice.call(arguments, 1); if (streams.length !== 1 || !streams[0].getTracks().find(function (t) { return t === track; })) { // this is not fully correct but all we can manage without // [[associated MediaStreams]] internal slot. throw new DOMException('The adapter.js addTrack polyfill only supports a single ' + ' stream which is associated with the specified track.', 'NotSupportedError'); } var alreadyExists = this.getSenders().find(function (s) { return s.track === track; }); if (alreadyExists) { throw new DOMException('Track already exists.', 'InvalidAccessError'); } this._streams = this._streams || {}; this._reverseStreams = this._reverseStreams || {}; var oldStream = this._streams[stream.id]; if (oldStream) { // this is using odd Chrome behaviour, use with caution: // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815 // Note: we rely on the high-level addTrack/dtmf shim to // create the sender with a dtmf sender. oldStream.addTrack(track); // Trigger ONN async. Promise.resolve().then(function () { _this13.dispatchEvent(new Event('negotiationneeded')); }); } else { var newStream = new window.MediaStream([track]); this._streams[stream.id] = newStream; this._reverseStreams[newStream.id] = stream; this.addStream(newStream); } return this.getSenders().find(function (s) { return s.track === track; }); }; // replace the internal stream id with the external one and // vice versa. function replaceInternalStreamId(pc, description) { var sdp = description.sdp; Object.keys(pc._reverseStreams || []).forEach(function (internalId) { var externalStream = pc._reverseStreams[internalId]; var internalStream = pc._streams[externalStream.id]; sdp = sdp.replace(new RegExp(internalStream.id, 'g'), externalStream.id); }); return new RTCSessionDescription({ type: description.type, sdp: sdp }); } function replaceExternalStreamId(pc, description) { var sdp = description.sdp; Object.keys(pc._reverseStreams || []).forEach(function (internalId) { var externalStream = pc._reverseStreams[internalId]; var internalStream = pc._streams[externalStream.id]; sdp = sdp.replace(new RegExp(externalStream.id, 'g'), internalStream.id); }); return new RTCSessionDescription({ type: description.type, sdp: sdp }); } ['createOffer', 'createAnswer'].forEach(function (method) { var nativeMethod = window.RTCPeerConnection.prototype[method]; var methodObj = _defineProperty({}, method, function () { var _this14 = this; var args = arguments; var isLegacyCall = arguments.length && typeof arguments[0] === 'function'; if (isLegacyCall) { return nativeMethod.apply(this, [function (description) { var desc = replaceInternalStreamId(_this14, description); args[0].apply(null, [desc]); }, function (err) { if (args[1]) { args[1].apply(null, err); } }, arguments[2]]); } return nativeMethod.apply(this, arguments).then(function (description) { return replaceInternalStreamId(_this14, description); }); }); window.RTCPeerConnection.prototype[method] = methodObj[method]; }); var origSetLocalDescription = window.RTCPeerConnection.prototype.setLocalDescription; window.RTCPeerConnection.prototype.setLocalDescription = function setLocalDescription() { if (!arguments.length || !arguments[0].type) { return origSetLocalDescription.apply(this, arguments); } arguments[0] = replaceExternalStreamId(this, arguments[0]); return origSetLocalDescription.apply(this, arguments); }; // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier var origLocalDescription = Object.getOwnPropertyDescriptor(window.RTCPeerConnection.prototype, 'localDescription'); Object.defineProperty(window.RTCPeerConnection.prototype, 'localDescription', { get: function get() { var description = origLocalDescription.get.apply(this); if (description.type === '') { return description; } return replaceInternalStreamId(this, description); } }); window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { var _this15 = this; if (this.signalingState === 'closed') { throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.', 'InvalidStateError'); } // We can not yet check for sender instanceof RTCRtpSender // since we shim RTPSender. So we check if sender._pc is set. if (!sender._pc) { throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack ' + 'does not implement interface RTCRtpSender.', 'TypeError'); } var isLocal = sender._pc === this; if (!isLocal) { throw new DOMException('Sender was not created by this connection.', 'InvalidAccessError'); } // Search for the native stream the senders track belongs to. this._streams = this._streams || {}; var stream = void 0; Object.keys(this._streams).forEach(function (streamid) { var hasTrack = _this15._streams[streamid].getTracks().find(function (track) { return sender.track === track; }); if (hasTrack) { stream = _this15._streams[streamid]; } }); if (stream) { if (stream.getTracks().length === 1) { // if this is the last track of the stream, remove the stream. This // takes care of any shimmed _senders. this.removeStream(this._reverseStreams[stream.id]); } else { // relying on the same odd chrome behaviour as above. stream.removeTrack(sender.track); } this.dispatchEvent(new Event('negotiationneeded')); } }; } function shimPeerConnection(window) { var browserDetails = utils.detectBrowser(window); if (!window.RTCPeerConnection && window.webkitRTCPeerConnection) { // very basic support for old versions. window.RTCPeerConnection = window.webkitRTCPeerConnection; } if (!window.RTCPeerConnection) { return; } // shim implicit creation of RTCSessionDescription/RTCIceCandidate if (browserDetails.version < 53) { ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'].forEach(function (method) { var nativeMethod = window.RTCPeerConnection.prototype[method]; var methodObj = _defineProperty({}, method, function () { arguments[0] = new (method === 'addIceCandidate' ? window.RTCIceCandidate : window.RTCSessionDescription)(arguments[0]); return nativeMethod.apply(this, arguments); }); window.RTCPeerConnection.prototype[method] = methodObj[method]; }); } // support for addIceCandidate(null or undefined) var nativeAddIceCandidate = window.RTCPeerConnection.prototype.addIceCandidate; window.RTCPeerConnection.prototype.addIceCandidate = function addIceCandidate() { if (!arguments[0]) { if (arguments[1]) { arguments[1].apply(null); } return Promise.resolve(); } // Firefox 68+ emits and processes {candidate: "", ...}, ignore // in older versions. Native support planned for Chrome M77. if (browserDetails.version < 78 && arguments[0] && arguments[0].candidate === '') { return Promise.resolve(); } return nativeAddIceCandidate.apply(this, arguments); }; } function fixNegotiationNeeded(window) { utils.wrapPeerConnectionEvent(window, 'negotiationneeded', function (e) { var pc = e.target; if (pc.signalingState !== 'stable') { return; } return e; }); } },{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(require,module,exports){ /* * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.shimGetDisplayMedia = shimGetDisplayMedia; function shimGetDisplayMedia(window, getSourceId) { if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) { return; } if (!window.navigator.mediaDevices) { return; } // getSourceId is a function that returns a promise resolving with // the sourceId of the screen/window/tab to be shared. if (typeof getSourceId !== 'function') { console.error('shimGetDisplayMedia: getSourceId argument is not ' + 'a function'); return; } window.navigator.mediaDevices.getDisplayMedia = function getDisplayMedia(constraints) { return getSourceId(constraints).then(function (sourceId) { var widthSpecified = constraints.video && constraints.video.width; var heightSpecified = constraints.video && constraints.video.height; var frameRateSpecified = constraints.video && constraints.video.frameRate; constraints.video = { mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId: sourceId, maxFrameRate: frameRateSpecified || 3 } }; if (widthSpecified) { constraints.video.mandatory.maxWidth = widthSpecified; } if (heightSpecified) { constraints.video.mandatory.maxHeight = heightSpecified; } return window.navigator.mediaDevices.getUserMedia(constraints); }); }; } },{}],5:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.shimGetUserMedia = shimGetUserMedia; var _utils = require('../utils.js'); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } var logging = utils.log; function shimGetUserMedia(window) { var navigator = window && window.navigator; if (!navigator.mediaDevices) { return; } var browserDetails = utils.detectBrowser(window); var constraintsToChrome_ = function constraintsToChrome_(c) { if ((typeof c === 'undefined' ? 'undefined' : _typeof(c)) !== 'object' || c.mandatory || c.optional) { return c; } var cc = {}; Object.keys(c).forEach(function (key) { if (key === 'require' || key === 'advanced' || key === 'mediaSource') { return; } var r = _typeof(c[key]) === 'object' ? c[key] : { ideal: c[key] }; if (r.exact !== undefined && typeof r.exact === 'number') { r.min = r.max = r.exact; } var oldname_ = function oldname_(prefix, name) { if (prefix) { return prefix + name.charAt(0).toUpperCase() + name.slice(1); } return name === 'deviceId' ? 'sourceId' : name; }; if (r.ideal !== undefined) { cc.optional = cc.optional || []; var oc = {}; if (typeof r.ideal === 'number') { oc[oldname_('min', key)] = r.ideal; cc.optional.push(oc); oc = {}; oc[oldname_('max', key)] = r.ideal; cc.optional.push(oc); } else { oc[oldname_('', key)] = r.ideal; cc.optional.push(oc); } } if (r.exact !== undefined && typeof r.exact !== 'number') { cc.mandatory = cc.mandatory || {}; cc.mandatory[oldname_('', key)] = r.exact; } else { ['min', 'max'].forEach(function (mix) { if (r[mix] !== undefined) { cc.mandatory = cc.mandatory || {}; cc.mandatory[oldname_(mix, key)] = r[mix]; } }); } }); if (c.advanced) { cc.optional = (cc.optional || []).concat(c.advanced); } return cc; }; var shimConstraints_ = function shimConstraints_(constraints, func) { if (browserDetails.version >= 61) { return func(constraints); } constraints = JSON.parse(JSON.stringify(constraints)); if (constraints && _typeof(constraints.audio) === 'object') { var remap = function remap(obj, a, b) { if (a in obj && !(b in obj)) { obj[b] = obj[a]; delete obj[a]; } }; constraints = JSON.parse(JSON.stringify(constraints)); remap(constraints.audio, 'autoGainControl', 'googAutoGainControl'); remap(constraints.audio, 'noiseSuppression', 'googNoiseSuppression'); constraints.audio = constraintsToChrome_(constraints.audio); } if (constraints && _typeof(constraints.video) === 'object') { // Shim facingMode for mobile & surface pro. var face = constraints.video.facingMode; face = face && ((typeof face === 'undefined' ? 'undefined' : _typeof(face)) === 'object' ? face : { ideal: face }); var getSupportedFacingModeLies = browserDetails.version < 66; if (face && (face.exact === 'user' || face.exact === 'environment' || face.ideal === 'user' || face.ideal === 'environment') && !(navigator.mediaDevices.getSupportedConstraints && navigator.mediaDevices.getSupportedConstraints().facingMode && !getSupportedFacingModeLies)) { delete constraints.video.facingMode; var matches = void 0; if (face.exact === 'environment' || face.ideal === 'environment') { matches = ['back', 'rear']; } else if (face.exact === 'user' || face.ideal === 'user') { matches = ['front']; } if (matches) { // Look for matches in label, or use last cam for back (typical). return navigator.mediaDevices.enumerateDevices().then(function (devices) { devices = devices.filter(function (d) { return d.kind === 'videoinput'; }); var dev = devices.find(function (d) { return matches.some(function (match) { return d.label.toLowerCase().includes(match); }); }); if (!dev && devices.length && matches.includes('back')) { dev = devices[devices.length - 1]; // more likely the back cam } if (dev) { constraints.video.deviceId = face.exact ? { exact: dev.deviceId } : { ideal: dev.deviceId }; } constraints.video = constraintsToChrome_(constraints.video); logging('chrome: ' + JSON.stringify(constraints)); return func(constraints); }); } } constraints.video = constraintsToChrome_(constraints.video); } logging('chrome: ' + JSON.stringify(constraints)); return func(constraints); }; var shimError_ = function shimError_(e) { if (browserDetails.version >= 64) { return e; } return { name: { PermissionDeniedError: 'NotAllowedError', PermissionDismissedError: 'NotAllowedError', InvalidStateError: 'NotAllowedError', DevicesNotFoundError: 'NotFoundError', ConstraintNotSatisfiedError: 'OverconstrainedError', TrackStartError: 'NotReadableError', MediaDeviceFailedDueToShutdown: 'NotAllowedError', MediaDeviceKillSwitchOn: 'NotAllowedError', TabCaptureError: 'AbortError', ScreenCaptureError: 'AbortError', DeviceCaptureError: 'AbortError' }[e.name] || e.name, message: e.message, constraint: e.constraint || e.constraintName, toString: function toString() { return this.name + (this.message && ': ') + this.message; } }; }; var getUserMedia_ = function getUserMedia_(constraints, onSuccess, onError) { shimConstraints_(constraints, function (c) { navigator.webkitGetUserMedia(c, onSuccess, function (e) { if (onError) { onError(shimError_(e)); } }); }); }; navigator.getUserMedia = getUserMedia_.bind(navigator); // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia // function which returns a Promise, it does not accept spec-style // constraints. if (navigator.mediaDevices.getUserMedia) { var origGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices); navigator.mediaDevices.getUserMedia = function (cs) { return shimConstraints_(cs, function (c) { return origGetUserMedia(c).then(function (stream) { if (c.audio && !stream.getAudioTracks().length || c.video && !stream.getVideoTracks().length) { stream.getTracks().forEach(function (track) { track.stop(); }); throw new DOMException('', 'NotFoundError'); } return stream; }, function (e) { return Promise.reject(shimError_(e)); }); }); }; } } },{"../utils.js":15}],6:[function(require,module,exports){ /* * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.shimRTCIceCandidate = shimRTCIceCandidate; exports.shimMaxMessageSize = shimMaxMessageSize; exports.shimSendThrowTypeError = shimSendThrowTypeError; exports.shimConnectionState = shimConnectionState; exports.removeAllowExtmapMixed = removeAllowExtmapMixed; var _sdp = require('sdp'); var _sdp2 = _interopRequireDefault(_sdp); var _utils = require('./utils'); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function shimRTCIceCandidate(window) { // foundation is arbitrarily chosen as an indicator for full support for // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface if (!window.RTCIceCandidate || window.RTCIceCandidate && 'foundation' in window.RTCIceCandidate.prototype) { return; } var NativeRTCIceCandidate = window.RTCIceCandidate; window.RTCIceCandidate = function RTCIceCandidate(args) { // Remove the a= which shouldn't be part of the candidate string. if ((typeof args === 'undefined' ? 'undefined' : _typeof(args)) === 'object' && args.candidate && args.candidate.indexOf('a=') === 0) { args = JSON.parse(JSON.stringify(args)); args.candidate = args.candidate.substr(2); } if (args.candidate && args.candidate.length) { // Augment the native candidate with the parsed fields. var nativeCandidate = new NativeRTCIceCandidate(args); var parsedCandidate = _sdp2.default.parseCandidate(args.candidate); var augmentedCandidate = Object.assign(nativeCandidate, parsedCandidate); // Add a serializer that does not serialize the extra attributes. augmentedCandidate.toJSON = function toJSON() { return { candidate: augmentedCandidate.candidate, sdpMid: augmentedCandidate.sdpMid, sdpMLineIndex: augmentedCandidate.sdpMLineIndex, usernameFragment: augmentedCandidate.usernameFragment }; }; return augmentedCandidate; } return new NativeRTCIceCandidate(args); }; window.RTCIceCandidate.prototype = NativeRTCIceCandidate.prototype; // Hook up the augmented candidate in onicecandidate and // addEventListener('icecandidate', ...) utils.wrapPeerConnectionEvent(window, 'icecandidate', function (e) { if (e.candidate) { Object.defineProperty(e, 'candidate', { value: new window.RTCIceCandidate(e.candidate), writable: 'false' }); } return e; }); } function shimMaxMessageSize(window) { if (!window.RTCPeerConnection) { return; } var browserDetails = utils.detectBrowser(window); if (!('sctp' in window.RTCPeerConnection.prototype)) { Object.defineProperty(window.RTCPeerConnection.prototype, 'sctp', { get: function get() { return typeof this._sctp === 'undefined' ? null : this._sctp; } }); } var sctpInDescription = function sctpInDescription(description) { if (!description || !description.sdp) { return false; } var sections = _sdp2.default.splitSections(description.sdp); sections.shift(); return sections.some(function (mediaSection) { var mLine = _sdp2.default.parseMLine(mediaSection); return mLine && mLine.kind === 'application' && mLine.protocol.indexOf('SCTP') !== -1; }); }; var getRemoteFirefoxVersion = function getRemoteFirefoxVersion(description) { // TODO: Is there a better solution for detecting Firefox? var match = description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/); if (match === null || match.length < 2) { return -1; } var version = parseInt(match[1], 10); // Test for NaN (yes, this is ugly) return version !== version ? -1 : version; }; var getCanSendMaxMessageSize = function getCanSendMaxMessageSize(remoteIsFirefox) { // Every implementation we know can send at least 64 KiB. // Note: Although Chrome is technically able to send up to 256 KiB, the // data does not reach the other peer reliably. // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419 var canSendMaxMessageSize = 65536; if (browserDetails.browser === 'firefox') { if (browserDetails.version < 57) { if (remoteIsFirefox === -1) { // FF < 57 will send in 16 KiB chunks using the deprecated PPID // fragmentation. canSendMaxMessageSize = 16384; } else { // However, other FF (and RAWRTC) can reassemble PPID-fragmented // messages. Thus, supporting ~2 GiB when sending. canSendMaxMessageSize = 2147483637; } } else if (browserDetails.version < 60) { // Currently, all FF >= 57 will reset the remote maximum message size // to the default value when a data channel is created at a later // stage. :( // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 canSendMaxMessageSize = browserDetails.version === 57 ? 65535 : 65536; } else { // FF >= 60 supports sending ~2 GiB canSendMaxMessageSize = 2147483637; } } return canSendMaxMessageSize; }; var getMaxMessageSize = function getMaxMessageSize(description, remoteIsFirefox) { // Note: 65536 bytes is the default value from the SDP spec. Also, // every implementation we know supports receiving 65536 bytes. var maxMessageSize = 65536; // FF 57 has a slightly incorrect default remote max message size, so // we need to adjust it here to avoid a failure when sending. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697 if (browserDetails.browser === 'firefox' && browserDetails.version === 57) { maxMessageSize = 65535; } var match = _sdp2.default.matchPrefix(description.sdp, 'a=max-message-size:'); if (match.length > 0) { maxMessageSize = parseInt(match[0].substr(19), 10); } else if (browserDetails.browser === 'firefox' && remoteIsFirefox !== -1) { // If the maximum message size is not present in the remote SDP and // both local and remote are Firefox, the remote peer can receive // ~2 GiB. maxMessageSize = 2147483637; } return maxMessageSize; }; var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { this._sctp = null; // Chrome decided to not expose .sctp in plan-b mode. // As usual, adapter.js has to do an 'ugly worakaround' // to cover up the mess. if (browserDetails.browser === 'chrome' && browserDetails.version >= 76) { var _getConfiguration = this.getConfiguration(), sdpSemantics = _getConfiguration.sdpSemantics; if (sdpSemantics === 'plan-b') { Object.defineProperty(this, 'sctp', { get: function get() { return typeof this._sctp === 'undefined' ? null : this._sctp; }, enumerable: true, configurable: true }); } } if (sctpInDescription(arguments[0])) { // Check if the remote is FF. var isFirefox = getRemoteFirefoxVersion(arguments[0]); // Get the maximum message size the local peer is capable of sending var canSendMMS = getCanSendMaxMessageSize(isFirefox); // Get the maximum message size of the remote peer. var remoteMMS = getMaxMessageSize(arguments[0], isFirefox); // Determine final maximum message size var maxMessageSize = void 0; if (canSendMMS === 0 && remoteMMS === 0) { maxMessageSize = Number.POSITIVE_INFINITY; } else if (canSendMMS === 0 || remoteMMS === 0) { maxMessageSize = Math.max(canSendMMS, remoteMMS); } else { maxMessageSize = Math.min(canSendMMS, remoteMMS); } // Create a dummy RTCSctpTransport object and the 'maxMessageSize' // attribute. var sctp = {}; Object.defineProperty(sctp, 'maxMessageSize', { get: function get() { return maxMessageSize; } }); this._sctp = sctp; } return origSetRemoteDescription.apply(this, arguments); }; } function shimSendThrowTypeError(window) { if (!(window.RTCPeerConnection && 'createDataChannel' in window.RTCPeerConnection.prototype)) { return; } // Note: Although Firefox >= 57 has a native implementation, the maximum // message size can be reset for all data channels at a later stage. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 function wrapDcSend(dc, pc) { var origDataChannelSend = dc.send; dc.send = function send() { var data = arguments[0]; var length = data.length || data.size || data.byteLength; if (dc.readyState === 'open' && pc.sctp && length > pc.sctp.maxMessageSize) { throw new TypeError('Message too large (can send a maximum of ' + pc.sctp.maxMessageSize + ' bytes)'); } return origDataChannelSend.apply(dc, arguments); }; } var origCreateDataChannel = window.RTCPeerConnection.prototype.createDataChannel; window.RTCPeerConnection.prototype.createDataChannel = function createDataChannel() { var dataChannel = origCreateDataChannel.apply(this, arguments); wrapDcSend(dataChannel, this); return dataChannel; }; utils.wrapPeerConnectionEvent(window, 'datachannel', function (e) { wrapDcSend(e.channel, e.target); return e; }); } /* shims RTCConnectionState by pretending it is the same as iceConnectionState. * See https://bugs.chromium.org/p/webrtc/issues/detail?id=6145#c12 * for why this is a valid hack in Chrome. In Firefox it is slightly incorrect * since DTLS failures would be hidden. See * https://bugzilla.mozilla.org/show_bug.cgi?id=1265827 * for the Firefox tracking bug. */ function shimConnectionState(window) { if (!window.RTCPeerConnection || 'connectionState' in window.RTCPeerConnection.prototype) { return; } var proto = window.RTCPeerConnection.prototype; Object.defineProperty(proto, 'connectionState', { get: function get() { return { completed: 'connected', checking: 'connecting' }[this.iceConnectionState] || this.iceConnectionState; }, enumerable: true, configurable: true }); Object.defineProperty(proto, 'onconnectionstatechange', { get: function get() { return this._onconnectionstatechange || null; }, set: function set(cb) { if (this._onconnectionstatechange) { this.removeEventListener('connectionstatechange', this._onconnectionstatechange); delete this._onconnectionstatechange; } if (cb) { this.addEventListener('connectionstatechange', this._onconnectionstatechange = cb); } }, enumerable: true, configurable: true }); ['setLocalDescription', 'setRemoteDescription'].forEach(function (method) { var origMethod = proto[method]; proto[method] = function () { if (!this._connectionstatechangepoly) { this._connectionstatechangepoly = function (e) { var pc = e.target; if (pc._lastConnectionState !== pc.connectionState) { pc._lastConnectionState = pc.connectionState; var newEvent = new Event('connectionstatechange', e); pc.dispatchEvent(newEvent); } return e; }; this.addEventListener('iceconnectionstatechange', this._connectionstatechangepoly); } return origMethod.apply(this, arguments); }; }); } function removeAllowExtmapMixed(window) { /* remove a=extmap-allow-mixed for Chrome < M71 */ if (!window.RTCPeerConnection) { return; } var browserDetails = utils.detectBrowser(window); if (browserDetails.browser === 'chrome' && browserDetails.version >= 71) { return; } var nativeSRD = window.RTCPeerConnection.prototype.setRemoteDescription; window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription(desc) { if (desc && desc.sdp && desc.sdp.indexOf('\na=extmap-allow-mixed') !== -1) { desc.sdp = desc.sdp.split('\n').filter(function (line) { return line.trim() !== 'a=extmap-allow-mixed'; }).join('\n'); } return nativeSRD.apply(this, arguments); }; } },{"./utils":15,"sdp":17}],7:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.shimGetDisplayMedia = exports.shimGetUserMedia = undefined; var _getusermedia = require('./getusermedia'); Object.defineProperty(exports, 'shimGetUserMedia', { enumerable: true, get: function get() { return _getusermedia.shimGetUserMedia; } }); var _getdisplaymedia = require('./getdisplaymedia'); Object.defineProperty(exports, 'shimGetDisplayMedia', { enumerable: true, get: function get() { return _getdisplaymedia.shimGetDisplayMedia; } }); exports.shimPeerConnection = shimPeerConnection; exports.shimReplaceTrack = shimReplaceTrack; var _utils = require('../utils'); var utils = _interopRequireWildcard(_utils); var _filtericeservers = require('./filtericeservers'); var _rtcpeerconnectionShim = require('rtcpeerconnection-shim'); var _rtcpeerconnectionShim2 = _interopRequireDefault(_rtcpeerconnectionShim); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function shimPeerConnection(window) { var browserDetails = utils.detectBrowser(window); if (window.RTCIceGatherer) { if (!window.RTCIceCandidate) { window.RTCIceCandidate = function RTCIceCandidate(args) { return args; }; } if (!window.RTCSessionDescription) { window.RTCSessionDescription = function RTCSessionDescription(args) { return args; }; } // this adds an additional event listener to MediaStrackTrack that signals // when a tracks enabled property was changed. Workaround for a bug in // addStream, see below. No longer required in 15025+ if (browserDetails.version < 15025) { var origMSTEnabled = Object.getOwnPropertyDescriptor(window.MediaStreamTrack.prototype, 'enabled'); Object.defineProperty(window.MediaStreamTrack.prototype, 'enabled', { set: function set(value) { origMSTEnabled.set.call(this, value); var ev = new Event('enabled'); ev.enabled = value; this.dispatchEvent(ev); } }); } } // ORTC defines the DTMF sender a bit different. // https://github.com/w3c/ortc/issues/714 if (window.RTCRtpSender && !('dtmf' in window.RTCRtpSender.prototype)) { Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', { get: function get() { if (this._dtmf === undefined) { if (this.track.kind === 'audio') { this._dtmf = new window.RTCDtmfSender(this); } else if (this.track.kind === 'video') { this._dtmf = null; } } return this._dtmf; } }); } // Edge currently only implements the RTCDtmfSender, not the // RTCDTMFSender alias. See http://draft.ortc.org/#rtcdtmfsender2* if (window.RTCDtmfSender && !window.RTCDTMFSender) { window.RTCDTMFSender = window.RTCDtmfSender; } var RTCPeerConnectionShim = (0, _rtcpeerconnectionShim2.default)(window, browserDetails.version); window.RTCPeerConnection = function RTCPeerConnection(config) { if (config && config.iceServers) { config.iceServers = (0, _filtericeservers.filterIceServers)(config.iceServers, browserDetails.version); utils.log('ICE servers after filtering:', config.iceServers); } return new RTCPeerConnectionShim(config); }; window.RTCPeerConnection.prototype = RTCPeerConnectionShim.prototype; } function shimReplaceTrack(window) { // ORTC has replaceTrack -- https://github.com/w3c/ortc/issues/614 if (window.RTCRtpSender && !('replaceTrack' in window.RTCRtpSender.prototype)) { window.RTCRtpSender.prototype.replaceTrack = window.RTCRtpSender.prototype.setTrack; } } },{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(require,module,exports){ /* * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.filterIceServers = filterIceServers; var _utils = require('../utils'); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } // Edge does not like // 1) stun: filtered after 14393 unless ?transport=udp is present // 2) turn: that does not have all of turn:host:port?transport=udp // 3) turn: with ipv6 addresses // 4) turn: occurring muliple times function filterIceServers(iceServers, edgeVersion) { var hasTurn = false; iceServers = JSON.parse(JSON.stringify(iceServers)); return iceServers.filter(function (server) { if (server && (server.urls || server.url)) { var urls = server.urls || server.url; if (server.url && !server.urls) { utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls'); } var isString = typeof urls === 'string'; if (isString) { urls = [urls]; } urls = urls.filter(function (url) { // filter STUN unconditionally. if (url.indexOf('stun:') === 0) { return false; } var validTurn = url.startsWith('turn') && !url.startsWith('turn:[') && url.includes('transport=udp'); if (validTurn && !hasTurn) { hasTurn = true; return true; } return validTurn && !hasTurn; }); delete server.url; server.urls = isString ? urls[0] : urls; return !!urls.length; } }); } },{"../utils":15}],9:[function(require,module,exports){ /* * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.shimGetDisplayMedia = shimGetDisplayMedia; function shimGetDisplayMedia(window) { if (!('getDisplayMedia' in window.navigator)) { return; } if (!window.navigator.mediaDevices) { return; } if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) { return; } window.navigator.mediaDevices.getDisplayMedia = window.navigator.getDisplayMedia.bind(window.navigator); } },{}],10:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.shimGetUserMedia = shimGetUserMedia; function shimGetUserMedia(window) { var navigator = window && window.navigator; var shimError_ = function shimError_(e) { return { name: { PermissionDeniedError: 'NotAllowedError' }[e.name] || e.name, message: e.message, constraint: e.constraint, toString: function toString() { return this.name; } }; }; // getUserMedia error shim. var origGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices); navigator.mediaDevices.getUserMedia = function (c) { return origGetUserMedia(c).catch(function (e) { return Promise.reject(shimError_(e)); }); }; } },{}],11:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.shimGetDisplayMedia = exports.shimGetUserMedia = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _getusermedia = require('./getusermedia'); Object.defineProperty(exports, 'shimGetUserMedia', { enumerable: true, get: function get() { return _getusermedia.shimGetUserMedia; } }); var _getdisplaymedia = require('./getdisplaymedia'); Object.defineProperty(exports, 'shimGetDisplayMedia', { enumerable: true, get: function get() { return _getdisplaymedia.shimGetDisplayMedia; } }); exports.shimOnTrack = shimOnTrack; exports.shimPeerConnection = shimPeerConnection; exports.shimSenderGetStats = shimSenderGetStats; exports.shimReceiverGetStats = shimReceiverGetStats; exports.shimRemoveStream = shimRemoveStream; exports.shimRTCDataChannel = shimRTCDataChannel; var _utils = require('../utils'); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function shimOnTrack(window) { if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCTrackEvent && 'receiver' in window.RTCTrackEvent.prototype && !('transceiver' in window.RTCTrackEvent.prototype)) { Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', { get: function get() { return { receiver: this.receiver }; } }); } } function shimPeerConnection(window) { var browserDetails = utils.detectBrowser(window); if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !(window.RTCPeerConnection || window.mozRTCPeerConnection)) { return; // probably media.peerconnection.enabled=false in about:config } if (!window.RTCPeerConnection && window.mozRTCPeerConnection) { // very basic support for old versions. window.RTCPeerConnection = window.mozRTCPeerConnection; } if (browserDetails.version < 53) { // shim away need for obsolete RTCIceCandidate/RTCSessionDescription. ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'].forEach(function (method) { var nativeMethod = window.RTCPeerConnection.prototype[method]; var methodObj = _defineProperty({}, method, function () { arguments[0] = new (method === 'addIceCandidate' ? window.RTCIceCandidate : window.RTCSessionDescription)(arguments[0]); return nativeMethod.apply(this, arguments); }); window.RTCPeerConnection.prototype[method] = methodObj[method]; }); } // support for addIceCandidate(null or undefined) // as well as ignoring {sdpMid, candidate: ""} if (browserDetails.version < 68) { var nativeAddIceCandidate = window.RTCPeerConnection.prototype.addIceCandidate; window.RTCPeerConnection.prototype.addIceCandidate = function addIceCandidate() { if (!arguments[0]) { if (arguments[1]) { arguments[1].apply(null); } return Promise.resolve(); } // Firefox 68+ emits and processes {candidate: "", ...}, ignore // in older versions. if (arguments[0] && arguments[0].candidate === '') { return Promise.resolve(); } return nativeAddIceCandidate.apply(this, arguments); }; } var modernStatsTypes = { inboundrtp: 'inbound-rtp', outboundrtp: 'outbound-rtp', candidatepair: 'candidate-pair', localcandidate: 'local-candidate', remotecandidate: 'remote-candidate' }; var nativeGetStats = window.RTCPeerConnection.prototype.getStats; window.RTCPeerConnection.prototype.getStats = function getStats() { var _arguments = Array.prototype.slice.call(arguments), selector = _arguments[0], onSucc = _arguments[1], onErr = _arguments[2]; return nativeGetStats.apply(this, [selector || null]).then(function (stats) { if (browserDetails.version < 53 && !onSucc) { // Shim only promise getStats with spec-hyphens in type names // Leave callback version alone; misc old uses of forEach before Map try { stats.forEach(function (stat) { stat.type = modernStatsTypes[stat.type] || stat.type; }); } catch (e) { if (e.name !== 'TypeError') { throw e; } // Avoid TypeError: "type" is read-only, in old versions. 34-43ish stats.forEach(function (stat, i) { stats.set(i, Object.assign({}, stat, { type: modernStatsTypes[stat.type] || stat.type })); }); } } return stats; }).then(onSucc, onErr); }; } function shimSenderGetStats(window) { if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender)) { return; } if (window.RTCRtpSender && 'getStats' in window.RTCRtpSender.prototype) { return; } var origGetSenders = window.RTCPeerConnection.prototype.getSenders; if (origGetSenders) { window.RTCPeerConnection.prototype.getSenders = function getSenders() { var _this = this; var senders = origGetSenders.apply(this, []); senders.forEach(function (sender) { return sender._pc = _this; }); return senders; }; } var origAddTrack = window.RTCPeerConnection.prototype.addTrack; if (origAddTrack) { window.RTCPeerConnection.prototype.addTrack = function addTrack() { var sender = origAddTrack.apply(this, arguments); sender._pc = this; return sender; }; } window.RTCRtpSender.prototype.getStats = function getStats() { return this.track ? this._pc.getStats(this.track) : Promise.resolve(new Map()); }; } function shimReceiverGetStats(window) { if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender)) { return; } if (window.RTCRtpSender && 'getStats' in window.RTCRtpReceiver.prototype) { return; } var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers; if (origGetReceivers) { window.RTCPeerConnection.prototype.getReceivers = function getReceivers() { var _this2 = this; var receivers = origGetReceivers.apply(this, []); receivers.forEach(function (receiver) { return receiver._pc = _this2; }); return receivers; }; } utils.wrapPeerConnectionEvent(window, 'track', function (e) { e.receiver._pc = e.srcElement; return e; }); window.RTCRtpReceiver.prototype.getStats = function getStats() { return this._pc.getStats(this.track); }; } function shimRemoveStream(window) { if (!window.RTCPeerConnection || 'removeStream' in window.RTCPeerConnection.prototype) { return; } window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { var _this3 = this; utils.deprecated('removeStream', 'removeTrack'); this.getSenders().forEach(function (sender) { if (sender.track && stream.getTracks().includes(sender.track)) { _this3.removeTrack(sender); } }); }; } function shimRTCDataChannel(window) { // rename DataChannel to RTCDataChannel (native fix in FF60): // https://bugzilla.mozilla.org/show_bug.cgi?id=1173851 if (window.DataChannel && !window.RTCDataChannel) { window.RTCDataChannel = window.DataChannel; } } },{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(require,module,exports){ /* * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.shimGetDisplayMedia = shimGetDisplayMedia; function shimGetDisplayMedia(window, preferredMediaSource) { if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) { return; } if (!window.navigator.mediaDevices) { return; } window.navigator.mediaDevices.getDisplayMedia = function getDisplayMedia(constraints) { if (!(constraints && constraints.video)) { var err = new DOMException('getDisplayMedia without video ' + 'constraints is undefined'); err.name = 'NotFoundError'; // from https://heycam.github.io/webidl/#idl-DOMException-error-names err.code = 8; return Promise.reject(err); } if (constraints.video === true) { constraints.video = { mediaSource: preferredMediaSource }; } else { constraints.video.mediaSource = preferredMediaSource; } return window.navigator.mediaDevices.getUserMedia(constraints); }; } },{}],13:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.shimGetUserMedia = shimGetUserMedia; var _utils = require('../utils'); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function shimGetUserMedia(window) { var browserDetails = utils.detectBrowser(window); var navigator = window && window.navigator; var MediaStreamTrack = window && window.MediaStreamTrack; navigator.getUserMedia = function (constraints, onSuccess, onError) { // Replace Firefox 44+'s deprecation warning with unprefixed version. utils.deprecated('navigator.getUserMedia', 'navigator.mediaDevices.getUserMedia'); navigator.mediaDevices.getUserMedia(constraints).then(onSuccess, onError); }; if (!(browserDetails.version > 55 && 'autoGainControl' in navigator.mediaDevices.getSupportedConstraints())) { var remap = function remap(obj, a, b) { if (a in obj && !(b in obj)) { obj[b] = obj[a]; delete obj[a]; } }; var nativeGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices); navigator.mediaDevices.getUserMedia = function (c) { if ((typeof c === 'undefined' ? 'undefined' : _typeof(c)) === 'object' && _typeof(c.audio) === 'object') { c = JSON.parse(JSON.stringify(c)); remap(c.audio, 'autoGainControl', 'mozAutoGainControl'); remap(c.audio, 'noiseSuppression', 'mozNoiseSuppression'); } return nativeGetUserMedia(c); }; if (MediaStreamTrack && MediaStreamTrack.prototype.getSettings) { var nativeGetSettings = MediaStreamTrack.prototype.getSettings; MediaStreamTrack.prototype.getSettings = function () { var obj = nativeGetSettings.apply(this, arguments); remap(obj, 'mozAutoGainControl', 'autoGainControl'); remap(obj, 'mozNoiseSuppression', 'noiseSuppression'); return obj; }; } if (MediaStreamTrack && MediaStreamTrack.prototype.applyConstraints) { var nativeApplyConstraints = MediaStreamTrack.prototype.applyConstraints; MediaStreamTrack.prototype.applyConstraints = function (c) { if (this.kind === 'audio' && (typeof c === 'undefined' ? 'undefined' : _typeof(c)) === 'object') { c = JSON.parse(JSON.stringify(c)); remap(c, 'autoGainControl', 'mozAutoGainControl'); remap(c, 'noiseSuppression', 'mozNoiseSuppression'); } return nativeApplyConstraints.apply(this, [c]); }; } } } },{"../utils":15}],14:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.shimLocalStreamsAPI = shimLocalStreamsAPI; exports.shimRemoteStreamsAPI = shimRemoteStreamsAPI; exports.shimCallbacksAPI = shimCallbacksAPI; exports.shimGetUserMedia = shimGetUserMedia; exports.shimConstraints = shimConstraints; exports.shimRTCIceServerUrls = shimRTCIceServerUrls; exports.shimTrackEventTransceiver = shimTrackEventTransceiver; exports.shimCreateOfferLegacy = shimCreateOfferLegacy; var _utils = require('../utils'); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function shimLocalStreamsAPI(window) { if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { return; } if (!('getLocalStreams' in window.RTCPeerConnection.prototype)) { window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { if (!this._localStreams) { this._localStreams = []; } return this._localStreams; }; } if (!('addStream' in window.RTCPeerConnection.prototype)) { var _addTrack = window.RTCPeerConnection.prototype.addTrack; window.RTCPeerConnection.prototype.addStream = function addStream(stream) { var _this = this; if (!this._localStreams) { this._localStreams = []; } if (!this._localStreams.includes(stream)) { this._localStreams.push(stream); } // Try to emulate Chrome's behaviour of adding in audio-video order. // Safari orders by track id. stream.getAudioTracks().forEach(function (track) { return _addTrack.call(_this, track, stream); }); stream.getVideoTracks().forEach(function (track) { return _addTrack.call(_this, track, stream); }); }; window.RTCPeerConnection.prototype.addTrack = function addTrack(track) { var stream = arguments[1]; if (stream) { if (!this._localStreams) { this._localStreams = [stream]; } else if (!this._localStreams.includes(stream)) { this._localStreams.push(stream); } } return _addTrack.apply(this, arguments); }; } if (!('removeStream' in window.RTCPeerConnection.prototype)) { window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { var _this2 = this; if (!this._localStreams) { this._localStreams = []; } var index = this._localStreams.indexOf(stream); if (index === -1) { return; } this._localStreams.splice(index, 1); var tracks = stream.getTracks(); this.getSenders().forEach(function (sender) { if (tracks.includes(sender.track)) { _this2.removeTrack(sender); } }); }; } } function shimRemoteStreamsAPI(window) { if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { return; } if (!('getRemoteStreams' in window.RTCPeerConnection.prototype)) { window.RTCPeerConnection.prototype.getRemoteStreams = function getRemoteStreams() { return this._remoteStreams ? this._remoteStreams : []; }; } if (!('onaddstream' in window.RTCPeerConnection.prototype)) { Object.defineProperty(window.RTCPeerConnection.prototype, 'onaddstream', { get: function get() { return this._onaddstream; }, set: function set(f) { var _this3 = this; if (this._onaddstream) { this.removeEventListener('addstream', this._onaddstream); this.removeEventListener('track', this._onaddstreampoly); } this.addEventListener('addstream', this._onaddstream = f); this.addEventListener('track', this._onaddstreampoly = function (e) { e.streams.forEach(function (stream) { if (!_this3._remoteStreams) { _this3._remoteStreams = []; } if (_this3._remoteStreams.includes(stream)) { return; } _this3._remoteStreams.push(stream); var event = new Event('addstream'); event.stream = stream; _this3.dispatchEvent(event); }); }); } }); var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { var pc = this; if (!this._onaddstreampoly) { this.addEventListener('track', this._onaddstreampoly = function (e) { e.streams.forEach(function (stream) { if (!pc._remoteStreams) { pc._remoteStreams = []; } if (pc._remoteStreams.indexOf(stream) >= 0) { return; } pc._remoteStreams.push(stream); var event = new Event('addstream'); event.stream = stream; pc.dispatchEvent(event); }); }); } return origSetRemoteDescription.apply(pc, arguments); }; } } function shimCallbacksAPI(window) { if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { return; } var prototype = window.RTCPeerConnection.prototype; var origCreateOffer = prototype.createOffer; var origCreateAnswer = prototype.createAnswer; var setLocalDescription = prototype.setLocalDescription; var setRemoteDescription = prototype.setRemoteDescription; var addIceCandidate = prototype.addIceCandidate; prototype.createOffer = function createOffer(successCallback, failureCallback) { var options = arguments.length >= 2 ? arguments[2] : arguments[0]; var promise = origCreateOffer.apply(this, [options]); if (!failureCallback) { return promise; } promise.then(successCallback, failureCallback); return Promise.resolve(); }; prototype.createAnswer = function createAnswer(successCallback, failureCallback) { var options = arguments.length >= 2 ? arguments[2] : arguments[0]; var promise = origCreateAnswer.apply(this, [options]); if (!failureCallback) { return promise; } promise.then(successCallback, failureCallback); return Promise.resolve(); }; var withCallback = function withCallback(description, successCallback, failureCallback) { var promise = setLocalDescription.apply(this, [description]); if (!failureCallback) { return promise; } promise.then(successCallback, failureCallback); return Promise.resolve(); }; prototype.setLocalDescription = withCallback; withCallback = function withCallback(description, successCallback, failureCallback) { var promise = setRemoteDescription.apply(this, [description]); if (!failureCallback) { return promise; } promise.then(successCallback, failureCallback); return Promise.resolve(); }; prototype.setRemoteDescription = withCallback; withCallback = function withCallback(candidate, successCallback, failureCallback) { var promise = addIceCandidate.apply(this, [candidate]); if (!failureCallback) { return promise; } promise.then(successCallback, failureCallback); return Promise.resolve(); }; prototype.addIceCandidate = withCallback; } function shimGetUserMedia(window) { var navigator = window && window.navigator; if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { // shim not needed in Safari 12.1 var mediaDevices = navigator.mediaDevices; var _getUserMedia = mediaDevices.getUserMedia.bind(mediaDevices); navigator.mediaDevices.getUserMedia = function (constraints) { return _getUserMedia(shimConstraints(constraints)); }; } if (!navigator.getUserMedia && navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { navigator.getUserMedia = function getUserMedia(constraints, cb, errcb) { navigator.mediaDevices.getUserMedia(constraints).then(cb, errcb); }.bind(navigator); } } function shimConstraints(constraints) { if (constraints && constraints.video !== undefined) { return Object.assign({}, constraints, { video: utils.compactObject(constraints.video) }); } return constraints; } function shimRTCIceServerUrls(window) { // migrate from non-spec RTCIceServer.url to RTCIceServer.urls var OrigPeerConnection = window.RTCPeerConnection; window.RTCPeerConnection = function RTCPeerConnection(pcConfig, pcConstraints) { if (pcConfig && pcConfig.iceServers) { var newIceServers = []; for (var i = 0; i < pcConfig.iceServers.length; i++) { var server = pcConfig.iceServers[i]; if (!server.hasOwnProperty('urls') && server.hasOwnProperty('url')) { utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls'); server = JSON.parse(JSON.stringify(server)); server.urls = server.url; delete server.url; newIceServers.push(server); } else { newIceServers.push(pcConfig.iceServers[i]); } } pcConfig.iceServers = newIceServers; } return new OrigPeerConnection(pcConfig, pcConstraints); }; window.RTCPeerConnection.prototype = OrigPeerConnection.prototype; // wrap static methods. Currently just generateCertificate. if ('generateCertificate' in window.RTCPeerConnection) { Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', { get: function get() { return OrigPeerConnection.generateCertificate; } }); } } function shimTrackEventTransceiver(window) { // Add event.transceiver member over deprecated event.receiver if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCTrackEvent && 'receiver' in window.RTCTrackEvent.prototype && !('transceiver' in window.RTCTrackEvent.prototype)) { Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', { get: function get() { return { receiver: this.receiver }; } }); } } function shimCreateOfferLegacy(window) { var origCreateOffer = window.RTCPeerConnection.prototype.createOffer; window.RTCPeerConnection.prototype.createOffer = function createOffer(offerOptions) { if (offerOptions) { if (typeof offerOptions.offerToReceiveAudio !== 'undefined') { // support bit values offerOptions.offerToReceiveAudio = !!offerOptions.offerToReceiveAudio; } var audioTransceiver = this.getTransceivers().find(function (transceiver) { return transceiver.receiver.track.kind === 'audio'; }); if (offerOptions.offerToReceiveAudio === false && audioTransceiver) { if (audioTransceiver.direction === 'sendrecv') { if (audioTransceiver.setDirection) { audioTransceiver.setDirection('sendonly'); } else { audioTransceiver.direction = 'sendonly'; } } else if (audioTransceiver.direction === 'recvonly') { if (audioTransceiver.setDirection) { audioTransceiver.setDirection('inactive'); } else { audioTransceiver.direction = 'inactive'; } } } else if (offerOptions.offerToReceiveAudio === true && !audioTransceiver) { this.addTransceiver('audio'); } if (typeof offerOptions.offerToReceiveVideo !== 'undefined') { // support bit values offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo; } var videoTransceiver = this.getTransceivers().find(function (transceiver) { return transceiver.receiver.track.kind === 'video'; }); if (offerOptions.offerToReceiveVideo === false && videoTransceiver) { if (videoTransceiver.direction === 'sendrecv') { if (videoTransceiver.setDirection) { videoTransceiver.setDirection('sendonly'); } else { videoTransceiver.direction = 'sendonly'; } } else if (videoTransceiver.direction === 'recvonly') { if (videoTransceiver.setDirection) { videoTransceiver.setDirection('inactive'); } else { videoTransceiver.direction = 'inactive'; } } } else if (offerOptions.offerToReceiveVideo === true && !videoTransceiver) { this.addTransceiver('video'); } } return origCreateOffer.apply(this, arguments); }; } },{"../utils":15}],15:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.extractVersion = extractVersion; exports.wrapPeerConnectionEvent = wrapPeerConnectionEvent; exports.disableLog = disableLog; exports.disableWarnings = disableWarnings; exports.log = log; exports.deprecated = deprecated; exports.detectBrowser = detectBrowser; exports.compactObject = compactObject; exports.walkStats = walkStats; exports.filterStats = filterStats; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var logDisabled_ = true; var deprecationWarnings_ = true; /** * Extract browser version out of the provided user agent string. * * @param {!string} uastring userAgent string. * @param {!string} expr Regular expression used as match criteria. * @param {!number} pos position in the version string to be returned. * @return {!number} browser version. */ function extractVersion(uastring, expr, pos) { var match = uastring.match(expr); return match && match.length >= pos && parseInt(match[pos], 10); } // Wraps the peerconnection event eventNameToWrap in a function // which returns the modified event object (or false to prevent // the event). function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) { if (!window.RTCPeerConnection) { return; } var proto = window.RTCPeerConnection.prototype; var nativeAddEventListener = proto.addEventListener; proto.addEventListener = function (nativeEventName, cb) { if (nativeEventName !== eventNameToWrap) { return nativeAddEventListener.apply(this, arguments); } var wrappedCallback = function wrappedCallback(e) { var modifiedEvent = wrapper(e); if (modifiedEvent) { cb(modifiedEvent); } }; this._eventMap = this._eventMap || {}; this._eventMap[cb] = wrappedCallback; return nativeAddEventListener.apply(this, [nativeEventName, wrappedCallback]); }; var nativeRemoveEventListener = proto.removeEventListener; proto.removeEventListener = function (nativeEventName, cb) { if (nativeEventName !== eventNameToWrap || !this._eventMap || !this._eventMap[cb]) { return nativeRemoveEventListener.apply(this, arguments); } var unwrappedCb = this._eventMap[cb]; delete this._eventMap[cb]; return nativeRemoveEventListener.apply(this, [nativeEventName, unwrappedCb]); }; Object.defineProperty(proto, 'on' + eventNameToWrap, { get: function get() { return this['_on' + eventNameToWrap]; }, set: function set(cb) { if (this['_on' + eventNameToWrap]) { this.removeEventListener(eventNameToWrap, this['_on' + eventNameToWrap]); delete this['_on' + eventNameToWrap]; } if (cb) { this.addEventListener(eventNameToWrap, this['_on' + eventNameToWrap] = cb); } }, enumerable: true, configurable: true }); } function disableLog(bool) { if (typeof bool !== 'boolean') { return new Error('Argument type: ' + (typeof bool === 'undefined' ? 'undefined' : _typeof(bool)) + '. Please use a boolean.'); } logDisabled_ = bool; return bool ? 'adapter.js logging disabled' : 'adapter.js logging enabled'; } /** * Disable or enable deprecation warnings * @param {!boolean} bool set to true to disable warnings. */ function disableWarnings(bool) { if (typeof bool !== 'boolean') { return new Error('Argument type: ' + (typeof bool === 'undefined' ? 'undefined' : _typeof(bool)) + '. Please use a boolean.'); } deprecationWarnings_ = !bool; return 'adapter.js deprecation warnings ' + (bool ? 'disabled' : 'enabled'); } function log() { if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object') { if (logDisabled_) { return; } if (typeof console !== 'undefined' && typeof console.log === 'function') { console.log.apply(console, arguments); } } } /** * Shows a deprecation warning suggesting the modern and spec-compatible API. */ function deprecated(oldMethod, newMethod) { if (!deprecationWarnings_) { return; } console.warn(oldMethod + ' is deprecated, please use ' + newMethod + ' instead.'); } /** * Browser detector. * * @return {object} result containing browser and version * properties. */ function detectBrowser(window) { var navigator = window.navigator; // Returned result object. var result = { browser: null, version: null }; // Fail early if it's not a browser if (typeof window === 'undefined' || !window.navigator) { result.browser = 'Not a browser.'; return result; } if (navigator.mozGetUserMedia) { // Firefox. result.browser = 'firefox'; result.version = extractVersion(navigator.userAgent, /Firefox\/(\d+)\./, 1); } else if (navigator.webkitGetUserMedia || window.isSecureContext === false && window.webkitRTCPeerConnection && !window.RTCIceGatherer) { // Chrome, Chromium, Webview, Opera. // Version matches Chrome/WebRTC version. // Chrome 74 removed webkitGetUserMedia on http as well so we need the // more complicated fallback to webkitRTCPeerConnection. result.browser = 'chrome'; result.version = extractVersion(navigator.userAgent, /Chrom(e|ium)\/(\d+)\./, 2); } else if (navigator.mediaDevices && navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) { // Edge. result.browser = 'edge'; result.version = extractVersion(navigator.userAgent, /Edge\/(\d+).(\d+)$/, 2); } else if (window.RTCPeerConnection && navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { // Safari. result.browser = 'safari'; result.version = extractVersion(navigator.userAgent, /AppleWebKit\/(\d+)\./, 1); result.supportsUnifiedPlan = window.RTCRtpTransceiver && 'currentDirection' in window.RTCRtpTransceiver.prototype; } else { // Default fallthrough: not supported. result.browser = 'Not a supported browser.'; return result; } return result; } /** * Checks if something is an object. * * @param {*} val The something you want to check. * @return true if val is an object, false otherwise. */ function isObject(val) { return Object.prototype.toString.call(val) === '[object Object]'; } /** * Remove all empty objects and undefined values * from a nested object -- an enhanced and vanilla version * of Lodash's `compact`. */ function compactObject(data) { if (!isObject(data)) { return data; } return Object.keys(data).reduce(function (accumulator, key) { var isObj = isObject(data[key]); var value = isObj ? compactObject(data[key]) : data[key]; var isEmptyObject = isObj && !Object.keys(value).length; if (value === undefined || isEmptyObject) { return accumulator; } return Object.assign(accumulator, _defineProperty({}, key, value)); }, {}); } /* iterates the stats graph recursively. */ function walkStats(stats, base, resultSet) { if (!base || resultSet.has(base.id)) { return; } resultSet.set(base.id, base); Object.keys(base).forEach(function (name) { if (name.endsWith('Id')) { walkStats(stats, stats.get(base[name]), resultSet); } else if (name.endsWith('Ids')) { base[name].forEach(function (id) { walkStats(stats, stats.get(id), resultSet); }); } }); } /* filter getStats for a sender/receiver track. */ function filterStats(result, track, outbound) { var streamStatsType = outbound ? 'outbound-rtp' : 'inbound-rtp'; var filteredResult = new Map(); if (track === null) { return filteredResult; } var trackStats = []; result.forEach(function (value) { if (value.type === 'track' && value.trackIdentifier === track.id) { trackStats.push(value); } }); trackStats.forEach(function (trackStat) { result.forEach(function (stats) { if (stats.type === streamStatsType && stats.trackId === trackStat.id) { walkStats(result, stats, filteredResult); } }); }); return filteredResult; } },{}],16:[function(require,module,exports){ /* * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* eslint-env node */ 'use strict'; var SDPUtils = require('sdp'); function fixStatsType(stat) { return { inboundrtp: 'inbound-rtp', outboundrtp: 'outbound-rtp', candidatepair: 'candidate-pair', localcandidate: 'local-candidate', remotecandidate: 'remote-candidate' }[stat.type] || stat.type; } function writeMediaSection(transceiver, caps, type, stream, dtlsRole) { var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps); // Map ICE parameters (ufrag, pwd) to SDP. sdp += SDPUtils.writeIceParameters( transceiver.iceGatherer.getLocalParameters()); // Map DTLS parameters to SDP. sdp += SDPUtils.writeDtlsParameters( transceiver.dtlsTransport.getLocalParameters(), type === 'offer' ? 'actpass' : dtlsRole || 'active'); sdp += 'a=mid:' + transceiver.mid + '\r\n'; if (transceiver.rtpSender && transceiver.rtpReceiver) { sdp += 'a=sendrecv\r\n'; } else if (transceiver.rtpSender) { sdp += 'a=sendonly\r\n'; } else if (transceiver.rtpReceiver) { sdp += 'a=recvonly\r\n'; } else { sdp += 'a=inactive\r\n'; } if (transceiver.rtpSender) { var trackId = transceiver.rtpSender._initialTrackId || transceiver.rtpSender.track.id; transceiver.rtpSender._initialTrackId = trackId; // spec. var msid = 'msid:' + (stream ? stream.id : '-') + ' ' + trackId + '\r\n'; sdp += 'a=' + msid; // for Chrome. Legacy should no longer be required. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc + ' ' + msid; // RTX if (transceiver.sendEncodingParameters[0].rtx) { sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc + ' ' + msid; sdp += 'a=ssrc-group:FID ' + transceiver.sendEncodingParameters[0].ssrc + ' ' + transceiver.sendEncodingParameters[0].rtx.ssrc + '\r\n'; } } // FIXME: this should be written by writeRtpDescription. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc + ' cname:' + SDPUtils.localCName + '\r\n'; if (transceiver.rtpSender && transceiver.sendEncodingParameters[0].rtx) { sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc + ' cname:' + SDPUtils.localCName + '\r\n'; } return sdp; } // Edge does not like // 1) stun: filtered after 14393 unless ?transport=udp is present // 2) turn: that does not have all of turn:host:port?transport=udp // 3) turn: with ipv6 addresses // 4) turn: occurring muliple times function filterIceServers(iceServers, edgeVersion) { var hasTurn = false; iceServers = JSON.parse(JSON.stringify(iceServers)); return iceServers.filter(function(server) { if (server && (server.urls || server.url)) { var urls = server.urls || server.url; if (server.url && !server.urls) { console.warn('RTCIceServer.url is deprecated! Use urls instead.'); } var isString = typeof urls === 'string'; if (isString) { urls = [urls]; } urls = urls.filter(function(url) { var validTurn = url.indexOf('turn:') === 0 && url.indexOf('transport=udp') !== -1 && url.indexOf('turn:[') === -1 && !hasTurn; if (validTurn) { hasTurn = true; return true; } return url.indexOf('stun:') === 0 && edgeVersion >= 14393 && url.indexOf('?transport=udp') === -1; }); delete server.url; server.urls = isString ? urls[0] : urls; return !!urls.length; } }); } // Determines the intersection of local and remote capabilities. function getCommonCapabilities(localCapabilities, remoteCapabilities) { var commonCapabilities = { codecs: [], headerExtensions: [], fecMechanisms: [] }; var findCodecByPayloadType = function(pt, codecs) { pt = parseInt(pt, 10); for (var i = 0; i < codecs.length; i++) { if (codecs[i].payloadType === pt || codecs[i].preferredPayloadType === pt) { return codecs[i]; } } }; var rtxCapabilityMatches = function(lRtx, rRtx, lCodecs, rCodecs) { var lCodec = findCodecByPayloadType(lRtx.parameters.apt, lCodecs); var rCodec = findCodecByPayloadType(rRtx.parameters.apt, rCodecs); return lCodec && rCodec && lCodec.name.toLowerCase() === rCodec.name.toLowerCase(); }; localCapabilities.codecs.forEach(function(lCodec) { for (var i = 0; i < remoteCapabilities.codecs.length; i++) { var rCodec = remoteCapabilities.codecs[i]; if (lCodec.name.toLowerCase() === rCodec.name.toLowerCase() && lCodec.clockRate === rCodec.clockRate) { if (lCodec.name.toLowerCase() === 'rtx' && lCodec.parameters && rCodec.parameters.apt) { // for RTX we need to find the local rtx that has a apt // which points to the same local codec as the remote one. if (!rtxCapabilityMatches(lCodec, rCodec, localCapabilities.codecs, remoteCapabilities.codecs)) { continue; } } rCodec = JSON.parse(JSON.stringify(rCodec)); // deepcopy // number of channels is the highest common number of channels rCodec.numChannels = Math.min(lCodec.numChannels, rCodec.numChannels); // push rCodec so we reply with offerer payload type commonCapabilities.codecs.push(rCodec); // determine common feedback mechanisms rCodec.rtcpFeedback = rCodec.rtcpFeedback.filter(function(fb) { for (var j = 0; j < lCodec.rtcpFeedback.length; j++) { if (lCodec.rtcpFeedback[j].type === fb.type && lCodec.rtcpFeedback[j].parameter === fb.parameter) { return true; } } return false; }); // FIXME: also need to determine .parameters // see https://github.com/openpeer/ortc/issues/569 break; } } }); localCapabilities.headerExtensions.forEach(function(lHeaderExtension) { for (var i = 0; i < remoteCapabilities.headerExtensions.length; i++) { var rHeaderExtension = remoteCapabilities.headerExtensions[i]; if (lHeaderExtension.uri === rHeaderExtension.uri) { commonCapabilities.headerExtensions.push(rHeaderExtension); break; } } }); // FIXME: fecMechanisms return commonCapabilities; } // is action=setLocalDescription with type allowed in signalingState function isActionAllowedInSignalingState(action, type, signalingState) { return { offer: { setLocalDescription: ['stable', 'have-local-offer'], setRemoteDescription: ['stable', 'have-remote-offer'] }, answer: { setLocalDescription: ['have-remote-offer', 'have-local-pranswer'], setRemoteDescription: ['have-local-offer', 'have-remote-pranswer'] } }[type][action].indexOf(signalingState) !== -1; } function maybeAddCandidate(iceTransport, candidate) { // Edge's internal representation adds some fields therefore // not all fieldѕ are taken into account. var alreadyAdded = iceTransport.getRemoteCandidates() .find(function(remoteCandidate) { return candidate.foundation === remoteCandidate.foundation && candidate.ip === remoteCandidate.ip && candidate.port === remoteCandidate.port && candidate.priority === remoteCandidate.priority && candidate.protocol === remoteCandidate.protocol && candidate.type === remoteCandidate.type; }); if (!alreadyAdded) { iceTransport.addRemoteCandidate(candidate); } return !alreadyAdded; } function makeError(name, description) { var e = new Error(description); e.name = name; // legacy error codes from https://heycam.github.io/webidl/#idl-DOMException-error-names e.code = { NotSupportedError: 9, InvalidStateError: 11, InvalidAccessError: 15, TypeError: undefined, OperationError: undefined }[name]; return e; } module.exports = function(window, edgeVersion) { // https://w3c.github.io/mediacapture-main/#mediastream // Helper function to add the track to the stream and // dispatch the event ourselves. function addTrackToStreamAndFireEvent(track, stream) { stream.addTrack(track); stream.dispatchEvent(new window.MediaStreamTrackEvent('addtrack', {track: track})); } function removeTrackFromStreamAndFireEvent(track, stream) { stream.removeTrack(track); stream.dispatchEvent(new window.MediaStreamTrackEvent('removetrack', {track: track})); } function fireAddTrack(pc, track, receiver, streams) { var trackEvent = new Event('track'); trackEvent.track = track; trackEvent.receiver = receiver; trackEvent.transceiver = {receiver: receiver}; trackEvent.streams = streams; window.setTimeout(function() { pc._dispatchEvent('track', trackEvent); }); } var RTCPeerConnection = function(config) { var pc = this; var _eventTarget = document.createDocumentFragment(); ['addEventListener', 'removeEventListener', 'dispatchEvent'] .forEach(function(method) { pc[method] = _eventTarget[method].bind(_eventTarget); }); this.canTrickleIceCandidates = null; this.needNegotiation = false; this.localStreams = []; this.remoteStreams = []; this._localDescription = null; this._remoteDescription = null; this.signalingState = 'stable'; this.iceConnectionState = 'new'; this.connectionState = 'new'; this.iceGatheringState = 'new'; config = JSON.parse(JSON.stringify(config || {})); this.usingBundle = config.bundlePolicy === 'max-bundle'; if (config.rtcpMuxPolicy === 'negotiate') { throw(makeError('NotSupportedError', 'rtcpMuxPolicy \'negotiate\' is not supported')); } else if (!config.rtcpMuxPolicy) { config.rtcpMuxPolicy = 'require'; } switch (config.iceTransportPolicy) { case 'all': case 'relay': break; default: config.iceTransportPolicy = 'all'; break; } switch (config.bundlePolicy) { case 'balanced': case 'max-compat': case 'max-bundle': break; default: config.bundlePolicy = 'balanced'; break; } config.iceServers = filterIceServers(config.iceServers || [], edgeVersion); this._iceGatherers = []; if (config.iceCandidatePoolSize) { for (var i = config.iceCandidatePoolSize; i > 0; i--) { this._iceGatherers.push(new window.RTCIceGatherer({ iceServers: config.iceServers, gatherPolicy: config.iceTransportPolicy })); } } else { config.iceCandidatePoolSize = 0; } this._config = config; // per-track iceGathers, iceTransports, dtlsTransports, rtpSenders, ... // everything that is needed to describe a SDP m-line. this.transceivers = []; this._sdpSessionId = SDPUtils.generateSessionId(); this._sdpSessionVersion = 0; this._dtlsRole = undefined; // role for a=setup to use in answers. this._isClosed = false; }; Object.defineProperty(RTCPeerConnection.prototype, 'localDescription', { configurable: true, get: function() { return this._localDescription; } }); Object.defineProperty(RTCPeerConnection.prototype, 'remoteDescription', { configurable: true, get: function() { return this._remoteDescription; } }); // set up event handlers on prototype RTCPeerConnection.prototype.onicecandidate = null; RTCPeerConnection.prototype.onaddstream = null; RTCPeerConnection.prototype.ontrack = null; RTCPeerConnection.prototype.onremovestream = null; RTCPeerConnection.prototype.onsignalingstatechange = null; RTCPeerConnection.prototype.oniceconnectionstatechange = null; RTCPeerConnection.prototype.onconnectionstatechange = null; RTCPeerConnection.prototype.onicegatheringstatechange = null; RTCPeerConnection.prototype.onnegotiationneeded = null; RTCPeerConnection.prototype.ondatachannel = null; RTCPeerConnection.prototype._dispatchEvent = function(name, event) { if (this._isClosed) { return; } this.dispatchEvent(event); if (typeof this['on' + name] === 'function') { this['on' + name](event); } }; RTCPeerConnection.prototype._emitGatheringStateChange = function() { var event = new Event('icegatheringstatechange'); this._dispatchEvent('icegatheringstatechange', event); }; RTCPeerConnection.prototype.getConfiguration = function() { return this._config; }; RTCPeerConnection.prototype.getLocalStreams = function() { return this.localStreams; }; RTCPeerConnection.prototype.getRemoteStreams = function() { return this.remoteStreams; }; // internal helper to create a transceiver object. // (which is not yet the same as the WebRTC 1.0 transceiver) RTCPeerConnection.prototype._createTransceiver = function(kind, doNotAdd) { var hasBundleTransport = this.transceivers.length > 0; var transceiver = { track: null, iceGatherer: null, iceTransport: null, dtlsTransport: null, localCapabilities: null, remoteCapabilities: null, rtpSender: null, rtpReceiver: null, kind: kind, mid: null, sendEncodingParameters: null, recvEncodingParameters: null, stream: null, associatedRemoteMediaStreams: [], wantReceive: true }; if (this.usingBundle && hasBundleTransport) { transceiver.iceTransport = this.transceivers[0].iceTransport; transceiver.dtlsTransport = this.transceivers[0].dtlsTransport; } else { var transports = this._createIceAndDtlsTransports(); transceiver.iceTransport = transports.iceTransport; transceiver.dtlsTransport = transports.dtlsTransport; } if (!doNotAdd) { this.transceivers.push(transceiver); } return transceiver; }; RTCPeerConnection.prototype.addTrack = function(track, stream) { if (this._isClosed) { throw makeError('InvalidStateError', 'Attempted to call addTrack on a closed peerconnection.'); } var alreadyExists = this.transceivers.find(function(s) { return s.track === track; }); if (alreadyExists) { throw makeError('InvalidAccessError', 'Track already exists.'); } var transceiver; for (var i = 0; i < this.transceivers.length; i++) { if (!this.transceivers[i].track && this.transceivers[i].kind === track.kind) { transceiver = this.transceivers[i]; } } if (!transceiver) { transceiver = this._createTransceiver(track.kind); } this._maybeFireNegotiationNeeded(); if (this.localStreams.indexOf(stream) === -1) { this.localStreams.push(stream); } transceiver.track = track; transceiver.stream = stream; transceiver.rtpSender = new window.RTCRtpSender(track, transceiver.dtlsTransport); return transceiver.rtpSender; }; RTCPeerConnection.prototype.addStream = function(stream) { var pc = this; if (edgeVersion >= 15025) { stream.getTracks().forEach(function(track) { pc.addTrack(track, stream); }); } else { // Clone is necessary for local demos mostly, attaching directly // to two different senders does not work (build 10547). // Fixed in 15025 (or earlier) var clonedStream = stream.clone(); stream.getTracks().forEach(function(track, idx) { var clonedTrack = clonedStream.getTracks()[idx]; track.addEventListener('enabled', function(event) { clonedTrack.enabled = event.enabled; }); }); clonedStream.getTracks().forEach(function(track) { pc.addTrack(track, clonedStream); }); } }; RTCPeerConnection.prototype.removeTrack = function(sender) { if (this._isClosed) { throw makeError('InvalidStateError', 'Attempted to call removeTrack on a closed peerconnection.'); } if (!(sender instanceof window.RTCRtpSender)) { throw new TypeError('Argument 1 of RTCPeerConnection.removeTrack ' + 'does not implement interface RTCRtpSender.'); } var transceiver = this.transceivers.find(function(t) { return t.rtpSender === sender; }); if (!transceiver) { throw makeError('InvalidAccessError', 'Sender was not created by this connection.'); } var stream = transceiver.stream; transceiver.rtpSender.stop(); transceiver.rtpSender = null; transceiver.track = null; transceiver.stream = null; // remove the stream from the set of local streams var localStreams = this.transceivers.map(function(t) { return t.stream; }); if (localStreams.indexOf(stream) === -1 && this.localStreams.indexOf(stream) > -1) { this.localStreams.splice(this.localStreams.indexOf(stream), 1); } this._maybeFireNegotiationNeeded(); }; RTCPeerConnection.prototype.removeStream = function(stream) { var pc = this; stream.getTracks().forEach(function(track) { var sender = pc.getSenders().find(function(s) { return s.track === track; }); if (sender) { pc.removeTrack(sender); } }); }; RTCPeerConnection.prototype.getSenders = function() { return this.transceivers.filter(function(transceiver) { return !!transceiver.rtpSender; }) .map(function(transceiver) { return transceiver.rtpSender; }); }; RTCPeerConnection.prototype.getReceivers = function() { return this.transceivers.filter(function(transceiver) { return !!transceiver.rtpReceiver; }) .map(function(transceiver) { return transceiver.rtpReceiver; }); }; RTCPeerConnection.prototype._createIceGatherer = function(sdpMLineIndex, usingBundle) { var pc = this; if (usingBundle && sdpMLineIndex > 0) { return this.transceivers[0].iceGatherer; } else if (this._iceGatherers.length) { return this._iceGatherers.shift(); } var iceGatherer = new window.RTCIceGatherer({ iceServers: this._config.iceServers, gatherPolicy: this._config.iceTransportPolicy }); Object.defineProperty(iceGatherer, 'state', {value: 'new', writable: true} ); this.transceivers[sdpMLineIndex].bufferedCandidateEvents = []; this.transceivers[sdpMLineIndex].bufferCandidates = function(event) { var end = !event.candidate || Object.keys(event.candidate).length === 0; // polyfill since RTCIceGatherer.state is not implemented in // Edge 10547 yet. iceGatherer.state = end ? 'completed' : 'gathering'; if (pc.transceivers[sdpMLineIndex].bufferedCandidateEvents !== null) { pc.transceivers[sdpMLineIndex].bufferedCandidateEvents.push(event); } }; iceGatherer.addEventListener('localcandidate', this.transceivers[sdpMLineIndex].bufferCandidates); return iceGatherer; }; // start gathering from an RTCIceGatherer. RTCPeerConnection.prototype._gather = function(mid, sdpMLineIndex) { var pc = this; var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer; if (iceGatherer.onlocalcandidate) { return; } var bufferedCandidateEvents = this.transceivers[sdpMLineIndex].bufferedCandidateEvents; this.transceivers[sdpMLineIndex].bufferedCandidateEvents = null; iceGatherer.removeEventListener('localcandidate', this.transceivers[sdpMLineIndex].bufferCandidates); iceGatherer.onlocalcandidate = function(evt) { if (pc.usingBundle && sdpMLineIndex > 0) { // if we know that we use bundle we can drop candidates with // ѕdpMLineIndex > 0. If we don't do this then our state gets // confused since we dispose the extra ice gatherer. return; } var event = new Event('icecandidate'); event.candidate = {sdpMid: mid, sdpMLineIndex: sdpMLineIndex}; var cand = evt.candidate; // Edge emits an empty object for RTCIceCandidateComplete‥ var end = !cand || Object.keys(cand).length === 0; if (end) { // polyfill since RTCIceGatherer.state is not implemented in // Edge 10547 yet. if (iceGatherer.state === 'new' || iceGatherer.state === 'gathering') { iceGatherer.state = 'completed'; } } else { if (iceGatherer.state === 'new') { iceGatherer.state = 'gathering'; } // RTCIceCandidate doesn't have a component, needs to be added cand.component = 1; // also the usernameFragment. TODO: update SDP to take both variants. cand.ufrag = iceGatherer.getLocalParameters().usernameFragment; var serializedCandidate = SDPUtils.writeCandidate(cand); event.candidate = Object.assign(event.candidate, SDPUtils.parseCandidate(serializedCandidate)); event.candidate.candidate = serializedCandidate; event.candidate.toJSON = function() { return { candidate: event.candidate.candidate, sdpMid: event.candidate.sdpMid, sdpMLineIndex: event.candidate.sdpMLineIndex, usernameFragment: event.candidate.usernameFragment }; }; } // update local description. var sections = SDPUtils.getMediaSections(pc._localDescription.sdp); if (!end) { sections[event.candidate.sdpMLineIndex] += 'a=' + event.candidate.candidate + '\r\n'; } else { sections[event.candidate.sdpMLineIndex] += 'a=end-of-candidates\r\n'; } pc._localDescription.sdp = SDPUtils.getDescription(pc._localDescription.sdp) + sections.join(''); var complete = pc.transceivers.every(function(transceiver) { return transceiver.iceGatherer && transceiver.iceGatherer.state === 'completed'; }); if (pc.iceGatheringState !== 'gathering') { pc.iceGatheringState = 'gathering'; pc._emitGatheringStateChange(); } // Emit candidate. Also emit null candidate when all gatherers are // complete. if (!end) { pc._dispatchEvent('icecandidate', event); } if (complete) { pc._dispatchEvent('icecandidate', new Event('icecandidate')); pc.iceGatheringState = 'complete'; pc._emitGatheringStateChange(); } }; // emit already gathered candidates. window.setTimeout(function() { bufferedCandidateEvents.forEach(function(e) { iceGatherer.onlocalcandidate(e); }); }, 0); }; // Create ICE transport and DTLS transport. RTCPeerConnection.prototype._createIceAndDtlsTransports = function() { var pc = this; var iceTransport = new window.RTCIceTransport(null); iceTransport.onicestatechange = function() { pc._updateIceConnectionState(); pc._updateConnectionState(); }; var dtlsTransport = new window.RTCDtlsTransport(iceTransport); dtlsTransport.ondtlsstatechange = function() { pc._updateConnectionState(); }; dtlsTransport.onerror = function() { // onerror does not set state to failed by itself. Object.defineProperty(dtlsTransport, 'state', {value: 'failed', writable: true}); pc._updateConnectionState(); }; return { iceTransport: iceTransport, dtlsTransport: dtlsTransport }; }; // Destroy ICE gatherer, ICE transport and DTLS transport. // Without triggering the callbacks. RTCPeerConnection.prototype._disposeIceAndDtlsTransports = function( sdpMLineIndex) { var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer; if (iceGatherer) { delete iceGatherer.onlocalcandidate; delete this.transceivers[sdpMLineIndex].iceGatherer; } var iceTransport = this.transceivers[sdpMLineIndex].iceTransport; if (iceTransport) { delete iceTransport.onicestatechange; delete this.transceivers[sdpMLineIndex].iceTransport; } var dtlsTransport = this.transceivers[sdpMLineIndex].dtlsTransport; if (dtlsTransport) { delete dtlsTransport.ondtlsstatechange; delete dtlsTransport.onerror; delete this.transceivers[sdpMLineIndex].dtlsTransport; } }; // Start the RTP Sender and Receiver for a transceiver. RTCPeerConnection.prototype._transceive = function(transceiver, send, recv) { var params = getCommonCapabilities(transceiver.localCapabilities, transceiver.remoteCapabilities); if (send && transceiver.rtpSender) { params.encodings = transceiver.sendEncodingParameters; params.rtcp = { cname: SDPUtils.localCName, compound: transceiver.rtcpParameters.compound }; if (transceiver.recvEncodingParameters.length) { params.rtcp.ssrc = transceiver.recvEncodingParameters[0].ssrc; } transceiver.rtpSender.send(params); } if (recv && transceiver.rtpReceiver && params.codecs.length > 0) { // remove RTX field in Edge 14942 if (transceiver.kind === 'video' && transceiver.recvEncodingParameters && edgeVersion < 15019) { transceiver.recvEncodingParameters.forEach(function(p) { delete p.rtx; }); } if (transceiver.recvEncodingParameters.length) { params.encodings = transceiver.recvEncodingParameters; } else { params.encodings = [{}]; } params.rtcp = { compound: transceiver.rtcpParameters.compound }; if (transceiver.rtcpParameters.cname) { params.rtcp.cname = transceiver.rtcpParameters.cname; } if (transceiver.sendEncodingParameters.length) { params.rtcp.ssrc = transceiver.sendEncodingParameters[0].ssrc; } transceiver.rtpReceiver.receive(params); } }; RTCPeerConnection.prototype.setLocalDescription = function(description) { var pc = this; // Note: pranswer is not supported. if (['offer', 'answer'].indexOf(description.type) === -1) { return Promise.reject(makeError('TypeError', 'Unsupported type "' + description.type + '"')); } if (!isActionAllowedInSignalingState('setLocalDescription', description.type, pc.signalingState) || pc._isClosed) { return Promise.reject(makeError('InvalidStateError', 'Can not set local ' + description.type + ' in state ' + pc.signalingState)); } var sections; var sessionpart; if (description.type === 'offer') { // VERY limited support for SDP munging. Limited to: // * changing the order of codecs sections = SDPUtils.splitSections(description.sdp); sessionpart = sections.shift(); sections.forEach(function(mediaSection, sdpMLineIndex) { var caps = SDPUtils.parseRtpParameters(mediaSection); pc.transceivers[sdpMLineIndex].localCapabilities = caps; }); pc.transceivers.forEach(function(transceiver, sdpMLineIndex) { pc._gather(transceiver.mid, sdpMLineIndex); }); } else if (description.type === 'answer') { sections = SDPUtils.splitSections(pc._remoteDescription.sdp); sessionpart = sections.shift(); var isIceLite = SDPUtils.matchPrefix(sessionpart, 'a=ice-lite').length > 0; sections.forEach(function(mediaSection, sdpMLineIndex) { var transceiver = pc.transceivers[sdpMLineIndex]; var iceGatherer = transceiver.iceGatherer; var iceTransport = transceiver.iceTransport; var dtlsTransport = transceiver.dtlsTransport; var localCapabilities = transceiver.localCapabilities; var remoteCapabilities = transceiver.remoteCapabilities; // treat bundle-only as not-rejected. var rejected = SDPUtils.isRejected(mediaSection) && SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 0; if (!rejected && !transceiver.rejected) { var remoteIceParameters = SDPUtils.getIceParameters( mediaSection, sessionpart); var remoteDtlsParameters = SDPUtils.getDtlsParameters( mediaSection, sessionpart); if (isIceLite) { remoteDtlsParameters.role = 'server'; } if (!pc.usingBundle || sdpMLineIndex === 0) { pc._gather(transceiver.mid, sdpMLineIndex); if (iceTransport.state === 'new') { iceTransport.start(iceGatherer, remoteIceParameters, isIceLite ? 'controlling' : 'controlled'); } if (dtlsTransport.state === 'new') { dtlsTransport.start(remoteDtlsParameters); } } // Calculate intersection of capabilities. var params = getCommonCapabilities(localCapabilities, remoteCapabilities); // Start the RTCRtpSender. The RTCRtpReceiver for this // transceiver has already been started in setRemoteDescription. pc._transceive(transceiver, params.codecs.length > 0, false); } }); } pc._localDescription = { type: description.type, sdp: description.sdp }; if (description.type === 'offer') { pc._updateSignalingState('have-local-offer'); } else { pc._updateSignalingState('stable'); } return Promise.resolve(); }; RTCPeerConnection.prototype.setRemoteDescription = function(description) { var pc = this; // Note: pranswer is not supported. if (['offer', 'answer'].indexOf(description.type) === -1) { return Promise.reject(makeError('TypeError', 'Unsupported type "' + description.type + '"')); } if (!isActionAllowedInSignalingState('setRemoteDescription', description.type, pc.signalingState) || pc._isClosed) { return Promise.reject(makeError('InvalidStateError', 'Can not set remote ' + description.type + ' in state ' + pc.signalingState)); } var streams = {}; pc.remoteStreams.forEach(function(stream) { streams[stream.id] = stream; }); var receiverList = []; var sections = SDPUtils.splitSections(description.sdp); var sessionpart = sections.shift(); var isIceLite = SDPUtils.matchPrefix(sessionpart, 'a=ice-lite').length > 0; var usingBundle = SDPUtils.matchPrefix(sessionpart, 'a=group:BUNDLE ').length > 0; pc.usingBundle = usingBundle; var iceOptions = SDPUtils.matchPrefix(sessionpart, 'a=ice-options:')[0]; if (iceOptions) { pc.canTrickleIceCandidates = iceOptions.substr(14).split(' ') .indexOf('trickle') >= 0; } else { pc.canTrickleIceCandidates = false; } sections.forEach(function(mediaSection, sdpMLineIndex) { var lines = SDPUtils.splitLines(mediaSection); var kind = SDPUtils.getKind(mediaSection); // treat bundle-only as not-rejected. var rejected = SDPUtils.isRejected(mediaSection) && SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 0; var protocol = lines[0].substr(2).split(' ')[2]; var direction = SDPUtils.getDirection(mediaSection, sessionpart); var remoteMsid = SDPUtils.parseMsid(mediaSection); var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier(); // Reject datachannels which are not implemented yet. if (rejected || (kind === 'application' && (protocol === 'DTLS/SCTP' || protocol === 'UDP/DTLS/SCTP'))) { // TODO: this is dangerous in the case where a non-rejected m-line // becomes rejected. pc.transceivers[sdpMLineIndex] = { mid: mid, kind: kind, protocol: protocol, rejected: true }; return; } if (!rejected && pc.transceivers[sdpMLineIndex] && pc.transceivers[sdpMLineIndex].rejected) { // recycle a rejected transceiver. pc.transceivers[sdpMLineIndex] = pc._createTransceiver(kind, true); } var transceiver; var iceGatherer; var iceTransport; var dtlsTransport; var rtpReceiver; var sendEncodingParameters; var recvEncodingParameters; var localCapabilities; var track; // FIXME: ensure the mediaSection has rtcp-mux set. var remoteCapabilities = SDPUtils.parseRtpParameters(mediaSection); var remoteIceParameters; var remoteDtlsParameters; if (!rejected) { remoteIceParameters = SDPUtils.getIceParameters(mediaSection, sessionpart); remoteDtlsParameters = SDPUtils.getDtlsParameters(mediaSection, sessionpart); remoteDtlsParameters.role = 'client'; } recvEncodingParameters = SDPUtils.parseRtpEncodingParameters(mediaSection); var rtcpParameters = SDPUtils.parseRtcpParameters(mediaSection); var isComplete = SDPUtils.matchPrefix(mediaSection, 'a=end-of-candidates', sessionpart).length > 0; var cands = SDPUtils.matchPrefix(mediaSection, 'a=candidate:') .map(function(cand) { return SDPUtils.parseCandidate(cand); }) .filter(function(cand) { return cand.component === 1; }); // Check if we can use BUNDLE and dispose transports. if ((description.type === 'offer' || description.type === 'answer') && !rejected && usingBundle && sdpMLineIndex > 0 && pc.transceivers[sdpMLineIndex]) { pc._disposeIceAndDtlsTransports(sdpMLineIndex); pc.transceivers[sdpMLineIndex].iceGatherer = pc.transceivers[0].iceGatherer; pc.transceivers[sdpMLineIndex].iceTransport = pc.transceivers[0].iceTransport; pc.transceivers[sdpMLineIndex].dtlsTransport = pc.transceivers[0].dtlsTransport; if (pc.transceivers[sdpMLineIndex].rtpSender) { pc.transceivers[sdpMLineIndex].rtpSender.setTransport( pc.transceivers[0].dtlsTransport); } if (pc.transceivers[sdpMLineIndex].rtpReceiver) { pc.transceivers[sdpMLineIndex].rtpReceiver.setTransport( pc.transceivers[0].dtlsTransport); } } if (description.type === 'offer' && !rejected) { transceiver = pc.transceivers[sdpMLineIndex] || pc._createTransceiver(kind); transceiver.mid = mid; if (!transceiver.iceGatherer) { transceiver.iceGatherer = pc._createIceGatherer(sdpMLineIndex, usingBundle); } if (cands.length && transceiver.iceTransport.state === 'new') { if (isComplete && (!usingBundle || sdpMLineIndex === 0)) { transceiver.iceTransport.setRemoteCandidates(cands); } else { cands.forEach(function(candidate) { maybeAddCandidate(transceiver.iceTransport, candidate); }); } } localCapabilities = window.RTCRtpReceiver.getCapabilities(kind); // filter RTX until additional stuff needed for RTX is implemented // in adapter.js if (edgeVersion < 15019) { localCapabilities.codecs = localCapabilities.codecs.filter( function(codec) { return codec.name !== 'rtx'; }); } sendEncodingParameters = transceiver.sendEncodingParameters || [{ ssrc: (2 * sdpMLineIndex + 2) * 1001 }]; // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams var isNewTrack = false; if (direction === 'sendrecv' || direction === 'sendonly') { isNewTrack = !transceiver.rtpReceiver; rtpReceiver = transceiver.rtpReceiver || new window.RTCRtpReceiver(transceiver.dtlsTransport, kind); if (isNewTrack) { var stream; track = rtpReceiver.track; // FIXME: does not work with Plan B. if (remoteMsid && remoteMsid.stream === '-') { // no-op. a stream id of '-' means: no associated stream. } else if (remoteMsid) { if (!streams[remoteMsid.stream]) { streams[remoteMsid.stream] = new window.MediaStream(); Object.defineProperty(streams[remoteMsid.stream], 'id', { get: function() { return remoteMsid.stream; } }); } Object.defineProperty(track, 'id', { get: function() { return remoteMsid.track; } }); stream = streams[remoteMsid.stream]; } else { if (!streams.default) { streams.default = new window.MediaStream(); } stream = streams.default; } if (stream) { addTrackToStreamAndFireEvent(track, stream); transceiver.associatedRemoteMediaStreams.push(stream); } receiverList.push([track, rtpReceiver, stream]); } } else if (transceiver.rtpReceiver && transceiver.rtpReceiver.track) { transceiver.associatedRemoteMediaStreams.forEach(function(s) { var nativeTrack = s.getTracks().find(function(t) { return t.id === transceiver.rtpReceiver.track.id; }); if (nativeTrack) { removeTrackFromStreamAndFireEvent(nativeTrack, s); } }); transceiver.associatedRemoteMediaStreams = []; } transceiver.localCapabilities = localCapabilities; transceiver.remoteCapabilities = remoteCapabilities; transceiver.rtpReceiver = rtpReceiver; transceiver.rtcpParameters = rtcpParameters; transceiver.sendEncodingParameters = sendEncodingParameters; transceiver.recvEncodingParameters = recvEncodingParameters; // Start the RTCRtpReceiver now. The RTPSender is started in // setLocalDescription. pc._transceive(pc.transceivers[sdpMLineIndex], false, isNewTrack); } else if (description.type === 'answer' && !rejected) { transceiver = pc.transceivers[sdpMLineIndex]; iceGatherer = transceiver.iceGatherer; iceTransport = transceiver.iceTransport; dtlsTransport = transceiver.dtlsTransport; rtpReceiver = transceiver.rtpReceiver; sendEncodingParameters = transceiver.sendEncodingParameters; localCapabilities = transceiver.localCapabilities; pc.transceivers[sdpMLineIndex].recvEncodingParameters = recvEncodingParameters; pc.transceivers[sdpMLineIndex].remoteCapabilities = remoteCapabilities; pc.transceivers[sdpMLineIndex].rtcpParameters = rtcpParameters; if (cands.length && iceTransport.state === 'new') { if ((isIceLite || isComplete) && (!usingBundle || sdpMLineIndex === 0)) { iceTransport.setRemoteCandidates(cands); } else { cands.forEach(function(candidate) { maybeAddCandidate(transceiver.iceTransport, candidate); }); } } if (!usingBundle || sdpMLineIndex === 0) { if (iceTransport.state === 'new') { iceTransport.start(iceGatherer, remoteIceParameters, 'controlling'); } if (dtlsTransport.state === 'new') { dtlsTransport.start(remoteDtlsParameters); } } // If the offer contained RTX but the answer did not, // remove RTX from sendEncodingParameters. var commonCapabilities = getCommonCapabilities( transceiver.localCapabilities, transceiver.remoteCapabilities); var hasRtx = commonCapabilities.codecs.filter(function(c) { return c.name.toLowerCase() === 'rtx'; }).length; if (!hasRtx && transceiver.sendEncodingParameters[0].rtx) { delete transceiver.sendEncodingParameters[0].rtx; } pc._transceive(transceiver, direction === 'sendrecv' || direction === 'recvonly', direction === 'sendrecv' || direction === 'sendonly'); // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams if (rtpReceiver && (direction === 'sendrecv' || direction === 'sendonly')) { track = rtpReceiver.track; if (remoteMsid) { if (!streams[remoteMsid.stream]) { streams[remoteMsid.stream] = new window.MediaStream(); } addTrackToStreamAndFireEvent(track, streams[remoteMsid.stream]); receiverList.push([track, rtpReceiver, streams[remoteMsid.stream]]); } else { if (!streams.default) { streams.default = new window.MediaStream(); } addTrackToStreamAndFireEvent(track, streams.default); receiverList.push([track, rtpReceiver, streams.default]); } } else { // FIXME: actually the receiver should be created later. delete transceiver.rtpReceiver; } } }); if (pc._dtlsRole === undefined) { pc._dtlsRole = description.type === 'offer' ? 'active' : 'passive'; } pc._remoteDescription = { type: description.type, sdp: description.sdp }; if (description.type === 'offer') { pc._updateSignalingState('have-remote-offer'); } else { pc._updateSignalingState('stable'); } Object.keys(streams).forEach(function(sid) { var stream = streams[sid]; if (stream.getTracks().length) { if (pc.remoteStreams.indexOf(stream) === -1) { pc.remoteStreams.push(stream); var event = new Event('addstream'); event.stream = stream; window.setTimeout(function() { pc._dispatchEvent('addstream', event); }); } receiverList.forEach(function(item) { var track = item[0]; var receiver = item[1]; if (stream.id !== item[2].id) { return; } fireAddTrack(pc, track, receiver, [stream]); }); } }); receiverList.forEach(function(item) { if (item[2]) { return; } fireAddTrack(pc, item[0], item[1], []); }); // check whether addIceCandidate({}) was called within four seconds after // setRemoteDescription. window.setTimeout(function() { if (!(pc && pc.transceivers)) { return; } pc.transceivers.forEach(function(transceiver) { if (transceiver.iceTransport && transceiver.iceTransport.state === 'new' && transceiver.iceTransport.getRemoteCandidates().length > 0) { console.warn('Timeout for addRemoteCandidate. Consider sending ' + 'an end-of-candidates notification'); transceiver.iceTransport.addRemoteCandidate({}); } }); }, 4000); return Promise.resolve(); }; RTCPeerConnection.prototype.close = function() { this.transceivers.forEach(function(transceiver) { /* not yet if (transceiver.iceGatherer) { transceiver.iceGatherer.close(); } */ if (transceiver.iceTransport) { transceiver.iceTransport.stop(); } if (transceiver.dtlsTransport) { transceiver.dtlsTransport.stop(); } if (transceiver.rtpSender) { transceiver.rtpSender.stop(); } if (transceiver.rtpReceiver) { transceiver.rtpReceiver.stop(); } }); // FIXME: clean up tracks, local streams, remote streams, etc this._isClosed = true; this._updateSignalingState('closed'); }; // Update the signaling state. RTCPeerConnection.prototype._updateSignalingState = function(newState) { this.signalingState = newState; var event = new Event('signalingstatechange'); this._dispatchEvent('signalingstatechange', event); }; // Determine whether to fire the negotiationneeded event. RTCPeerConnection.prototype._maybeFireNegotiationNeeded = function() { var pc = this; if (this.signalingState !== 'stable' || this.needNegotiation === true) { return; } this.needNegotiation = true; window.setTimeout(function() { if (pc.needNegotiation) { pc.needNegotiation = false; var event = new Event('negotiationneeded'); pc._dispatchEvent('negotiationneeded', event); } }, 0); }; // Update the ice connection state. RTCPeerConnection.prototype._updateIceConnectionState = function() { var newState; var states = { 'new': 0, closed: 0, checking: 0, connected: 0, completed: 0, disconnected: 0, failed: 0 }; this.transceivers.forEach(function(transceiver) { if (transceiver.iceTransport && !transceiver.rejected) { states[transceiver.iceTransport.state]++; } }); newState = 'new'; if (states.failed > 0) { newState = 'failed'; } else if (states.checking > 0) { newState = 'checking'; } else if (states.disconnected > 0) { newState = 'disconnected'; } else if (states.new > 0) { newState = 'new'; } else if (states.connected > 0) { newState = 'connected'; } else if (states.completed > 0) { newState = 'completed'; } if (newState !== this.iceConnectionState) { this.iceConnectionState = newState; var event = new Event('iceconnectionstatechange'); this._dispatchEvent('iceconnectionstatechange', event); } }; // Update the connection state. RTCPeerConnection.prototype._updateConnectionState = function() { var newState; var states = { 'new': 0, closed: 0, connecting: 0, connected: 0, completed: 0, disconnected: 0, failed: 0 }; this.transceivers.forEach(function(transceiver) { if (transceiver.iceTransport && transceiver.dtlsTransport && !transceiver.rejected) { states[transceiver.iceTransport.state]++; states[transceiver.dtlsTransport.state]++; } }); // ICETransport.completed and connected are the same for this purpose. states.connected += states.completed; newState = 'new'; if (states.failed > 0) { newState = 'failed'; } else if (states.connecting > 0) { newState = 'connecting'; } else if (states.disconnected > 0) { newState = 'disconnected'; } else if (states.new > 0) { newState = 'new'; } else if (states.connected > 0) { newState = 'connected'; } if (newState !== this.connectionState) { this.connectionState = newState; var event = new Event('connectionstatechange'); this._dispatchEvent('connectionstatechange', event); } }; RTCPeerConnection.prototype.createOffer = function() { var pc = this; if (pc._isClosed) { return Promise.reject(makeError('InvalidStateError', 'Can not call createOffer after close')); } var numAudioTracks = pc.transceivers.filter(function(t) { return t.kind === 'audio'; }).length; var numVideoTracks = pc.transceivers.filter(function(t) { return t.kind === 'video'; }).length; // Determine number of audio and video tracks we need to send/recv. var offerOptions = arguments[0]; if (offerOptions) { // Reject Chrome legacy constraints. if (offerOptions.mandatory || offerOptions.optional) { throw new TypeError( 'Legacy mandatory/optional constraints not supported.'); } if (offerOptions.offerToReceiveAudio !== undefined) { if (offerOptions.offerToReceiveAudio === true) { numAudioTracks = 1; } else if (offerOptions.offerToReceiveAudio === false) { numAudioTracks = 0; } else { numAudioTracks = offerOptions.offerToReceiveAudio; } } if (offerOptions.offerToReceiveVideo !== undefined) { if (offerOptions.offerToReceiveVideo === true) { numVideoTracks = 1; } else if (offerOptions.offerToReceiveVideo === false) { numVideoTracks = 0; } else { numVideoTracks = offerOptions.offerToReceiveVideo; } } } pc.transceivers.forEach(function(transceiver) { if (transceiver.kind === 'audio') { numAudioTracks--; if (numAudioTracks < 0) { transceiver.wantReceive = false; } } else if (transceiver.kind === 'video') { numVideoTracks--; if (numVideoTracks < 0) { transceiver.wantReceive = false; } } }); // Create M-lines for recvonly streams. while (numAudioTracks > 0 || numVideoTracks > 0) { if (numAudioTracks > 0) { pc._createTransceiver('audio'); numAudioTracks--; } if (numVideoTracks > 0) { pc._createTransceiver('video'); numVideoTracks--; } } var sdp = SDPUtils.writeSessionBoilerplate(pc._sdpSessionId, pc._sdpSessionVersion++); pc.transceivers.forEach(function(transceiver, sdpMLineIndex) { // For each track, create an ice gatherer, ice transport, // dtls transport, potentially rtpsender and rtpreceiver. var track = transceiver.track; var kind = transceiver.kind; var mid = transceiver.mid || SDPUtils.generateIdentifier(); transceiver.mid = mid; if (!transceiver.iceGatherer) { transceiver.iceGatherer = pc._createIceGatherer(sdpMLineIndex, pc.usingBundle); } var localCapabilities = window.RTCRtpSender.getCapabilities(kind); // filter RTX until additional stuff needed for RTX is implemented // in adapter.js if (edgeVersion < 15019) { localCapabilities.codecs = localCapabilities.codecs.filter( function(codec) { return codec.name !== 'rtx'; }); } localCapabilities.codecs.forEach(function(codec) { // work around https://bugs.chromium.org/p/webrtc/issues/detail?id=6552 // by adding level-asymmetry-allowed=1 if (codec.name === 'H264' && codec.parameters['level-asymmetry-allowed'] === undefined) { codec.parameters['level-asymmetry-allowed'] = '1'; } // for subsequent offers, we might have to re-use the payload // type of the last offer. if (transceiver.remoteCapabilities && transceiver.remoteCapabilities.codecs) { transceiver.remoteCapabilities.codecs.forEach(function(remoteCodec) { if (codec.name.toLowerCase() === remoteCodec.name.toLowerCase() && codec.clockRate === remoteCodec.clockRate) { codec.preferredPayloadType = remoteCodec.payloadType; } }); } }); localCapabilities.headerExtensions.forEach(function(hdrExt) { var remoteExtensions = transceiver.remoteCapabilities && transceiver.remoteCapabilities.headerExtensions || []; remoteExtensions.forEach(function(rHdrExt) { if (hdrExt.uri === rHdrExt.uri) { hdrExt.id = rHdrExt.id; } }); }); // generate an ssrc now, to be used later in rtpSender.send var sendEncodingParameters = transceiver.sendEncodingParameters || [{ ssrc: (2 * sdpMLineIndex + 1) * 1001 }]; if (track) { // add RTX if (edgeVersion >= 15019 && kind === 'video' && !sendEncodingParameters[0].rtx) { sendEncodingParameters[0].rtx = { ssrc: sendEncodingParameters[0].ssrc + 1 }; } } if (transceiver.wantReceive) { transceiver.rtpReceiver = new window.RTCRtpReceiver( transceiver.dtlsTransport, kind); } transceiver.localCapabilities = localCapabilities; transceiver.sendEncodingParameters = sendEncodingParameters; }); // always offer BUNDLE and dispose on return if not supported. if (pc._config.bundlePolicy !== 'max-compat') { sdp += 'a=group:BUNDLE ' + pc.transceivers.map(function(t) { return t.mid; }).join(' ') + '\r\n'; } sdp += 'a=ice-options:trickle\r\n'; pc.transceivers.forEach(function(transceiver, sdpMLineIndex) { sdp += writeMediaSection(transceiver, transceiver.localCapabilities, 'offer', transceiver.stream, pc._dtlsRole); sdp += 'a=rtcp-rsize\r\n'; if (transceiver.iceGatherer && pc.iceGatheringState !== 'new' && (sdpMLineIndex === 0 || !pc.usingBundle)) { transceiver.iceGatherer.getLocalCandidates().forEach(function(cand) { cand.component = 1; sdp += 'a=' + SDPUtils.writeCandidate(cand) + '\r\n'; }); if (transceiver.iceGatherer.state === 'completed') { sdp += 'a=end-of-candidates\r\n'; } } }); var desc = new window.RTCSessionDescription({ type: 'offer', sdp: sdp }); return Promise.resolve(desc); }; RTCPeerConnection.prototype.createAnswer = function() { var pc = this; if (pc._isClosed) { return Promise.reject(makeError('InvalidStateError', 'Can not call createAnswer after close')); } if (!(pc.signalingState === 'have-remote-offer' || pc.signalingState === 'have-local-pranswer')) { return Promise.reject(makeError('InvalidStateError', 'Can not call createAnswer in signalingState ' + pc.signalingState)); } var sdp = SDPUtils.writeSessionBoilerplate(pc._sdpSessionId, pc._sdpSessionVersion++); if (pc.usingBundle) { sdp += 'a=group:BUNDLE ' + pc.transceivers.map(function(t) { return t.mid; }).join(' ') + '\r\n'; } sdp += 'a=ice-options:trickle\r\n'; var mediaSectionsInOffer = SDPUtils.getMediaSections( pc._remoteDescription.sdp).length; pc.transceivers.forEach(function(transceiver, sdpMLineIndex) { if (sdpMLineIndex + 1 > mediaSectionsInOffer) { return; } if (transceiver.rejected) { if (transceiver.kind === 'application') { if (transceiver.protocol === 'DTLS/SCTP') { // legacy fmt sdp += 'm=application 0 DTLS/SCTP 5000\r\n'; } else { sdp += 'm=application 0 ' + transceiver.protocol + ' webrtc-datachannel\r\n'; } } else if (transceiver.kind === 'audio') { sdp += 'm=audio 0 UDP/TLS/RTP/SAVPF 0\r\n' + 'a=rtpmap:0 PCMU/8000\r\n'; } else if (transceiver.kind === 'video') { sdp += 'm=video 0 UDP/TLS/RTP/SAVPF 120\r\n' + 'a=rtpmap:120 VP8/90000\r\n'; } sdp += 'c=IN IP4 0.0.0.0\r\n' + 'a=inactive\r\n' + 'a=mid:' + transceiver.mid + '\r\n'; return; } // FIXME: look at direction. if (transceiver.stream) { var localTrack; if (transceiver.kind === 'audio') { localTrack = transceiver.stream.getAudioTracks()[0]; } else if (transceiver.kind === 'video') { localTrack = transceiver.stream.getVideoTracks()[0]; } if (localTrack) { // add RTX if (edgeVersion >= 15019 && transceiver.kind === 'video' && !transceiver.sendEncodingParameters[0].rtx) { transceiver.sendEncodingParameters[0].rtx = { ssrc: transceiver.sendEncodingParameters[0].ssrc + 1 }; } } } // Calculate intersection of capabilities. var commonCapabilities = getCommonCapabilities( transceiver.localCapabilities, transceiver.remoteCapabilities); var hasRtx = commonCapabilities.codecs.filter(function(c) { return c.name.toLowerCase() === 'rtx'; }).length; if (!hasRtx && transceiver.sendEncodingParameters[0].rtx) { delete transceiver.sendEncodingParameters[0].rtx; } sdp += writeMediaSection(transceiver, commonCapabilities, 'answer', transceiver.stream, pc._dtlsRole); if (transceiver.rtcpParameters && transceiver.rtcpParameters.reducedSize) { sdp += 'a=rtcp-rsize\r\n'; } }); var desc = new window.RTCSessionDescription({ type: 'answer', sdp: sdp }); return Promise.resolve(desc); }; RTCPeerConnection.prototype.addIceCandidate = function(candidate) { var pc = this; var sections; if (candidate && !(candidate.sdpMLineIndex !== undefined || candidate.sdpMid)) { return Promise.reject(new TypeError('sdpMLineIndex or sdpMid required')); } // TODO: needs to go into ops queue. return new Promise(function(resolve, reject) { if (!pc._remoteDescription) { return reject(makeError('InvalidStateError', 'Can not add ICE candidate without a remote description')); } else if (!candidate || candidate.candidate === '') { for (var j = 0; j < pc.transceivers.length; j++) { if (pc.transceivers[j].rejected) { continue; } pc.transceivers[j].iceTransport.addRemoteCandidate({}); sections = SDPUtils.getMediaSections(pc._remoteDescription.sdp); sections[j] += 'a=end-of-candidates\r\n'; pc._remoteDescription.sdp = SDPUtils.getDescription(pc._remoteDescription.sdp) + sections.join(''); if (pc.usingBundle) { break; } } } else { var sdpMLineIndex = candidate.sdpMLineIndex; if (candidate.sdpMid) { for (var i = 0; i < pc.transceivers.length; i++) { if (pc.transceivers[i].mid === candidate.sdpMid) { sdpMLineIndex = i; break; } } } var transceiver = pc.transceivers[sdpMLineIndex]; if (transceiver) { if (transceiver.rejected) { return resolve(); } var cand = Object.keys(candidate.candidate).length > 0 ? SDPUtils.parseCandidate(candidate.candidate) : {}; // Ignore Chrome's invalid candidates since Edge does not like them. if (cand.protocol === 'tcp' && (cand.port === 0 || cand.port === 9)) { return resolve(); } // Ignore RTCP candidates, we assume RTCP-MUX. if (cand.component && cand.component !== 1) { return resolve(); } // when using bundle, avoid adding candidates to the wrong // ice transport. And avoid adding candidates added in the SDP. if (sdpMLineIndex === 0 || (sdpMLineIndex > 0 && transceiver.iceTransport !== pc.transceivers[0].iceTransport)) { if (!maybeAddCandidate(transceiver.iceTransport, cand)) { return reject(makeError('OperationError', 'Can not add ICE candidate')); } } // update the remoteDescription. var candidateString = candidate.candidate.trim(); if (candidateString.indexOf('a=') === 0) { candidateString = candidateString.substr(2); } sections = SDPUtils.getMediaSections(pc._remoteDescription.sdp); sections[sdpMLineIndex] += 'a=' + (cand.type ? candidateString : 'end-of-candidates') + '\r\n'; pc._remoteDescription.sdp = SDPUtils.getDescription(pc._remoteDescription.sdp) + sections.join(''); } else { return reject(makeError('OperationError', 'Can not add ICE candidate')); } } resolve(); }); }; RTCPeerConnection.prototype.getStats = function(selector) { if (selector && selector instanceof window.MediaStreamTrack) { var senderOrReceiver = null; this.transceivers.forEach(function(transceiver) { if (transceiver.rtpSender && transceiver.rtpSender.track === selector) { senderOrReceiver = transceiver.rtpSender; } else if (transceiver.rtpReceiver && transceiver.rtpReceiver.track === selector) { senderOrReceiver = transceiver.rtpReceiver; } }); if (!senderOrReceiver) { throw makeError('InvalidAccessError', 'Invalid selector.'); } return senderOrReceiver.getStats(); } var promises = []; this.transceivers.forEach(function(transceiver) { ['rtpSender', 'rtpReceiver', 'iceGatherer', 'iceTransport', 'dtlsTransport'].forEach(function(method) { if (transceiver[method]) { promises.push(transceiver[method].getStats()); } }); }); return Promise.all(promises).then(function(allStats) { var results = new Map(); allStats.forEach(function(stats) { stats.forEach(function(stat) { results.set(stat.id, stat); }); }); return results; }); }; // fix low-level stat names and return Map instead of object. var ortcObjects = ['RTCRtpSender', 'RTCRtpReceiver', 'RTCIceGatherer', 'RTCIceTransport', 'RTCDtlsTransport']; ortcObjects.forEach(function(ortcObjectName) { var obj = window[ortcObjectName]; if (obj && obj.prototype && obj.prototype.getStats) { var nativeGetstats = obj.prototype.getStats; obj.prototype.getStats = function() { return nativeGetstats.apply(this) .then(function(nativeStats) { var mapStats = new Map(); Object.keys(nativeStats).forEach(function(id) { nativeStats[id].type = fixStatsType(nativeStats[id]); mapStats.set(id, nativeStats[id]); }); return mapStats; }); }; } }); // legacy callback shims. Should be moved to adapter.js some days. var methods = ['createOffer', 'createAnswer']; methods.forEach(function(method) { var nativeMethod = RTCPeerConnection.prototype[method]; RTCPeerConnection.prototype[method] = function() { var args = arguments; if (typeof args[0] === 'function' || typeof args[1] === 'function') { // legacy return nativeMethod.apply(this, [arguments[2]]) .then(function(description) { if (typeof args[0] === 'function') { args[0].apply(null, [description]); } }, function(error) { if (typeof args[1] === 'function') { args[1].apply(null, [error]); } }); } return nativeMethod.apply(this, arguments); }; }); methods = ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']; methods.forEach(function(method) { var nativeMethod = RTCPeerConnection.prototype[method]; RTCPeerConnection.prototype[method] = function() { var args = arguments; if (typeof args[1] === 'function' || typeof args[2] === 'function') { // legacy return nativeMethod.apply(this, arguments) .then(function() { if (typeof args[1] === 'function') { args[1].apply(null); } }, function(error) { if (typeof args[2] === 'function') { args[2].apply(null, [error]); } }); } return nativeMethod.apply(this, arguments); }; }); // getStats is special. It doesn't have a spec legacy method yet we support // getStats(something, cb) without error callbacks. ['getStats'].forEach(function(method) { var nativeMethod = RTCPeerConnection.prototype[method]; RTCPeerConnection.prototype[method] = function() { var args = arguments; if (typeof args[1] === 'function') { return nativeMethod.apply(this, arguments) .then(function() { if (typeof args[1] === 'function') { args[1].apply(null); } }); } return nativeMethod.apply(this, arguments); }; }); return RTCPeerConnection; }; },{"sdp":17}],17:[function(require,module,exports){ /* eslint-env node */ 'use strict'; // SDP helpers. var SDPUtils = {}; // Generate an alphanumeric identifier for cname or mids. // TODO: use UUIDs instead? https://gist.github.com/jed/982883 SDPUtils.generateIdentifier = function() { return Math.random().toString(36).substr(2, 10); }; // The RTCP CNAME used by all peerconnections from the same JS. SDPUtils.localCName = SDPUtils.generateIdentifier(); // Splits SDP into lines, dealing with both CRLF and LF. SDPUtils.splitLines = function(blob) { return blob.trim().split('\n').map(function(line) { return line.trim(); }); }; // Splits SDP into sessionpart and mediasections. Ensures CRLF. SDPUtils.splitSections = function(blob) { var parts = blob.split('\nm='); return parts.map(function(part, index) { return (index > 0 ? 'm=' + part : part).trim() + '\r\n'; }); }; // returns the session description. SDPUtils.getDescription = function(blob) { var sections = SDPUtils.splitSections(blob); return sections && sections[0]; }; // returns the individual media sections. SDPUtils.getMediaSections = function(blob) { var sections = SDPUtils.splitSections(blob); sections.shift(); return sections; }; // Returns lines that start with a certain prefix. SDPUtils.matchPrefix = function(blob, prefix) { return SDPUtils.splitLines(blob).filter(function(line) { return line.indexOf(prefix) === 0; }); }; // Parses an ICE candidate line. Sample input: // candidate:702786350 2 udp 41819902 8.8.8.8 60769 typ relay raddr 8.8.8.8 // rport 55996" SDPUtils.parseCandidate = function(line) { var parts; // Parse both variants. if (line.indexOf('a=candidate:') === 0) { parts = line.substring(12).split(' '); } else { parts = line.substring(10).split(' '); } var candidate = { foundation: parts[0], component: parseInt(parts[1], 10), protocol: parts[2].toLowerCase(), priority: parseInt(parts[3], 10), ip: parts[4], address: parts[4], // address is an alias for ip. port: parseInt(parts[5], 10), // skip parts[6] == 'typ' type: parts[7] }; for (var i = 8; i < parts.length; i += 2) { switch (parts[i]) { case 'raddr': candidate.relatedAddress = parts[i + 1]; break; case 'rport': candidate.relatedPort = parseInt(parts[i + 1], 10); break; case 'tcptype': candidate.tcpType = parts[i + 1]; break; case 'ufrag': candidate.ufrag = parts[i + 1]; // for backward compability. candidate.usernameFragment = parts[i + 1]; break; default: // extension handling, in particular ufrag candidate[parts[i]] = parts[i + 1]; break; } } return candidate; }; // Translates a candidate object into SDP candidate attribute. SDPUtils.writeCandidate = function(candidate) { var sdp = []; sdp.push(candidate.foundation); sdp.push(candidate.component); sdp.push(candidate.protocol.toUpperCase()); sdp.push(candidate.priority); sdp.push(candidate.address || candidate.ip); sdp.push(candidate.port); var type = candidate.type; sdp.push('typ'); sdp.push(type); if (type !== 'host' && candidate.relatedAddress && candidate.relatedPort) { sdp.push('raddr'); sdp.push(candidate.relatedAddress); sdp.push('rport'); sdp.push(candidate.relatedPort); } if (candidate.tcpType && candidate.protocol.toLowerCase() === 'tcp') { sdp.push('tcptype'); sdp.push(candidate.tcpType); } if (candidate.usernameFragment || candidate.ufrag) { sdp.push('ufrag'); sdp.push(candidate.usernameFragment || candidate.ufrag); } return 'candidate:' + sdp.join(' '); }; // Parses an ice-options line, returns an array of option tags. // a=ice-options:foo bar SDPUtils.parseIceOptions = function(line) { return line.substr(14).split(' '); }; // Parses an rtpmap line, returns RTCRtpCoddecParameters. Sample input: // a=rtpmap:111 opus/48000/2 SDPUtils.parseRtpMap = function(line) { var parts = line.substr(9).split(' '); var parsed = { payloadType: parseInt(parts.shift(), 10) // was: id }; parts = parts[0].split('/'); parsed.name = parts[0]; parsed.clockRate = parseInt(parts[1], 10); // was: clockrate parsed.channels = parts.length === 3 ? parseInt(parts[2], 10) : 1; // legacy alias, got renamed back to channels in ORTC. parsed.numChannels = parsed.channels; return parsed; }; // Generate an a=rtpmap line from RTCRtpCodecCapability or // RTCRtpCodecParameters. SDPUtils.writeRtpMap = function(codec) { var pt = codec.payloadType; if (codec.preferredPayloadType !== undefined) { pt = codec.preferredPayloadType; } var channels = codec.channels || codec.numChannels || 1; return 'a=rtpmap:' + pt + ' ' + codec.name + '/' + codec.clockRate + (channels !== 1 ? '/' + channels : '') + '\r\n'; }; // Parses an a=extmap line (headerextension from RFC 5285). Sample input: // a=extmap:2 urn:ietf:params:rtp-hdrext:toffset // a=extmap:2/sendonly urn:ietf:params:rtp-hdrext:toffset SDPUtils.parseExtmap = function(line) { var parts = line.substr(9).split(' '); return { id: parseInt(parts[0], 10), direction: parts[0].indexOf('/') > 0 ? parts[0].split('/')[1] : 'sendrecv', uri: parts[1] }; }; // Generates a=extmap line from RTCRtpHeaderExtensionParameters or // RTCRtpHeaderExtension. SDPUtils.writeExtmap = function(headerExtension) { return 'a=extmap:' + (headerExtension.id || headerExtension.preferredId) + (headerExtension.direction && headerExtension.direction !== 'sendrecv' ? '/' + headerExtension.direction : '') + ' ' + headerExtension.uri + '\r\n'; }; // Parses an ftmp line, returns dictionary. Sample input: // a=fmtp:96 vbr=on;cng=on // Also deals with vbr=on; cng=on SDPUtils.parseFmtp = function(line) { var parsed = {}; var kv; var parts = line.substr(line.indexOf(' ') + 1).split(';'); for (var j = 0; j < parts.length; j++) { kv = parts[j].trim().split('='); parsed[kv[0].trim()] = kv[1]; } return parsed; }; // Generates an a=ftmp line from RTCRtpCodecCapability or RTCRtpCodecParameters. SDPUtils.writeFmtp = function(codec) { var line = ''; var pt = codec.payloadType; if (codec.preferredPayloadType !== undefined) { pt = codec.preferredPayloadType; } if (codec.parameters && Object.keys(codec.parameters).length) { var params = []; Object.keys(codec.parameters).forEach(function(param) { if (codec.parameters[param]) { params.push(param + '=' + codec.parameters[param]); } else { params.push(param); } }); line += 'a=fmtp:' + pt + ' ' + params.join(';') + '\r\n'; } return line; }; // Parses an rtcp-fb line, returns RTCPRtcpFeedback object. Sample input: // a=rtcp-fb:98 nack rpsi SDPUtils.parseRtcpFb = function(line) { var parts = line.substr(line.indexOf(' ') + 1).split(' '); return { type: parts.shift(), parameter: parts.join(' ') }; }; // Generate a=rtcp-fb lines from RTCRtpCodecCapability or RTCRtpCodecParameters. SDPUtils.writeRtcpFb = function(codec) { var lines = ''; var pt = codec.payloadType; if (codec.preferredPayloadType !== undefined) { pt = codec.preferredPayloadType; } if (codec.rtcpFeedback && codec.rtcpFeedback.length) { // FIXME: special handling for trr-int? codec.rtcpFeedback.forEach(function(fb) { lines += 'a=rtcp-fb:' + pt + ' ' + fb.type + (fb.parameter && fb.parameter.length ? ' ' + fb.parameter : '') + '\r\n'; }); } return lines; }; // Parses an RFC 5576 ssrc media attribute. Sample input: // a=ssrc:3735928559 cname:something SDPUtils.parseSsrcMedia = function(line) { var sp = line.indexOf(' '); var parts = { ssrc: parseInt(line.substr(7, sp - 7), 10) }; var colon = line.indexOf(':', sp); if (colon > -1) { parts.attribute = line.substr(sp + 1, colon - sp - 1); parts.value = line.substr(colon + 1); } else { parts.attribute = line.substr(sp + 1); } return parts; }; SDPUtils.parseSsrcGroup = function(line) { var parts = line.substr(13).split(' '); return { semantics: parts.shift(), ssrcs: parts.map(function(ssrc) { return parseInt(ssrc, 10); }) }; }; // Extracts the MID (RFC 5888) from a media section. // returns the MID or undefined if no mid line was found. SDPUtils.getMid = function(mediaSection) { var mid = SDPUtils.matchPrefix(mediaSection, 'a=mid:')[0]; if (mid) { return mid.substr(6); } }; SDPUtils.parseFingerprint = function(line) { var parts = line.substr(14).split(' '); return { algorithm: parts[0].toLowerCase(), // algorithm is case-sensitive in Edge. value: parts[1] }; }; // Extracts DTLS parameters from SDP media section or sessionpart. // FIXME: for consistency with other functions this should only // get the fingerprint line as input. See also getIceParameters. SDPUtils.getDtlsParameters = function(mediaSection, sessionpart) { var lines = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=fingerprint:'); // Note: a=setup line is ignored since we use the 'auto' role. // Note2: 'algorithm' is not case sensitive except in Edge. return { role: 'auto', fingerprints: lines.map(SDPUtils.parseFingerprint) }; }; // Serializes DTLS parameters to SDP. SDPUtils.writeDtlsParameters = function(params, setupType) { var sdp = 'a=setup:' + setupType + '\r\n'; params.fingerprints.forEach(function(fp) { sdp += 'a=fingerprint:' + fp.algorithm + ' ' + fp.value + '\r\n'; }); return sdp; }; // Parses ICE information from SDP media section or sessionpart. // FIXME: for consistency with other functions this should only // get the ice-ufrag and ice-pwd lines as input. SDPUtils.getIceParameters = function(mediaSection, sessionpart) { var lines = SDPUtils.splitLines(mediaSection); // Search in session part, too. lines = lines.concat(SDPUtils.splitLines(sessionpart)); var iceParameters = { usernameFragment: lines.filter(function(line) { return line.indexOf('a=ice-ufrag:') === 0; })[0].substr(12), password: lines.filter(function(line) { return line.indexOf('a=ice-pwd:') === 0; })[0].substr(10) }; return iceParameters; }; // Serializes ICE parameters to SDP. SDPUtils.writeIceParameters = function(params) { return 'a=ice-ufrag:' + params.usernameFragment + '\r\n' + 'a=ice-pwd:' + params.password + '\r\n'; }; // Parses the SDP media section and returns RTCRtpParameters. SDPUtils.parseRtpParameters = function(mediaSection) { var description = { codecs: [], headerExtensions: [], fecMechanisms: [], rtcp: [] }; var lines = SDPUtils.splitLines(mediaSection); var mline = lines[0].split(' '); for (var i = 3; i < mline.length; i++) { // find all codecs from mline[3..] var pt = mline[i]; var rtpmapline = SDPUtils.matchPrefix( mediaSection, 'a=rtpmap:' + pt + ' ')[0]; if (rtpmapline) { var codec = SDPUtils.parseRtpMap(rtpmapline); var fmtps = SDPUtils.matchPrefix( mediaSection, 'a=fmtp:' + pt + ' '); // Only the first a=fmtp:<pt> is considered. codec.parameters = fmtps.length ? SDPUtils.parseFmtp(fmtps[0]) : {}; codec.rtcpFeedback = SDPUtils.matchPrefix( mediaSection, 'a=rtcp-fb:' + pt + ' ') .map(SDPUtils.parseRtcpFb); description.codecs.push(codec); // parse FEC mechanisms from rtpmap lines. switch (codec.name.toUpperCase()) { case 'RED': case 'ULPFEC': description.fecMechanisms.push(codec.name.toUpperCase()); break; default: // only RED and ULPFEC are recognized as FEC mechanisms. break; } } } SDPUtils.matchPrefix(mediaSection, 'a=extmap:').forEach(function(line) { description.headerExtensions.push(SDPUtils.parseExtmap(line)); }); // FIXME: parse rtcp. return description; }; // Generates parts of the SDP media section describing the capabilities / // parameters. SDPUtils.writeRtpDescription = function(kind, caps) { var sdp = ''; // Build the mline. sdp += 'm=' + kind + ' '; sdp += caps.codecs.length > 0 ? '9' : '0'; // reject if no codecs. sdp += ' UDP/TLS/RTP/SAVPF '; sdp += caps.codecs.map(function(codec) { if (codec.preferredPayloadType !== undefined) { return codec.preferredPayloadType; } return codec.payloadType; }).join(' ') + '\r\n'; sdp += 'c=IN IP4 0.0.0.0\r\n'; sdp += 'a=rtcp:9 IN IP4 0.0.0.0\r\n'; // Add a=rtpmap lines for each codec. Also fmtp and rtcp-fb. caps.codecs.forEach(function(codec) { sdp += SDPUtils.writeRtpMap(codec); sdp += SDPUtils.writeFmtp(codec); sdp += SDPUtils.writeRtcpFb(codec); }); var maxptime = 0; caps.codecs.forEach(function(codec) { if (codec.maxptime > maxptime) { maxptime = codec.maxptime; } }); if (maxptime > 0) { sdp += 'a=maxptime:' + maxptime + '\r\n'; } sdp += 'a=rtcp-mux\r\n'; if (caps.headerExtensions) { caps.headerExtensions.forEach(function(extension) { sdp += SDPUtils.writeExtmap(extension); }); } // FIXME: write fecMechanisms. return sdp; }; // Parses the SDP media section and returns an array of // RTCRtpEncodingParameters. SDPUtils.parseRtpEncodingParameters = function(mediaSection) { var encodingParameters = []; var description = SDPUtils.parseRtpParameters(mediaSection); var hasRed = description.fecMechanisms.indexOf('RED') !== -1; var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1; // filter a=ssrc:... cname:, ignore PlanB-msid var ssrcs = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:') .map(function(line) { return SDPUtils.parseSsrcMedia(line); }) .filter(function(parts) { return parts.attribute === 'cname'; }); var primarySsrc = ssrcs.length > 0 && ssrcs[0].ssrc; var secondarySsrc; var flows = SDPUtils.matchPrefix(mediaSection, 'a=ssrc-group:FID') .map(function(line) { var parts = line.substr(17).split(' '); return parts.map(function(part) { return parseInt(part, 10); }); }); if (flows.length > 0 && flows[0].length > 1 && flows[0][0] === primarySsrc) { secondarySsrc = flows[0][1]; } description.codecs.forEach(function(codec) { if (codec.name.toUpperCase() === 'RTX' && codec.parameters.apt) { var encParam = { ssrc: primarySsrc, codecPayloadType: parseInt(codec.parameters.apt, 10) }; if (primarySsrc && secondarySsrc) { encParam.rtx = {ssrc: secondarySsrc}; } encodingParameters.push(encParam); if (hasRed) { encParam = JSON.parse(JSON.stringify(encParam)); encParam.fec = { ssrc: primarySsrc, mechanism: hasUlpfec ? 'red+ulpfec' : 'red' }; encodingParameters.push(encParam); } } }); if (encodingParameters.length === 0 && primarySsrc) { encodingParameters.push({ ssrc: primarySsrc }); } // we support both b=AS and b=TIAS but interpret AS as TIAS. var bandwidth = SDPUtils.matchPrefix(mediaSection, 'b='); if (bandwidth.length) { if (bandwidth[0].indexOf('b=TIAS:') === 0) { bandwidth = parseInt(bandwidth[0].substr(7), 10); } else if (bandwidth[0].indexOf('b=AS:') === 0) { // use formula from JSEP to convert b=AS to TIAS value. bandwidth = parseInt(bandwidth[0].substr(5), 10) * 1000 * 0.95 - (50 * 40 * 8); } else { bandwidth = undefined; } encodingParameters.forEach(function(params) { params.maxBitrate = bandwidth; }); } return encodingParameters; }; // parses http://draft.ortc.org/#rtcrtcpparameters* SDPUtils.parseRtcpParameters = function(mediaSection) { var rtcpParameters = {}; // Gets the first SSRC. Note tha with RTX there might be multiple // SSRCs. var remoteSsrc = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:') .map(function(line) { return SDPUtils.parseSsrcMedia(line); }) .filter(function(obj) { return obj.attribute === 'cname'; })[0]; if (remoteSsrc) { rtcpParameters.cname = remoteSsrc.value; rtcpParameters.ssrc = remoteSsrc.ssrc; } // Edge uses the compound attribute instead of reducedSize // compound is !reducedSize var rsize = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-rsize'); rtcpParameters.reducedSize = rsize.length > 0; rtcpParameters.compound = rsize.length === 0; // parses the rtcp-mux attrіbute. // Note that Edge does not support unmuxed RTCP. var mux = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-mux'); rtcpParameters.mux = mux.length > 0; return rtcpParameters; }; // parses either a=msid: or a=ssrc:... msid lines and returns // the id of the MediaStream and MediaStreamTrack. SDPUtils.parseMsid = function(mediaSection) { var parts; var spec = SDPUtils.matchPrefix(mediaSection, 'a=msid:'); if (spec.length === 1) { parts = spec[0].substr(7).split(' '); return {stream: parts[0], track: parts[1]}; } var planB = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:') .map(function(line) { return SDPUtils.parseSsrcMedia(line); }) .filter(function(msidParts) { return msidParts.attribute === 'msid'; }); if (planB.length > 0) { parts = planB[0].value.split(' '); return {stream: parts[0], track: parts[1]}; } }; // Generate a session ID for SDP. // https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-20#section-5.2.1 // recommends using a cryptographically random +ve 64-bit value // but right now this should be acceptable and within the right range SDPUtils.generateSessionId = function() { return Math.random().toString().substr(2, 21); }; // Write boilder plate for start of SDP // sessId argument is optional - if not supplied it will // be generated randomly // sessVersion is optional and defaults to 2 // sessUser is optional and defaults to 'thisisadapterortc' SDPUtils.writeSessionBoilerplate = function(sessId, sessVer, sessUser) { var sessionId; var version = sessVer !== undefined ? sessVer : 2; if (sessId) { sessionId = sessId; } else { sessionId = SDPUtils.generateSessionId(); } var user = sessUser || 'thisisadapterortc'; // FIXME: sess-id should be an NTP timestamp. return 'v=0\r\n' + 'o=' + user + ' ' + sessionId + ' ' + version + ' IN IP4 127.0.0.1\r\n' + 's=-\r\n' + 't=0 0\r\n'; }; SDPUtils.writeMediaSection = function(transceiver, caps, type, stream) { var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps); // Map ICE parameters (ufrag, pwd) to SDP. sdp += SDPUtils.writeIceParameters( transceiver.iceGatherer.getLocalParameters()); // Map DTLS parameters to SDP. sdp += SDPUtils.writeDtlsParameters( transceiver.dtlsTransport.getLocalParameters(), type === 'offer' ? 'actpass' : 'active'); sdp += 'a=mid:' + transceiver.mid + '\r\n'; if (transceiver.direction) { sdp += 'a=' + transceiver.direction + '\r\n'; } else if (transceiver.rtpSender && transceiver.rtpReceiver) { sdp += 'a=sendrecv\r\n'; } else if (transceiver.rtpSender) { sdp += 'a=sendonly\r\n'; } else if (transceiver.rtpReceiver) { sdp += 'a=recvonly\r\n'; } else { sdp += 'a=inactive\r\n'; } if (transceiver.rtpSender) { // spec. var msid = 'msid:' + stream.id + ' ' + transceiver.rtpSender.track.id + '\r\n'; sdp += 'a=' + msid; // for Chrome. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc + ' ' + msid; if (transceiver.sendEncodingParameters[0].rtx) { sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc + ' ' + msid; sdp += 'a=ssrc-group:FID ' + transceiver.sendEncodingParameters[0].ssrc + ' ' + transceiver.sendEncodingParameters[0].rtx.ssrc + '\r\n'; } } // FIXME: this should be written by writeRtpDescription. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc + ' cname:' + SDPUtils.localCName + '\r\n'; if (transceiver.rtpSender && transceiver.sendEncodingParameters[0].rtx) { sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc + ' cname:' + SDPUtils.localCName + '\r\n'; } return sdp; }; // Gets the direction from the mediaSection or the sessionpart. SDPUtils.getDirection = function(mediaSection, sessionpart) { // Look for sendrecv, sendonly, recvonly, inactive, default to sendrecv. var lines = SDPUtils.splitLines(mediaSection); for (var i = 0; i < lines.length; i++) { switch (lines[i]) { case 'a=sendrecv': case 'a=sendonly': case 'a=recvonly': case 'a=inactive': return lines[i].substr(2); default: // FIXME: What should happen here? } } if (sessionpart) { return SDPUtils.getDirection(sessionpart); } return 'sendrecv'; }; SDPUtils.getKind = function(mediaSection) { var lines = SDPUtils.splitLines(mediaSection); var mline = lines[0].split(' '); return mline[0].substr(2); }; SDPUtils.isRejected = function(mediaSection) { return mediaSection.split(' ', 2)[1] === '0'; }; SDPUtils.parseMLine = function(mediaSection) { var lines = SDPUtils.splitLines(mediaSection); var parts = lines[0].substr(2).split(' '); return { kind: parts[0], port: parseInt(parts[1], 10), protocol: parts[2], fmt: parts.slice(3).join(' ') }; }; SDPUtils.parseOLine = function(mediaSection) { var line = SDPUtils.matchPrefix(mediaSection, 'o=')[0]; var parts = line.substr(2).split(' '); return { username: parts[0], sessionId: parts[1], sessionVersion: parseInt(parts[2], 10), netType: parts[3], addressType: parts[4], address: parts[5] }; }; // a very naive interpretation of a valid SDP. SDPUtils.isValidSDP = function(blob) { if (typeof blob !== 'string' || blob.length === 0) { return false; } var lines = SDPUtils.splitLines(blob); for (var i = 0; i < lines.length; i++) { if (lines[i].length < 2 || lines[i].charAt(1) !== '=') { return false; } // TODO: check the modifier a bit more. } return true; }; // Expose public methods. if (typeof module === 'object') { module.exports = SDPUtils; } },{}]},{},[1])(1) });
2301_76564925/webrtc
adapter-latest.js
JavaScript
apache-2.0
188,347
CC = g++ CFLAGS = -Wall -Wextra -O2 -g LDFLAGS = -levent TARGET = server SRC = server.cpp # 默认构建目标 all: $(TARGET) $(TARGET): $(SRC) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) # 清理编译产物 clean: rm -f $(TARGET) *.o # 安装依赖(Ubuntu/Debian) install-deps: sudo apt-get install -y libevent-dev g++ make
2301_76564925/webrtc
makefile
Makefile
apache-2.0
329
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WebRTC屏幕共享</title> <script src="https://cdn.tailwindcss.com"></script> <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet"> <script> tailwind.config = { theme: { extend: { colors: { primary: '#165DFF', secondary: '#36D399', danger: '#F87272', neutral: '#3D4451', }, fontFamily: { inter: ['Inter', 'system-ui', 'sans-serif'], }, } } } </script> <style type="text/tailwindcss"> @layer utilities { .content-auto { content-visibility: auto; } .backdrop-blur-sm { backdrop-filter: blur(4px); } .transition-transform-opacity { transition-property: transform, opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; } .video-container { aspect-ratio: 16/9; } } </style> </head> <body class="bg-gray-100 font-inter min-h-screen flex flex-col"> <!-- 房间选择页面 --> <div id="room-selection" class="flex-grow flex items-center justify-center p-4"> <div class="w-full max-w-md bg-white rounded-2xl shadow-xl p-8 transform transition-all duration-300 hover:shadow-2xl"> <div class="text-center mb-8"> <div class="inline-block p-4 bg-primary/10 rounded-full mb-4"> <i class="fa fa-video-camera text-3xl text-primary"></i> </div> <h1 class="text-[clamp(1.5rem,3vw,2.5rem)] font-bold text-neutral">WebRTC屏幕共享</h1> <p class="text-gray-500 mt-2">通过房间号加入或创建屏幕共享会话</p> </div> <form id="room-form" class="space-y-6"> <div> <label for="room-id" class="block text-sm font-medium text-gray-700 mb-1">房间号</label> <div class="relative"> <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> <i class="fa fa-hashtag text-gray-400"></i> </div> <input type="text" id="room-id" name="room-id" class="pl-10 block w-full rounded-lg border-gray-300 shadow-sm focus:ring-primary focus:border-primary sm:text-sm border py-3" placeholder="输入或创建房间号" required> </div> </div> <button type="submit" class="w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-all transform hover:scale-[1.02]"> <i class="fa fa-sign-in mr-2"></i> 进入房间 </button> </form> <div class="mt-8 text-center text-sm text-gray-500"> <p>提示: 分享相同的房间号给对方以开始屏幕共享</p> </div> </div> </div> <!-- 屏幕共享主页面 (初始隐藏) --> <div id="screen-share" class="hidden flex-grow flex flex-col"> <header class="bg-white shadow-md"> <div class="container mx-auto px-4 py-4 flex justify-between items-center"> <div class="flex items-center gap-2"> <i class="fa fa-video-camera text-primary text-xl"></i> <h1 class="text-[clamp(1.2rem,2vw,1.8rem)] font-bold text-neutral"> <span id="room-title">房间 #12345</span> </h1> </div> <div class="flex items-center gap-4"> <span id="connection-status" class="text-sm px-3 py-1 rounded-full bg-gray-100 text-gray-600 flex items-center"> <i class="fa fa-circle text-yellow-500 mr-2 text-xs"></i> 等待连接 </span> <button id="leave-room" class="px-4 py-2 bg-danger hover:bg-danger/90 text-white rounded-lg flex items-center gap-2 transition-all transform hover:scale-105"> <i class="fa fa-sign-out"></i> <span>离开房间</span> </button> </div> </div> </header> <main class="flex-grow container mx-auto px-4 py-8"> <div class="max-w-6xl mx-auto"> <!-- 状态卡片 --> <div class="bg-white rounded-xl shadow-lg p-6 mb-8 transition-all duration-300 hover:shadow-xl"> <div id="main-status-card" class="flex items-center justify-center py-4"> <div class="text-center"> <div class="inline-block p-4 bg-primary/10 rounded-full mb-4"> <i class="fa fa-info-circle text-3xl text-primary"></i> </div> <h2 id="main-status-text" class="text-[clamp(1.2rem,2vw,1.5rem)] font-medium text-neutral"> 等待对方加入房间 </h2> <p class="text-gray-500 mt-2">请确保已与对方共享房间号</p> </div> </div> </div> <!-- 视频显示区域 --> <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8"> <!-- 主视频窗口 --> <div class="lg:col-span-2 relative bg-gray-900 rounded-xl overflow-hidden shadow-xl"> <div id="main-video-container" class="video-container relative cursor-pointer"> <video id="remote-video" class="w-full h-full object-contain" autoplay></video> <!-- 初始提示覆盖层 --> <div id="remote-overlay" class="absolute inset-0 bg-black/60 flex items-center justify-center"> <div class="text-center p-6"> <div class="inline-block p-4 bg-white/10 rounded-full mb-4 backdrop-blur-sm"> <i class="fa fa-spinner fa-spin text-5xl text-white/80"></i> </div> <h3 class="text-xl font-medium text-white mb-2">等待对方共享内容</h3> <p class="text-white/70">对方加入并开始共享后,内容将显示在这里</p> </div> </div> <!-- 视频控制条 --> <div class="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-4 opacity-0 hover:opacity-100 transition-opacity duration-300 flex justify-between items-center"> <div class="text-white/80 text-sm"> <span id="remote-title">对方的屏幕</span> </div> <div class="flex gap-2"> <button id="toggle-fullscreen" class="p-2 bg-white/20 hover:bg-white/30 rounded-full text-white transition-all"> <i class="fa fa-expand"></i> </button> </div> </div> </div> </div> <!-- 本地视频窗口 --> <div class="relative bg-gray-900 rounded-xl overflow-hidden shadow-xl"> <div id="local-video-container" class="video-container relative cursor-pointer hover:ring-4 hover:ring-primary transition-all"> <video id="local-video" class="w-full h-full object-contain" autoplay muted></video> <!-- 初始提示覆盖层 --> <div id="local-overlay" class="absolute inset-0 bg-black/60 flex items-center justify-center"> <div class="text-center p-6"> <div class="inline-block p-4 bg-white/10 rounded-full mb-4 backdrop-blur-sm"> <i class="fa fa-play-circle text-5xl text-white/80"></i> </div> <h3 class="text-xl font-medium text-white mb-2">点击开始共享</h3> <p class="text-white/70">点击下方按钮选择要共享的屏幕内容</p> </div> </div> <!-- 视频控制条 --> <div class="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-4 opacity-0 hover:opacity-100 transition-opacity duration-300 flex justify-between items-center"> <div class="text-white/80 text-sm"> <span id="local-title">我的屏幕</span> </div> <div class="flex gap-2"> <button id="start-share-btn" class="px-4 py-2 bg-primary hover:bg-primary/90 text-white rounded-lg flex items-center gap-2 transition-all"> <i class="fa fa-desktop"></i> <span>开始共享</span> </button> </div> </div> <!-- 交换按钮 --> <div class="absolute top-4 right-4"> <button id="swap-video-btn" class="p-3 bg-primary/90 hover:bg-primary text-white rounded-full shadow-lg transition-all transform hover:scale-110"> <i class="fa fa-exchange"></i> </button> </div> </div> </div> </div> <!-- 信息卡片 --> <div class="bg-white rounded-xl shadow-lg p-6 mb-8"> <h3 class="text-xl font-medium text-neutral mb-4 flex items-center"> <i class="fa fa-info-circle text-primary mr-2"></i> 使用说明 </h3> <ul class="space-y-2 text-gray-600"> <li class="flex items-start"> <i class="fa fa-check-circle text-secondary mt-1 mr-2"></i> <span>点击"开始共享"按钮选择要共享的内容(整个屏幕、窗口或浏览器标签)</span> </li> <li class="flex items-start"> <i class="fa fa-check-circle text-secondary mt-1 mr-2"></i> <span>大窗口显示对方的共享内容,小窗口显示您的共享内容</span> </li> <li class="flex items-start"> <i class="fa fa-exchange text-primary mt-1 mr-2"></i> <span>点击小窗口上的交换按钮可以切换大小窗口显示内容</span> </li> <li class="flex items-start"> <i class="fa fa-expand text-primary mt-1 mr-2"></i> <span>双击大窗口或点击全屏按钮可以进入全屏模式</span> </li> <li class="flex items-start"> <i class="fa fa-exclamation-triangle text-warning mt-1 mr-2"></i> <span>屏幕共享可能会暴露敏感信息,请确保仅共享适当的内容</span> </li> </ul> </div> </div> </main> <footer class="bg-white border-t border-gray-200 py-6"> <div class="container mx-auto px-4 text-center text-gray-500 text-sm"> <p>© 2025 WebRTC屏幕共享 | 使用现代Web API构建</p> </div> </footer> </div> <!-- JavaScript --> <script> 'use strict'; // DOM元素 const roomSelectionPage = document.getElementById('room-selection'); const screenSharePage = document.getElementById('screen-share'); const roomForm = document.getElementById('room-form'); const roomIdInput = document.getElementById('room-id'); const roomTitle = document.getElementById('room-title'); const leaveRoomBtn = document.getElementById('leave-room'); const connectionStatus = document.getElementById('connection-status'); const mainStatusText = document.getElementById('main-status-text'); const remoteVideo = document.getElementById('remote-video'); const localVideo = document.getElementById('local-video'); const remoteOverlay = document.getElementById('remote-overlay'); const localOverlay = document.getElementById('local-overlay'); const startShareBtn = document.getElementById('start-share-btn'); const swapVideoBtn = document.getElementById('swap-video-btn'); const toggleFullscreenBtn = document.getElementById('toggle-fullscreen'); const mainVideoContainer = document.getElementById('main-video-container'); const localVideoContainer = document.getElementById('local-video-container'); const remoteTitle = document.getElementById('remote-title'); const localTitle = document.getElementById('local-title'); const SIGNAL_TYPE_JOIN = "join"; const SIGNAL_TYPE_RESP_JOIN = "resp-join"; // 告知加入者对方是谁 const SIGNAL_TYPE_LEAVE = "leave"; const SIGNAL_TYPE_NEW_PEER = "new-peer"; const SIGNAL_TYPE_PEER_LEAVE = "peer-leave"; const SIGNAL_TYPE_OFFER = "offer"; const SIGNAL_TYPE_ANSWER = "answer"; const SIGNAL_TYPE_CANDIDATE = "candidate"; const SIGNAL_TYPE_START = "start"; const SIGNAL_TYPE_END = "end"; // 应用状态 let isSwapped = false; let localStream = null; let remoteStream = null; let lastClickTime = 0; var localUserId = Math.random().toString(36).substr(2); // 本地uid var remoteUserId = -1; // 对端 var roomId = 0; var pc = null; var RTCEngine; // 房间表单提交 roomForm.addEventListener('submit', (e) => { e.preventDefault(); roomId = roomIdInput.value; if (roomId) { // 更新房间标题 roomTitle.textContent = `房间 #${roomId.trim()}`; // 切换页面 roomSelectionPage.classList.add('hidden'); screenSharePage.classList.remove('hidden'); console.log("加入按钮被点击, roomId: " + roomId); // 初始化本地码流 initLocalStream(); } }); // 离开房间 leaveRoomBtn.addEventListener('click', () => { // 停止所有流 if (localStream) { localStream.getTracks().forEach(track => track.stop()); localStream = null; } if (remoteStream) { remoteStream.getTracks().forEach(track => track.stop()); remoteStream = null; } doLeave(); // 重置UI resetUI(); // 返回房间选择页面 screenSharePage.classList.add('hidden'); roomSelectionPage.classList.remove('hidden'); }); // 开始共享屏幕 startShareBtn.addEventListener('click', async () => { try { doStart(roomId); // 将流连接到视频元素 localVideo.srcObject = localStream; // 隐藏初始覆盖层 localOverlay.classList.add('opacity-0', 'pointer-events-none'); // 更新UI状态 startShareBtn.innerHTML = '<i class="fa fa-stop"></i><span>停止共享</span>'; startShareBtn.classList.remove('bg-primary'); startShareBtn.classList.add('bg-danger'); // 添加流结束事件监听(用户在系统层面停止共享) localStream.getVideoTracks()[0].addEventListener('ended', () => { stopSharing(); }); } catch (error) { console.error('获取屏幕共享流失败:', error); alert('无法开始屏幕共享: ' + error.message); } }); // 停止共享 function stopSharing() { if (localStream) { localStream.getTracks().forEach(track => track.stop()); doEnd(roomId); // 重置UI localVideo.srcObject = null; localOverlay.classList.remove('opacity-0', 'pointer-events-none'); startShareBtn.innerHTML = '<i class="fa fa-desktop"></i><span>开始共享</span>'; startShareBtn.classList.remove('bg-danger'); startShareBtn.classList.add('bg-primary'); // 如果远程流是克隆的本地流,也停止它 if (remoteStream) { remoteStream.getTracks().forEach(track => track.stop()); remoteStream = null; remoteVideo.srcObject = null; remoteOverlay.classList.remove('opacity-0', 'pointer-events-none'); mainStatusText.textContent = '对方尚未开始共享屏幕'; } } } // 交换视频 swapVideoBtn.addEventListener('click', () => { isSwapped = !isSwapped; if (isSwapped) { // 交换流 if (localStream && remoteStream) { localVideo.srcObject = remoteStream; remoteVideo.srcObject = localStream; // 交换标题 [localTitle.textContent, remoteTitle.textContent] = [remoteTitle.textContent, localTitle.textContent]; // 交换UI类 mainVideoContainer.classList.remove('lg:col-span-2'); mainVideoContainer.classList.add('lg:col-span-1'); localVideoContainer.classList.remove('lg:col-span-1'); localVideoContainer.classList.add('lg:col-span-2'); // 动画效果 mainVideoContainer.classList.add('scale-95'); localVideoContainer.classList.add('scale-95'); setTimeout(() => { mainVideoContainer.classList.remove('scale-95'); localVideoContainer.classList.remove('scale-95'); }, 100); } } else { // 恢复原始状态 if (localStream && remoteStream) { localVideo.srcObject = localStream; remoteVideo.srcObject = remoteStream; // 恢复标题 [localTitle.textContent, remoteTitle.textContent] = [remoteTitle.textContent, localTitle.textContent]; // 恢复UI类 mainVideoContainer.classList.remove('lg:col-span-1'); mainVideoContainer.classList.add('lg:col-span-2'); localVideoContainer.classList.remove('lg:col-span-2'); localVideoContainer.classList.add('lg:col-span-1'); // 动画效果 mainVideoContainer.classList.add('scale-95'); localVideoContainer.classList.add('scale-95'); setTimeout(() => { mainVideoContainer.classList.remove('scale-95'); localVideoContainer.classList.remove('scale-95'); }, 100); } } }); // 全屏切换 toggleFullscreenBtn.addEventListener('click', toggleFullscreen); // 双击主窗口进入全屏 mainVideoContainer.addEventListener('click', (e) => { const now = Date.now(); const delta = now - lastClickTime; if (delta < 300) { // 300ms内的两次点击被视为双击 toggleFullscreen(); } lastClickTime = now; }); // 全屏切换函数 function toggleFullscreen() { if (!document.fullscreenElement) { mainVideoContainer.requestFullscreen().catch(err => { console.error(`全屏请求错误: ${err.message}`); }); toggleFullscreenBtn.innerHTML = '<i class="fa fa-compress"></i>'; } else { document.exitFullscreen(); toggleFullscreenBtn.innerHTML = '<i class="fa fa-expand"></i>'; } } // 监听全屏状态变化 document.addEventListener('fullscreenchange', () => { if (!document.fullscreenElement) { toggleFullscreenBtn.innerHTML = '<i class="fa fa-expand"></i>'; } }); // 更新连接状态 function updateConnectionStatus(text, iconColor) { connectionStatus.innerHTML = ` <i class="fa fa-circle ${iconColor} mr-2 text-xs"></i> ${text} `; } // 重置UI function resetUI() { // 重置视频元素 localVideo.srcObject = null; remoteVideo.srcObject = null; // 显示初始覆盖层 localOverlay.classList.remove('opacity-0', 'pointer-events-none'); remoteOverlay.classList.remove('opacity-0', 'pointer-events-none'); // 重置按钮状态 startShareBtn.innerHTML = '<i class="fa fa-desktop"></i><span>开始共享</span>'; startShareBtn.classList.remove('bg-danger'); startShareBtn.classList.add('bg-primary'); // 重置视频容器类 mainVideoContainer.classList.remove('lg:col-span-1'); mainVideoContainer.classList.add('lg:col-span-2'); localVideoContainer.classList.remove('lg:col-span-2'); localVideoContainer.classList.add('lg:col-span-1'); // 重置标题 remoteTitle.textContent = '对方的屏幕'; localTitle.textContent = '我的屏幕'; // 重置状态 isSwapped = false; updateConnectionStatus('等待连接', 'text-yellow-500'); mainStatusText.textContent = '等待对方加入房间'; // 退出全屏 if (document.fullscreenElement) { document.exitFullscreen(); } } // 检查浏览器兼容性 if (!navigator.mediaDevices || !navigator.mediaDevices.getDisplayMedia) { alert('您的浏览器不支持屏幕共享功能'); startShareBtn.disabled = true; startShareBtn.classList.add('opacity-50', 'cursor-not-allowed'); } function handleIceCandidate(event) { console.info("handleIceCandidate"); if (event.candidate) { var jsonMsg = { 'cmd': SIGNAL_TYPE_CANDIDATE, 'roomId': roomId, 'uid': localUserId, 'remoteUid': remoteUserId, 'msg': JSON.stringify(event.candidate) }; var message = JSON.stringify(jsonMsg); RTCEngine.sendMessage(message); // console.info("handleIceCandidate message: " + message); console.info("send candidate message"); } else { console.warn("End of candidates"); } } function handleRemoteStreamAdd(event) { console.info("handleRemoteStreamAdd"); remoteStream = event.streams[0]; // remoteVideo.srcObject = remoteStream; } function handleConnectionStateChange() { if(pc != null) { console.info("ConnectionState -> " + pc.connectionState); } } function handleIceConnectionStateChange() { if(pc != null) { console.info("IceConnectionState -> " + pc.iceConnectionState); } } function createPeerConnection() { console.log("createPeerConnection") var defaultConfiguration = { // bundlePolicy: "max-bundle", rtcpMuxPolicy: "require", iceTransportPolicy:"relay",//relay 或者 all // 修改ice数组测试效果,需要进行封装 iceServers: [ { "urls": [ "turn:192.168.3.186:3478?transport=udp", "turn:192.168.3.186:3478?transport=tcp" // 可以插入多个进行备选 ], "username": "achene", "credential": "123456" }, { "urls": [ "stun:192.168.3.186:3478" ] } ] }; pc = new RTCPeerConnection(defaultConfiguration); pc.onicecandidate = handleIceCandidate; pc.ontrack = handleRemoteStreamAdd; pc.onconnectionstatechange = handleConnectionStateChange; pc.oniceconnectionstatechange = handleIceConnectionStateChange localStream.getTracks().forEach((track) => pc.addTrack(track, localStream)); } function createOfferAndSendMessage(session) { pc.setLocalDescription(session) .then(function () { var jsonMsg = { 'cmd': 'offer', 'roomId': roomId, 'uid': localUserId, 'remoteUid': remoteUserId, 'msg': JSON.stringify(session) }; var message = JSON.stringify(jsonMsg); RTCEngine.sendMessage(message); console.info("send offer message"); }) .catch(function (error) { console.error("offer setLocalDescription failed: " + error); }); } function handleCreateOfferError(error) { console.error("handleCreateOfferError: " + error); } function createAnswerAndSendMessage(session) { pc.setLocalDescription(session) .then(function () { var jsonMsg = { 'cmd': SIGNAL_TYPE_ANSWER, 'roomId': roomId, 'uid': localUserId, 'remoteUid': remoteUserId, 'msg': JSON.stringify(session) }; var message = JSON.stringify(jsonMsg); RTCEngine.sendMessage(message); console.info("send answer message"); }) .catch(function (error) { console.error("answer setLocalDescription failed: " + error); }); } function handleCreateAnswerError(error) { console.error("handleCreateAnswerError: " + error); } var RTCEngine = function (wsUrl) { this.init(wsUrl); RTCEngine = this; return this; } RTCEngine.prototype.init = function (wsUrl) { // 设置websocket url this.wsUrl = wsUrl; /** websocket对象 */ this.signaling = null; } RTCEngine.prototype.createWebsocket = function () { RTCEngine = this; RTCEngine.signaling = new WebSocket(this.wsUrl); RTCEngine.signaling.onopen = function () { RTCEngine.onOpen(); } RTCEngine.signaling.onmessage = function (ev) { RTCEngine.onMessage(ev); } RTCEngine.signaling.onerror = function (ev) { RTCEngine.onError(ev); } RTCEngine.signaling.onclose = function (ev) { RTCEngine.onClose(ev); } } RTCEngine.prototype.onOpen = function () { console.log("websocket open"); } RTCEngine.prototype.onMessage = function (event) { console.log("onMessage: " + event.data); var jsonMsg = null; try { jsonMsg = JSON.parse(event.data); } catch(e) { console.warn("onMessage parse Json failed:" + e); return; } switch (jsonMsg.cmd) { case SIGNAL_TYPE_NEW_PEER: handleRemoteNewPeer(jsonMsg); break; case SIGNAL_TYPE_RESP_JOIN: handleResponseJoin(jsonMsg); break; case SIGNAL_TYPE_PEER_LEAVE: handleRemotePeerLeave(jsonMsg); break; case SIGNAL_TYPE_OFFER: handleRemoteOffer(jsonMsg); break; case SIGNAL_TYPE_ANSWER: handleRemoteAnswer(jsonMsg); break; case SIGNAL_TYPE_CANDIDATE: handleRemoteCandidate(jsonMsg); break; case SIGNAL_TYPE_START: handleRtmoteStart(jsonMsg); break; case SIGNAL_TYPE_END: handleRtmoteEnd(jsonMsg); break; } } RTCEngine.prototype.onError = function (event) { console.log("onError: " + event.data); } RTCEngine.prototype.onClose = function (event) { console.log("onClose -> code: " + event.code + ", reason:" + EventTarget.reason); } RTCEngine.prototype.sendMessage = function (message) { this.signaling.send(message); } function handleRtmoteEnd(message) { console.info("handleRtmoteEnd"); mainStatusText.textContent = '对方未开启共享' remoteVideo.srcObject = null; } function handleRtmoteStart(message) { console.info("handleRtmoteStart"); mainStatusText.textContent = '对方开启共享' remoteVideo.srcObject = remoteStream; remoteOverlay.classList.add('opacity-0', 'pointer-events-none'); } function handleResponseJoin(message) { console.info("handleResponseJoin, remoteUid: " + message.remoteUid); remoteUserId = message.remoteUid; } function handleRemotePeerLeave(message) { console.info("handleRemotePeerLeave, remoteUid: " + message.remoteUid); remoteVideo.srcObject = null; if(pc != null) { pc.close(); pc = null; } } function handleRemoteNewPeer(message) { console.info("handleRemoteNewPeer, remoteUid: " + message.remoteUid); remoteUserId = message.remoteUid; doOffer(); } function handleRemoteOffer(message) { console.info("handleRemoteOffer"); if(pc == null) { createPeerConnection(); } var desc = JSON.parse(message.msg); pc.setRemoteDescription(desc); doAnswer(); } function handleRemoteAnswer(message) { console.info("handleRemoteAnswer"); var desc = JSON.parse(message.msg); pc.setRemoteDescription(desc); } function handleRemoteCandidate(message) { updateConnectionStatus('已连接', 'text-green-500'); mainStatusText.textContent = '对方尚未开始共享屏幕'; console.info("handleRemoteCandidate"); var candidate = JSON.parse(message.msg); pc.addIceCandidate(candidate).catch(e => { console.error("addIceCandidate failed:" + e.name); }); } function doOffer() { // 创建RTCPeerConnection console.log("dooffer") if (pc == null) { createPeerConnection(); } pc.createOffer().then(createOfferAndSendMessage).catch(handleCreateOfferError); } function doAnswer() { pc.createAnswer().then(createAnswerAndSendMessage).catch(handleCreateAnswerError); } function doStart(roomId) { var jsonMsg = { 'cmd': SIGNAL_TYPE_START, 'roomId': roomId, 'uid': localUserId, 'remoteUid': remoteUserId }; var message = JSON.stringify(jsonMsg); RTCEngine.sendMessage(message); console.info("doStart"); } function doEnd(roomId) { var jsonMsg = { 'cmd': SIGNAL_TYPE_END, 'roomId': roomId, 'uid': localUserId, 'remoteUid': remoteUserId }; var message = JSON.stringify(jsonMsg); RTCEngine.sendMessage(message); console.info("doEnd"); } function doJoin(roomId) { var jsonMsg = { 'cmd': SIGNAL_TYPE_JOIN, 'roomId': roomId, 'uid': localUserId, }; var message = JSON.stringify(jsonMsg); RTCEngine.sendMessage(message); console.info("doJoin"); } function doLeave() { var jsonMsg = { 'cmd': SIGNAL_TYPE_LEAVE, 'roomId': roomId, 'uid': localUserId, }; var message = JSON.stringify(jsonMsg); RTCEngine.sendMessage(message); console.info("doLeave"); hangup(); } function hangup() { localVideo.srcObject = null; // 0.关闭自己的本地显示 remoteVideo.srcObject = null; // 1.不显示对方 closeLocalStream(); // 2. 关闭本地流 if(pc != null) { pc.close(); // 3.关闭RTCPeerConnection pc = null; } } function closeLocalStream() { if(localStream != null) { localStream.getTracks().forEach((track) => { track.stop(); }); } } function openLocalStream(stream) { console.log('Open local stream'); doJoin(roomId); localVideo.srcObject = stream; localStream = stream; } function initLocalStream() { navigator.mediaDevices.getDisplayMedia({ video: { cursor: "always" // 显示鼠标指针 }, audio: false // 不捕获音频 }) .then(openLocalStream) .catch(function (e) { alert("getUserMedia() error: " + e.name); }); } RTCEngine = new RTCEngine("ws://192.168.3.186:8099"); RTCEngine.createWebsocket(); </script> </body> </html>
2301_76564925/webrtc
screen.html
HTML
apache-2.0
38,458
#include <event2/event.h> #include <event2/bufferevent.h> #include <event2/listener.h> #include <event2/buffer.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <unistd.h> #define DEFAULT_PORT 8080 #define RESP_HEADER_FMT "HTTP/1.1 200 OK\r\n" \ "Content-Type: text/html\r\n" \ "Content-Length: %zu\r\n" \ "Connection: close\r\n\r\n" static char *response_data = NULL; static size_t response_len = 0; /* 信号处理回调 */ static void signal_cb(evutil_socket_t sig, short events, void *user_data) { struct event_base *base = reinterpret_cast<event_base *>(user_data); printf("Caught signal %d, shutting down...\n", sig); event_base_loopexit(base, NULL); } /* 事件回调:处理连接事件 */ static void event_cb(struct bufferevent *bev, short events, void *ctx) { if (events & BEV_EVENT_ERROR) { perror("Bufferevent error"); } bufferevent_free(bev); } /* 写回调:数据发送完成后关闭连接 */ static void write_cb(struct bufferevent *bev, void *ctx) { struct evbuffer *output = bufferevent_get_output(bev); if (evbuffer_get_length(output) == 0) { bufferevent_free(bev); } } /* 接受新连接回调 */ static void accept_conn_cb(struct evconnlistener *listener, evutil_socket_t fd, struct sockaddr *address, int socklen, void *ctx) { struct event_base *base = evconnlistener_get_base(listener); struct bufferevent *bev = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS); if (!bev) { fprintf(stderr, "Error creating bufferevent!"); return; } bufferevent_setcb(bev, NULL, write_cb, event_cb, NULL); bufferevent_enable(bev, EV_WRITE); bufferevent_disable(bev, EV_READ); /* 发送预生成的响应数据 */ bufferevent_write(bev, response_data, response_len); } /* 初始化HTTP响应数据 */ static int init_response(const char *filename) { FILE *fp = fopen(filename, "rb"); if (!fp) { perror("Failed to open HTML file"); return -1; } /* 获取文件大小 */ if (fseek(fp, 0, SEEK_END)) { perror("fseek failed"); fclose(fp); return -1; } long fsize = ftell(fp); if (fsize == -1) { perror("ftell failed"); fclose(fp); return -1; } rewind(fp); /* 读取文件内容 */ char *content = reinterpret_cast<char *>(malloc(fsize)); if (!content) { perror("malloc failed"); fclose(fp); return -1; } if (fread(content, 1, fsize, fp) != (size_t)fsize) { perror("fread failed"); free(content); fclose(fp); return -1; } fclose(fp); /* 生成HTTP响应头 */ char header[512]; int header_len = snprintf(header, sizeof(header), RESP_HEADER_FMT, fsize); if (header_len < 0 || header_len >= (int)sizeof(header)) { fprintf(stderr, "Header generation failed"); free(content); return -1; } /* 合并头和内容 */ response_len = header_len + fsize; response_data = reinterpret_cast<char *>(malloc(response_len)); if (!response_data) { perror("malloc failed"); free(content); return -1; } memcpy(response_data, header, header_len); memcpy(response_data + header_len, content, fsize); free(content); return 0; } /* 清理资源 */ static void cleanup() { if (response_data) { free(response_data); response_data = NULL; } } int main(int argc, char **argv) { /* 初始化响应数据 */ if (init_response("screen.html") != 0) { return EXIT_FAILURE; } /* 初始化libevent */ struct event_base *base = event_base_new(); if (!base) { fprintf(stderr, "Could not initialize libevent!\n"); cleanup(); return EXIT_FAILURE; } /* 设置信号处理 */ struct event *sigint = evsignal_new(base, SIGINT, signal_cb, base); if (!sigint || event_add(sigint, NULL) < 0) { fprintf(stderr, "Could not create/add signal event!\n"); event_base_free(base); cleanup(); return EXIT_FAILURE; } /* 配置监听地址 */ struct sockaddr_in sin; memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_addr.s_addr = htonl(0); // 0.0.0.0 sin.sin_port = htons(DEFAULT_PORT); /* 创建监听器 */ struct evconnlistener *listener = evconnlistener_new_bind( base, accept_conn_cb, base, LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_FREE, -1, (struct sockaddr*)&sin, sizeof(sin)); if (!listener) { perror("Couldn't create listener"); event_base_free(base); cleanup(); return EXIT_FAILURE; } printf("Server running on port %d...\n", DEFAULT_PORT); event_base_dispatch(base); /* 清理 */ evconnlistener_free(listener); event_free(sigint); event_base_free(base); cleanup(); return EXIT_SUCCESS; }
2301_76564925/webrtc
server.cpp
C++
apache-2.0
5,127
var ws = require("nodejs-websocket") var prort = 8099; // join 主动加入房间 // leave 主动离开房间 // new-peer 有人加入房间,通知已经在房间的人 // peer-leave 有人离开房间,通知已经在房间的人 // offer 发送offer给对端peer // answer发送offer给对端peer // candidate 发送candidate给对端peer const SIGNAL_TYPE_JOIN = "join"; const SIGNAL_TYPE_RESP_JOIN = "resp-join"; // 告知加入者对方是谁 const SIGNAL_TYPE_LEAVE = "leave"; const SIGNAL_TYPE_NEW_PEER = "new-peer"; const SIGNAL_TYPE_PEER_LEAVE = "peer-leave"; const SIGNAL_TYPE_OFFER = "offer"; const SIGNAL_TYPE_ANSWER = "answer"; const SIGNAL_TYPE_CANDIDATE = "candidate"; const SIGNAL_TYPE_START = "start"; const SIGNAL_TYPE_END = "end"; /** ----- RTCMap ----- */ var RTCMap = function () { this._entrys = new Array(); this.put = function (key, value) { if (key == null || key == undefined) { return; } var index = this._getIndex(key); if (index == -1) { var entry = new Object(); entry.key = key; entry.value = value; this._entrys[this._entrys.length] = entry; } else { this._entrys[index].value = value; } }; this.get = function (key) { var index = this._getIndex(key); return (index != -1) ? this._entrys[index].value : null; }; this.remove = function (key) { var index = this._getIndex(key); if (index != -1) { this._entrys.splice(index, 1); } }; this.clear = function () { this._entrys.length = 0; }; this.contains = function (key) { var index = this._getIndex(key); return (index != -1) ? true : false; }; this.size = function () { return this._entrys.length; }; this.getEntrys = function () { return this._entrys; }; this._getIndex = function (key) { if (key == null || key == undefined) { return -1; } var _length = this._entrys.length; for (var i = 0; i < _length; i++) { var entry = this._entrys[i]; if (entry == null || entry == undefined) { continue; } if (entry.key === key) {// equal return i; } } return -1; }; } var roomTableMap = new RTCMap(); function Client(uid, conn, roomId) { this.uid = uid; // 用户所属的id this.conn = conn; // uid对应的websocket连接 this.roomId = roomId; } function handleJoin(message, conn) { var roomId = message.roomId; var uid = message.uid; console.info("uid: " + uid + "try to join room " + roomId); var roomMap = roomTableMap.get(roomId); if (roomMap == null) { roomMap = new RTCMap(); roomTableMap.put(roomId, roomMap); } if(roomMap.size() >= 2) { console.error("roomId:" + roomId + " 已经有两人存在,请使用其他房间"); // 加信令通知客户端,房间已满 return null; } var client = new Client(uid, conn, roomId); roomMap.put(uid, client); if(roomMap.size() > 1) { // 房间里面已经有人了,加上新进来的人,那就是>=2了,所以要通知对方 var clients = roomMap.getEntrys(); for(var i in clients) { var remoteUid = clients[i].key; if (remoteUid != uid) { var jsonMsg = { 'cmd': SIGNAL_TYPE_NEW_PEER, 'remoteUid': uid }; var msg = JSON.stringify(jsonMsg); var remoteClient =roomMap.get(remoteUid); console.info("new-peer: " + msg); remoteClient.conn.sendText(msg); jsonMsg = { 'cmd':SIGNAL_TYPE_RESP_JOIN, 'remoteUid': remoteUid }; msg = JSON.stringify(jsonMsg); console.info("resp-join: " + msg); conn.sendText(msg); } } } return client; } function handleStart(message) { var roomId = message.roomId; var uid = message.uid; var remoteUid = message.remoteUid; console.info("handlestart uid: " + uid + " to remoteUid" + remoteUid); var roomMap = roomTableMap.get(roomId); if (roomMap == null) { console.error("handlestart can't find then roomId " + roomId); return; } if(roomMap.get(uid) == null) { console.error("handlestart can't find then uid " + uid); return; } var remoteClient = roomMap.get(remoteUid); if(remoteClient) { var msg = JSON.stringify(message); remoteClient.conn.sendText(msg); } else { console.error("can't find remoteUid: " + remoteUid); } } function handleEnd(message) { var roomId = message.roomId; var uid = message.uid; var remoteUid = message.remoteUid; console.info("handleend uid: " + uid + "to remoteUid" + remoteUid); var roomMap = roomTableMap.get(roomId); if (roomMap == null) { console.error("handleend can't find then roomId " + roomId); return; } if(roomMap.get(uid) == null) { console.error("handleend can't find then uid " + uid); return; } var remoteClient = roomMap.get(remoteUid); if(remoteClient) { var msg = JSON.stringify(message); remoteClient.conn.sendText(msg); } else { console.error("can't find remoteUid: " + remoteUid); } } function handleLeave(message) { var roomId = message.roomId; var uid = message.uid; console.info("uid: " + uid + "leave room " + roomId); var roomMap = roomTableMap.get(roomId); if (roomMap == null) { console.error("handleLeave can't find then roomId " + roomId); return; } roomMap.remove(uid); // 删除发送者 if(roomMap.size() >= 1) { var clients = roomMap.getEntrys(); for(var i in clients) { var jsonMsg = { 'cmd': 'peer-leave', 'remoteUid': uid // 谁离开就填写谁 }; var msg = JSON.stringify(jsonMsg); var remoteUid = clients[i].key; var remoteClient = roomMap.get(remoteUid); if(remoteClient) { console.info("notify peer:" + remoteClient.uid + ", uid:" + uid + " leave"); remoteClient.conn.sendText(msg); } } } } function handleForceLeave(client) { var roomId = client.roomId; var uid = client.uid; // 1. 先查找房间号 var roomMap = roomTableMap.get(roomId); if (roomMap == null) { console.warn("handleForceLeave can't find then roomId " + roomId); return; } // 2. 判别uid是否在房间 if (!roomMap.contains(uid)) { console.info("uid: " + uid +" have leave roomId " + roomId); return; } // 3.走到这一步,说明客户端没有正常离开,所以我们要执行离开程序 console.info("uid: " + uid + " force leave room " + roomId); roomMap.remove(uid); // 删除发送者 if(roomMap.size() >= 1) { var clients = roomMap.getEntrys(); for(var i in clients) { var jsonMsg = { 'cmd': 'peer-leave', 'remoteUid': uid // 谁离开就填写谁 }; var msg = JSON.stringify(jsonMsg); var remoteUid = clients[i].key; var remoteClient = roomMap.get(remoteUid); if(remoteClient) { console.info("notify peer:" + remoteClient.uid + ", uid:" + uid + " leave"); remoteClient.conn.sendText(msg); } } } } function handleOffer(message) { var roomId = message.roomId; var uid = message.uid; var remoteUid = message.remoteUid; console.info("handleOffer uid: " + uid + "transfer offer to remoteUid" + remoteUid); var roomMap = roomTableMap.get(roomId); if (roomMap == null) { console.error("handleOffer can't find then roomId " + roomId); return; } if(roomMap.get(uid) == null) { console.error("handleOffer can't find then uid " + uid); return; } var remoteClient = roomMap.get(remoteUid); if(remoteClient) { var msg = JSON.stringify(message); remoteClient.conn.sendText(msg); } else { console.error("can't find remoteUid: " + remoteUid); } } function handleAnswer(message) { var roomId = message.roomId; var uid = message.uid; var remoteUid = message.remoteUid; console.info("handleAnswer uid: " + uid + "transfer answer to remoteUid" + remoteUid); var roomMap = roomTableMap.get(roomId); if (roomMap == null) { console.error("handleAnswer can't find then roomId " + roomId); return; } if(roomMap.get(uid) == null) { console.error("handleAnswer can't find then uid " + uid); return; } var remoteClient = roomMap.get(remoteUid); if(remoteClient) { var msg = JSON.stringify(message); remoteClient.conn.sendText(msg); } else { console.error("can't find remoteUid: " + remoteUid); } } function handleCandidate(message) { var roomId = message.roomId; var uid = message.uid; var remoteUid = message.remoteUid; console.info("handleCandidate uid: " + uid + "transfer candidate to remoteUid" + remoteUid); var roomMap = roomTableMap.get(roomId); if (roomMap == null) { console.error("handleCandidate can't find then roomId " + roomId); return; } if(roomMap.get(uid) == null) { console.error("handleCandidate can't find then uid " + uid); return; } var remoteClient = roomMap.get(remoteUid); if(remoteClient) { var msg = JSON.stringify(message); remoteClient.conn.sendText(msg); } else { console.error("can't find remoteUid: " + remoteUid); } } var server = ws.createServer(function(conn){ console.log("创建一个新的连接--------") conn.client = null; // 对应的客户端信息 // conn.sendText("我收到你的连接了...."); conn.on("text", function(str) { // console.info("recv msg:" + str); var jsonMsg = JSON.parse(str); switch (jsonMsg.cmd) { case SIGNAL_TYPE_JOIN: conn.client = handleJoin(jsonMsg, conn); break; case SIGNAL_TYPE_LEAVE: handleLeave(jsonMsg); break; case SIGNAL_TYPE_OFFER: handleOffer(jsonMsg); break; case SIGNAL_TYPE_ANSWER: handleAnswer(jsonMsg); break; case SIGNAL_TYPE_CANDIDATE: handleCandidate(jsonMsg); break; case SIGNAL_TYPE_START: handleStart(jsonMsg); break; case SIGNAL_TYPE_END: handleEnd(jsonMsg); break; } }); conn.on("close", function(code, reason) { console.info("连接关闭 code: " + code + ", reason: " + reason); if(conn.client != null) { // 强制让客户端从房间退出 handleForceLeave(conn.client); } }); conn.on("error", function(err) { console.info("监听到错误:" + err); }); }).listen(prort);
2301_76564925/webrtc
signal_server.js
JavaScript
apache-2.0
11,949
from pyspark import SparkContext,SparkConf conf = SparkConf().setAppName("pyspark_demo") sc.stop() sc = SparkContext(conf = conf) # 构造一个RDD rdd = sc.parallelize([1, 2, 3, 3])
2201_75373101/PressureGaugeScaleInspection
Exc.py
Python
unknown
184
import json import os import cv2 import math import numpy as np from multiprocessing import Manager class Manometer_1(object): def cv_imread(self, file_path): cv_img = cv2.imdecode(np.fromfile(file_path, dtype=np.uint8), -1) # im decode读取的是rgb,如果后续需要opencv处理的话,需要转换成bgr,转换后图片颜色会变化 cv_img = cv2.cvtColor(cv_img, cv2.COLOR_RGB2BGR) return cv_img def __init__(self): self.kernel = np.ones((3, 3), np.uint8) img_Path = dit["file_path"] img_file = os.listdir(img_Path) i = 0 for Path in img_file: i += 1 path = os.path.join(img_Path, Path) if i < dit["start"] and dit["select"] == 1: continue elif i > dit["end"] and dit["select"] == 1: break try: # 第一步:读取图片 self.original = self.cv_imread(path) print("处理的图片:", path) # self.Imgshow(self.original) # 展示原图 img = cv2.cvtColor(self.original, cv2.COLOR_RGB2GRAY) # self.Imgshow(img) # 展示灰度图 # 第二步:用霍夫圆定位表的位置和表的中心 img1, cir = self.location_hfy(img) # self.Imgshow(img1) # 第三步:矫正 img2 = self.correct(img1, cir) # 第四步:直线拟合 lineN = self.fit_line(img2, cir) # 第五步:刻度读取 s = self.read_scale(lineN[0], lineN[1], cir) print("压力表度数:", round(s, 4), "度") # 展示处理的图像 self.Imgshow(self.original) except: i += 1 print("图片处理错误") continue def location_hfy(self, src): img = cv2.Canny(src, 50, 150, apertureSize=3) mD = dit["location_hfy"]["HoughCircles"]["minDist"] p2 = dit["location_hfy"]["HoughCircles"]["param2"] miR = dit["location_hfy"]["HoughCircles"]["minRadius"] maR = dit["location_hfy"]["HoughCircles"]["maxRadius"] circles1 = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, mD, param2=p2, minRadius=miR, maxRadius=maR) circles1 = np.uint16(np.around(circles1)) circle1 = circles1[0][0] r0_2 = int(circle1[2] * 0.2) black1 = np.zeros((src.shape[0], src.shape[1]), np.uint8) cv2.circle(black1, (circle1[0], circle1[1]), r0_2, (255, 255, 255), -1) img1 = cv2.bitwise_and(src, black1) img1 = img1 + 255 yl = circle1[1] + r0_2 yh = circle1[1] - r0_2 xl = circle1[0] + r0_2 xh = circle1[0] - r0_2 for y in range(yh, yl): for x in range(xh, xl): if img1[y][x] <= 100 and img1[y][x] > 50: img1[y][x] = img1[y][x] * 2 elif img1[y][x] <= 50: img1[y][x] = 0 roi = img1[circle1[1] - r0_2:circle1[1] + r0_2, circle1[0] - r0_2:circle1[0] + r0_2] roi = cv2.resize(roi, None, fx=5, fy=5) retval, roi = cv2.threshold(roi, 100, 255, cv2.THRESH_BINARY) roi = cv2.erode(roi, self.kernel, iterations=3) x = roi.shape[0] y = roi.shape[1] for i in range(x): for j in range(y): if roi[i][j] == 0: break else: roi[i][j] = 0 for j in range(y): if roi[i][y - j - 1] == 0: break else: roi[i][y - j - 1] = 0 img = cv2.Canny(roi, 50, 150, apertureSize=3) circles2 = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, mD, param2=15, minRadius=int(r0_2 / 8) * 5, maxRadius=int(r0_2 / 2) * 5) circles2 = np.uint16(np.around(circles2)) circle2 = circles2[0][0] circle2[0] = int(circle2[0] / 5 + circle1[0] - r0_2) circle2[1] = int(circle2[1] / 5 + circle1[1] - r0_2) circle2[2] = circle1[2] cv2.circle(self.original, (circle2[0], circle2[1]), 2, (255, 255, 255), -1) black2 = np.zeros((src.shape[0], src.shape[1]), np.uint8) cv2.circle(black2, (circle2[0], circle2[1]), circle1[2], (255, 255, 255), -1) img2 = cv2.bitwise_and(src, black2) cv2.circle(self.original, (circle1[0], circle1[1]), circle1[2], (150, 250, 200), 2) return img2, circle2 def correct(self, src, C): ang = dit["correct"]["ang"] m = cv2.getRotationMatrix2D((C[0], C[1]), ang, 1) dsize = (src.shape[1], src.shape[0]) img = cv2.warpAffine(src, m, dsize) self.original = cv2.warpAffine(self.original, m, dsize) return img def fit_line(self, src, C): black = np.zeros((src.shape[0], src.shape[1]), np.uint8) cv2.circle(black, (C[0], C[1]), int(C[2] / 1.5), (255, 255, 255), -1) cv2.circle(black, (C[0], C[1]), int(C[2] / 3), (0, 0, 0), -1) cv2.rectangle(black, (C[0] - int(C[2] / 8), C[1]), (C[0] + int(C[2] / 8), C[1] + C[2]), (0, 0, 0), -1) img1 = cv2.bitwise_and(src, black) img1 = img1 + 255 thr = dit["fit_line"]["threshold1"]["thresh"] ret, img1 = cv2.threshold(img1, thr, 255, cv2.THRESH_BINARY) img1 = cv2.dilate(img1, self.kernel, iterations=1) end1 = cv2.Canny(img1, 50, 150, apertureSize=3) th = dit["fit_line"]["HoughLines1"]["threshold"] lines = cv2.HoughLines(end1, 1, np.pi / 180, th) lineN = [] db1 = C[0] ** 2 + C[1] ** 2 find = True fe = dit["fit_line"]["f1_error"] while (find): for line in lines: rho, theta = line[0] a = np.cos(theta) b = np.sin(theta) x0, y0 = a * rho, b * rho db2 = (x0 - C[0]) ** 2 + (y0 - C[1]) ** 2 if (db1 - db2) > (rho ** 2) * fe or (db1 - db2) < (rho ** 2) / fe: continue lineN.append([rho, theta]) pt1 = (int(x0 + 1000 * (-b)), int(y0 + 1000 * (a))) pt2 = (int(x0 - 1000 * (-b)), int(y0 - 1000 * (a))) cv2.line(self.original, pt1, pt2, (255, 255, 255), 2) cv2.line(self.original, (0, 0), (int(x0), int(y0)), (0, 255, 0), 2) cv2.line(self.original, (0, 0), (C[0], C[1]), (255, 0, 0), 2) cv2.line(self.original, (int(x0), int(y0)), (C[0], C[1]), (0, 0, 255), 2) find = False break fe += 0.01 black = np.zeros((src.shape[0], src.shape[1]), np.uint8) cv2.circle(black, (C[0], C[1]), int(C[2] / 3), (255, 255, 255), int(C[2] / 6), 2) img2 = cv2.bitwise_and(src, black) img2 = img2 + 255 thr = dit["fit_line"]["threshold2"]["thresh"] ret, img2 = cv2.threshold(img2, thr, 255, cv2.THRESH_BINARY) iter = dit["fit_line"]["dilate"]["iterations"] img2 = cv2.dilate(img2, self.kernel, iterations=iter) end2 = cv2.Canny(img2, 50, 150, apertureSize=3) th = dit["fit_line"]["HoughLines2"]["threshold"] lines = cv2.HoughLines(end2, 1, np.pi / 180, th) find = True fe = dit["fit_line"]["f2_error"] while (find): for line in lines: rho, theta = line[0] the = math.degrees(theta) if abs(the - math.degrees(lineN[0][1])) > (90 - fe) and abs(the - math.degrees(lineN[0][1])) < ( 90 + fe): lineN.append([rho, theta]) a = np.cos(theta) b = np.sin(theta) x0, y0 = a * rho, b * rho pt1 = (int(x0 + 1000 * (-b)), int(y0 + 1000 * (a))) pt2 = (int(x0 - 1000 * (-b)), int(y0 - 1000 * (a))) cv2.line(self.original, pt1, pt2, (255, 255, 255), 2) cv2.line(self.original, (0, 0), (int(x0), int(y0)), (0, 255, 255), 2) find = False break fe += 0.1 return lineN def read_scale(self, l1, l2, C): fl = dit["read_scale"]["infinite_limit"] if abs(abs(l1[1] - np.pi / 2) - np.pi / 2) <= fl: return 0.3 if abs(abs(l2[1] - np.pi / 2) - np.pi / 2) <= fl: return 0.1 k1 = np.tan(l1[1] - np.pi / 2) k2 = np.tan(l2[1] - np.pi / 2) x1 = l1[0] * np.cos(l1[1]) y1 = l1[0] * np.sin(l1[1]) x2 = l2[0] * np.cos(l2[1]) y2 = l2[0] * np.sin(l2[1]) x0 = (y2 - y1 + (k1 * x1) - (k2 * x2)) / (k1 - k2) y0 = k1 * (x0 - x1) + y1 aC = math.atan(C[1] / C[0]) rC = l1[0] / math.cos(abs(aC - l1[1])) xc = rC * np.cos(aC) yc = rC * np.sin(aC) cv2.circle(self.original, (int(x1), int(y1)), 3, (0, 255, 255), -1) cv2.circle(self.original, (int(x2), int(y2)), 3, (0, 255, 255), -1) cv2.circle(self.original, (int(x0), int(y0)), 3, (100, 255, 100), -1) cv2.circle(self.original, (int(xc), int(yc)), 3, (100, 255, 100), -1) if x0 < xc: rad = math.degrees(math.atan((xc - x0) / (y0 - yc))) if rad < 0: rad = 180 + rad rad = 135 + rad elif x0 == xc: rad = 135 else: rad = math.degrees(math.atan((x0 - xc) / (y0 - yc))) if rad < 0: rad = 180 + rad rad = 135 - rad kedu = rad * (0.6 / 270) return kedu def Imgshow(self, img): cv2.imshow('result', img) cv2.waitKey(0) cv2.destroyAllWindows() if __name__ == "__main__": manager = Manager() path = r"set/" filename = r"runini" filesuffix = r".json" filePath = path + filename + filesuffix with open(filePath, encoding="utf-8") as ru_file: dit = manager.dict(**json.load(ru_file)) m = Manometer_1()
2201_75373101/PressureGaugeScaleInspection
main.py
Python
unknown
10,140
import json import os import cv2 import math import numpy as np from multiprocessing import Manager from datetime import datetime class Manometer_1(object): def cv_imread(self,file_path): cv_img = cv2.imdecode(np.fromfile(file_path, dtype=np.uint8), -1) # im decode读取的是rgb,如果后续需要opencv处理的话,需要转换成bgr,转换后图片颜色会变化 cv_img = cv2.cvtColor(cv_img, cv2.COLOR_RGB2BGR) return cv_img def __init__(self): self.kernel = np.ones((3, 3), np.uint8) img_Path = dit["file_path"] img_file = os.listdir(img_Path) i=0 for Path in img_file: i += 1 path = os.path.join(img_Path,Path) if i < dit["start"] and dit["select"]==1: continue elif i > dit["end"] and dit["select"]==1: break try: # 第一步:读取图片 # self.original=cv2.imread(ImPh,cv2.IMREAD_REDUCED_COLOR_2) self.original = self.cv_imread(path) print("处理的图片:", path) # self.Imgshow(self.original) # 展示原图 img = cv2.cvtColor(self.original, cv2.COLOR_RGB2GRAY) # self.Imgshow(img) # 展示灰度图 # 第二步:用霍夫圆定位表的位置和表的中心 img1,cir= self.location_hfy(img) # self.Imgshow(img1) # 第三步:矫正 img2 = self.correct(img1,cir) # 第四步:直线拟合 lineN = self.fit_line(img2,cir) # 第五步:刻度读取 s = self.read_scale(lineN[0],lineN[1],cir) print("压力表度数:", round(s, 4), "度") # 展示处理的图像 self.Imgshow(self.original) except: i += 1 print("图片处理错误") continue def location_hfy(self,src): img = cv2.Canny(src, 50, 150, apertureSize=3) mD = dit["location_hfy"]["HoughCircles"]["minDist"] p2 = dit["location_hfy"]["HoughCircles"]["param2"] miR = dit["location_hfy"]["HoughCircles"]["minRadius"] maR = dit["location_hfy"]["HoughCircles"]["maxRadius"] circles1 = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, mD, param2=p2, minRadius=miR, maxRadius=maR) circles1 = np.uint16(np.around(circles1)) circle1 = circles1[0][0] r0_2 = int(circle1[2] * 0.2) black1 = np.zeros((src.shape[0], src.shape[1]), np.uint8) cv2.circle(black1, (circle1[0], circle1[1]), r0_2, (255, 255, 255), -1) img1 = cv2.bitwise_and(src, black1) img1 = img1 + 255 yl = circle1[1] + r0_2 yh = circle1[1] - r0_2 xl = circle1[0] + r0_2 xh = circle1[0] - r0_2 for y in range(yh,yl): for x in range(xh,xl): if img1[y][x]<=100 and img1[y][x]>50: img1[y][x] = img1[y][x] * 2 elif img1[y][x]<=50: img1[y][x] = 0 roi=img1[circle1[1]-r0_2:circle1[1]+r0_2,circle1[0]-r0_2:circle1[0]+r0_2] roi=cv2.resize(roi, None, fx=5, fy=5) retval ,roi = cv2.threshold(roi,100,255,cv2.THRESH_BINARY) roi = cv2.erode(roi,self.kernel,iterations=3) x = roi.shape[0] y = roi.shape[1] for i in range(x): for j in range(y): if roi[i][j]==0: break else: roi[i][j]=0 for j in range(y): if roi[i][y-j-1]==0: break else: roi[i][y-j-1]=0 img = cv2.Canny(roi, 50, 150, apertureSize=3) circles2 = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, mD, param2=15, minRadius=int(r0_2/8)*5, maxRadius=int(r0_2/2)*5) circles2 = np.uint16(np.around(circles2)) circle2 = circles2[0][0] circle2[0] = int(circle2[0]/5+circle1[0]-r0_2) circle2[1] = int(circle2[1]/5+circle1[1]-r0_2) circle2[2] = circle1[2] cv2.circle(self.original, (circle2[0], circle2[1]), 2, (255, 255, 255), -1) black2 = np.zeros((src.shape[0], src.shape[1]), np.uint8) cv2.circle(black2, (circle2[0], circle2[1]), circle1[2], (255, 255, 255), -1) img2 = cv2.bitwise_and(src, black2) cv2.circle(self.original, (circle1[0], circle1[1]), circle1[2], (150, 250, 200), 2) return img2,circle2 def correct(self,src,C): ang = dit["correct"]["ang"] m = cv2.getRotationMatrix2D((C[0],C[1]), ang,1) dsize = (src.shape[1], src.shape[0]) img = cv2.warpAffine(src, m, dsize) self.original = cv2.warpAffine(self.original, m, dsize) return img def fit_line(self,src, C): black = np.zeros((src.shape[0], src.shape[1]), np.uint8) cv2.circle(black, (C[0], C[1]), int(C[2]/1.5), (255, 255, 255), -1) cv2.circle(black, (C[0], C[1]), int(C[2]/3), (0, 0, 0), -1) cv2.rectangle(black, (C[0] - int(C[2]/8), C[1]),(C[0] + int(C[2]/8), C[1] + C[2]), (0, 0, 0), -1) img1 = cv2.bitwise_and(src, black) img1 = img1 + 255 thr = dit["fit_line"]["threshold1"]["thresh"] ret, img1 = cv2.threshold(img1, thr, 255, cv2.THRESH_BINARY) img1 = cv2.dilate(img1,self.kernel,iterations=1) end1 = cv2.Canny(img1, 50, 150, apertureSize=3) th = dit["fit_line"]["HoughLines1"]["threshold"] lines = cv2.HoughLines(end1, 1, np.pi / 180, th) lineN = [] db1 = C[0]**2 + C[1]**2 find = True fe = dit["fit_line"]["f1_error"] while(find): for line in lines: rho, theta = line[0] a = np.cos(theta) b = np.sin(theta) x0, y0 = a * rho, b * rho db2 = (x0-C[0])**2 + (y0-C[1])**2 if (db1-db2) > (rho**2)*fe or (db1-db2) < (rho**2)/fe: continue lineN.append([rho, theta]) pt1 = (int(x0 + 1000 * (-b)), int(y0 + 1000 * (a))) pt2 = (int(x0 - 1000 * (-b)), int(y0 - 1000 * (a))) cv2.line(self.original, pt1, pt2, (255, 255, 255), 2) cv2.line(self.original, (0, 0), (int(x0), int(y0)), (0, 255, 0), 2) cv2.line(self.original, (0, 0), (C[0], C[1]), (255, 0, 0), 2) cv2.line(self.original, (int(x0), int(y0)), (C[0], C[1]), (0, 0, 255), 2) find = False break fe+=0.01 black = np.zeros((src.shape[0], src.shape[1]), np.uint8) cv2.circle(black, (C[0], C[1]), int(C[2]/3), (255, 255, 255), int(C[2]/6),2) img2 = cv2.bitwise_and(src, black) img2 = img2 + 255 thr = dit["fit_line"]["threshold2"]["thresh"] ret, img2 = cv2.threshold(img2, thr, 255, cv2.THRESH_BINARY) iter = dit["fit_line"]["dilate"]["iterations"] img2 = cv2.dilate(img2,self.kernel,iterations=iter) end2 = cv2.Canny(img2, 50, 150, apertureSize=3) th = dit["fit_line"]["HoughLines2"]["threshold"] lines = cv2.HoughLines(end2, 1, np.pi / 180, th) find = True fe = dit["fit_line"]["f2_error"] while (find): for line in lines: rho, theta = line[0] the = math.degrees(theta) if abs(the - math.degrees(lineN[0][1])) > (90-fe) and abs(the - math.degrees(lineN[0][1])) < (90+fe): lineN.append([rho, theta]) a = np.cos(theta) b = np.sin(theta) x0, y0 = a * rho, b * rho pt1 = (int(x0 + 1000 * (-b)), int(y0 + 1000 * (a))) pt2 = (int(x0 - 1000 * (-b)), int(y0 - 1000 * (a))) cv2.line(self.original, pt1, pt2, (255, 255, 255), 2) cv2.line(self.original, (0, 0), (int(x0), int(y0)), (0, 255, 255), 2) find = False break fe +=0.1 return lineN def read_scale(self, l1, l2, C): fl = dit["read_scale"]["infinite_limit"] if abs(abs(l1[1] - np.pi/2)-np.pi/2)<=fl: return 0.3 if abs(abs(l2[1] - np.pi/2)-np.pi/2)<=fl: return 0.1 k1 = np.tan(l1[1] - np.pi/2) k2 = np.tan(l2[1] - np.pi/2) x1 = l1[0] * np.cos(l1[1]) y1 = l1[0] * np.sin(l1[1]) x2 = l2[0] * np.cos(l2[1]) y2 = l2[0] * np.sin(l2[1]) x0 = (y2 - y1 + (k1 * x1) - (k2 * x2)) / (k1 - k2) y0 = k1 * (x0 - x1) + y1 aC = math.atan(C[1]/C[0]) rC = l1[0]/math.cos(abs(aC - l1[1])) xc = rC*np.cos(aC) yc = rC*np.sin(aC) cv2.circle(self.original, (int(x1), int(y1)), 3, (0, 255, 255), -1) cv2.circle(self.original, (int(x2), int(y2)), 3, (0, 255, 255), -1) cv2.circle(self.original, (int(x0), int(y0)), 3, (100, 255, 100), -1) cv2.circle(self.original, (int(xc), int(yc)), 3, (100, 255, 100), -1) if x0 < xc: rad = math.degrees(math.atan((xc-x0)/(y0-yc))) if rad < 0: rad = 180 + rad rad = 135 + rad elif x0 == xc: rad = 135 else: rad = math.degrees(math.atan((x0-xc)/(y0-yc))) if rad < 0: rad = 180 + rad rad = 135 - rad kedu = rad*(0.6/270) # if() return kedu def Imgshow(self,img): cv2.imshow('v',img) cv2.waitKey(0) cv2.destroyAllWindows() def save(path): #安全保险 string = '''{ "file_path": "runs/local_img/left/big", "select": 0, "start": 1, "end": 1, "location_hfy": { "HoughCircles": { "minDist": 1000, "param2": 30, "minRadius": 80, "maxRadius": 160 } }, "correct": { "ang": -3 }, "fit_line": { "threshold1": { "thresh": 80 }, "HoughLines1": { "threshold": 20 }, "f1_error": 1.01, "threshold2": { "thresh": 80 }, "dilate": { "iterations": 2 }, "HoughLines2": { "threshold": 10 }, "f2_error": 0.5 }, "read_scale": { "infinite_limit": 0.0001 } } ''' with open(path, 'w',encoding="utf-8") as ru_file: ru_file.write(string) if __name__ == "__main__": manager = Manager() path = r"set/" filename = r"runini" filesuffix = r".json" filePath = path+filename+filesuffix # if os.path.exists(filePath): # pass # else: # save(filePath) #启动保险 with open(filePath, encoding="utf-8") as ru_file: dit = manager.dict(**json.load(ru_file)) m = Manometer_1() with open(filePath, encoding="utf-8") as ru_file: now = datetime.now() nowdate = str(now.date()) with open(path + filename + nowdate + filesuffix, 'w', encoding="utf-8") as savefile: s = json.load(ru_file) js = json.dumps(s, indent=5) savefile.write(js)
2201_75373101/PressureGaugeScaleInspection
源.py
Python
unknown
11,275
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="static/plugins/bootstrap-3.4.1/css/bootstrap.css"> </head> <body> <input type="button" value="提交" /> <input type="button" value="提交" class="btn btn-primary"/> <input type="button" value="提交" class="btn btn-success"/> <input type="button" value="提交" class="btn btn-danger"/> <input type="button" value="提交" class="btn btn-danger btn-xs"/> </body> </html>
2301_76469554/Bootstrap_project
1. 初始BootStrap.html
HTML
unknown
520
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="static/plugins/bootstrap-3.4.1/css/bootstrap.css"> <style> .navbar{ border-radius: 0; } </style> </head> <body> <div class="navbar navbar-default"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">中国联通</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li> <li><a href="#">广西</a></li> <li><a href="#">上海</a></li> <li><a href="#">深圳</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> <li role="separator" class="divider"></li> <li><a href="#">One more separated link</a></li> </ul> </li> </ul> <form class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> <ul class="nav navbar-nav navbar-right"> <li><a href="#">登录</a></li> <li><a href="#">注册</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </div> </body> </html>
2301_76469554/Bootstrap_project
2. 导航.html
HTML
unknown
3,400
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="static/plugins/bootstrap-3.4.1/css/bootstrap.css"> </head> <body> <div> <div class="col-sm-offset-2" style="background-color: red">1</div> </div> </body> </html>
2301_76469554/Bootstrap_project
3. 栅格.html
HTML
unknown
302
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="static/plugins/bootstrap-3.4.1/css/bootstrap.css"> <style> .navbar { border-radius: 0; } </style> </head> <body> <div class="navbar navbar-default"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">中国联通</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li> <li><a href="#">广西</a></li> <li><a href="#">上海</a></li> <li><a href="#">深圳</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> <li role="separator" class="divider"></li> <li><a href="#">One more separated link</a></li> </ul> </li> </ul> <form class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> <ul class="nav navbar-nav navbar-right"> <li><a href="#">登录</a></li> <li><a href="#">注册</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </div> <div class="container-fluid clearfix"> <div class="col-sm-9"> <div class="media"> <div class="media-left"> <a href="#"> <img class="media-object" data-src="holder.js/64x64" alt="64x64" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PCEtLQpTb3VyY2UgVVJMOiBob2xkZXIuanMvNjR4NjQKQ3JlYXRlZCB3aXRoIEhvbGRlci5qcyAyLjYuMC4KTGVhcm4gbW9yZSBhdCBodHRwOi8vaG9sZGVyanMuY29tCihjKSAyMDEyLTIwMTUgSXZhbiBNYWxvcGluc2t5IC0gaHR0cDovL2ltc2t5LmNvCi0tPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbI2hvbGRlcl8xOTQ4MWQyOTYwOSB0ZXh0IHsgZmlsbDojQUFBQUFBO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1mYW1pbHk6QXJpYWwsIEhlbHZldGljYSwgT3BlbiBTYW5zLCBzYW5zLXNlcmlmLCBtb25vc3BhY2U7Zm9udC1zaXplOjEwcHQgfSBdXT48L3N0eWxlPjwvZGVmcz48ZyBpZD0iaG9sZGVyXzE5NDgxZDI5NjA5Ij48cmVjdCB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIGZpbGw9IiNFRUVFRUUiLz48Zz48dGV4dCB4PSIxMy4xNzUyMTg1ODIxNTMzMiIgeT0iMzYuNTU5OTk5OTQyNzc5NTQiPjY0eDY0PC90ZXh0PjwvZz48L2c+PC9zdmc+" data-holder-rendered="true" style="width: 64px; height: 64px;"> </a> </div> <div class="media-body"> <h4 class="media-heading">Media heading</h4> Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. </div> </div> <div class="media"> <div class="media-left"> <a href="#"> <img class="media-object" data-src="holder.js/64x64" alt="64x64" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PCEtLQpTb3VyY2UgVVJMOiBob2xkZXIuanMvNjR4NjQKQ3JlYXRlZCB3aXRoIEhvbGRlci5qcyAyLjYuMC4KTGVhcm4gbW9yZSBhdCBodHRwOi8vaG9sZGVyanMuY29tCihjKSAyMDEyLTIwMTUgSXZhbiBNYWxvcGluc2t5IC0gaHR0cDovL2ltc2t5LmNvCi0tPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbI2hvbGRlcl8xOTQ4MWQyOTYwOSB0ZXh0IHsgZmlsbDojQUFBQUFBO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1mYW1pbHk6QXJpYWwsIEhlbHZldGljYSwgT3BlbiBTYW5zLCBzYW5zLXNlcmlmLCBtb25vc3BhY2U7Zm9udC1zaXplOjEwcHQgfSBdXT48L3N0eWxlPjwvZGVmcz48ZyBpZD0iaG9sZGVyXzE5NDgxZDI5NjA5Ij48cmVjdCB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIGZpbGw9IiNFRUVFRUUiLz48Zz48dGV4dCB4PSIxMy4xNzUyMTg1ODIxNTMzMiIgeT0iMzYuNTU5OTk5OTQyNzc5NTQiPjY0eDY0PC90ZXh0PjwvZz48L2c+PC9zdmc+" data-holder-rendered="true" style="width: 64px; height: 64px;"> </a> </div> <div class="media-body"> <h4 class="media-heading">Media heading</h4> Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. </div> </div> <div class="media"> <div class="media-left"> <a href="#"> <img class="media-object" data-src="holder.js/64x64" alt="64x64" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PCEtLQpTb3VyY2UgVVJMOiBob2xkZXIuanMvNjR4NjQKQ3JlYXRlZCB3aXRoIEhvbGRlci5qcyAyLjYuMC4KTGVhcm4gbW9yZSBhdCBodHRwOi8vaG9sZGVyanMuY29tCihjKSAyMDEyLTIwMTUgSXZhbiBNYWxvcGluc2t5IC0gaHR0cDovL2ltc2t5LmNvCi0tPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbI2hvbGRlcl8xOTQ4MWQyOTYwOSB0ZXh0IHsgZmlsbDojQUFBQUFBO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1mYW1pbHk6QXJpYWwsIEhlbHZldGljYSwgT3BlbiBTYW5zLCBzYW5zLXNlcmlmLCBtb25vc3BhY2U7Zm9udC1zaXplOjEwcHQgfSBdXT48L3N0eWxlPjwvZGVmcz48ZyBpZD0iaG9sZGVyXzE5NDgxZDI5NjA5Ij48cmVjdCB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIGZpbGw9IiNFRUVFRUUiLz48Zz48dGV4dCB4PSIxMy4xNzUyMTg1ODIxNTMzMiIgeT0iMzYuNTU5OTk5OTQyNzc5NTQiPjY0eDY0PC90ZXh0PjwvZz48L2c+PC9zdmc+" data-holder-rendered="true" style="width: 64px; height: 64px;"> </a> </div> <div class="media-body"> <h4 class="media-heading">Media heading</h4> Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. </div> </div> <ul class="pagination"> <li> <a href="#" aria-label="Previous"> <span aria-hidden="true">«</span> </a> </li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li> <a href="#" aria-label="Next"> <span aria-hidden="true">»</span> </a> </li> </ul> </div> <div class="col-sm-3"> <div class="panel panel-default"> <div class="panel-heading">最新推荐</div> <div class="panel-body"> Panel content </div> </div> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> Panel content </div> </div> <div class="panel panel-danger"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> Panel content </div> </div> </div> </div> </body> </html>
2301_76469554/Bootstrap_project
4. 博客.html
HTML
unknown
9,776
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登录</title> <link rel="stylesheet" href="static/plugins/bootstrap-3.4.1/css/bootstrap.css"> <style> .account { width: 500px; border: 1px solid #dddddd; border-radius: 5px; box-shadow: 5px 5px 20px #aaaaaa; margin-left: auto; margin-right: auto; margin-top: 100px; padding: 20px 40px; } .account h2 { text-align: center; } </style> </head> <body> <div class="account"> <h2>用户登录</h2> <form> <div class="form-group"> <label for="exampleInputEmail1">用户名</label> <input type="email" class="form-control" id="exampleInputEmail1" placeholder="用户名"> </div> <div class="form-group"> <label for="exampleInputPassword1">密码</label> <input type="password" class="form-control" id="exampleInputPassword1" placeholder="密码"> </div> <button type="submit" class="btn btn-primary">登 录</button> </form> </div> </body> </html>
2301_76469554/Bootstrap_project
5. 登录.html
HTML
unknown
1,172
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>后台管理</title> <link rel="stylesheet" href="static/plugins/bootstrap-3.4.1/css/bootstrap.css"> <style> .navbar { border-radius: 0; } .myTable { margin: 10px 20px; } .btn-primary { margin-left: 20px; } </style> </head> <body> <div class="navbar navbar-default"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">中国联通XX系统</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li><a href="#">广西</a></li> <li><a href="#">上海</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="#">登录</a></li> <li><a href="#">注册</a></li> </ul> </div> </div> </div> <div class="container"> <div> <button type="button" class="btn btn-primary btn-md active">新 建</button> </div> <div class="myTable"> <table class="table table-bordered table-hover " id="myTable"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr> </thead> <tbody> <tr> <th scope="row">1</th> <td>Mark</td> <td>Otto</td> <td>@mdo</td> </tr> <tr> <th scope="row">2</th> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <th scope="row">3</th> <td>Larry</td> <td>the Bird</td> <td>@twitter</td> </tr> </tbody> </table> </div> </div> </body> </html>
2301_76469554/Bootstrap_project
6. 后台管理.html
HTML
unknown
2,463
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>后台管理</title> <link rel="stylesheet" href="static/plugins/bootstrap-3.4.1/css/bootstrap.css"> <link rel="stylesheet" href="static/plugins/font-awesome-4.7.0/css/font-awesome.css"> <style> .navbar { border-radius: 0; } .btn-primary { margin-left: 20px; } </style> </head> <body> <div class="navbar navbar-default"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">中国联通XX系统</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li><a href="#">广西</a></li> <li><a href="#">上海</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="#">登录</a></li> <li><a href="#">注册</a></li> </ul> </div> </div> </div> <div class="container"> <div class="panel panel-default"> <div class="panel-heading"> <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 表单区域 </div> <div class="panel-body"> <form class="form-inline"> <div class="form-group"> <label class="sr-only" for="exampleInputEmail3">Email address</label> <input type="email" class="form-control" id="exampleInputEmail3" placeholder="Email"> </div> <div class="form-group"> <label class="sr-only" for="exampleInputPassword3">Password</label> <input type="password" class="form-control" id="exampleInputPassword3" placeholder="Password"> </div> <button type="submit" class="btn btn-success"> <i class="fa fa-save" aria-hidden="true"></i> 保 存 </button> </form> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span> 数据列表 </div> <!-- <div class="panel-body">--> <!-- 注意:以下我们经过筛选出来的重要数据。--> <!-- </div>--> <table class="table table-bordered table-hover " id="myTable"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>操作</th> </tr> </thead> <tbody> <tr> <th scope="row">1</th> <td>Mark</td> <td>Otto</td> <td> <button type="button" class="btn btn-xs btn-primary"> <i class="fa fa-edit"></i> 编辑 </button> <button type="button" class="btn btn-xs btn-danger"> <i class="fa fa-trash" aria-hidden="true"></i> 删除 </button> </td> </tr> <tr> <th scope="row">2</th> <td>Jacob</td> <td>Thornton</td> <td> <button type="button" class="btn btn-xs btn-primary"> <i class="fa fa-edit"></i> 编辑 </button> <button type="button" class="btn btn-xs btn-danger"> <i class="fa fa-trash" aria-hidden="true"></i> 删除 </button> </td> </tr> <tr> <th scope="row">3</th> <td>Larry</td> <td>The Bird</td> <td> <button type="button" class="btn btn-xs btn-primary"> <i class="fa fa-edit"></i> 编辑 </button> <button type="button" class="btn btn-xs btn-danger"> <i class="fa fa-trash" aria-hidden="true"></i> 删除 </button> </td> </tr> </tbody> </table> </div> <ul class="pagination"> <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">«</span></a></li> <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#" aria-label="Next"><span aria-hidden="true">»</span></a></li> </ul> </div> </body> </html>
2301_76469554/Bootstrap_project
7. 后台管理(面板).html
HTML
unknown
5,398
// Animated Icons // -------------------------- .@{fa-css-prefix}-spin { -webkit-animation: fa-spin 2s infinite linear; animation: fa-spin 2s infinite linear; } .@{fa-css-prefix}-pulse { -webkit-animation: fa-spin 1s infinite steps(8); animation: fa-spin 1s infinite steps(8); } @-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } @keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/animated.less
Less
unknown
713
// Bordered & Pulled // ------------------------- .@{fa-css-prefix}-border { padding: .2em .25em .15em; border: solid .08em @fa-border-color; border-radius: .1em; } .@{fa-css-prefix}-pull-left { float: left; } .@{fa-css-prefix}-pull-right { float: right; } .@{fa-css-prefix} { &.@{fa-css-prefix}-pull-left { margin-right: .3em; } &.@{fa-css-prefix}-pull-right { margin-left: .3em; } } /* Deprecated as of 4.4.0 */ .pull-right { float: right; } .pull-left { float: left; } .@{fa-css-prefix} { &.pull-left { margin-right: .3em; } &.pull-right { margin-left: .3em; } }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/bordered-pulled.less
Less
unknown
585
// Base Class Definition // ------------------------- .@{fa-css-prefix} { display: inline-block; font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration font-size: inherit; // can't have font-size inherit on line above, so need to override text-rendering: auto; // optimizelegibility throws things off #1094 -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/core.less
Less
unknown
452
// Fixed Width Icons // ------------------------- .@{fa-css-prefix}-fw { width: (18em / 14); text-align: center; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/fixed-width.less
Less
unknown
119
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */ .@{fa-css-prefix}-glass:before { content: @fa-var-glass; } .@{fa-css-prefix}-music:before { content: @fa-var-music; } .@{fa-css-prefix}-search:before { content: @fa-var-search; } .@{fa-css-prefix}-envelope-o:before { content: @fa-var-envelope-o; } .@{fa-css-prefix}-heart:before { content: @fa-var-heart; } .@{fa-css-prefix}-star:before { content: @fa-var-star; } .@{fa-css-prefix}-star-o:before { content: @fa-var-star-o; } .@{fa-css-prefix}-user:before { content: @fa-var-user; } .@{fa-css-prefix}-film:before { content: @fa-var-film; } .@{fa-css-prefix}-th-large:before { content: @fa-var-th-large; } .@{fa-css-prefix}-th:before { content: @fa-var-th; } .@{fa-css-prefix}-th-list:before { content: @fa-var-th-list; } .@{fa-css-prefix}-check:before { content: @fa-var-check; } .@{fa-css-prefix}-remove:before, .@{fa-css-prefix}-close:before, .@{fa-css-prefix}-times:before { content: @fa-var-times; } .@{fa-css-prefix}-search-plus:before { content: @fa-var-search-plus; } .@{fa-css-prefix}-search-minus:before { content: @fa-var-search-minus; } .@{fa-css-prefix}-power-off:before { content: @fa-var-power-off; } .@{fa-css-prefix}-signal:before { content: @fa-var-signal; } .@{fa-css-prefix}-gear:before, .@{fa-css-prefix}-cog:before { content: @fa-var-cog; } .@{fa-css-prefix}-trash-o:before { content: @fa-var-trash-o; } .@{fa-css-prefix}-home:before { content: @fa-var-home; } .@{fa-css-prefix}-file-o:before { content: @fa-var-file-o; } .@{fa-css-prefix}-clock-o:before { content: @fa-var-clock-o; } .@{fa-css-prefix}-road:before { content: @fa-var-road; } .@{fa-css-prefix}-download:before { content: @fa-var-download; } .@{fa-css-prefix}-arrow-circle-o-down:before { content: @fa-var-arrow-circle-o-down; } .@{fa-css-prefix}-arrow-circle-o-up:before { content: @fa-var-arrow-circle-o-up; } .@{fa-css-prefix}-inbox:before { content: @fa-var-inbox; } .@{fa-css-prefix}-play-circle-o:before { content: @fa-var-play-circle-o; } .@{fa-css-prefix}-rotate-right:before, .@{fa-css-prefix}-repeat:before { content: @fa-var-repeat; } .@{fa-css-prefix}-refresh:before { content: @fa-var-refresh; } .@{fa-css-prefix}-list-alt:before { content: @fa-var-list-alt; } .@{fa-css-prefix}-lock:before { content: @fa-var-lock; } .@{fa-css-prefix}-flag:before { content: @fa-var-flag; } .@{fa-css-prefix}-headphones:before { content: @fa-var-headphones; } .@{fa-css-prefix}-volume-off:before { content: @fa-var-volume-off; } .@{fa-css-prefix}-volume-down:before { content: @fa-var-volume-down; } .@{fa-css-prefix}-volume-up:before { content: @fa-var-volume-up; } .@{fa-css-prefix}-qrcode:before { content: @fa-var-qrcode; } .@{fa-css-prefix}-barcode:before { content: @fa-var-barcode; } .@{fa-css-prefix}-tag:before { content: @fa-var-tag; } .@{fa-css-prefix}-tags:before { content: @fa-var-tags; } .@{fa-css-prefix}-book:before { content: @fa-var-book; } .@{fa-css-prefix}-bookmark:before { content: @fa-var-bookmark; } .@{fa-css-prefix}-print:before { content: @fa-var-print; } .@{fa-css-prefix}-camera:before { content: @fa-var-camera; } .@{fa-css-prefix}-font:before { content: @fa-var-font; } .@{fa-css-prefix}-bold:before { content: @fa-var-bold; } .@{fa-css-prefix}-italic:before { content: @fa-var-italic; } .@{fa-css-prefix}-text-height:before { content: @fa-var-text-height; } .@{fa-css-prefix}-text-width:before { content: @fa-var-text-width; } .@{fa-css-prefix}-align-left:before { content: @fa-var-align-left; } .@{fa-css-prefix}-align-center:before { content: @fa-var-align-center; } .@{fa-css-prefix}-align-right:before { content: @fa-var-align-right; } .@{fa-css-prefix}-align-justify:before { content: @fa-var-align-justify; } .@{fa-css-prefix}-list:before { content: @fa-var-list; } .@{fa-css-prefix}-dedent:before, .@{fa-css-prefix}-outdent:before { content: @fa-var-outdent; } .@{fa-css-prefix}-indent:before { content: @fa-var-indent; } .@{fa-css-prefix}-video-camera:before { content: @fa-var-video-camera; } .@{fa-css-prefix}-photo:before, .@{fa-css-prefix}-image:before, .@{fa-css-prefix}-picture-o:before { content: @fa-var-picture-o; } .@{fa-css-prefix}-pencil:before { content: @fa-var-pencil; } .@{fa-css-prefix}-map-marker:before { content: @fa-var-map-marker; } .@{fa-css-prefix}-adjust:before { content: @fa-var-adjust; } .@{fa-css-prefix}-tint:before { content: @fa-var-tint; } .@{fa-css-prefix}-edit:before, .@{fa-css-prefix}-pencil-square-o:before { content: @fa-var-pencil-square-o; } .@{fa-css-prefix}-share-square-o:before { content: @fa-var-share-square-o; } .@{fa-css-prefix}-check-square-o:before { content: @fa-var-check-square-o; } .@{fa-css-prefix}-arrows:before { content: @fa-var-arrows; } .@{fa-css-prefix}-step-backward:before { content: @fa-var-step-backward; } .@{fa-css-prefix}-fast-backward:before { content: @fa-var-fast-backward; } .@{fa-css-prefix}-backward:before { content: @fa-var-backward; } .@{fa-css-prefix}-play:before { content: @fa-var-play; } .@{fa-css-prefix}-pause:before { content: @fa-var-pause; } .@{fa-css-prefix}-stop:before { content: @fa-var-stop; } .@{fa-css-prefix}-forward:before { content: @fa-var-forward; } .@{fa-css-prefix}-fast-forward:before { content: @fa-var-fast-forward; } .@{fa-css-prefix}-step-forward:before { content: @fa-var-step-forward; } .@{fa-css-prefix}-eject:before { content: @fa-var-eject; } .@{fa-css-prefix}-chevron-left:before { content: @fa-var-chevron-left; } .@{fa-css-prefix}-chevron-right:before { content: @fa-var-chevron-right; } .@{fa-css-prefix}-plus-circle:before { content: @fa-var-plus-circle; } .@{fa-css-prefix}-minus-circle:before { content: @fa-var-minus-circle; } .@{fa-css-prefix}-times-circle:before { content: @fa-var-times-circle; } .@{fa-css-prefix}-check-circle:before { content: @fa-var-check-circle; } .@{fa-css-prefix}-question-circle:before { content: @fa-var-question-circle; } .@{fa-css-prefix}-info-circle:before { content: @fa-var-info-circle; } .@{fa-css-prefix}-crosshairs:before { content: @fa-var-crosshairs; } .@{fa-css-prefix}-times-circle-o:before { content: @fa-var-times-circle-o; } .@{fa-css-prefix}-check-circle-o:before { content: @fa-var-check-circle-o; } .@{fa-css-prefix}-ban:before { content: @fa-var-ban; } .@{fa-css-prefix}-arrow-left:before { content: @fa-var-arrow-left; } .@{fa-css-prefix}-arrow-right:before { content: @fa-var-arrow-right; } .@{fa-css-prefix}-arrow-up:before { content: @fa-var-arrow-up; } .@{fa-css-prefix}-arrow-down:before { content: @fa-var-arrow-down; } .@{fa-css-prefix}-mail-forward:before, .@{fa-css-prefix}-share:before { content: @fa-var-share; } .@{fa-css-prefix}-expand:before { content: @fa-var-expand; } .@{fa-css-prefix}-compress:before { content: @fa-var-compress; } .@{fa-css-prefix}-plus:before { content: @fa-var-plus; } .@{fa-css-prefix}-minus:before { content: @fa-var-minus; } .@{fa-css-prefix}-asterisk:before { content: @fa-var-asterisk; } .@{fa-css-prefix}-exclamation-circle:before { content: @fa-var-exclamation-circle; } .@{fa-css-prefix}-gift:before { content: @fa-var-gift; } .@{fa-css-prefix}-leaf:before { content: @fa-var-leaf; } .@{fa-css-prefix}-fire:before { content: @fa-var-fire; } .@{fa-css-prefix}-eye:before { content: @fa-var-eye; } .@{fa-css-prefix}-eye-slash:before { content: @fa-var-eye-slash; } .@{fa-css-prefix}-warning:before, .@{fa-css-prefix}-exclamation-triangle:before { content: @fa-var-exclamation-triangle; } .@{fa-css-prefix}-plane:before { content: @fa-var-plane; } .@{fa-css-prefix}-calendar:before { content: @fa-var-calendar; } .@{fa-css-prefix}-random:before { content: @fa-var-random; } .@{fa-css-prefix}-comment:before { content: @fa-var-comment; } .@{fa-css-prefix}-magnet:before { content: @fa-var-magnet; } .@{fa-css-prefix}-chevron-up:before { content: @fa-var-chevron-up; } .@{fa-css-prefix}-chevron-down:before { content: @fa-var-chevron-down; } .@{fa-css-prefix}-retweet:before { content: @fa-var-retweet; } .@{fa-css-prefix}-shopping-cart:before { content: @fa-var-shopping-cart; } .@{fa-css-prefix}-folder:before { content: @fa-var-folder; } .@{fa-css-prefix}-folder-open:before { content: @fa-var-folder-open; } .@{fa-css-prefix}-arrows-v:before { content: @fa-var-arrows-v; } .@{fa-css-prefix}-arrows-h:before { content: @fa-var-arrows-h; } .@{fa-css-prefix}-bar-chart-o:before, .@{fa-css-prefix}-bar-chart:before { content: @fa-var-bar-chart; } .@{fa-css-prefix}-twitter-square:before { content: @fa-var-twitter-square; } .@{fa-css-prefix}-facebook-square:before { content: @fa-var-facebook-square; } .@{fa-css-prefix}-camera-retro:before { content: @fa-var-camera-retro; } .@{fa-css-prefix}-key:before { content: @fa-var-key; } .@{fa-css-prefix}-gears:before, .@{fa-css-prefix}-cogs:before { content: @fa-var-cogs; } .@{fa-css-prefix}-comments:before { content: @fa-var-comments; } .@{fa-css-prefix}-thumbs-o-up:before { content: @fa-var-thumbs-o-up; } .@{fa-css-prefix}-thumbs-o-down:before { content: @fa-var-thumbs-o-down; } .@{fa-css-prefix}-star-half:before { content: @fa-var-star-half; } .@{fa-css-prefix}-heart-o:before { content: @fa-var-heart-o; } .@{fa-css-prefix}-sign-out:before { content: @fa-var-sign-out; } .@{fa-css-prefix}-linkedin-square:before { content: @fa-var-linkedin-square; } .@{fa-css-prefix}-thumb-tack:before { content: @fa-var-thumb-tack; } .@{fa-css-prefix}-external-link:before { content: @fa-var-external-link; } .@{fa-css-prefix}-sign-in:before { content: @fa-var-sign-in; } .@{fa-css-prefix}-trophy:before { content: @fa-var-trophy; } .@{fa-css-prefix}-github-square:before { content: @fa-var-github-square; } .@{fa-css-prefix}-upload:before { content: @fa-var-upload; } .@{fa-css-prefix}-lemon-o:before { content: @fa-var-lemon-o; } .@{fa-css-prefix}-phone:before { content: @fa-var-phone; } .@{fa-css-prefix}-square-o:before { content: @fa-var-square-o; } .@{fa-css-prefix}-bookmark-o:before { content: @fa-var-bookmark-o; } .@{fa-css-prefix}-phone-square:before { content: @fa-var-phone-square; } .@{fa-css-prefix}-twitter:before { content: @fa-var-twitter; } .@{fa-css-prefix}-facebook-f:before, .@{fa-css-prefix}-facebook:before { content: @fa-var-facebook; } .@{fa-css-prefix}-github:before { content: @fa-var-github; } .@{fa-css-prefix}-unlock:before { content: @fa-var-unlock; } .@{fa-css-prefix}-credit-card:before { content: @fa-var-credit-card; } .@{fa-css-prefix}-feed:before, .@{fa-css-prefix}-rss:before { content: @fa-var-rss; } .@{fa-css-prefix}-hdd-o:before { content: @fa-var-hdd-o; } .@{fa-css-prefix}-bullhorn:before { content: @fa-var-bullhorn; } .@{fa-css-prefix}-bell:before { content: @fa-var-bell; } .@{fa-css-prefix}-certificate:before { content: @fa-var-certificate; } .@{fa-css-prefix}-hand-o-right:before { content: @fa-var-hand-o-right; } .@{fa-css-prefix}-hand-o-left:before { content: @fa-var-hand-o-left; } .@{fa-css-prefix}-hand-o-up:before { content: @fa-var-hand-o-up; } .@{fa-css-prefix}-hand-o-down:before { content: @fa-var-hand-o-down; } .@{fa-css-prefix}-arrow-circle-left:before { content: @fa-var-arrow-circle-left; } .@{fa-css-prefix}-arrow-circle-right:before { content: @fa-var-arrow-circle-right; } .@{fa-css-prefix}-arrow-circle-up:before { content: @fa-var-arrow-circle-up; } .@{fa-css-prefix}-arrow-circle-down:before { content: @fa-var-arrow-circle-down; } .@{fa-css-prefix}-globe:before { content: @fa-var-globe; } .@{fa-css-prefix}-wrench:before { content: @fa-var-wrench; } .@{fa-css-prefix}-tasks:before { content: @fa-var-tasks; } .@{fa-css-prefix}-filter:before { content: @fa-var-filter; } .@{fa-css-prefix}-briefcase:before { content: @fa-var-briefcase; } .@{fa-css-prefix}-arrows-alt:before { content: @fa-var-arrows-alt; } .@{fa-css-prefix}-group:before, .@{fa-css-prefix}-users:before { content: @fa-var-users; } .@{fa-css-prefix}-chain:before, .@{fa-css-prefix}-link:before { content: @fa-var-link; } .@{fa-css-prefix}-cloud:before { content: @fa-var-cloud; } .@{fa-css-prefix}-flask:before { content: @fa-var-flask; } .@{fa-css-prefix}-cut:before, .@{fa-css-prefix}-scissors:before { content: @fa-var-scissors; } .@{fa-css-prefix}-copy:before, .@{fa-css-prefix}-files-o:before { content: @fa-var-files-o; } .@{fa-css-prefix}-paperclip:before { content: @fa-var-paperclip; } .@{fa-css-prefix}-save:before, .@{fa-css-prefix}-floppy-o:before { content: @fa-var-floppy-o; } .@{fa-css-prefix}-square:before { content: @fa-var-square; } .@{fa-css-prefix}-navicon:before, .@{fa-css-prefix}-reorder:before, .@{fa-css-prefix}-bars:before { content: @fa-var-bars; } .@{fa-css-prefix}-list-ul:before { content: @fa-var-list-ul; } .@{fa-css-prefix}-list-ol:before { content: @fa-var-list-ol; } .@{fa-css-prefix}-strikethrough:before { content: @fa-var-strikethrough; } .@{fa-css-prefix}-underline:before { content: @fa-var-underline; } .@{fa-css-prefix}-table:before { content: @fa-var-table; } .@{fa-css-prefix}-magic:before { content: @fa-var-magic; } .@{fa-css-prefix}-truck:before { content: @fa-var-truck; } .@{fa-css-prefix}-pinterest:before { content: @fa-var-pinterest; } .@{fa-css-prefix}-pinterest-square:before { content: @fa-var-pinterest-square; } .@{fa-css-prefix}-google-plus-square:before { content: @fa-var-google-plus-square; } .@{fa-css-prefix}-google-plus:before { content: @fa-var-google-plus; } .@{fa-css-prefix}-money:before { content: @fa-var-money; } .@{fa-css-prefix}-caret-down:before { content: @fa-var-caret-down; } .@{fa-css-prefix}-caret-up:before { content: @fa-var-caret-up; } .@{fa-css-prefix}-caret-left:before { content: @fa-var-caret-left; } .@{fa-css-prefix}-caret-right:before { content: @fa-var-caret-right; } .@{fa-css-prefix}-columns:before { content: @fa-var-columns; } .@{fa-css-prefix}-unsorted:before, .@{fa-css-prefix}-sort:before { content: @fa-var-sort; } .@{fa-css-prefix}-sort-down:before, .@{fa-css-prefix}-sort-desc:before { content: @fa-var-sort-desc; } .@{fa-css-prefix}-sort-up:before, .@{fa-css-prefix}-sort-asc:before { content: @fa-var-sort-asc; } .@{fa-css-prefix}-envelope:before { content: @fa-var-envelope; } .@{fa-css-prefix}-linkedin:before { content: @fa-var-linkedin; } .@{fa-css-prefix}-rotate-left:before, .@{fa-css-prefix}-undo:before { content: @fa-var-undo; } .@{fa-css-prefix}-legal:before, .@{fa-css-prefix}-gavel:before { content: @fa-var-gavel; } .@{fa-css-prefix}-dashboard:before, .@{fa-css-prefix}-tachometer:before { content: @fa-var-tachometer; } .@{fa-css-prefix}-comment-o:before { content: @fa-var-comment-o; } .@{fa-css-prefix}-comments-o:before { content: @fa-var-comments-o; } .@{fa-css-prefix}-flash:before, .@{fa-css-prefix}-bolt:before { content: @fa-var-bolt; } .@{fa-css-prefix}-sitemap:before { content: @fa-var-sitemap; } .@{fa-css-prefix}-umbrella:before { content: @fa-var-umbrella; } .@{fa-css-prefix}-paste:before, .@{fa-css-prefix}-clipboard:before { content: @fa-var-clipboard; } .@{fa-css-prefix}-lightbulb-o:before { content: @fa-var-lightbulb-o; } .@{fa-css-prefix}-exchange:before { content: @fa-var-exchange; } .@{fa-css-prefix}-cloud-download:before { content: @fa-var-cloud-download; } .@{fa-css-prefix}-cloud-upload:before { content: @fa-var-cloud-upload; } .@{fa-css-prefix}-user-md:before { content: @fa-var-user-md; } .@{fa-css-prefix}-stethoscope:before { content: @fa-var-stethoscope; } .@{fa-css-prefix}-suitcase:before { content: @fa-var-suitcase; } .@{fa-css-prefix}-bell-o:before { content: @fa-var-bell-o; } .@{fa-css-prefix}-coffee:before { content: @fa-var-coffee; } .@{fa-css-prefix}-cutlery:before { content: @fa-var-cutlery; } .@{fa-css-prefix}-file-text-o:before { content: @fa-var-file-text-o; } .@{fa-css-prefix}-building-o:before { content: @fa-var-building-o; } .@{fa-css-prefix}-hospital-o:before { content: @fa-var-hospital-o; } .@{fa-css-prefix}-ambulance:before { content: @fa-var-ambulance; } .@{fa-css-prefix}-medkit:before { content: @fa-var-medkit; } .@{fa-css-prefix}-fighter-jet:before { content: @fa-var-fighter-jet; } .@{fa-css-prefix}-beer:before { content: @fa-var-beer; } .@{fa-css-prefix}-h-square:before { content: @fa-var-h-square; } .@{fa-css-prefix}-plus-square:before { content: @fa-var-plus-square; } .@{fa-css-prefix}-angle-double-left:before { content: @fa-var-angle-double-left; } .@{fa-css-prefix}-angle-double-right:before { content: @fa-var-angle-double-right; } .@{fa-css-prefix}-angle-double-up:before { content: @fa-var-angle-double-up; } .@{fa-css-prefix}-angle-double-down:before { content: @fa-var-angle-double-down; } .@{fa-css-prefix}-angle-left:before { content: @fa-var-angle-left; } .@{fa-css-prefix}-angle-right:before { content: @fa-var-angle-right; } .@{fa-css-prefix}-angle-up:before { content: @fa-var-angle-up; } .@{fa-css-prefix}-angle-down:before { content: @fa-var-angle-down; } .@{fa-css-prefix}-desktop:before { content: @fa-var-desktop; } .@{fa-css-prefix}-laptop:before { content: @fa-var-laptop; } .@{fa-css-prefix}-tablet:before { content: @fa-var-tablet; } .@{fa-css-prefix}-mobile-phone:before, .@{fa-css-prefix}-mobile:before { content: @fa-var-mobile; } .@{fa-css-prefix}-circle-o:before { content: @fa-var-circle-o; } .@{fa-css-prefix}-quote-left:before { content: @fa-var-quote-left; } .@{fa-css-prefix}-quote-right:before { content: @fa-var-quote-right; } .@{fa-css-prefix}-spinner:before { content: @fa-var-spinner; } .@{fa-css-prefix}-circle:before { content: @fa-var-circle; } .@{fa-css-prefix}-mail-reply:before, .@{fa-css-prefix}-reply:before { content: @fa-var-reply; } .@{fa-css-prefix}-github-alt:before { content: @fa-var-github-alt; } .@{fa-css-prefix}-folder-o:before { content: @fa-var-folder-o; } .@{fa-css-prefix}-folder-open-o:before { content: @fa-var-folder-open-o; } .@{fa-css-prefix}-smile-o:before { content: @fa-var-smile-o; } .@{fa-css-prefix}-frown-o:before { content: @fa-var-frown-o; } .@{fa-css-prefix}-meh-o:before { content: @fa-var-meh-o; } .@{fa-css-prefix}-gamepad:before { content: @fa-var-gamepad; } .@{fa-css-prefix}-keyboard-o:before { content: @fa-var-keyboard-o; } .@{fa-css-prefix}-flag-o:before { content: @fa-var-flag-o; } .@{fa-css-prefix}-flag-checkered:before { content: @fa-var-flag-checkered; } .@{fa-css-prefix}-terminal:before { content: @fa-var-terminal; } .@{fa-css-prefix}-code:before { content: @fa-var-code; } .@{fa-css-prefix}-mail-reply-all:before, .@{fa-css-prefix}-reply-all:before { content: @fa-var-reply-all; } .@{fa-css-prefix}-star-half-empty:before, .@{fa-css-prefix}-star-half-full:before, .@{fa-css-prefix}-star-half-o:before { content: @fa-var-star-half-o; } .@{fa-css-prefix}-location-arrow:before { content: @fa-var-location-arrow; } .@{fa-css-prefix}-crop:before { content: @fa-var-crop; } .@{fa-css-prefix}-code-fork:before { content: @fa-var-code-fork; } .@{fa-css-prefix}-unlink:before, .@{fa-css-prefix}-chain-broken:before { content: @fa-var-chain-broken; } .@{fa-css-prefix}-question:before { content: @fa-var-question; } .@{fa-css-prefix}-info:before { content: @fa-var-info; } .@{fa-css-prefix}-exclamation:before { content: @fa-var-exclamation; } .@{fa-css-prefix}-superscript:before { content: @fa-var-superscript; } .@{fa-css-prefix}-subscript:before { content: @fa-var-subscript; } .@{fa-css-prefix}-eraser:before { content: @fa-var-eraser; } .@{fa-css-prefix}-puzzle-piece:before { content: @fa-var-puzzle-piece; } .@{fa-css-prefix}-microphone:before { content: @fa-var-microphone; } .@{fa-css-prefix}-microphone-slash:before { content: @fa-var-microphone-slash; } .@{fa-css-prefix}-shield:before { content: @fa-var-shield; } .@{fa-css-prefix}-calendar-o:before { content: @fa-var-calendar-o; } .@{fa-css-prefix}-fire-extinguisher:before { content: @fa-var-fire-extinguisher; } .@{fa-css-prefix}-rocket:before { content: @fa-var-rocket; } .@{fa-css-prefix}-maxcdn:before { content: @fa-var-maxcdn; } .@{fa-css-prefix}-chevron-circle-left:before { content: @fa-var-chevron-circle-left; } .@{fa-css-prefix}-chevron-circle-right:before { content: @fa-var-chevron-circle-right; } .@{fa-css-prefix}-chevron-circle-up:before { content: @fa-var-chevron-circle-up; } .@{fa-css-prefix}-chevron-circle-down:before { content: @fa-var-chevron-circle-down; } .@{fa-css-prefix}-html5:before { content: @fa-var-html5; } .@{fa-css-prefix}-css3:before { content: @fa-var-css3; } .@{fa-css-prefix}-anchor:before { content: @fa-var-anchor; } .@{fa-css-prefix}-unlock-alt:before { content: @fa-var-unlock-alt; } .@{fa-css-prefix}-bullseye:before { content: @fa-var-bullseye; } .@{fa-css-prefix}-ellipsis-h:before { content: @fa-var-ellipsis-h; } .@{fa-css-prefix}-ellipsis-v:before { content: @fa-var-ellipsis-v; } .@{fa-css-prefix}-rss-square:before { content: @fa-var-rss-square; } .@{fa-css-prefix}-play-circle:before { content: @fa-var-play-circle; } .@{fa-css-prefix}-ticket:before { content: @fa-var-ticket; } .@{fa-css-prefix}-minus-square:before { content: @fa-var-minus-square; } .@{fa-css-prefix}-minus-square-o:before { content: @fa-var-minus-square-o; } .@{fa-css-prefix}-level-up:before { content: @fa-var-level-up; } .@{fa-css-prefix}-level-down:before { content: @fa-var-level-down; } .@{fa-css-prefix}-check-square:before { content: @fa-var-check-square; } .@{fa-css-prefix}-pencil-square:before { content: @fa-var-pencil-square; } .@{fa-css-prefix}-external-link-square:before { content: @fa-var-external-link-square; } .@{fa-css-prefix}-share-square:before { content: @fa-var-share-square; } .@{fa-css-prefix}-compass:before { content: @fa-var-compass; } .@{fa-css-prefix}-toggle-down:before, .@{fa-css-prefix}-caret-square-o-down:before { content: @fa-var-caret-square-o-down; } .@{fa-css-prefix}-toggle-up:before, .@{fa-css-prefix}-caret-square-o-up:before { content: @fa-var-caret-square-o-up; } .@{fa-css-prefix}-toggle-right:before, .@{fa-css-prefix}-caret-square-o-right:before { content: @fa-var-caret-square-o-right; } .@{fa-css-prefix}-euro:before, .@{fa-css-prefix}-eur:before { content: @fa-var-eur; } .@{fa-css-prefix}-gbp:before { content: @fa-var-gbp; } .@{fa-css-prefix}-dollar:before, .@{fa-css-prefix}-usd:before { content: @fa-var-usd; } .@{fa-css-prefix}-rupee:before, .@{fa-css-prefix}-inr:before { content: @fa-var-inr; } .@{fa-css-prefix}-cny:before, .@{fa-css-prefix}-rmb:before, .@{fa-css-prefix}-yen:before, .@{fa-css-prefix}-jpy:before { content: @fa-var-jpy; } .@{fa-css-prefix}-ruble:before, .@{fa-css-prefix}-rouble:before, .@{fa-css-prefix}-rub:before { content: @fa-var-rub; } .@{fa-css-prefix}-won:before, .@{fa-css-prefix}-krw:before { content: @fa-var-krw; } .@{fa-css-prefix}-bitcoin:before, .@{fa-css-prefix}-btc:before { content: @fa-var-btc; } .@{fa-css-prefix}-file:before { content: @fa-var-file; } .@{fa-css-prefix}-file-text:before { content: @fa-var-file-text; } .@{fa-css-prefix}-sort-alpha-asc:before { content: @fa-var-sort-alpha-asc; } .@{fa-css-prefix}-sort-alpha-desc:before { content: @fa-var-sort-alpha-desc; } .@{fa-css-prefix}-sort-amount-asc:before { content: @fa-var-sort-amount-asc; } .@{fa-css-prefix}-sort-amount-desc:before { content: @fa-var-sort-amount-desc; } .@{fa-css-prefix}-sort-numeric-asc:before { content: @fa-var-sort-numeric-asc; } .@{fa-css-prefix}-sort-numeric-desc:before { content: @fa-var-sort-numeric-desc; } .@{fa-css-prefix}-thumbs-up:before { content: @fa-var-thumbs-up; } .@{fa-css-prefix}-thumbs-down:before { content: @fa-var-thumbs-down; } .@{fa-css-prefix}-youtube-square:before { content: @fa-var-youtube-square; } .@{fa-css-prefix}-youtube:before { content: @fa-var-youtube; } .@{fa-css-prefix}-xing:before { content: @fa-var-xing; } .@{fa-css-prefix}-xing-square:before { content: @fa-var-xing-square; } .@{fa-css-prefix}-youtube-play:before { content: @fa-var-youtube-play; } .@{fa-css-prefix}-dropbox:before { content: @fa-var-dropbox; } .@{fa-css-prefix}-stack-overflow:before { content: @fa-var-stack-overflow; } .@{fa-css-prefix}-instagram:before { content: @fa-var-instagram; } .@{fa-css-prefix}-flickr:before { content: @fa-var-flickr; } .@{fa-css-prefix}-adn:before { content: @fa-var-adn; } .@{fa-css-prefix}-bitbucket:before { content: @fa-var-bitbucket; } .@{fa-css-prefix}-bitbucket-square:before { content: @fa-var-bitbucket-square; } .@{fa-css-prefix}-tumblr:before { content: @fa-var-tumblr; } .@{fa-css-prefix}-tumblr-square:before { content: @fa-var-tumblr-square; } .@{fa-css-prefix}-long-arrow-down:before { content: @fa-var-long-arrow-down; } .@{fa-css-prefix}-long-arrow-up:before { content: @fa-var-long-arrow-up; } .@{fa-css-prefix}-long-arrow-left:before { content: @fa-var-long-arrow-left; } .@{fa-css-prefix}-long-arrow-right:before { content: @fa-var-long-arrow-right; } .@{fa-css-prefix}-apple:before { content: @fa-var-apple; } .@{fa-css-prefix}-windows:before { content: @fa-var-windows; } .@{fa-css-prefix}-android:before { content: @fa-var-android; } .@{fa-css-prefix}-linux:before { content: @fa-var-linux; } .@{fa-css-prefix}-dribbble:before { content: @fa-var-dribbble; } .@{fa-css-prefix}-skype:before { content: @fa-var-skype; } .@{fa-css-prefix}-foursquare:before { content: @fa-var-foursquare; } .@{fa-css-prefix}-trello:before { content: @fa-var-trello; } .@{fa-css-prefix}-female:before { content: @fa-var-female; } .@{fa-css-prefix}-male:before { content: @fa-var-male; } .@{fa-css-prefix}-gittip:before, .@{fa-css-prefix}-gratipay:before { content: @fa-var-gratipay; } .@{fa-css-prefix}-sun-o:before { content: @fa-var-sun-o; } .@{fa-css-prefix}-moon-o:before { content: @fa-var-moon-o; } .@{fa-css-prefix}-archive:before { content: @fa-var-archive; } .@{fa-css-prefix}-bug:before { content: @fa-var-bug; } .@{fa-css-prefix}-vk:before { content: @fa-var-vk; } .@{fa-css-prefix}-weibo:before { content: @fa-var-weibo; } .@{fa-css-prefix}-renren:before { content: @fa-var-renren; } .@{fa-css-prefix}-pagelines:before { content: @fa-var-pagelines; } .@{fa-css-prefix}-stack-exchange:before { content: @fa-var-stack-exchange; } .@{fa-css-prefix}-arrow-circle-o-right:before { content: @fa-var-arrow-circle-o-right; } .@{fa-css-prefix}-arrow-circle-o-left:before { content: @fa-var-arrow-circle-o-left; } .@{fa-css-prefix}-toggle-left:before, .@{fa-css-prefix}-caret-square-o-left:before { content: @fa-var-caret-square-o-left; } .@{fa-css-prefix}-dot-circle-o:before { content: @fa-var-dot-circle-o; } .@{fa-css-prefix}-wheelchair:before { content: @fa-var-wheelchair; } .@{fa-css-prefix}-vimeo-square:before { content: @fa-var-vimeo-square; } .@{fa-css-prefix}-turkish-lira:before, .@{fa-css-prefix}-try:before { content: @fa-var-try; } .@{fa-css-prefix}-plus-square-o:before { content: @fa-var-plus-square-o; } .@{fa-css-prefix}-space-shuttle:before { content: @fa-var-space-shuttle; } .@{fa-css-prefix}-slack:before { content: @fa-var-slack; } .@{fa-css-prefix}-envelope-square:before { content: @fa-var-envelope-square; } .@{fa-css-prefix}-wordpress:before { content: @fa-var-wordpress; } .@{fa-css-prefix}-openid:before { content: @fa-var-openid; } .@{fa-css-prefix}-institution:before, .@{fa-css-prefix}-bank:before, .@{fa-css-prefix}-university:before { content: @fa-var-university; } .@{fa-css-prefix}-mortar-board:before, .@{fa-css-prefix}-graduation-cap:before { content: @fa-var-graduation-cap; } .@{fa-css-prefix}-yahoo:before { content: @fa-var-yahoo; } .@{fa-css-prefix}-google:before { content: @fa-var-google; } .@{fa-css-prefix}-reddit:before { content: @fa-var-reddit; } .@{fa-css-prefix}-reddit-square:before { content: @fa-var-reddit-square; } .@{fa-css-prefix}-stumbleupon-circle:before { content: @fa-var-stumbleupon-circle; } .@{fa-css-prefix}-stumbleupon:before { content: @fa-var-stumbleupon; } .@{fa-css-prefix}-delicious:before { content: @fa-var-delicious; } .@{fa-css-prefix}-digg:before { content: @fa-var-digg; } .@{fa-css-prefix}-pied-piper-pp:before { content: @fa-var-pied-piper-pp; } .@{fa-css-prefix}-pied-piper-alt:before { content: @fa-var-pied-piper-alt; } .@{fa-css-prefix}-drupal:before { content: @fa-var-drupal; } .@{fa-css-prefix}-joomla:before { content: @fa-var-joomla; } .@{fa-css-prefix}-language:before { content: @fa-var-language; } .@{fa-css-prefix}-fax:before { content: @fa-var-fax; } .@{fa-css-prefix}-building:before { content: @fa-var-building; } .@{fa-css-prefix}-child:before { content: @fa-var-child; } .@{fa-css-prefix}-paw:before { content: @fa-var-paw; } .@{fa-css-prefix}-spoon:before { content: @fa-var-spoon; } .@{fa-css-prefix}-cube:before { content: @fa-var-cube; } .@{fa-css-prefix}-cubes:before { content: @fa-var-cubes; } .@{fa-css-prefix}-behance:before { content: @fa-var-behance; } .@{fa-css-prefix}-behance-square:before { content: @fa-var-behance-square; } .@{fa-css-prefix}-steam:before { content: @fa-var-steam; } .@{fa-css-prefix}-steam-square:before { content: @fa-var-steam-square; } .@{fa-css-prefix}-recycle:before { content: @fa-var-recycle; } .@{fa-css-prefix}-automobile:before, .@{fa-css-prefix}-car:before { content: @fa-var-car; } .@{fa-css-prefix}-cab:before, .@{fa-css-prefix}-taxi:before { content: @fa-var-taxi; } .@{fa-css-prefix}-tree:before { content: @fa-var-tree; } .@{fa-css-prefix}-spotify:before { content: @fa-var-spotify; } .@{fa-css-prefix}-deviantart:before { content: @fa-var-deviantart; } .@{fa-css-prefix}-soundcloud:before { content: @fa-var-soundcloud; } .@{fa-css-prefix}-database:before { content: @fa-var-database; } .@{fa-css-prefix}-file-pdf-o:before { content: @fa-var-file-pdf-o; } .@{fa-css-prefix}-file-word-o:before { content: @fa-var-file-word-o; } .@{fa-css-prefix}-file-excel-o:before { content: @fa-var-file-excel-o; } .@{fa-css-prefix}-file-powerpoint-o:before { content: @fa-var-file-powerpoint-o; } .@{fa-css-prefix}-file-photo-o:before, .@{fa-css-prefix}-file-picture-o:before, .@{fa-css-prefix}-file-image-o:before { content: @fa-var-file-image-o; } .@{fa-css-prefix}-file-zip-o:before, .@{fa-css-prefix}-file-archive-o:before { content: @fa-var-file-archive-o; } .@{fa-css-prefix}-file-sound-o:before, .@{fa-css-prefix}-file-audio-o:before { content: @fa-var-file-audio-o; } .@{fa-css-prefix}-file-movie-o:before, .@{fa-css-prefix}-file-video-o:before { content: @fa-var-file-video-o; } .@{fa-css-prefix}-file-code-o:before { content: @fa-var-file-code-o; } .@{fa-css-prefix}-vine:before { content: @fa-var-vine; } .@{fa-css-prefix}-codepen:before { content: @fa-var-codepen; } .@{fa-css-prefix}-jsfiddle:before { content: @fa-var-jsfiddle; } .@{fa-css-prefix}-life-bouy:before, .@{fa-css-prefix}-life-buoy:before, .@{fa-css-prefix}-life-saver:before, .@{fa-css-prefix}-support:before, .@{fa-css-prefix}-life-ring:before { content: @fa-var-life-ring; } .@{fa-css-prefix}-circle-o-notch:before { content: @fa-var-circle-o-notch; } .@{fa-css-prefix}-ra:before, .@{fa-css-prefix}-resistance:before, .@{fa-css-prefix}-rebel:before { content: @fa-var-rebel; } .@{fa-css-prefix}-ge:before, .@{fa-css-prefix}-empire:before { content: @fa-var-empire; } .@{fa-css-prefix}-git-square:before { content: @fa-var-git-square; } .@{fa-css-prefix}-git:before { content: @fa-var-git; } .@{fa-css-prefix}-y-combinator-square:before, .@{fa-css-prefix}-yc-square:before, .@{fa-css-prefix}-hacker-news:before { content: @fa-var-hacker-news; } .@{fa-css-prefix}-tencent-weibo:before { content: @fa-var-tencent-weibo; } .@{fa-css-prefix}-qq:before { content: @fa-var-qq; } .@{fa-css-prefix}-wechat:before, .@{fa-css-prefix}-weixin:before { content: @fa-var-weixin; } .@{fa-css-prefix}-send:before, .@{fa-css-prefix}-paper-plane:before { content: @fa-var-paper-plane; } .@{fa-css-prefix}-send-o:before, .@{fa-css-prefix}-paper-plane-o:before { content: @fa-var-paper-plane-o; } .@{fa-css-prefix}-history:before { content: @fa-var-history; } .@{fa-css-prefix}-circle-thin:before { content: @fa-var-circle-thin; } .@{fa-css-prefix}-header:before { content: @fa-var-header; } .@{fa-css-prefix}-paragraph:before { content: @fa-var-paragraph; } .@{fa-css-prefix}-sliders:before { content: @fa-var-sliders; } .@{fa-css-prefix}-share-alt:before { content: @fa-var-share-alt; } .@{fa-css-prefix}-share-alt-square:before { content: @fa-var-share-alt-square; } .@{fa-css-prefix}-bomb:before { content: @fa-var-bomb; } .@{fa-css-prefix}-soccer-ball-o:before, .@{fa-css-prefix}-futbol-o:before { content: @fa-var-futbol-o; } .@{fa-css-prefix}-tty:before { content: @fa-var-tty; } .@{fa-css-prefix}-binoculars:before { content: @fa-var-binoculars; } .@{fa-css-prefix}-plug:before { content: @fa-var-plug; } .@{fa-css-prefix}-slideshare:before { content: @fa-var-slideshare; } .@{fa-css-prefix}-twitch:before { content: @fa-var-twitch; } .@{fa-css-prefix}-yelp:before { content: @fa-var-yelp; } .@{fa-css-prefix}-newspaper-o:before { content: @fa-var-newspaper-o; } .@{fa-css-prefix}-wifi:before { content: @fa-var-wifi; } .@{fa-css-prefix}-calculator:before { content: @fa-var-calculator; } .@{fa-css-prefix}-paypal:before { content: @fa-var-paypal; } .@{fa-css-prefix}-google-wallet:before { content: @fa-var-google-wallet; } .@{fa-css-prefix}-cc-visa:before { content: @fa-var-cc-visa; } .@{fa-css-prefix}-cc-mastercard:before { content: @fa-var-cc-mastercard; } .@{fa-css-prefix}-cc-discover:before { content: @fa-var-cc-discover; } .@{fa-css-prefix}-cc-amex:before { content: @fa-var-cc-amex; } .@{fa-css-prefix}-cc-paypal:before { content: @fa-var-cc-paypal; } .@{fa-css-prefix}-cc-stripe:before { content: @fa-var-cc-stripe; } .@{fa-css-prefix}-bell-slash:before { content: @fa-var-bell-slash; } .@{fa-css-prefix}-bell-slash-o:before { content: @fa-var-bell-slash-o; } .@{fa-css-prefix}-trash:before { content: @fa-var-trash; } .@{fa-css-prefix}-copyright:before { content: @fa-var-copyright; } .@{fa-css-prefix}-at:before { content: @fa-var-at; } .@{fa-css-prefix}-eyedropper:before { content: @fa-var-eyedropper; } .@{fa-css-prefix}-paint-brush:before { content: @fa-var-paint-brush; } .@{fa-css-prefix}-birthday-cake:before { content: @fa-var-birthday-cake; } .@{fa-css-prefix}-area-chart:before { content: @fa-var-area-chart; } .@{fa-css-prefix}-pie-chart:before { content: @fa-var-pie-chart; } .@{fa-css-prefix}-line-chart:before { content: @fa-var-line-chart; } .@{fa-css-prefix}-lastfm:before { content: @fa-var-lastfm; } .@{fa-css-prefix}-lastfm-square:before { content: @fa-var-lastfm-square; } .@{fa-css-prefix}-toggle-off:before { content: @fa-var-toggle-off; } .@{fa-css-prefix}-toggle-on:before { content: @fa-var-toggle-on; } .@{fa-css-prefix}-bicycle:before { content: @fa-var-bicycle; } .@{fa-css-prefix}-bus:before { content: @fa-var-bus; } .@{fa-css-prefix}-ioxhost:before { content: @fa-var-ioxhost; } .@{fa-css-prefix}-angellist:before { content: @fa-var-angellist; } .@{fa-css-prefix}-cc:before { content: @fa-var-cc; } .@{fa-css-prefix}-shekel:before, .@{fa-css-prefix}-sheqel:before, .@{fa-css-prefix}-ils:before { content: @fa-var-ils; } .@{fa-css-prefix}-meanpath:before { content: @fa-var-meanpath; } .@{fa-css-prefix}-buysellads:before { content: @fa-var-buysellads; } .@{fa-css-prefix}-connectdevelop:before { content: @fa-var-connectdevelop; } .@{fa-css-prefix}-dashcube:before { content: @fa-var-dashcube; } .@{fa-css-prefix}-forumbee:before { content: @fa-var-forumbee; } .@{fa-css-prefix}-leanpub:before { content: @fa-var-leanpub; } .@{fa-css-prefix}-sellsy:before { content: @fa-var-sellsy; } .@{fa-css-prefix}-shirtsinbulk:before { content: @fa-var-shirtsinbulk; } .@{fa-css-prefix}-simplybuilt:before { content: @fa-var-simplybuilt; } .@{fa-css-prefix}-skyatlas:before { content: @fa-var-skyatlas; } .@{fa-css-prefix}-cart-plus:before { content: @fa-var-cart-plus; } .@{fa-css-prefix}-cart-arrow-down:before { content: @fa-var-cart-arrow-down; } .@{fa-css-prefix}-diamond:before { content: @fa-var-diamond; } .@{fa-css-prefix}-ship:before { content: @fa-var-ship; } .@{fa-css-prefix}-user-secret:before { content: @fa-var-user-secret; } .@{fa-css-prefix}-motorcycle:before { content: @fa-var-motorcycle; } .@{fa-css-prefix}-street-view:before { content: @fa-var-street-view; } .@{fa-css-prefix}-heartbeat:before { content: @fa-var-heartbeat; } .@{fa-css-prefix}-venus:before { content: @fa-var-venus; } .@{fa-css-prefix}-mars:before { content: @fa-var-mars; } .@{fa-css-prefix}-mercury:before { content: @fa-var-mercury; } .@{fa-css-prefix}-intersex:before, .@{fa-css-prefix}-transgender:before { content: @fa-var-transgender; } .@{fa-css-prefix}-transgender-alt:before { content: @fa-var-transgender-alt; } .@{fa-css-prefix}-venus-double:before { content: @fa-var-venus-double; } .@{fa-css-prefix}-mars-double:before { content: @fa-var-mars-double; } .@{fa-css-prefix}-venus-mars:before { content: @fa-var-venus-mars; } .@{fa-css-prefix}-mars-stroke:before { content: @fa-var-mars-stroke; } .@{fa-css-prefix}-mars-stroke-v:before { content: @fa-var-mars-stroke-v; } .@{fa-css-prefix}-mars-stroke-h:before { content: @fa-var-mars-stroke-h; } .@{fa-css-prefix}-neuter:before { content: @fa-var-neuter; } .@{fa-css-prefix}-genderless:before { content: @fa-var-genderless; } .@{fa-css-prefix}-facebook-official:before { content: @fa-var-facebook-official; } .@{fa-css-prefix}-pinterest-p:before { content: @fa-var-pinterest-p; } .@{fa-css-prefix}-whatsapp:before { content: @fa-var-whatsapp; } .@{fa-css-prefix}-server:before { content: @fa-var-server; } .@{fa-css-prefix}-user-plus:before { content: @fa-var-user-plus; } .@{fa-css-prefix}-user-times:before { content: @fa-var-user-times; } .@{fa-css-prefix}-hotel:before, .@{fa-css-prefix}-bed:before { content: @fa-var-bed; } .@{fa-css-prefix}-viacoin:before { content: @fa-var-viacoin; } .@{fa-css-prefix}-train:before { content: @fa-var-train; } .@{fa-css-prefix}-subway:before { content: @fa-var-subway; } .@{fa-css-prefix}-medium:before { content: @fa-var-medium; } .@{fa-css-prefix}-yc:before, .@{fa-css-prefix}-y-combinator:before { content: @fa-var-y-combinator; } .@{fa-css-prefix}-optin-monster:before { content: @fa-var-optin-monster; } .@{fa-css-prefix}-opencart:before { content: @fa-var-opencart; } .@{fa-css-prefix}-expeditedssl:before { content: @fa-var-expeditedssl; } .@{fa-css-prefix}-battery-4:before, .@{fa-css-prefix}-battery:before, .@{fa-css-prefix}-battery-full:before { content: @fa-var-battery-full; } .@{fa-css-prefix}-battery-3:before, .@{fa-css-prefix}-battery-three-quarters:before { content: @fa-var-battery-three-quarters; } .@{fa-css-prefix}-battery-2:before, .@{fa-css-prefix}-battery-half:before { content: @fa-var-battery-half; } .@{fa-css-prefix}-battery-1:before, .@{fa-css-prefix}-battery-quarter:before { content: @fa-var-battery-quarter; } .@{fa-css-prefix}-battery-0:before, .@{fa-css-prefix}-battery-empty:before { content: @fa-var-battery-empty; } .@{fa-css-prefix}-mouse-pointer:before { content: @fa-var-mouse-pointer; } .@{fa-css-prefix}-i-cursor:before { content: @fa-var-i-cursor; } .@{fa-css-prefix}-object-group:before { content: @fa-var-object-group; } .@{fa-css-prefix}-object-ungroup:before { content: @fa-var-object-ungroup; } .@{fa-css-prefix}-sticky-note:before { content: @fa-var-sticky-note; } .@{fa-css-prefix}-sticky-note-o:before { content: @fa-var-sticky-note-o; } .@{fa-css-prefix}-cc-jcb:before { content: @fa-var-cc-jcb; } .@{fa-css-prefix}-cc-diners-club:before { content: @fa-var-cc-diners-club; } .@{fa-css-prefix}-clone:before { content: @fa-var-clone; } .@{fa-css-prefix}-balance-scale:before { content: @fa-var-balance-scale; } .@{fa-css-prefix}-hourglass-o:before { content: @fa-var-hourglass-o; } .@{fa-css-prefix}-hourglass-1:before, .@{fa-css-prefix}-hourglass-start:before { content: @fa-var-hourglass-start; } .@{fa-css-prefix}-hourglass-2:before, .@{fa-css-prefix}-hourglass-half:before { content: @fa-var-hourglass-half; } .@{fa-css-prefix}-hourglass-3:before, .@{fa-css-prefix}-hourglass-end:before { content: @fa-var-hourglass-end; } .@{fa-css-prefix}-hourglass:before { content: @fa-var-hourglass; } .@{fa-css-prefix}-hand-grab-o:before, .@{fa-css-prefix}-hand-rock-o:before { content: @fa-var-hand-rock-o; } .@{fa-css-prefix}-hand-stop-o:before, .@{fa-css-prefix}-hand-paper-o:before { content: @fa-var-hand-paper-o; } .@{fa-css-prefix}-hand-scissors-o:before { content: @fa-var-hand-scissors-o; } .@{fa-css-prefix}-hand-lizard-o:before { content: @fa-var-hand-lizard-o; } .@{fa-css-prefix}-hand-spock-o:before { content: @fa-var-hand-spock-o; } .@{fa-css-prefix}-hand-pointer-o:before { content: @fa-var-hand-pointer-o; } .@{fa-css-prefix}-hand-peace-o:before { content: @fa-var-hand-peace-o; } .@{fa-css-prefix}-trademark:before { content: @fa-var-trademark; } .@{fa-css-prefix}-registered:before { content: @fa-var-registered; } .@{fa-css-prefix}-creative-commons:before { content: @fa-var-creative-commons; } .@{fa-css-prefix}-gg:before { content: @fa-var-gg; } .@{fa-css-prefix}-gg-circle:before { content: @fa-var-gg-circle; } .@{fa-css-prefix}-tripadvisor:before { content: @fa-var-tripadvisor; } .@{fa-css-prefix}-odnoklassniki:before { content: @fa-var-odnoklassniki; } .@{fa-css-prefix}-odnoklassniki-square:before { content: @fa-var-odnoklassniki-square; } .@{fa-css-prefix}-get-pocket:before { content: @fa-var-get-pocket; } .@{fa-css-prefix}-wikipedia-w:before { content: @fa-var-wikipedia-w; } .@{fa-css-prefix}-safari:before { content: @fa-var-safari; } .@{fa-css-prefix}-chrome:before { content: @fa-var-chrome; } .@{fa-css-prefix}-firefox:before { content: @fa-var-firefox; } .@{fa-css-prefix}-opera:before { content: @fa-var-opera; } .@{fa-css-prefix}-internet-explorer:before { content: @fa-var-internet-explorer; } .@{fa-css-prefix}-tv:before, .@{fa-css-prefix}-television:before { content: @fa-var-television; } .@{fa-css-prefix}-contao:before { content: @fa-var-contao; } .@{fa-css-prefix}-500px:before { content: @fa-var-500px; } .@{fa-css-prefix}-amazon:before { content: @fa-var-amazon; } .@{fa-css-prefix}-calendar-plus-o:before { content: @fa-var-calendar-plus-o; } .@{fa-css-prefix}-calendar-minus-o:before { content: @fa-var-calendar-minus-o; } .@{fa-css-prefix}-calendar-times-o:before { content: @fa-var-calendar-times-o; } .@{fa-css-prefix}-calendar-check-o:before { content: @fa-var-calendar-check-o; } .@{fa-css-prefix}-industry:before { content: @fa-var-industry; } .@{fa-css-prefix}-map-pin:before { content: @fa-var-map-pin; } .@{fa-css-prefix}-map-signs:before { content: @fa-var-map-signs; } .@{fa-css-prefix}-map-o:before { content: @fa-var-map-o; } .@{fa-css-prefix}-map:before { content: @fa-var-map; } .@{fa-css-prefix}-commenting:before { content: @fa-var-commenting; } .@{fa-css-prefix}-commenting-o:before { content: @fa-var-commenting-o; } .@{fa-css-prefix}-houzz:before { content: @fa-var-houzz; } .@{fa-css-prefix}-vimeo:before { content: @fa-var-vimeo; } .@{fa-css-prefix}-black-tie:before { content: @fa-var-black-tie; } .@{fa-css-prefix}-fonticons:before { content: @fa-var-fonticons; } .@{fa-css-prefix}-reddit-alien:before { content: @fa-var-reddit-alien; } .@{fa-css-prefix}-edge:before { content: @fa-var-edge; } .@{fa-css-prefix}-credit-card-alt:before { content: @fa-var-credit-card-alt; } .@{fa-css-prefix}-codiepie:before { content: @fa-var-codiepie; } .@{fa-css-prefix}-modx:before { content: @fa-var-modx; } .@{fa-css-prefix}-fort-awesome:before { content: @fa-var-fort-awesome; } .@{fa-css-prefix}-usb:before { content: @fa-var-usb; } .@{fa-css-prefix}-product-hunt:before { content: @fa-var-product-hunt; } .@{fa-css-prefix}-mixcloud:before { content: @fa-var-mixcloud; } .@{fa-css-prefix}-scribd:before { content: @fa-var-scribd; } .@{fa-css-prefix}-pause-circle:before { content: @fa-var-pause-circle; } .@{fa-css-prefix}-pause-circle-o:before { content: @fa-var-pause-circle-o; } .@{fa-css-prefix}-stop-circle:before { content: @fa-var-stop-circle; } .@{fa-css-prefix}-stop-circle-o:before { content: @fa-var-stop-circle-o; } .@{fa-css-prefix}-shopping-bag:before { content: @fa-var-shopping-bag; } .@{fa-css-prefix}-shopping-basket:before { content: @fa-var-shopping-basket; } .@{fa-css-prefix}-hashtag:before { content: @fa-var-hashtag; } .@{fa-css-prefix}-bluetooth:before { content: @fa-var-bluetooth; } .@{fa-css-prefix}-bluetooth-b:before { content: @fa-var-bluetooth-b; } .@{fa-css-prefix}-percent:before { content: @fa-var-percent; } .@{fa-css-prefix}-gitlab:before { content: @fa-var-gitlab; } .@{fa-css-prefix}-wpbeginner:before { content: @fa-var-wpbeginner; } .@{fa-css-prefix}-wpforms:before { content: @fa-var-wpforms; } .@{fa-css-prefix}-envira:before { content: @fa-var-envira; } .@{fa-css-prefix}-universal-access:before { content: @fa-var-universal-access; } .@{fa-css-prefix}-wheelchair-alt:before { content: @fa-var-wheelchair-alt; } .@{fa-css-prefix}-question-circle-o:before { content: @fa-var-question-circle-o; } .@{fa-css-prefix}-blind:before { content: @fa-var-blind; } .@{fa-css-prefix}-audio-description:before { content: @fa-var-audio-description; } .@{fa-css-prefix}-volume-control-phone:before { content: @fa-var-volume-control-phone; } .@{fa-css-prefix}-braille:before { content: @fa-var-braille; } .@{fa-css-prefix}-assistive-listening-systems:before { content: @fa-var-assistive-listening-systems; } .@{fa-css-prefix}-asl-interpreting:before, .@{fa-css-prefix}-american-sign-language-interpreting:before { content: @fa-var-american-sign-language-interpreting; } .@{fa-css-prefix}-deafness:before, .@{fa-css-prefix}-hard-of-hearing:before, .@{fa-css-prefix}-deaf:before { content: @fa-var-deaf; } .@{fa-css-prefix}-glide:before { content: @fa-var-glide; } .@{fa-css-prefix}-glide-g:before { content: @fa-var-glide-g; } .@{fa-css-prefix}-signing:before, .@{fa-css-prefix}-sign-language:before { content: @fa-var-sign-language; } .@{fa-css-prefix}-low-vision:before { content: @fa-var-low-vision; } .@{fa-css-prefix}-viadeo:before { content: @fa-var-viadeo; } .@{fa-css-prefix}-viadeo-square:before { content: @fa-var-viadeo-square; } .@{fa-css-prefix}-snapchat:before { content: @fa-var-snapchat; } .@{fa-css-prefix}-snapchat-ghost:before { content: @fa-var-snapchat-ghost; } .@{fa-css-prefix}-snapchat-square:before { content: @fa-var-snapchat-square; } .@{fa-css-prefix}-pied-piper:before { content: @fa-var-pied-piper; } .@{fa-css-prefix}-first-order:before { content: @fa-var-first-order; } .@{fa-css-prefix}-yoast:before { content: @fa-var-yoast; } .@{fa-css-prefix}-themeisle:before { content: @fa-var-themeisle; } .@{fa-css-prefix}-google-plus-circle:before, .@{fa-css-prefix}-google-plus-official:before { content: @fa-var-google-plus-official; } .@{fa-css-prefix}-fa:before, .@{fa-css-prefix}-font-awesome:before { content: @fa-var-font-awesome; } .@{fa-css-prefix}-handshake-o:before { content: @fa-var-handshake-o; } .@{fa-css-prefix}-envelope-open:before { content: @fa-var-envelope-open; } .@{fa-css-prefix}-envelope-open-o:before { content: @fa-var-envelope-open-o; } .@{fa-css-prefix}-linode:before { content: @fa-var-linode; } .@{fa-css-prefix}-address-book:before { content: @fa-var-address-book; } .@{fa-css-prefix}-address-book-o:before { content: @fa-var-address-book-o; } .@{fa-css-prefix}-vcard:before, .@{fa-css-prefix}-address-card:before { content: @fa-var-address-card; } .@{fa-css-prefix}-vcard-o:before, .@{fa-css-prefix}-address-card-o:before { content: @fa-var-address-card-o; } .@{fa-css-prefix}-user-circle:before { content: @fa-var-user-circle; } .@{fa-css-prefix}-user-circle-o:before { content: @fa-var-user-circle-o; } .@{fa-css-prefix}-user-o:before { content: @fa-var-user-o; } .@{fa-css-prefix}-id-badge:before { content: @fa-var-id-badge; } .@{fa-css-prefix}-drivers-license:before, .@{fa-css-prefix}-id-card:before { content: @fa-var-id-card; } .@{fa-css-prefix}-drivers-license-o:before, .@{fa-css-prefix}-id-card-o:before { content: @fa-var-id-card-o; } .@{fa-css-prefix}-quora:before { content: @fa-var-quora; } .@{fa-css-prefix}-free-code-camp:before { content: @fa-var-free-code-camp; } .@{fa-css-prefix}-telegram:before { content: @fa-var-telegram; } .@{fa-css-prefix}-thermometer-4:before, .@{fa-css-prefix}-thermometer:before, .@{fa-css-prefix}-thermometer-full:before { content: @fa-var-thermometer-full; } .@{fa-css-prefix}-thermometer-3:before, .@{fa-css-prefix}-thermometer-three-quarters:before { content: @fa-var-thermometer-three-quarters; } .@{fa-css-prefix}-thermometer-2:before, .@{fa-css-prefix}-thermometer-half:before { content: @fa-var-thermometer-half; } .@{fa-css-prefix}-thermometer-1:before, .@{fa-css-prefix}-thermometer-quarter:before { content: @fa-var-thermometer-quarter; } .@{fa-css-prefix}-thermometer-0:before, .@{fa-css-prefix}-thermometer-empty:before { content: @fa-var-thermometer-empty; } .@{fa-css-prefix}-shower:before { content: @fa-var-shower; } .@{fa-css-prefix}-bathtub:before, .@{fa-css-prefix}-s15:before, .@{fa-css-prefix}-bath:before { content: @fa-var-bath; } .@{fa-css-prefix}-podcast:before { content: @fa-var-podcast; } .@{fa-css-prefix}-window-maximize:before { content: @fa-var-window-maximize; } .@{fa-css-prefix}-window-minimize:before { content: @fa-var-window-minimize; } .@{fa-css-prefix}-window-restore:before { content: @fa-var-window-restore; } .@{fa-css-prefix}-times-rectangle:before, .@{fa-css-prefix}-window-close:before { content: @fa-var-window-close; } .@{fa-css-prefix}-times-rectangle-o:before, .@{fa-css-prefix}-window-close-o:before { content: @fa-var-window-close-o; } .@{fa-css-prefix}-bandcamp:before { content: @fa-var-bandcamp; } .@{fa-css-prefix}-grav:before { content: @fa-var-grav; } .@{fa-css-prefix}-etsy:before { content: @fa-var-etsy; } .@{fa-css-prefix}-imdb:before { content: @fa-var-imdb; } .@{fa-css-prefix}-ravelry:before { content: @fa-var-ravelry; } .@{fa-css-prefix}-eercast:before { content: @fa-var-eercast; } .@{fa-css-prefix}-microchip:before { content: @fa-var-microchip; } .@{fa-css-prefix}-snowflake-o:before { content: @fa-var-snowflake-o; } .@{fa-css-prefix}-superpowers:before { content: @fa-var-superpowers; } .@{fa-css-prefix}-wpexplorer:before { content: @fa-var-wpexplorer; } .@{fa-css-prefix}-meetup:before { content: @fa-var-meetup; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/icons.less
Less
unknown
49,712
// Icon Sizes // ------------------------- /* makes the font 33% larger relative to the icon container */ .@{fa-css-prefix}-lg { font-size: (4em / 3); line-height: (3em / 4); vertical-align: -15%; } .@{fa-css-prefix}-2x { font-size: 2em; } .@{fa-css-prefix}-3x { font-size: 3em; } .@{fa-css-prefix}-4x { font-size: 4em; } .@{fa-css-prefix}-5x { font-size: 5em; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/larger.less
Less
unknown
370
// List Icons // ------------------------- .@{fa-css-prefix}-ul { padding-left: 0; margin-left: @fa-li-width; list-style-type: none; > li { position: relative; } } .@{fa-css-prefix}-li { position: absolute; left: -@fa-li-width; width: @fa-li-width; top: (2em / 14); text-align: center; &.@{fa-css-prefix}-lg { left: (-@fa-li-width + (4em / 14)); } }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/list.less
Less
unknown
377
// Mixins // -------------------------- .fa-icon() { display: inline-block; font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration font-size: inherit; // can't have font-size inherit on line above, so need to override text-rendering: auto; // optimizelegibility throws things off #1094 -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .fa-icon-rotate(@degrees, @rotation) { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; -webkit-transform: rotate(@degrees); -ms-transform: rotate(@degrees); transform: rotate(@degrees); } .fa-icon-flip(@horiz, @vert, @rotation) { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; -webkit-transform: scale(@horiz, @vert); -ms-transform: scale(@horiz, @vert); transform: scale(@horiz, @vert); } // Only display content to screen readers. A la Bootstrap 4. // // See: http://a11yproject.com/posts/how-to-hide-content/ .sr-only() { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; } // Use in conjunction with .sr-only to only display content when it's focused. // // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 // // Credit: HTML5 Boilerplate .sr-only-focusable() { &:active, &:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; } }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/mixins.less
Less
unknown
1,603
/* FONT PATH * -------------------------- */ @font-face { font-family: 'FontAwesome'; src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts font-weight: normal; font-style: normal; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/path.less
Less
unknown
771
// Rotated & Flipped Icons // ------------------------- .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } // Hook for IE8-9 // ------------------------- :root .@{fa-css-prefix}-rotate-90, :root .@{fa-css-prefix}-rotate-180, :root .@{fa-css-prefix}-rotate-270, :root .@{fa-css-prefix}-flip-horizontal, :root .@{fa-css-prefix}-flip-vertical { filter: none; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/rotated-flipped.less
Less
unknown
622
// Screen Readers // ------------------------- .sr-only { .sr-only(); } .sr-only-focusable { .sr-only-focusable(); }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/screen-reader.less
Less
unknown
118
// Stacked Icons // ------------------------- .@{fa-css-prefix}-stack { position: relative; display: inline-block; width: 2em; height: 2em; line-height: 2em; vertical-align: middle; } .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { position: absolute; left: 0; width: 100%; text-align: center; } .@{fa-css-prefix}-stack-1x { line-height: inherit; } .@{fa-css-prefix}-stack-2x { font-size: 2em; } .@{fa-css-prefix}-inverse { color: @fa-inverse; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/stacked.less
Less
unknown
476
// Variables // -------------------------- @fa-font-path: "../fonts"; @fa-font-size-base: 14px; @fa-line-height-base: 1; //@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts"; // for referencing Bootstrap CDN font files directly @fa-css-prefix: fa; @fa-version: "4.7.0"; @fa-border-color: #eee; @fa-inverse: #fff; @fa-li-width: (30em / 14); @fa-var-500px: "\f26e"; @fa-var-address-book: "\f2b9"; @fa-var-address-book-o: "\f2ba"; @fa-var-address-card: "\f2bb"; @fa-var-address-card-o: "\f2bc"; @fa-var-adjust: "\f042"; @fa-var-adn: "\f170"; @fa-var-align-center: "\f037"; @fa-var-align-justify: "\f039"; @fa-var-align-left: "\f036"; @fa-var-align-right: "\f038"; @fa-var-amazon: "\f270"; @fa-var-ambulance: "\f0f9"; @fa-var-american-sign-language-interpreting: "\f2a3"; @fa-var-anchor: "\f13d"; @fa-var-android: "\f17b"; @fa-var-angellist: "\f209"; @fa-var-angle-double-down: "\f103"; @fa-var-angle-double-left: "\f100"; @fa-var-angle-double-right: "\f101"; @fa-var-angle-double-up: "\f102"; @fa-var-angle-down: "\f107"; @fa-var-angle-left: "\f104"; @fa-var-angle-right: "\f105"; @fa-var-angle-up: "\f106"; @fa-var-apple: "\f179"; @fa-var-archive: "\f187"; @fa-var-area-chart: "\f1fe"; @fa-var-arrow-circle-down: "\f0ab"; @fa-var-arrow-circle-left: "\f0a8"; @fa-var-arrow-circle-o-down: "\f01a"; @fa-var-arrow-circle-o-left: "\f190"; @fa-var-arrow-circle-o-right: "\f18e"; @fa-var-arrow-circle-o-up: "\f01b"; @fa-var-arrow-circle-right: "\f0a9"; @fa-var-arrow-circle-up: "\f0aa"; @fa-var-arrow-down: "\f063"; @fa-var-arrow-left: "\f060"; @fa-var-arrow-right: "\f061"; @fa-var-arrow-up: "\f062"; @fa-var-arrows: "\f047"; @fa-var-arrows-alt: "\f0b2"; @fa-var-arrows-h: "\f07e"; @fa-var-arrows-v: "\f07d"; @fa-var-asl-interpreting: "\f2a3"; @fa-var-assistive-listening-systems: "\f2a2"; @fa-var-asterisk: "\f069"; @fa-var-at: "\f1fa"; @fa-var-audio-description: "\f29e"; @fa-var-automobile: "\f1b9"; @fa-var-backward: "\f04a"; @fa-var-balance-scale: "\f24e"; @fa-var-ban: "\f05e"; @fa-var-bandcamp: "\f2d5"; @fa-var-bank: "\f19c"; @fa-var-bar-chart: "\f080"; @fa-var-bar-chart-o: "\f080"; @fa-var-barcode: "\f02a"; @fa-var-bars: "\f0c9"; @fa-var-bath: "\f2cd"; @fa-var-bathtub: "\f2cd"; @fa-var-battery: "\f240"; @fa-var-battery-0: "\f244"; @fa-var-battery-1: "\f243"; @fa-var-battery-2: "\f242"; @fa-var-battery-3: "\f241"; @fa-var-battery-4: "\f240"; @fa-var-battery-empty: "\f244"; @fa-var-battery-full: "\f240"; @fa-var-battery-half: "\f242"; @fa-var-battery-quarter: "\f243"; @fa-var-battery-three-quarters: "\f241"; @fa-var-bed: "\f236"; @fa-var-beer: "\f0fc"; @fa-var-behance: "\f1b4"; @fa-var-behance-square: "\f1b5"; @fa-var-bell: "\f0f3"; @fa-var-bell-o: "\f0a2"; @fa-var-bell-slash: "\f1f6"; @fa-var-bell-slash-o: "\f1f7"; @fa-var-bicycle: "\f206"; @fa-var-binoculars: "\f1e5"; @fa-var-birthday-cake: "\f1fd"; @fa-var-bitbucket: "\f171"; @fa-var-bitbucket-square: "\f172"; @fa-var-bitcoin: "\f15a"; @fa-var-black-tie: "\f27e"; @fa-var-blind: "\f29d"; @fa-var-bluetooth: "\f293"; @fa-var-bluetooth-b: "\f294"; @fa-var-bold: "\f032"; @fa-var-bolt: "\f0e7"; @fa-var-bomb: "\f1e2"; @fa-var-book: "\f02d"; @fa-var-bookmark: "\f02e"; @fa-var-bookmark-o: "\f097"; @fa-var-braille: "\f2a1"; @fa-var-briefcase: "\f0b1"; @fa-var-btc: "\f15a"; @fa-var-bug: "\f188"; @fa-var-building: "\f1ad"; @fa-var-building-o: "\f0f7"; @fa-var-bullhorn: "\f0a1"; @fa-var-bullseye: "\f140"; @fa-var-bus: "\f207"; @fa-var-buysellads: "\f20d"; @fa-var-cab: "\f1ba"; @fa-var-calculator: "\f1ec"; @fa-var-calendar: "\f073"; @fa-var-calendar-check-o: "\f274"; @fa-var-calendar-minus-o: "\f272"; @fa-var-calendar-o: "\f133"; @fa-var-calendar-plus-o: "\f271"; @fa-var-calendar-times-o: "\f273"; @fa-var-camera: "\f030"; @fa-var-camera-retro: "\f083"; @fa-var-car: "\f1b9"; @fa-var-caret-down: "\f0d7"; @fa-var-caret-left: "\f0d9"; @fa-var-caret-right: "\f0da"; @fa-var-caret-square-o-down: "\f150"; @fa-var-caret-square-o-left: "\f191"; @fa-var-caret-square-o-right: "\f152"; @fa-var-caret-square-o-up: "\f151"; @fa-var-caret-up: "\f0d8"; @fa-var-cart-arrow-down: "\f218"; @fa-var-cart-plus: "\f217"; @fa-var-cc: "\f20a"; @fa-var-cc-amex: "\f1f3"; @fa-var-cc-diners-club: "\f24c"; @fa-var-cc-discover: "\f1f2"; @fa-var-cc-jcb: "\f24b"; @fa-var-cc-mastercard: "\f1f1"; @fa-var-cc-paypal: "\f1f4"; @fa-var-cc-stripe: "\f1f5"; @fa-var-cc-visa: "\f1f0"; @fa-var-certificate: "\f0a3"; @fa-var-chain: "\f0c1"; @fa-var-chain-broken: "\f127"; @fa-var-check: "\f00c"; @fa-var-check-circle: "\f058"; @fa-var-check-circle-o: "\f05d"; @fa-var-check-square: "\f14a"; @fa-var-check-square-o: "\f046"; @fa-var-chevron-circle-down: "\f13a"; @fa-var-chevron-circle-left: "\f137"; @fa-var-chevron-circle-right: "\f138"; @fa-var-chevron-circle-up: "\f139"; @fa-var-chevron-down: "\f078"; @fa-var-chevron-left: "\f053"; @fa-var-chevron-right: "\f054"; @fa-var-chevron-up: "\f077"; @fa-var-child: "\f1ae"; @fa-var-chrome: "\f268"; @fa-var-circle: "\f111"; @fa-var-circle-o: "\f10c"; @fa-var-circle-o-notch: "\f1ce"; @fa-var-circle-thin: "\f1db"; @fa-var-clipboard: "\f0ea"; @fa-var-clock-o: "\f017"; @fa-var-clone: "\f24d"; @fa-var-close: "\f00d"; @fa-var-cloud: "\f0c2"; @fa-var-cloud-download: "\f0ed"; @fa-var-cloud-upload: "\f0ee"; @fa-var-cny: "\f157"; @fa-var-code: "\f121"; @fa-var-code-fork: "\f126"; @fa-var-codepen: "\f1cb"; @fa-var-codiepie: "\f284"; @fa-var-coffee: "\f0f4"; @fa-var-cog: "\f013"; @fa-var-cogs: "\f085"; @fa-var-columns: "\f0db"; @fa-var-comment: "\f075"; @fa-var-comment-o: "\f0e5"; @fa-var-commenting: "\f27a"; @fa-var-commenting-o: "\f27b"; @fa-var-comments: "\f086"; @fa-var-comments-o: "\f0e6"; @fa-var-compass: "\f14e"; @fa-var-compress: "\f066"; @fa-var-connectdevelop: "\f20e"; @fa-var-contao: "\f26d"; @fa-var-copy: "\f0c5"; @fa-var-copyright: "\f1f9"; @fa-var-creative-commons: "\f25e"; @fa-var-credit-card: "\f09d"; @fa-var-credit-card-alt: "\f283"; @fa-var-crop: "\f125"; @fa-var-crosshairs: "\f05b"; @fa-var-css3: "\f13c"; @fa-var-cube: "\f1b2"; @fa-var-cubes: "\f1b3"; @fa-var-cut: "\f0c4"; @fa-var-cutlery: "\f0f5"; @fa-var-dashboard: "\f0e4"; @fa-var-dashcube: "\f210"; @fa-var-database: "\f1c0"; @fa-var-deaf: "\f2a4"; @fa-var-deafness: "\f2a4"; @fa-var-dedent: "\f03b"; @fa-var-delicious: "\f1a5"; @fa-var-desktop: "\f108"; @fa-var-deviantart: "\f1bd"; @fa-var-diamond: "\f219"; @fa-var-digg: "\f1a6"; @fa-var-dollar: "\f155"; @fa-var-dot-circle-o: "\f192"; @fa-var-download: "\f019"; @fa-var-dribbble: "\f17d"; @fa-var-drivers-license: "\f2c2"; @fa-var-drivers-license-o: "\f2c3"; @fa-var-dropbox: "\f16b"; @fa-var-drupal: "\f1a9"; @fa-var-edge: "\f282"; @fa-var-edit: "\f044"; @fa-var-eercast: "\f2da"; @fa-var-eject: "\f052"; @fa-var-ellipsis-h: "\f141"; @fa-var-ellipsis-v: "\f142"; @fa-var-empire: "\f1d1"; @fa-var-envelope: "\f0e0"; @fa-var-envelope-o: "\f003"; @fa-var-envelope-open: "\f2b6"; @fa-var-envelope-open-o: "\f2b7"; @fa-var-envelope-square: "\f199"; @fa-var-envira: "\f299"; @fa-var-eraser: "\f12d"; @fa-var-etsy: "\f2d7"; @fa-var-eur: "\f153"; @fa-var-euro: "\f153"; @fa-var-exchange: "\f0ec"; @fa-var-exclamation: "\f12a"; @fa-var-exclamation-circle: "\f06a"; @fa-var-exclamation-triangle: "\f071"; @fa-var-expand: "\f065"; @fa-var-expeditedssl: "\f23e"; @fa-var-external-link: "\f08e"; @fa-var-external-link-square: "\f14c"; @fa-var-eye: "\f06e"; @fa-var-eye-slash: "\f070"; @fa-var-eyedropper: "\f1fb"; @fa-var-fa: "\f2b4"; @fa-var-facebook: "\f09a"; @fa-var-facebook-f: "\f09a"; @fa-var-facebook-official: "\f230"; @fa-var-facebook-square: "\f082"; @fa-var-fast-backward: "\f049"; @fa-var-fast-forward: "\f050"; @fa-var-fax: "\f1ac"; @fa-var-feed: "\f09e"; @fa-var-female: "\f182"; @fa-var-fighter-jet: "\f0fb"; @fa-var-file: "\f15b"; @fa-var-file-archive-o: "\f1c6"; @fa-var-file-audio-o: "\f1c7"; @fa-var-file-code-o: "\f1c9"; @fa-var-file-excel-o: "\f1c3"; @fa-var-file-image-o: "\f1c5"; @fa-var-file-movie-o: "\f1c8"; @fa-var-file-o: "\f016"; @fa-var-file-pdf-o: "\f1c1"; @fa-var-file-photo-o: "\f1c5"; @fa-var-file-picture-o: "\f1c5"; @fa-var-file-powerpoint-o: "\f1c4"; @fa-var-file-sound-o: "\f1c7"; @fa-var-file-text: "\f15c"; @fa-var-file-text-o: "\f0f6"; @fa-var-file-video-o: "\f1c8"; @fa-var-file-word-o: "\f1c2"; @fa-var-file-zip-o: "\f1c6"; @fa-var-files-o: "\f0c5"; @fa-var-film: "\f008"; @fa-var-filter: "\f0b0"; @fa-var-fire: "\f06d"; @fa-var-fire-extinguisher: "\f134"; @fa-var-firefox: "\f269"; @fa-var-first-order: "\f2b0"; @fa-var-flag: "\f024"; @fa-var-flag-checkered: "\f11e"; @fa-var-flag-o: "\f11d"; @fa-var-flash: "\f0e7"; @fa-var-flask: "\f0c3"; @fa-var-flickr: "\f16e"; @fa-var-floppy-o: "\f0c7"; @fa-var-folder: "\f07b"; @fa-var-folder-o: "\f114"; @fa-var-folder-open: "\f07c"; @fa-var-folder-open-o: "\f115"; @fa-var-font: "\f031"; @fa-var-font-awesome: "\f2b4"; @fa-var-fonticons: "\f280"; @fa-var-fort-awesome: "\f286"; @fa-var-forumbee: "\f211"; @fa-var-forward: "\f04e"; @fa-var-foursquare: "\f180"; @fa-var-free-code-camp: "\f2c5"; @fa-var-frown-o: "\f119"; @fa-var-futbol-o: "\f1e3"; @fa-var-gamepad: "\f11b"; @fa-var-gavel: "\f0e3"; @fa-var-gbp: "\f154"; @fa-var-ge: "\f1d1"; @fa-var-gear: "\f013"; @fa-var-gears: "\f085"; @fa-var-genderless: "\f22d"; @fa-var-get-pocket: "\f265"; @fa-var-gg: "\f260"; @fa-var-gg-circle: "\f261"; @fa-var-gift: "\f06b"; @fa-var-git: "\f1d3"; @fa-var-git-square: "\f1d2"; @fa-var-github: "\f09b"; @fa-var-github-alt: "\f113"; @fa-var-github-square: "\f092"; @fa-var-gitlab: "\f296"; @fa-var-gittip: "\f184"; @fa-var-glass: "\f000"; @fa-var-glide: "\f2a5"; @fa-var-glide-g: "\f2a6"; @fa-var-globe: "\f0ac"; @fa-var-google: "\f1a0"; @fa-var-google-plus: "\f0d5"; @fa-var-google-plus-circle: "\f2b3"; @fa-var-google-plus-official: "\f2b3"; @fa-var-google-plus-square: "\f0d4"; @fa-var-google-wallet: "\f1ee"; @fa-var-graduation-cap: "\f19d"; @fa-var-gratipay: "\f184"; @fa-var-grav: "\f2d6"; @fa-var-group: "\f0c0"; @fa-var-h-square: "\f0fd"; @fa-var-hacker-news: "\f1d4"; @fa-var-hand-grab-o: "\f255"; @fa-var-hand-lizard-o: "\f258"; @fa-var-hand-o-down: "\f0a7"; @fa-var-hand-o-left: "\f0a5"; @fa-var-hand-o-right: "\f0a4"; @fa-var-hand-o-up: "\f0a6"; @fa-var-hand-paper-o: "\f256"; @fa-var-hand-peace-o: "\f25b"; @fa-var-hand-pointer-o: "\f25a"; @fa-var-hand-rock-o: "\f255"; @fa-var-hand-scissors-o: "\f257"; @fa-var-hand-spock-o: "\f259"; @fa-var-hand-stop-o: "\f256"; @fa-var-handshake-o: "\f2b5"; @fa-var-hard-of-hearing: "\f2a4"; @fa-var-hashtag: "\f292"; @fa-var-hdd-o: "\f0a0"; @fa-var-header: "\f1dc"; @fa-var-headphones: "\f025"; @fa-var-heart: "\f004"; @fa-var-heart-o: "\f08a"; @fa-var-heartbeat: "\f21e"; @fa-var-history: "\f1da"; @fa-var-home: "\f015"; @fa-var-hospital-o: "\f0f8"; @fa-var-hotel: "\f236"; @fa-var-hourglass: "\f254"; @fa-var-hourglass-1: "\f251"; @fa-var-hourglass-2: "\f252"; @fa-var-hourglass-3: "\f253"; @fa-var-hourglass-end: "\f253"; @fa-var-hourglass-half: "\f252"; @fa-var-hourglass-o: "\f250"; @fa-var-hourglass-start: "\f251"; @fa-var-houzz: "\f27c"; @fa-var-html5: "\f13b"; @fa-var-i-cursor: "\f246"; @fa-var-id-badge: "\f2c1"; @fa-var-id-card: "\f2c2"; @fa-var-id-card-o: "\f2c3"; @fa-var-ils: "\f20b"; @fa-var-image: "\f03e"; @fa-var-imdb: "\f2d8"; @fa-var-inbox: "\f01c"; @fa-var-indent: "\f03c"; @fa-var-industry: "\f275"; @fa-var-info: "\f129"; @fa-var-info-circle: "\f05a"; @fa-var-inr: "\f156"; @fa-var-instagram: "\f16d"; @fa-var-institution: "\f19c"; @fa-var-internet-explorer: "\f26b"; @fa-var-intersex: "\f224"; @fa-var-ioxhost: "\f208"; @fa-var-italic: "\f033"; @fa-var-joomla: "\f1aa"; @fa-var-jpy: "\f157"; @fa-var-jsfiddle: "\f1cc"; @fa-var-key: "\f084"; @fa-var-keyboard-o: "\f11c"; @fa-var-krw: "\f159"; @fa-var-language: "\f1ab"; @fa-var-laptop: "\f109"; @fa-var-lastfm: "\f202"; @fa-var-lastfm-square: "\f203"; @fa-var-leaf: "\f06c"; @fa-var-leanpub: "\f212"; @fa-var-legal: "\f0e3"; @fa-var-lemon-o: "\f094"; @fa-var-level-down: "\f149"; @fa-var-level-up: "\f148"; @fa-var-life-bouy: "\f1cd"; @fa-var-life-buoy: "\f1cd"; @fa-var-life-ring: "\f1cd"; @fa-var-life-saver: "\f1cd"; @fa-var-lightbulb-o: "\f0eb"; @fa-var-line-chart: "\f201"; @fa-var-link: "\f0c1"; @fa-var-linkedin: "\f0e1"; @fa-var-linkedin-square: "\f08c"; @fa-var-linode: "\f2b8"; @fa-var-linux: "\f17c"; @fa-var-list: "\f03a"; @fa-var-list-alt: "\f022"; @fa-var-list-ol: "\f0cb"; @fa-var-list-ul: "\f0ca"; @fa-var-location-arrow: "\f124"; @fa-var-lock: "\f023"; @fa-var-long-arrow-down: "\f175"; @fa-var-long-arrow-left: "\f177"; @fa-var-long-arrow-right: "\f178"; @fa-var-long-arrow-up: "\f176"; @fa-var-low-vision: "\f2a8"; @fa-var-magic: "\f0d0"; @fa-var-magnet: "\f076"; @fa-var-mail-forward: "\f064"; @fa-var-mail-reply: "\f112"; @fa-var-mail-reply-all: "\f122"; @fa-var-male: "\f183"; @fa-var-map: "\f279"; @fa-var-map-marker: "\f041"; @fa-var-map-o: "\f278"; @fa-var-map-pin: "\f276"; @fa-var-map-signs: "\f277"; @fa-var-mars: "\f222"; @fa-var-mars-double: "\f227"; @fa-var-mars-stroke: "\f229"; @fa-var-mars-stroke-h: "\f22b"; @fa-var-mars-stroke-v: "\f22a"; @fa-var-maxcdn: "\f136"; @fa-var-meanpath: "\f20c"; @fa-var-medium: "\f23a"; @fa-var-medkit: "\f0fa"; @fa-var-meetup: "\f2e0"; @fa-var-meh-o: "\f11a"; @fa-var-mercury: "\f223"; @fa-var-microchip: "\f2db"; @fa-var-microphone: "\f130"; @fa-var-microphone-slash: "\f131"; @fa-var-minus: "\f068"; @fa-var-minus-circle: "\f056"; @fa-var-minus-square: "\f146"; @fa-var-minus-square-o: "\f147"; @fa-var-mixcloud: "\f289"; @fa-var-mobile: "\f10b"; @fa-var-mobile-phone: "\f10b"; @fa-var-modx: "\f285"; @fa-var-money: "\f0d6"; @fa-var-moon-o: "\f186"; @fa-var-mortar-board: "\f19d"; @fa-var-motorcycle: "\f21c"; @fa-var-mouse-pointer: "\f245"; @fa-var-music: "\f001"; @fa-var-navicon: "\f0c9"; @fa-var-neuter: "\f22c"; @fa-var-newspaper-o: "\f1ea"; @fa-var-object-group: "\f247"; @fa-var-object-ungroup: "\f248"; @fa-var-odnoklassniki: "\f263"; @fa-var-odnoklassniki-square: "\f264"; @fa-var-opencart: "\f23d"; @fa-var-openid: "\f19b"; @fa-var-opera: "\f26a"; @fa-var-optin-monster: "\f23c"; @fa-var-outdent: "\f03b"; @fa-var-pagelines: "\f18c"; @fa-var-paint-brush: "\f1fc"; @fa-var-paper-plane: "\f1d8"; @fa-var-paper-plane-o: "\f1d9"; @fa-var-paperclip: "\f0c6"; @fa-var-paragraph: "\f1dd"; @fa-var-paste: "\f0ea"; @fa-var-pause: "\f04c"; @fa-var-pause-circle: "\f28b"; @fa-var-pause-circle-o: "\f28c"; @fa-var-paw: "\f1b0"; @fa-var-paypal: "\f1ed"; @fa-var-pencil: "\f040"; @fa-var-pencil-square: "\f14b"; @fa-var-pencil-square-o: "\f044"; @fa-var-percent: "\f295"; @fa-var-phone: "\f095"; @fa-var-phone-square: "\f098"; @fa-var-photo: "\f03e"; @fa-var-picture-o: "\f03e"; @fa-var-pie-chart: "\f200"; @fa-var-pied-piper: "\f2ae"; @fa-var-pied-piper-alt: "\f1a8"; @fa-var-pied-piper-pp: "\f1a7"; @fa-var-pinterest: "\f0d2"; @fa-var-pinterest-p: "\f231"; @fa-var-pinterest-square: "\f0d3"; @fa-var-plane: "\f072"; @fa-var-play: "\f04b"; @fa-var-play-circle: "\f144"; @fa-var-play-circle-o: "\f01d"; @fa-var-plug: "\f1e6"; @fa-var-plus: "\f067"; @fa-var-plus-circle: "\f055"; @fa-var-plus-square: "\f0fe"; @fa-var-plus-square-o: "\f196"; @fa-var-podcast: "\f2ce"; @fa-var-power-off: "\f011"; @fa-var-print: "\f02f"; @fa-var-product-hunt: "\f288"; @fa-var-puzzle-piece: "\f12e"; @fa-var-qq: "\f1d6"; @fa-var-qrcode: "\f029"; @fa-var-question: "\f128"; @fa-var-question-circle: "\f059"; @fa-var-question-circle-o: "\f29c"; @fa-var-quora: "\f2c4"; @fa-var-quote-left: "\f10d"; @fa-var-quote-right: "\f10e"; @fa-var-ra: "\f1d0"; @fa-var-random: "\f074"; @fa-var-ravelry: "\f2d9"; @fa-var-rebel: "\f1d0"; @fa-var-recycle: "\f1b8"; @fa-var-reddit: "\f1a1"; @fa-var-reddit-alien: "\f281"; @fa-var-reddit-square: "\f1a2"; @fa-var-refresh: "\f021"; @fa-var-registered: "\f25d"; @fa-var-remove: "\f00d"; @fa-var-renren: "\f18b"; @fa-var-reorder: "\f0c9"; @fa-var-repeat: "\f01e"; @fa-var-reply: "\f112"; @fa-var-reply-all: "\f122"; @fa-var-resistance: "\f1d0"; @fa-var-retweet: "\f079"; @fa-var-rmb: "\f157"; @fa-var-road: "\f018"; @fa-var-rocket: "\f135"; @fa-var-rotate-left: "\f0e2"; @fa-var-rotate-right: "\f01e"; @fa-var-rouble: "\f158"; @fa-var-rss: "\f09e"; @fa-var-rss-square: "\f143"; @fa-var-rub: "\f158"; @fa-var-ruble: "\f158"; @fa-var-rupee: "\f156"; @fa-var-s15: "\f2cd"; @fa-var-safari: "\f267"; @fa-var-save: "\f0c7"; @fa-var-scissors: "\f0c4"; @fa-var-scribd: "\f28a"; @fa-var-search: "\f002"; @fa-var-search-minus: "\f010"; @fa-var-search-plus: "\f00e"; @fa-var-sellsy: "\f213"; @fa-var-send: "\f1d8"; @fa-var-send-o: "\f1d9"; @fa-var-server: "\f233"; @fa-var-share: "\f064"; @fa-var-share-alt: "\f1e0"; @fa-var-share-alt-square: "\f1e1"; @fa-var-share-square: "\f14d"; @fa-var-share-square-o: "\f045"; @fa-var-shekel: "\f20b"; @fa-var-sheqel: "\f20b"; @fa-var-shield: "\f132"; @fa-var-ship: "\f21a"; @fa-var-shirtsinbulk: "\f214"; @fa-var-shopping-bag: "\f290"; @fa-var-shopping-basket: "\f291"; @fa-var-shopping-cart: "\f07a"; @fa-var-shower: "\f2cc"; @fa-var-sign-in: "\f090"; @fa-var-sign-language: "\f2a7"; @fa-var-sign-out: "\f08b"; @fa-var-signal: "\f012"; @fa-var-signing: "\f2a7"; @fa-var-simplybuilt: "\f215"; @fa-var-sitemap: "\f0e8"; @fa-var-skyatlas: "\f216"; @fa-var-skype: "\f17e"; @fa-var-slack: "\f198"; @fa-var-sliders: "\f1de"; @fa-var-slideshare: "\f1e7"; @fa-var-smile-o: "\f118"; @fa-var-snapchat: "\f2ab"; @fa-var-snapchat-ghost: "\f2ac"; @fa-var-snapchat-square: "\f2ad"; @fa-var-snowflake-o: "\f2dc"; @fa-var-soccer-ball-o: "\f1e3"; @fa-var-sort: "\f0dc"; @fa-var-sort-alpha-asc: "\f15d"; @fa-var-sort-alpha-desc: "\f15e"; @fa-var-sort-amount-asc: "\f160"; @fa-var-sort-amount-desc: "\f161"; @fa-var-sort-asc: "\f0de"; @fa-var-sort-desc: "\f0dd"; @fa-var-sort-down: "\f0dd"; @fa-var-sort-numeric-asc: "\f162"; @fa-var-sort-numeric-desc: "\f163"; @fa-var-sort-up: "\f0de"; @fa-var-soundcloud: "\f1be"; @fa-var-space-shuttle: "\f197"; @fa-var-spinner: "\f110"; @fa-var-spoon: "\f1b1"; @fa-var-spotify: "\f1bc"; @fa-var-square: "\f0c8"; @fa-var-square-o: "\f096"; @fa-var-stack-exchange: "\f18d"; @fa-var-stack-overflow: "\f16c"; @fa-var-star: "\f005"; @fa-var-star-half: "\f089"; @fa-var-star-half-empty: "\f123"; @fa-var-star-half-full: "\f123"; @fa-var-star-half-o: "\f123"; @fa-var-star-o: "\f006"; @fa-var-steam: "\f1b6"; @fa-var-steam-square: "\f1b7"; @fa-var-step-backward: "\f048"; @fa-var-step-forward: "\f051"; @fa-var-stethoscope: "\f0f1"; @fa-var-sticky-note: "\f249"; @fa-var-sticky-note-o: "\f24a"; @fa-var-stop: "\f04d"; @fa-var-stop-circle: "\f28d"; @fa-var-stop-circle-o: "\f28e"; @fa-var-street-view: "\f21d"; @fa-var-strikethrough: "\f0cc"; @fa-var-stumbleupon: "\f1a4"; @fa-var-stumbleupon-circle: "\f1a3"; @fa-var-subscript: "\f12c"; @fa-var-subway: "\f239"; @fa-var-suitcase: "\f0f2"; @fa-var-sun-o: "\f185"; @fa-var-superpowers: "\f2dd"; @fa-var-superscript: "\f12b"; @fa-var-support: "\f1cd"; @fa-var-table: "\f0ce"; @fa-var-tablet: "\f10a"; @fa-var-tachometer: "\f0e4"; @fa-var-tag: "\f02b"; @fa-var-tags: "\f02c"; @fa-var-tasks: "\f0ae"; @fa-var-taxi: "\f1ba"; @fa-var-telegram: "\f2c6"; @fa-var-television: "\f26c"; @fa-var-tencent-weibo: "\f1d5"; @fa-var-terminal: "\f120"; @fa-var-text-height: "\f034"; @fa-var-text-width: "\f035"; @fa-var-th: "\f00a"; @fa-var-th-large: "\f009"; @fa-var-th-list: "\f00b"; @fa-var-themeisle: "\f2b2"; @fa-var-thermometer: "\f2c7"; @fa-var-thermometer-0: "\f2cb"; @fa-var-thermometer-1: "\f2ca"; @fa-var-thermometer-2: "\f2c9"; @fa-var-thermometer-3: "\f2c8"; @fa-var-thermometer-4: "\f2c7"; @fa-var-thermometer-empty: "\f2cb"; @fa-var-thermometer-full: "\f2c7"; @fa-var-thermometer-half: "\f2c9"; @fa-var-thermometer-quarter: "\f2ca"; @fa-var-thermometer-three-quarters: "\f2c8"; @fa-var-thumb-tack: "\f08d"; @fa-var-thumbs-down: "\f165"; @fa-var-thumbs-o-down: "\f088"; @fa-var-thumbs-o-up: "\f087"; @fa-var-thumbs-up: "\f164"; @fa-var-ticket: "\f145"; @fa-var-times: "\f00d"; @fa-var-times-circle: "\f057"; @fa-var-times-circle-o: "\f05c"; @fa-var-times-rectangle: "\f2d3"; @fa-var-times-rectangle-o: "\f2d4"; @fa-var-tint: "\f043"; @fa-var-toggle-down: "\f150"; @fa-var-toggle-left: "\f191"; @fa-var-toggle-off: "\f204"; @fa-var-toggle-on: "\f205"; @fa-var-toggle-right: "\f152"; @fa-var-toggle-up: "\f151"; @fa-var-trademark: "\f25c"; @fa-var-train: "\f238"; @fa-var-transgender: "\f224"; @fa-var-transgender-alt: "\f225"; @fa-var-trash: "\f1f8"; @fa-var-trash-o: "\f014"; @fa-var-tree: "\f1bb"; @fa-var-trello: "\f181"; @fa-var-tripadvisor: "\f262"; @fa-var-trophy: "\f091"; @fa-var-truck: "\f0d1"; @fa-var-try: "\f195"; @fa-var-tty: "\f1e4"; @fa-var-tumblr: "\f173"; @fa-var-tumblr-square: "\f174"; @fa-var-turkish-lira: "\f195"; @fa-var-tv: "\f26c"; @fa-var-twitch: "\f1e8"; @fa-var-twitter: "\f099"; @fa-var-twitter-square: "\f081"; @fa-var-umbrella: "\f0e9"; @fa-var-underline: "\f0cd"; @fa-var-undo: "\f0e2"; @fa-var-universal-access: "\f29a"; @fa-var-university: "\f19c"; @fa-var-unlink: "\f127"; @fa-var-unlock: "\f09c"; @fa-var-unlock-alt: "\f13e"; @fa-var-unsorted: "\f0dc"; @fa-var-upload: "\f093"; @fa-var-usb: "\f287"; @fa-var-usd: "\f155"; @fa-var-user: "\f007"; @fa-var-user-circle: "\f2bd"; @fa-var-user-circle-o: "\f2be"; @fa-var-user-md: "\f0f0"; @fa-var-user-o: "\f2c0"; @fa-var-user-plus: "\f234"; @fa-var-user-secret: "\f21b"; @fa-var-user-times: "\f235"; @fa-var-users: "\f0c0"; @fa-var-vcard: "\f2bb"; @fa-var-vcard-o: "\f2bc"; @fa-var-venus: "\f221"; @fa-var-venus-double: "\f226"; @fa-var-venus-mars: "\f228"; @fa-var-viacoin: "\f237"; @fa-var-viadeo: "\f2a9"; @fa-var-viadeo-square: "\f2aa"; @fa-var-video-camera: "\f03d"; @fa-var-vimeo: "\f27d"; @fa-var-vimeo-square: "\f194"; @fa-var-vine: "\f1ca"; @fa-var-vk: "\f189"; @fa-var-volume-control-phone: "\f2a0"; @fa-var-volume-down: "\f027"; @fa-var-volume-off: "\f026"; @fa-var-volume-up: "\f028"; @fa-var-warning: "\f071"; @fa-var-wechat: "\f1d7"; @fa-var-weibo: "\f18a"; @fa-var-weixin: "\f1d7"; @fa-var-whatsapp: "\f232"; @fa-var-wheelchair: "\f193"; @fa-var-wheelchair-alt: "\f29b"; @fa-var-wifi: "\f1eb"; @fa-var-wikipedia-w: "\f266"; @fa-var-window-close: "\f2d3"; @fa-var-window-close-o: "\f2d4"; @fa-var-window-maximize: "\f2d0"; @fa-var-window-minimize: "\f2d1"; @fa-var-window-restore: "\f2d2"; @fa-var-windows: "\f17a"; @fa-var-won: "\f159"; @fa-var-wordpress: "\f19a"; @fa-var-wpbeginner: "\f297"; @fa-var-wpexplorer: "\f2de"; @fa-var-wpforms: "\f298"; @fa-var-wrench: "\f0ad"; @fa-var-xing: "\f168"; @fa-var-xing-square: "\f169"; @fa-var-y-combinator: "\f23b"; @fa-var-y-combinator-square: "\f1d4"; @fa-var-yahoo: "\f19e"; @fa-var-yc: "\f23b"; @fa-var-yc-square: "\f1d4"; @fa-var-yelp: "\f1e9"; @fa-var-yen: "\f157"; @fa-var-yoast: "\f2b1"; @fa-var-youtube: "\f167"; @fa-var-youtube-play: "\f16a"; @fa-var-youtube-square: "\f166";
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/less/variables.less
Less
unknown
22,563
// Spinning Icons // -------------------------- .#{$fa-css-prefix}-spin { -webkit-animation: fa-spin 2s infinite linear; animation: fa-spin 2s infinite linear; } .#{$fa-css-prefix}-pulse { -webkit-animation: fa-spin 1s infinite steps(8); animation: fa-spin 1s infinite steps(8); } @-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } @keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_animated.scss
SCSS
unknown
715
// Bordered & Pulled // ------------------------- .#{$fa-css-prefix}-border { padding: .2em .25em .15em; border: solid .08em $fa-border-color; border-radius: .1em; } .#{$fa-css-prefix}-pull-left { float: left; } .#{$fa-css-prefix}-pull-right { float: right; } .#{$fa-css-prefix} { &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } } /* Deprecated as of 4.4.0 */ .pull-right { float: right; } .pull-left { float: left; } .#{$fa-css-prefix} { &.pull-left { margin-right: .3em; } &.pull-right { margin-left: .3em; } }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_bordered-pulled.scss
SCSS
unknown
592
// Base Class Definition // ------------------------- .#{$fa-css-prefix} { display: inline-block; font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration font-size: inherit; // can't have font-size inherit on line above, so need to override text-rendering: auto; // optimizelegibility throws things off #1094 -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_core.scss
SCSS
unknown
459
// Fixed Width Icons // ------------------------- .#{$fa-css-prefix}-fw { width: (18em / 14); text-align: center; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_fixed-width.scss
SCSS
unknown
120
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */ .#{$fa-css-prefix}-glass:before { content: $fa-var-glass; } .#{$fa-css-prefix}-music:before { content: $fa-var-music; } .#{$fa-css-prefix}-search:before { content: $fa-var-search; } .#{$fa-css-prefix}-envelope-o:before { content: $fa-var-envelope-o; } .#{$fa-css-prefix}-heart:before { content: $fa-var-heart; } .#{$fa-css-prefix}-star:before { content: $fa-var-star; } .#{$fa-css-prefix}-star-o:before { content: $fa-var-star-o; } .#{$fa-css-prefix}-user:before { content: $fa-var-user; } .#{$fa-css-prefix}-film:before { content: $fa-var-film; } .#{$fa-css-prefix}-th-large:before { content: $fa-var-th-large; } .#{$fa-css-prefix}-th:before { content: $fa-var-th; } .#{$fa-css-prefix}-th-list:before { content: $fa-var-th-list; } .#{$fa-css-prefix}-check:before { content: $fa-var-check; } .#{$fa-css-prefix}-remove:before, .#{$fa-css-prefix}-close:before, .#{$fa-css-prefix}-times:before { content: $fa-var-times; } .#{$fa-css-prefix}-search-plus:before { content: $fa-var-search-plus; } .#{$fa-css-prefix}-search-minus:before { content: $fa-var-search-minus; } .#{$fa-css-prefix}-power-off:before { content: $fa-var-power-off; } .#{$fa-css-prefix}-signal:before { content: $fa-var-signal; } .#{$fa-css-prefix}-gear:before, .#{$fa-css-prefix}-cog:before { content: $fa-var-cog; } .#{$fa-css-prefix}-trash-o:before { content: $fa-var-trash-o; } .#{$fa-css-prefix}-home:before { content: $fa-var-home; } .#{$fa-css-prefix}-file-o:before { content: $fa-var-file-o; } .#{$fa-css-prefix}-clock-o:before { content: $fa-var-clock-o; } .#{$fa-css-prefix}-road:before { content: $fa-var-road; } .#{$fa-css-prefix}-download:before { content: $fa-var-download; } .#{$fa-css-prefix}-arrow-circle-o-down:before { content: $fa-var-arrow-circle-o-down; } .#{$fa-css-prefix}-arrow-circle-o-up:before { content: $fa-var-arrow-circle-o-up; } .#{$fa-css-prefix}-inbox:before { content: $fa-var-inbox; } .#{$fa-css-prefix}-play-circle-o:before { content: $fa-var-play-circle-o; } .#{$fa-css-prefix}-rotate-right:before, .#{$fa-css-prefix}-repeat:before { content: $fa-var-repeat; } .#{$fa-css-prefix}-refresh:before { content: $fa-var-refresh; } .#{$fa-css-prefix}-list-alt:before { content: $fa-var-list-alt; } .#{$fa-css-prefix}-lock:before { content: $fa-var-lock; } .#{$fa-css-prefix}-flag:before { content: $fa-var-flag; } .#{$fa-css-prefix}-headphones:before { content: $fa-var-headphones; } .#{$fa-css-prefix}-volume-off:before { content: $fa-var-volume-off; } .#{$fa-css-prefix}-volume-down:before { content: $fa-var-volume-down; } .#{$fa-css-prefix}-volume-up:before { content: $fa-var-volume-up; } .#{$fa-css-prefix}-qrcode:before { content: $fa-var-qrcode; } .#{$fa-css-prefix}-barcode:before { content: $fa-var-barcode; } .#{$fa-css-prefix}-tag:before { content: $fa-var-tag; } .#{$fa-css-prefix}-tags:before { content: $fa-var-tags; } .#{$fa-css-prefix}-book:before { content: $fa-var-book; } .#{$fa-css-prefix}-bookmark:before { content: $fa-var-bookmark; } .#{$fa-css-prefix}-print:before { content: $fa-var-print; } .#{$fa-css-prefix}-camera:before { content: $fa-var-camera; } .#{$fa-css-prefix}-font:before { content: $fa-var-font; } .#{$fa-css-prefix}-bold:before { content: $fa-var-bold; } .#{$fa-css-prefix}-italic:before { content: $fa-var-italic; } .#{$fa-css-prefix}-text-height:before { content: $fa-var-text-height; } .#{$fa-css-prefix}-text-width:before { content: $fa-var-text-width; } .#{$fa-css-prefix}-align-left:before { content: $fa-var-align-left; } .#{$fa-css-prefix}-align-center:before { content: $fa-var-align-center; } .#{$fa-css-prefix}-align-right:before { content: $fa-var-align-right; } .#{$fa-css-prefix}-align-justify:before { content: $fa-var-align-justify; } .#{$fa-css-prefix}-list:before { content: $fa-var-list; } .#{$fa-css-prefix}-dedent:before, .#{$fa-css-prefix}-outdent:before { content: $fa-var-outdent; } .#{$fa-css-prefix}-indent:before { content: $fa-var-indent; } .#{$fa-css-prefix}-video-camera:before { content: $fa-var-video-camera; } .#{$fa-css-prefix}-photo:before, .#{$fa-css-prefix}-image:before, .#{$fa-css-prefix}-picture-o:before { content: $fa-var-picture-o; } .#{$fa-css-prefix}-pencil:before { content: $fa-var-pencil; } .#{$fa-css-prefix}-map-marker:before { content: $fa-var-map-marker; } .#{$fa-css-prefix}-adjust:before { content: $fa-var-adjust; } .#{$fa-css-prefix}-tint:before { content: $fa-var-tint; } .#{$fa-css-prefix}-edit:before, .#{$fa-css-prefix}-pencil-square-o:before { content: $fa-var-pencil-square-o; } .#{$fa-css-prefix}-share-square-o:before { content: $fa-var-share-square-o; } .#{$fa-css-prefix}-check-square-o:before { content: $fa-var-check-square-o; } .#{$fa-css-prefix}-arrows:before { content: $fa-var-arrows; } .#{$fa-css-prefix}-step-backward:before { content: $fa-var-step-backward; } .#{$fa-css-prefix}-fast-backward:before { content: $fa-var-fast-backward; } .#{$fa-css-prefix}-backward:before { content: $fa-var-backward; } .#{$fa-css-prefix}-play:before { content: $fa-var-play; } .#{$fa-css-prefix}-pause:before { content: $fa-var-pause; } .#{$fa-css-prefix}-stop:before { content: $fa-var-stop; } .#{$fa-css-prefix}-forward:before { content: $fa-var-forward; } .#{$fa-css-prefix}-fast-forward:before { content: $fa-var-fast-forward; } .#{$fa-css-prefix}-step-forward:before { content: $fa-var-step-forward; } .#{$fa-css-prefix}-eject:before { content: $fa-var-eject; } .#{$fa-css-prefix}-chevron-left:before { content: $fa-var-chevron-left; } .#{$fa-css-prefix}-chevron-right:before { content: $fa-var-chevron-right; } .#{$fa-css-prefix}-plus-circle:before { content: $fa-var-plus-circle; } .#{$fa-css-prefix}-minus-circle:before { content: $fa-var-minus-circle; } .#{$fa-css-prefix}-times-circle:before { content: $fa-var-times-circle; } .#{$fa-css-prefix}-check-circle:before { content: $fa-var-check-circle; } .#{$fa-css-prefix}-question-circle:before { content: $fa-var-question-circle; } .#{$fa-css-prefix}-info-circle:before { content: $fa-var-info-circle; } .#{$fa-css-prefix}-crosshairs:before { content: $fa-var-crosshairs; } .#{$fa-css-prefix}-times-circle-o:before { content: $fa-var-times-circle-o; } .#{$fa-css-prefix}-check-circle-o:before { content: $fa-var-check-circle-o; } .#{$fa-css-prefix}-ban:before { content: $fa-var-ban; } .#{$fa-css-prefix}-arrow-left:before { content: $fa-var-arrow-left; } .#{$fa-css-prefix}-arrow-right:before { content: $fa-var-arrow-right; } .#{$fa-css-prefix}-arrow-up:before { content: $fa-var-arrow-up; } .#{$fa-css-prefix}-arrow-down:before { content: $fa-var-arrow-down; } .#{$fa-css-prefix}-mail-forward:before, .#{$fa-css-prefix}-share:before { content: $fa-var-share; } .#{$fa-css-prefix}-expand:before { content: $fa-var-expand; } .#{$fa-css-prefix}-compress:before { content: $fa-var-compress; } .#{$fa-css-prefix}-plus:before { content: $fa-var-plus; } .#{$fa-css-prefix}-minus:before { content: $fa-var-minus; } .#{$fa-css-prefix}-asterisk:before { content: $fa-var-asterisk; } .#{$fa-css-prefix}-exclamation-circle:before { content: $fa-var-exclamation-circle; } .#{$fa-css-prefix}-gift:before { content: $fa-var-gift; } .#{$fa-css-prefix}-leaf:before { content: $fa-var-leaf; } .#{$fa-css-prefix}-fire:before { content: $fa-var-fire; } .#{$fa-css-prefix}-eye:before { content: $fa-var-eye; } .#{$fa-css-prefix}-eye-slash:before { content: $fa-var-eye-slash; } .#{$fa-css-prefix}-warning:before, .#{$fa-css-prefix}-exclamation-triangle:before { content: $fa-var-exclamation-triangle; } .#{$fa-css-prefix}-plane:before { content: $fa-var-plane; } .#{$fa-css-prefix}-calendar:before { content: $fa-var-calendar; } .#{$fa-css-prefix}-random:before { content: $fa-var-random; } .#{$fa-css-prefix}-comment:before { content: $fa-var-comment; } .#{$fa-css-prefix}-magnet:before { content: $fa-var-magnet; } .#{$fa-css-prefix}-chevron-up:before { content: $fa-var-chevron-up; } .#{$fa-css-prefix}-chevron-down:before { content: $fa-var-chevron-down; } .#{$fa-css-prefix}-retweet:before { content: $fa-var-retweet; } .#{$fa-css-prefix}-shopping-cart:before { content: $fa-var-shopping-cart; } .#{$fa-css-prefix}-folder:before { content: $fa-var-folder; } .#{$fa-css-prefix}-folder-open:before { content: $fa-var-folder-open; } .#{$fa-css-prefix}-arrows-v:before { content: $fa-var-arrows-v; } .#{$fa-css-prefix}-arrows-h:before { content: $fa-var-arrows-h; } .#{$fa-css-prefix}-bar-chart-o:before, .#{$fa-css-prefix}-bar-chart:before { content: $fa-var-bar-chart; } .#{$fa-css-prefix}-twitter-square:before { content: $fa-var-twitter-square; } .#{$fa-css-prefix}-facebook-square:before { content: $fa-var-facebook-square; } .#{$fa-css-prefix}-camera-retro:before { content: $fa-var-camera-retro; } .#{$fa-css-prefix}-key:before { content: $fa-var-key; } .#{$fa-css-prefix}-gears:before, .#{$fa-css-prefix}-cogs:before { content: $fa-var-cogs; } .#{$fa-css-prefix}-comments:before { content: $fa-var-comments; } .#{$fa-css-prefix}-thumbs-o-up:before { content: $fa-var-thumbs-o-up; } .#{$fa-css-prefix}-thumbs-o-down:before { content: $fa-var-thumbs-o-down; } .#{$fa-css-prefix}-star-half:before { content: $fa-var-star-half; } .#{$fa-css-prefix}-heart-o:before { content: $fa-var-heart-o; } .#{$fa-css-prefix}-sign-out:before { content: $fa-var-sign-out; } .#{$fa-css-prefix}-linkedin-square:before { content: $fa-var-linkedin-square; } .#{$fa-css-prefix}-thumb-tack:before { content: $fa-var-thumb-tack; } .#{$fa-css-prefix}-external-link:before { content: $fa-var-external-link; } .#{$fa-css-prefix}-sign-in:before { content: $fa-var-sign-in; } .#{$fa-css-prefix}-trophy:before { content: $fa-var-trophy; } .#{$fa-css-prefix}-github-square:before { content: $fa-var-github-square; } .#{$fa-css-prefix}-upload:before { content: $fa-var-upload; } .#{$fa-css-prefix}-lemon-o:before { content: $fa-var-lemon-o; } .#{$fa-css-prefix}-phone:before { content: $fa-var-phone; } .#{$fa-css-prefix}-square-o:before { content: $fa-var-square-o; } .#{$fa-css-prefix}-bookmark-o:before { content: $fa-var-bookmark-o; } .#{$fa-css-prefix}-phone-square:before { content: $fa-var-phone-square; } .#{$fa-css-prefix}-twitter:before { content: $fa-var-twitter; } .#{$fa-css-prefix}-facebook-f:before, .#{$fa-css-prefix}-facebook:before { content: $fa-var-facebook; } .#{$fa-css-prefix}-github:before { content: $fa-var-github; } .#{$fa-css-prefix}-unlock:before { content: $fa-var-unlock; } .#{$fa-css-prefix}-credit-card:before { content: $fa-var-credit-card; } .#{$fa-css-prefix}-feed:before, .#{$fa-css-prefix}-rss:before { content: $fa-var-rss; } .#{$fa-css-prefix}-hdd-o:before { content: $fa-var-hdd-o; } .#{$fa-css-prefix}-bullhorn:before { content: $fa-var-bullhorn; } .#{$fa-css-prefix}-bell:before { content: $fa-var-bell; } .#{$fa-css-prefix}-certificate:before { content: $fa-var-certificate; } .#{$fa-css-prefix}-hand-o-right:before { content: $fa-var-hand-o-right; } .#{$fa-css-prefix}-hand-o-left:before { content: $fa-var-hand-o-left; } .#{$fa-css-prefix}-hand-o-up:before { content: $fa-var-hand-o-up; } .#{$fa-css-prefix}-hand-o-down:before { content: $fa-var-hand-o-down; } .#{$fa-css-prefix}-arrow-circle-left:before { content: $fa-var-arrow-circle-left; } .#{$fa-css-prefix}-arrow-circle-right:before { content: $fa-var-arrow-circle-right; } .#{$fa-css-prefix}-arrow-circle-up:before { content: $fa-var-arrow-circle-up; } .#{$fa-css-prefix}-arrow-circle-down:before { content: $fa-var-arrow-circle-down; } .#{$fa-css-prefix}-globe:before { content: $fa-var-globe; } .#{$fa-css-prefix}-wrench:before { content: $fa-var-wrench; } .#{$fa-css-prefix}-tasks:before { content: $fa-var-tasks; } .#{$fa-css-prefix}-filter:before { content: $fa-var-filter; } .#{$fa-css-prefix}-briefcase:before { content: $fa-var-briefcase; } .#{$fa-css-prefix}-arrows-alt:before { content: $fa-var-arrows-alt; } .#{$fa-css-prefix}-group:before, .#{$fa-css-prefix}-users:before { content: $fa-var-users; } .#{$fa-css-prefix}-chain:before, .#{$fa-css-prefix}-link:before { content: $fa-var-link; } .#{$fa-css-prefix}-cloud:before { content: $fa-var-cloud; } .#{$fa-css-prefix}-flask:before { content: $fa-var-flask; } .#{$fa-css-prefix}-cut:before, .#{$fa-css-prefix}-scissors:before { content: $fa-var-scissors; } .#{$fa-css-prefix}-copy:before, .#{$fa-css-prefix}-files-o:before { content: $fa-var-files-o; } .#{$fa-css-prefix}-paperclip:before { content: $fa-var-paperclip; } .#{$fa-css-prefix}-save:before, .#{$fa-css-prefix}-floppy-o:before { content: $fa-var-floppy-o; } .#{$fa-css-prefix}-square:before { content: $fa-var-square; } .#{$fa-css-prefix}-navicon:before, .#{$fa-css-prefix}-reorder:before, .#{$fa-css-prefix}-bars:before { content: $fa-var-bars; } .#{$fa-css-prefix}-list-ul:before { content: $fa-var-list-ul; } .#{$fa-css-prefix}-list-ol:before { content: $fa-var-list-ol; } .#{$fa-css-prefix}-strikethrough:before { content: $fa-var-strikethrough; } .#{$fa-css-prefix}-underline:before { content: $fa-var-underline; } .#{$fa-css-prefix}-table:before { content: $fa-var-table; } .#{$fa-css-prefix}-magic:before { content: $fa-var-magic; } .#{$fa-css-prefix}-truck:before { content: $fa-var-truck; } .#{$fa-css-prefix}-pinterest:before { content: $fa-var-pinterest; } .#{$fa-css-prefix}-pinterest-square:before { content: $fa-var-pinterest-square; } .#{$fa-css-prefix}-google-plus-square:before { content: $fa-var-google-plus-square; } .#{$fa-css-prefix}-google-plus:before { content: $fa-var-google-plus; } .#{$fa-css-prefix}-money:before { content: $fa-var-money; } .#{$fa-css-prefix}-caret-down:before { content: $fa-var-caret-down; } .#{$fa-css-prefix}-caret-up:before { content: $fa-var-caret-up; } .#{$fa-css-prefix}-caret-left:before { content: $fa-var-caret-left; } .#{$fa-css-prefix}-caret-right:before { content: $fa-var-caret-right; } .#{$fa-css-prefix}-columns:before { content: $fa-var-columns; } .#{$fa-css-prefix}-unsorted:before, .#{$fa-css-prefix}-sort:before { content: $fa-var-sort; } .#{$fa-css-prefix}-sort-down:before, .#{$fa-css-prefix}-sort-desc:before { content: $fa-var-sort-desc; } .#{$fa-css-prefix}-sort-up:before, .#{$fa-css-prefix}-sort-asc:before { content: $fa-var-sort-asc; } .#{$fa-css-prefix}-envelope:before { content: $fa-var-envelope; } .#{$fa-css-prefix}-linkedin:before { content: $fa-var-linkedin; } .#{$fa-css-prefix}-rotate-left:before, .#{$fa-css-prefix}-undo:before { content: $fa-var-undo; } .#{$fa-css-prefix}-legal:before, .#{$fa-css-prefix}-gavel:before { content: $fa-var-gavel; } .#{$fa-css-prefix}-dashboard:before, .#{$fa-css-prefix}-tachometer:before { content: $fa-var-tachometer; } .#{$fa-css-prefix}-comment-o:before { content: $fa-var-comment-o; } .#{$fa-css-prefix}-comments-o:before { content: $fa-var-comments-o; } .#{$fa-css-prefix}-flash:before, .#{$fa-css-prefix}-bolt:before { content: $fa-var-bolt; } .#{$fa-css-prefix}-sitemap:before { content: $fa-var-sitemap; } .#{$fa-css-prefix}-umbrella:before { content: $fa-var-umbrella; } .#{$fa-css-prefix}-paste:before, .#{$fa-css-prefix}-clipboard:before { content: $fa-var-clipboard; } .#{$fa-css-prefix}-lightbulb-o:before { content: $fa-var-lightbulb-o; } .#{$fa-css-prefix}-exchange:before { content: $fa-var-exchange; } .#{$fa-css-prefix}-cloud-download:before { content: $fa-var-cloud-download; } .#{$fa-css-prefix}-cloud-upload:before { content: $fa-var-cloud-upload; } .#{$fa-css-prefix}-user-md:before { content: $fa-var-user-md; } .#{$fa-css-prefix}-stethoscope:before { content: $fa-var-stethoscope; } .#{$fa-css-prefix}-suitcase:before { content: $fa-var-suitcase; } .#{$fa-css-prefix}-bell-o:before { content: $fa-var-bell-o; } .#{$fa-css-prefix}-coffee:before { content: $fa-var-coffee; } .#{$fa-css-prefix}-cutlery:before { content: $fa-var-cutlery; } .#{$fa-css-prefix}-file-text-o:before { content: $fa-var-file-text-o; } .#{$fa-css-prefix}-building-o:before { content: $fa-var-building-o; } .#{$fa-css-prefix}-hospital-o:before { content: $fa-var-hospital-o; } .#{$fa-css-prefix}-ambulance:before { content: $fa-var-ambulance; } .#{$fa-css-prefix}-medkit:before { content: $fa-var-medkit; } .#{$fa-css-prefix}-fighter-jet:before { content: $fa-var-fighter-jet; } .#{$fa-css-prefix}-beer:before { content: $fa-var-beer; } .#{$fa-css-prefix}-h-square:before { content: $fa-var-h-square; } .#{$fa-css-prefix}-plus-square:before { content: $fa-var-plus-square; } .#{$fa-css-prefix}-angle-double-left:before { content: $fa-var-angle-double-left; } .#{$fa-css-prefix}-angle-double-right:before { content: $fa-var-angle-double-right; } .#{$fa-css-prefix}-angle-double-up:before { content: $fa-var-angle-double-up; } .#{$fa-css-prefix}-angle-double-down:before { content: $fa-var-angle-double-down; } .#{$fa-css-prefix}-angle-left:before { content: $fa-var-angle-left; } .#{$fa-css-prefix}-angle-right:before { content: $fa-var-angle-right; } .#{$fa-css-prefix}-angle-up:before { content: $fa-var-angle-up; } .#{$fa-css-prefix}-angle-down:before { content: $fa-var-angle-down; } .#{$fa-css-prefix}-desktop:before { content: $fa-var-desktop; } .#{$fa-css-prefix}-laptop:before { content: $fa-var-laptop; } .#{$fa-css-prefix}-tablet:before { content: $fa-var-tablet; } .#{$fa-css-prefix}-mobile-phone:before, .#{$fa-css-prefix}-mobile:before { content: $fa-var-mobile; } .#{$fa-css-prefix}-circle-o:before { content: $fa-var-circle-o; } .#{$fa-css-prefix}-quote-left:before { content: $fa-var-quote-left; } .#{$fa-css-prefix}-quote-right:before { content: $fa-var-quote-right; } .#{$fa-css-prefix}-spinner:before { content: $fa-var-spinner; } .#{$fa-css-prefix}-circle:before { content: $fa-var-circle; } .#{$fa-css-prefix}-mail-reply:before, .#{$fa-css-prefix}-reply:before { content: $fa-var-reply; } .#{$fa-css-prefix}-github-alt:before { content: $fa-var-github-alt; } .#{$fa-css-prefix}-folder-o:before { content: $fa-var-folder-o; } .#{$fa-css-prefix}-folder-open-o:before { content: $fa-var-folder-open-o; } .#{$fa-css-prefix}-smile-o:before { content: $fa-var-smile-o; } .#{$fa-css-prefix}-frown-o:before { content: $fa-var-frown-o; } .#{$fa-css-prefix}-meh-o:before { content: $fa-var-meh-o; } .#{$fa-css-prefix}-gamepad:before { content: $fa-var-gamepad; } .#{$fa-css-prefix}-keyboard-o:before { content: $fa-var-keyboard-o; } .#{$fa-css-prefix}-flag-o:before { content: $fa-var-flag-o; } .#{$fa-css-prefix}-flag-checkered:before { content: $fa-var-flag-checkered; } .#{$fa-css-prefix}-terminal:before { content: $fa-var-terminal; } .#{$fa-css-prefix}-code:before { content: $fa-var-code; } .#{$fa-css-prefix}-mail-reply-all:before, .#{$fa-css-prefix}-reply-all:before { content: $fa-var-reply-all; } .#{$fa-css-prefix}-star-half-empty:before, .#{$fa-css-prefix}-star-half-full:before, .#{$fa-css-prefix}-star-half-o:before { content: $fa-var-star-half-o; } .#{$fa-css-prefix}-location-arrow:before { content: $fa-var-location-arrow; } .#{$fa-css-prefix}-crop:before { content: $fa-var-crop; } .#{$fa-css-prefix}-code-fork:before { content: $fa-var-code-fork; } .#{$fa-css-prefix}-unlink:before, .#{$fa-css-prefix}-chain-broken:before { content: $fa-var-chain-broken; } .#{$fa-css-prefix}-question:before { content: $fa-var-question; } .#{$fa-css-prefix}-info:before { content: $fa-var-info; } .#{$fa-css-prefix}-exclamation:before { content: $fa-var-exclamation; } .#{$fa-css-prefix}-superscript:before { content: $fa-var-superscript; } .#{$fa-css-prefix}-subscript:before { content: $fa-var-subscript; } .#{$fa-css-prefix}-eraser:before { content: $fa-var-eraser; } .#{$fa-css-prefix}-puzzle-piece:before { content: $fa-var-puzzle-piece; } .#{$fa-css-prefix}-microphone:before { content: $fa-var-microphone; } .#{$fa-css-prefix}-microphone-slash:before { content: $fa-var-microphone-slash; } .#{$fa-css-prefix}-shield:before { content: $fa-var-shield; } .#{$fa-css-prefix}-calendar-o:before { content: $fa-var-calendar-o; } .#{$fa-css-prefix}-fire-extinguisher:before { content: $fa-var-fire-extinguisher; } .#{$fa-css-prefix}-rocket:before { content: $fa-var-rocket; } .#{$fa-css-prefix}-maxcdn:before { content: $fa-var-maxcdn; } .#{$fa-css-prefix}-chevron-circle-left:before { content: $fa-var-chevron-circle-left; } .#{$fa-css-prefix}-chevron-circle-right:before { content: $fa-var-chevron-circle-right; } .#{$fa-css-prefix}-chevron-circle-up:before { content: $fa-var-chevron-circle-up; } .#{$fa-css-prefix}-chevron-circle-down:before { content: $fa-var-chevron-circle-down; } .#{$fa-css-prefix}-html5:before { content: $fa-var-html5; } .#{$fa-css-prefix}-css3:before { content: $fa-var-css3; } .#{$fa-css-prefix}-anchor:before { content: $fa-var-anchor; } .#{$fa-css-prefix}-unlock-alt:before { content: $fa-var-unlock-alt; } .#{$fa-css-prefix}-bullseye:before { content: $fa-var-bullseye; } .#{$fa-css-prefix}-ellipsis-h:before { content: $fa-var-ellipsis-h; } .#{$fa-css-prefix}-ellipsis-v:before { content: $fa-var-ellipsis-v; } .#{$fa-css-prefix}-rss-square:before { content: $fa-var-rss-square; } .#{$fa-css-prefix}-play-circle:before { content: $fa-var-play-circle; } .#{$fa-css-prefix}-ticket:before { content: $fa-var-ticket; } .#{$fa-css-prefix}-minus-square:before { content: $fa-var-minus-square; } .#{$fa-css-prefix}-minus-square-o:before { content: $fa-var-minus-square-o; } .#{$fa-css-prefix}-level-up:before { content: $fa-var-level-up; } .#{$fa-css-prefix}-level-down:before { content: $fa-var-level-down; } .#{$fa-css-prefix}-check-square:before { content: $fa-var-check-square; } .#{$fa-css-prefix}-pencil-square:before { content: $fa-var-pencil-square; } .#{$fa-css-prefix}-external-link-square:before { content: $fa-var-external-link-square; } .#{$fa-css-prefix}-share-square:before { content: $fa-var-share-square; } .#{$fa-css-prefix}-compass:before { content: $fa-var-compass; } .#{$fa-css-prefix}-toggle-down:before, .#{$fa-css-prefix}-caret-square-o-down:before { content: $fa-var-caret-square-o-down; } .#{$fa-css-prefix}-toggle-up:before, .#{$fa-css-prefix}-caret-square-o-up:before { content: $fa-var-caret-square-o-up; } .#{$fa-css-prefix}-toggle-right:before, .#{$fa-css-prefix}-caret-square-o-right:before { content: $fa-var-caret-square-o-right; } .#{$fa-css-prefix}-euro:before, .#{$fa-css-prefix}-eur:before { content: $fa-var-eur; } .#{$fa-css-prefix}-gbp:before { content: $fa-var-gbp; } .#{$fa-css-prefix}-dollar:before, .#{$fa-css-prefix}-usd:before { content: $fa-var-usd; } .#{$fa-css-prefix}-rupee:before, .#{$fa-css-prefix}-inr:before { content: $fa-var-inr; } .#{$fa-css-prefix}-cny:before, .#{$fa-css-prefix}-rmb:before, .#{$fa-css-prefix}-yen:before, .#{$fa-css-prefix}-jpy:before { content: $fa-var-jpy; } .#{$fa-css-prefix}-ruble:before, .#{$fa-css-prefix}-rouble:before, .#{$fa-css-prefix}-rub:before { content: $fa-var-rub; } .#{$fa-css-prefix}-won:before, .#{$fa-css-prefix}-krw:before { content: $fa-var-krw; } .#{$fa-css-prefix}-bitcoin:before, .#{$fa-css-prefix}-btc:before { content: $fa-var-btc; } .#{$fa-css-prefix}-file:before { content: $fa-var-file; } .#{$fa-css-prefix}-file-text:before { content: $fa-var-file-text; } .#{$fa-css-prefix}-sort-alpha-asc:before { content: $fa-var-sort-alpha-asc; } .#{$fa-css-prefix}-sort-alpha-desc:before { content: $fa-var-sort-alpha-desc; } .#{$fa-css-prefix}-sort-amount-asc:before { content: $fa-var-sort-amount-asc; } .#{$fa-css-prefix}-sort-amount-desc:before { content: $fa-var-sort-amount-desc; } .#{$fa-css-prefix}-sort-numeric-asc:before { content: $fa-var-sort-numeric-asc; } .#{$fa-css-prefix}-sort-numeric-desc:before { content: $fa-var-sort-numeric-desc; } .#{$fa-css-prefix}-thumbs-up:before { content: $fa-var-thumbs-up; } .#{$fa-css-prefix}-thumbs-down:before { content: $fa-var-thumbs-down; } .#{$fa-css-prefix}-youtube-square:before { content: $fa-var-youtube-square; } .#{$fa-css-prefix}-youtube:before { content: $fa-var-youtube; } .#{$fa-css-prefix}-xing:before { content: $fa-var-xing; } .#{$fa-css-prefix}-xing-square:before { content: $fa-var-xing-square; } .#{$fa-css-prefix}-youtube-play:before { content: $fa-var-youtube-play; } .#{$fa-css-prefix}-dropbox:before { content: $fa-var-dropbox; } .#{$fa-css-prefix}-stack-overflow:before { content: $fa-var-stack-overflow; } .#{$fa-css-prefix}-instagram:before { content: $fa-var-instagram; } .#{$fa-css-prefix}-flickr:before { content: $fa-var-flickr; } .#{$fa-css-prefix}-adn:before { content: $fa-var-adn; } .#{$fa-css-prefix}-bitbucket:before { content: $fa-var-bitbucket; } .#{$fa-css-prefix}-bitbucket-square:before { content: $fa-var-bitbucket-square; } .#{$fa-css-prefix}-tumblr:before { content: $fa-var-tumblr; } .#{$fa-css-prefix}-tumblr-square:before { content: $fa-var-tumblr-square; } .#{$fa-css-prefix}-long-arrow-down:before { content: $fa-var-long-arrow-down; } .#{$fa-css-prefix}-long-arrow-up:before { content: $fa-var-long-arrow-up; } .#{$fa-css-prefix}-long-arrow-left:before { content: $fa-var-long-arrow-left; } .#{$fa-css-prefix}-long-arrow-right:before { content: $fa-var-long-arrow-right; } .#{$fa-css-prefix}-apple:before { content: $fa-var-apple; } .#{$fa-css-prefix}-windows:before { content: $fa-var-windows; } .#{$fa-css-prefix}-android:before { content: $fa-var-android; } .#{$fa-css-prefix}-linux:before { content: $fa-var-linux; } .#{$fa-css-prefix}-dribbble:before { content: $fa-var-dribbble; } .#{$fa-css-prefix}-skype:before { content: $fa-var-skype; } .#{$fa-css-prefix}-foursquare:before { content: $fa-var-foursquare; } .#{$fa-css-prefix}-trello:before { content: $fa-var-trello; } .#{$fa-css-prefix}-female:before { content: $fa-var-female; } .#{$fa-css-prefix}-male:before { content: $fa-var-male; } .#{$fa-css-prefix}-gittip:before, .#{$fa-css-prefix}-gratipay:before { content: $fa-var-gratipay; } .#{$fa-css-prefix}-sun-o:before { content: $fa-var-sun-o; } .#{$fa-css-prefix}-moon-o:before { content: $fa-var-moon-o; } .#{$fa-css-prefix}-archive:before { content: $fa-var-archive; } .#{$fa-css-prefix}-bug:before { content: $fa-var-bug; } .#{$fa-css-prefix}-vk:before { content: $fa-var-vk; } .#{$fa-css-prefix}-weibo:before { content: $fa-var-weibo; } .#{$fa-css-prefix}-renren:before { content: $fa-var-renren; } .#{$fa-css-prefix}-pagelines:before { content: $fa-var-pagelines; } .#{$fa-css-prefix}-stack-exchange:before { content: $fa-var-stack-exchange; } .#{$fa-css-prefix}-arrow-circle-o-right:before { content: $fa-var-arrow-circle-o-right; } .#{$fa-css-prefix}-arrow-circle-o-left:before { content: $fa-var-arrow-circle-o-left; } .#{$fa-css-prefix}-toggle-left:before, .#{$fa-css-prefix}-caret-square-o-left:before { content: $fa-var-caret-square-o-left; } .#{$fa-css-prefix}-dot-circle-o:before { content: $fa-var-dot-circle-o; } .#{$fa-css-prefix}-wheelchair:before { content: $fa-var-wheelchair; } .#{$fa-css-prefix}-vimeo-square:before { content: $fa-var-vimeo-square; } .#{$fa-css-prefix}-turkish-lira:before, .#{$fa-css-prefix}-try:before { content: $fa-var-try; } .#{$fa-css-prefix}-plus-square-o:before { content: $fa-var-plus-square-o; } .#{$fa-css-prefix}-space-shuttle:before { content: $fa-var-space-shuttle; } .#{$fa-css-prefix}-slack:before { content: $fa-var-slack; } .#{$fa-css-prefix}-envelope-square:before { content: $fa-var-envelope-square; } .#{$fa-css-prefix}-wordpress:before { content: $fa-var-wordpress; } .#{$fa-css-prefix}-openid:before { content: $fa-var-openid; } .#{$fa-css-prefix}-institution:before, .#{$fa-css-prefix}-bank:before, .#{$fa-css-prefix}-university:before { content: $fa-var-university; } .#{$fa-css-prefix}-mortar-board:before, .#{$fa-css-prefix}-graduation-cap:before { content: $fa-var-graduation-cap; } .#{$fa-css-prefix}-yahoo:before { content: $fa-var-yahoo; } .#{$fa-css-prefix}-google:before { content: $fa-var-google; } .#{$fa-css-prefix}-reddit:before { content: $fa-var-reddit; } .#{$fa-css-prefix}-reddit-square:before { content: $fa-var-reddit-square; } .#{$fa-css-prefix}-stumbleupon-circle:before { content: $fa-var-stumbleupon-circle; } .#{$fa-css-prefix}-stumbleupon:before { content: $fa-var-stumbleupon; } .#{$fa-css-prefix}-delicious:before { content: $fa-var-delicious; } .#{$fa-css-prefix}-digg:before { content: $fa-var-digg; } .#{$fa-css-prefix}-pied-piper-pp:before { content: $fa-var-pied-piper-pp; } .#{$fa-css-prefix}-pied-piper-alt:before { content: $fa-var-pied-piper-alt; } .#{$fa-css-prefix}-drupal:before { content: $fa-var-drupal; } .#{$fa-css-prefix}-joomla:before { content: $fa-var-joomla; } .#{$fa-css-prefix}-language:before { content: $fa-var-language; } .#{$fa-css-prefix}-fax:before { content: $fa-var-fax; } .#{$fa-css-prefix}-building:before { content: $fa-var-building; } .#{$fa-css-prefix}-child:before { content: $fa-var-child; } .#{$fa-css-prefix}-paw:before { content: $fa-var-paw; } .#{$fa-css-prefix}-spoon:before { content: $fa-var-spoon; } .#{$fa-css-prefix}-cube:before { content: $fa-var-cube; } .#{$fa-css-prefix}-cubes:before { content: $fa-var-cubes; } .#{$fa-css-prefix}-behance:before { content: $fa-var-behance; } .#{$fa-css-prefix}-behance-square:before { content: $fa-var-behance-square; } .#{$fa-css-prefix}-steam:before { content: $fa-var-steam; } .#{$fa-css-prefix}-steam-square:before { content: $fa-var-steam-square; } .#{$fa-css-prefix}-recycle:before { content: $fa-var-recycle; } .#{$fa-css-prefix}-automobile:before, .#{$fa-css-prefix}-car:before { content: $fa-var-car; } .#{$fa-css-prefix}-cab:before, .#{$fa-css-prefix}-taxi:before { content: $fa-var-taxi; } .#{$fa-css-prefix}-tree:before { content: $fa-var-tree; } .#{$fa-css-prefix}-spotify:before { content: $fa-var-spotify; } .#{$fa-css-prefix}-deviantart:before { content: $fa-var-deviantart; } .#{$fa-css-prefix}-soundcloud:before { content: $fa-var-soundcloud; } .#{$fa-css-prefix}-database:before { content: $fa-var-database; } .#{$fa-css-prefix}-file-pdf-o:before { content: $fa-var-file-pdf-o; } .#{$fa-css-prefix}-file-word-o:before { content: $fa-var-file-word-o; } .#{$fa-css-prefix}-file-excel-o:before { content: $fa-var-file-excel-o; } .#{$fa-css-prefix}-file-powerpoint-o:before { content: $fa-var-file-powerpoint-o; } .#{$fa-css-prefix}-file-photo-o:before, .#{$fa-css-prefix}-file-picture-o:before, .#{$fa-css-prefix}-file-image-o:before { content: $fa-var-file-image-o; } .#{$fa-css-prefix}-file-zip-o:before, .#{$fa-css-prefix}-file-archive-o:before { content: $fa-var-file-archive-o; } .#{$fa-css-prefix}-file-sound-o:before, .#{$fa-css-prefix}-file-audio-o:before { content: $fa-var-file-audio-o; } .#{$fa-css-prefix}-file-movie-o:before, .#{$fa-css-prefix}-file-video-o:before { content: $fa-var-file-video-o; } .#{$fa-css-prefix}-file-code-o:before { content: $fa-var-file-code-o; } .#{$fa-css-prefix}-vine:before { content: $fa-var-vine; } .#{$fa-css-prefix}-codepen:before { content: $fa-var-codepen; } .#{$fa-css-prefix}-jsfiddle:before { content: $fa-var-jsfiddle; } .#{$fa-css-prefix}-life-bouy:before, .#{$fa-css-prefix}-life-buoy:before, .#{$fa-css-prefix}-life-saver:before, .#{$fa-css-prefix}-support:before, .#{$fa-css-prefix}-life-ring:before { content: $fa-var-life-ring; } .#{$fa-css-prefix}-circle-o-notch:before { content: $fa-var-circle-o-notch; } .#{$fa-css-prefix}-ra:before, .#{$fa-css-prefix}-resistance:before, .#{$fa-css-prefix}-rebel:before { content: $fa-var-rebel; } .#{$fa-css-prefix}-ge:before, .#{$fa-css-prefix}-empire:before { content: $fa-var-empire; } .#{$fa-css-prefix}-git-square:before { content: $fa-var-git-square; } .#{$fa-css-prefix}-git:before { content: $fa-var-git; } .#{$fa-css-prefix}-y-combinator-square:before, .#{$fa-css-prefix}-yc-square:before, .#{$fa-css-prefix}-hacker-news:before { content: $fa-var-hacker-news; } .#{$fa-css-prefix}-tencent-weibo:before { content: $fa-var-tencent-weibo; } .#{$fa-css-prefix}-qq:before { content: $fa-var-qq; } .#{$fa-css-prefix}-wechat:before, .#{$fa-css-prefix}-weixin:before { content: $fa-var-weixin; } .#{$fa-css-prefix}-send:before, .#{$fa-css-prefix}-paper-plane:before { content: $fa-var-paper-plane; } .#{$fa-css-prefix}-send-o:before, .#{$fa-css-prefix}-paper-plane-o:before { content: $fa-var-paper-plane-o; } .#{$fa-css-prefix}-history:before { content: $fa-var-history; } .#{$fa-css-prefix}-circle-thin:before { content: $fa-var-circle-thin; } .#{$fa-css-prefix}-header:before { content: $fa-var-header; } .#{$fa-css-prefix}-paragraph:before { content: $fa-var-paragraph; } .#{$fa-css-prefix}-sliders:before { content: $fa-var-sliders; } .#{$fa-css-prefix}-share-alt:before { content: $fa-var-share-alt; } .#{$fa-css-prefix}-share-alt-square:before { content: $fa-var-share-alt-square; } .#{$fa-css-prefix}-bomb:before { content: $fa-var-bomb; } .#{$fa-css-prefix}-soccer-ball-o:before, .#{$fa-css-prefix}-futbol-o:before { content: $fa-var-futbol-o; } .#{$fa-css-prefix}-tty:before { content: $fa-var-tty; } .#{$fa-css-prefix}-binoculars:before { content: $fa-var-binoculars; } .#{$fa-css-prefix}-plug:before { content: $fa-var-plug; } .#{$fa-css-prefix}-slideshare:before { content: $fa-var-slideshare; } .#{$fa-css-prefix}-twitch:before { content: $fa-var-twitch; } .#{$fa-css-prefix}-yelp:before { content: $fa-var-yelp; } .#{$fa-css-prefix}-newspaper-o:before { content: $fa-var-newspaper-o; } .#{$fa-css-prefix}-wifi:before { content: $fa-var-wifi; } .#{$fa-css-prefix}-calculator:before { content: $fa-var-calculator; } .#{$fa-css-prefix}-paypal:before { content: $fa-var-paypal; } .#{$fa-css-prefix}-google-wallet:before { content: $fa-var-google-wallet; } .#{$fa-css-prefix}-cc-visa:before { content: $fa-var-cc-visa; } .#{$fa-css-prefix}-cc-mastercard:before { content: $fa-var-cc-mastercard; } .#{$fa-css-prefix}-cc-discover:before { content: $fa-var-cc-discover; } .#{$fa-css-prefix}-cc-amex:before { content: $fa-var-cc-amex; } .#{$fa-css-prefix}-cc-paypal:before { content: $fa-var-cc-paypal; } .#{$fa-css-prefix}-cc-stripe:before { content: $fa-var-cc-stripe; } .#{$fa-css-prefix}-bell-slash:before { content: $fa-var-bell-slash; } .#{$fa-css-prefix}-bell-slash-o:before { content: $fa-var-bell-slash-o; } .#{$fa-css-prefix}-trash:before { content: $fa-var-trash; } .#{$fa-css-prefix}-copyright:before { content: $fa-var-copyright; } .#{$fa-css-prefix}-at:before { content: $fa-var-at; } .#{$fa-css-prefix}-eyedropper:before { content: $fa-var-eyedropper; } .#{$fa-css-prefix}-paint-brush:before { content: $fa-var-paint-brush; } .#{$fa-css-prefix}-birthday-cake:before { content: $fa-var-birthday-cake; } .#{$fa-css-prefix}-area-chart:before { content: $fa-var-area-chart; } .#{$fa-css-prefix}-pie-chart:before { content: $fa-var-pie-chart; } .#{$fa-css-prefix}-line-chart:before { content: $fa-var-line-chart; } .#{$fa-css-prefix}-lastfm:before { content: $fa-var-lastfm; } .#{$fa-css-prefix}-lastfm-square:before { content: $fa-var-lastfm-square; } .#{$fa-css-prefix}-toggle-off:before { content: $fa-var-toggle-off; } .#{$fa-css-prefix}-toggle-on:before { content: $fa-var-toggle-on; } .#{$fa-css-prefix}-bicycle:before { content: $fa-var-bicycle; } .#{$fa-css-prefix}-bus:before { content: $fa-var-bus; } .#{$fa-css-prefix}-ioxhost:before { content: $fa-var-ioxhost; } .#{$fa-css-prefix}-angellist:before { content: $fa-var-angellist; } .#{$fa-css-prefix}-cc:before { content: $fa-var-cc; } .#{$fa-css-prefix}-shekel:before, .#{$fa-css-prefix}-sheqel:before, .#{$fa-css-prefix}-ils:before { content: $fa-var-ils; } .#{$fa-css-prefix}-meanpath:before { content: $fa-var-meanpath; } .#{$fa-css-prefix}-buysellads:before { content: $fa-var-buysellads; } .#{$fa-css-prefix}-connectdevelop:before { content: $fa-var-connectdevelop; } .#{$fa-css-prefix}-dashcube:before { content: $fa-var-dashcube; } .#{$fa-css-prefix}-forumbee:before { content: $fa-var-forumbee; } .#{$fa-css-prefix}-leanpub:before { content: $fa-var-leanpub; } .#{$fa-css-prefix}-sellsy:before { content: $fa-var-sellsy; } .#{$fa-css-prefix}-shirtsinbulk:before { content: $fa-var-shirtsinbulk; } .#{$fa-css-prefix}-simplybuilt:before { content: $fa-var-simplybuilt; } .#{$fa-css-prefix}-skyatlas:before { content: $fa-var-skyatlas; } .#{$fa-css-prefix}-cart-plus:before { content: $fa-var-cart-plus; } .#{$fa-css-prefix}-cart-arrow-down:before { content: $fa-var-cart-arrow-down; } .#{$fa-css-prefix}-diamond:before { content: $fa-var-diamond; } .#{$fa-css-prefix}-ship:before { content: $fa-var-ship; } .#{$fa-css-prefix}-user-secret:before { content: $fa-var-user-secret; } .#{$fa-css-prefix}-motorcycle:before { content: $fa-var-motorcycle; } .#{$fa-css-prefix}-street-view:before { content: $fa-var-street-view; } .#{$fa-css-prefix}-heartbeat:before { content: $fa-var-heartbeat; } .#{$fa-css-prefix}-venus:before { content: $fa-var-venus; } .#{$fa-css-prefix}-mars:before { content: $fa-var-mars; } .#{$fa-css-prefix}-mercury:before { content: $fa-var-mercury; } .#{$fa-css-prefix}-intersex:before, .#{$fa-css-prefix}-transgender:before { content: $fa-var-transgender; } .#{$fa-css-prefix}-transgender-alt:before { content: $fa-var-transgender-alt; } .#{$fa-css-prefix}-venus-double:before { content: $fa-var-venus-double; } .#{$fa-css-prefix}-mars-double:before { content: $fa-var-mars-double; } .#{$fa-css-prefix}-venus-mars:before { content: $fa-var-venus-mars; } .#{$fa-css-prefix}-mars-stroke:before { content: $fa-var-mars-stroke; } .#{$fa-css-prefix}-mars-stroke-v:before { content: $fa-var-mars-stroke-v; } .#{$fa-css-prefix}-mars-stroke-h:before { content: $fa-var-mars-stroke-h; } .#{$fa-css-prefix}-neuter:before { content: $fa-var-neuter; } .#{$fa-css-prefix}-genderless:before { content: $fa-var-genderless; } .#{$fa-css-prefix}-facebook-official:before { content: $fa-var-facebook-official; } .#{$fa-css-prefix}-pinterest-p:before { content: $fa-var-pinterest-p; } .#{$fa-css-prefix}-whatsapp:before { content: $fa-var-whatsapp; } .#{$fa-css-prefix}-server:before { content: $fa-var-server; } .#{$fa-css-prefix}-user-plus:before { content: $fa-var-user-plus; } .#{$fa-css-prefix}-user-times:before { content: $fa-var-user-times; } .#{$fa-css-prefix}-hotel:before, .#{$fa-css-prefix}-bed:before { content: $fa-var-bed; } .#{$fa-css-prefix}-viacoin:before { content: $fa-var-viacoin; } .#{$fa-css-prefix}-train:before { content: $fa-var-train; } .#{$fa-css-prefix}-subway:before { content: $fa-var-subway; } .#{$fa-css-prefix}-medium:before { content: $fa-var-medium; } .#{$fa-css-prefix}-yc:before, .#{$fa-css-prefix}-y-combinator:before { content: $fa-var-y-combinator; } .#{$fa-css-prefix}-optin-monster:before { content: $fa-var-optin-monster; } .#{$fa-css-prefix}-opencart:before { content: $fa-var-opencart; } .#{$fa-css-prefix}-expeditedssl:before { content: $fa-var-expeditedssl; } .#{$fa-css-prefix}-battery-4:before, .#{$fa-css-prefix}-battery:before, .#{$fa-css-prefix}-battery-full:before { content: $fa-var-battery-full; } .#{$fa-css-prefix}-battery-3:before, .#{$fa-css-prefix}-battery-three-quarters:before { content: $fa-var-battery-three-quarters; } .#{$fa-css-prefix}-battery-2:before, .#{$fa-css-prefix}-battery-half:before { content: $fa-var-battery-half; } .#{$fa-css-prefix}-battery-1:before, .#{$fa-css-prefix}-battery-quarter:before { content: $fa-var-battery-quarter; } .#{$fa-css-prefix}-battery-0:before, .#{$fa-css-prefix}-battery-empty:before { content: $fa-var-battery-empty; } .#{$fa-css-prefix}-mouse-pointer:before { content: $fa-var-mouse-pointer; } .#{$fa-css-prefix}-i-cursor:before { content: $fa-var-i-cursor; } .#{$fa-css-prefix}-object-group:before { content: $fa-var-object-group; } .#{$fa-css-prefix}-object-ungroup:before { content: $fa-var-object-ungroup; } .#{$fa-css-prefix}-sticky-note:before { content: $fa-var-sticky-note; } .#{$fa-css-prefix}-sticky-note-o:before { content: $fa-var-sticky-note-o; } .#{$fa-css-prefix}-cc-jcb:before { content: $fa-var-cc-jcb; } .#{$fa-css-prefix}-cc-diners-club:before { content: $fa-var-cc-diners-club; } .#{$fa-css-prefix}-clone:before { content: $fa-var-clone; } .#{$fa-css-prefix}-balance-scale:before { content: $fa-var-balance-scale; } .#{$fa-css-prefix}-hourglass-o:before { content: $fa-var-hourglass-o; } .#{$fa-css-prefix}-hourglass-1:before, .#{$fa-css-prefix}-hourglass-start:before { content: $fa-var-hourglass-start; } .#{$fa-css-prefix}-hourglass-2:before, .#{$fa-css-prefix}-hourglass-half:before { content: $fa-var-hourglass-half; } .#{$fa-css-prefix}-hourglass-3:before, .#{$fa-css-prefix}-hourglass-end:before { content: $fa-var-hourglass-end; } .#{$fa-css-prefix}-hourglass:before { content: $fa-var-hourglass; } .#{$fa-css-prefix}-hand-grab-o:before, .#{$fa-css-prefix}-hand-rock-o:before { content: $fa-var-hand-rock-o; } .#{$fa-css-prefix}-hand-stop-o:before, .#{$fa-css-prefix}-hand-paper-o:before { content: $fa-var-hand-paper-o; } .#{$fa-css-prefix}-hand-scissors-o:before { content: $fa-var-hand-scissors-o; } .#{$fa-css-prefix}-hand-lizard-o:before { content: $fa-var-hand-lizard-o; } .#{$fa-css-prefix}-hand-spock-o:before { content: $fa-var-hand-spock-o; } .#{$fa-css-prefix}-hand-pointer-o:before { content: $fa-var-hand-pointer-o; } .#{$fa-css-prefix}-hand-peace-o:before { content: $fa-var-hand-peace-o; } .#{$fa-css-prefix}-trademark:before { content: $fa-var-trademark; } .#{$fa-css-prefix}-registered:before { content: $fa-var-registered; } .#{$fa-css-prefix}-creative-commons:before { content: $fa-var-creative-commons; } .#{$fa-css-prefix}-gg:before { content: $fa-var-gg; } .#{$fa-css-prefix}-gg-circle:before { content: $fa-var-gg-circle; } .#{$fa-css-prefix}-tripadvisor:before { content: $fa-var-tripadvisor; } .#{$fa-css-prefix}-odnoklassniki:before { content: $fa-var-odnoklassniki; } .#{$fa-css-prefix}-odnoklassniki-square:before { content: $fa-var-odnoklassniki-square; } .#{$fa-css-prefix}-get-pocket:before { content: $fa-var-get-pocket; } .#{$fa-css-prefix}-wikipedia-w:before { content: $fa-var-wikipedia-w; } .#{$fa-css-prefix}-safari:before { content: $fa-var-safari; } .#{$fa-css-prefix}-chrome:before { content: $fa-var-chrome; } .#{$fa-css-prefix}-firefox:before { content: $fa-var-firefox; } .#{$fa-css-prefix}-opera:before { content: $fa-var-opera; } .#{$fa-css-prefix}-internet-explorer:before { content: $fa-var-internet-explorer; } .#{$fa-css-prefix}-tv:before, .#{$fa-css-prefix}-television:before { content: $fa-var-television; } .#{$fa-css-prefix}-contao:before { content: $fa-var-contao; } .#{$fa-css-prefix}-500px:before { content: $fa-var-500px; } .#{$fa-css-prefix}-amazon:before { content: $fa-var-amazon; } .#{$fa-css-prefix}-calendar-plus-o:before { content: $fa-var-calendar-plus-o; } .#{$fa-css-prefix}-calendar-minus-o:before { content: $fa-var-calendar-minus-o; } .#{$fa-css-prefix}-calendar-times-o:before { content: $fa-var-calendar-times-o; } .#{$fa-css-prefix}-calendar-check-o:before { content: $fa-var-calendar-check-o; } .#{$fa-css-prefix}-industry:before { content: $fa-var-industry; } .#{$fa-css-prefix}-map-pin:before { content: $fa-var-map-pin; } .#{$fa-css-prefix}-map-signs:before { content: $fa-var-map-signs; } .#{$fa-css-prefix}-map-o:before { content: $fa-var-map-o; } .#{$fa-css-prefix}-map:before { content: $fa-var-map; } .#{$fa-css-prefix}-commenting:before { content: $fa-var-commenting; } .#{$fa-css-prefix}-commenting-o:before { content: $fa-var-commenting-o; } .#{$fa-css-prefix}-houzz:before { content: $fa-var-houzz; } .#{$fa-css-prefix}-vimeo:before { content: $fa-var-vimeo; } .#{$fa-css-prefix}-black-tie:before { content: $fa-var-black-tie; } .#{$fa-css-prefix}-fonticons:before { content: $fa-var-fonticons; } .#{$fa-css-prefix}-reddit-alien:before { content: $fa-var-reddit-alien; } .#{$fa-css-prefix}-edge:before { content: $fa-var-edge; } .#{$fa-css-prefix}-credit-card-alt:before { content: $fa-var-credit-card-alt; } .#{$fa-css-prefix}-codiepie:before { content: $fa-var-codiepie; } .#{$fa-css-prefix}-modx:before { content: $fa-var-modx; } .#{$fa-css-prefix}-fort-awesome:before { content: $fa-var-fort-awesome; } .#{$fa-css-prefix}-usb:before { content: $fa-var-usb; } .#{$fa-css-prefix}-product-hunt:before { content: $fa-var-product-hunt; } .#{$fa-css-prefix}-mixcloud:before { content: $fa-var-mixcloud; } .#{$fa-css-prefix}-scribd:before { content: $fa-var-scribd; } .#{$fa-css-prefix}-pause-circle:before { content: $fa-var-pause-circle; } .#{$fa-css-prefix}-pause-circle-o:before { content: $fa-var-pause-circle-o; } .#{$fa-css-prefix}-stop-circle:before { content: $fa-var-stop-circle; } .#{$fa-css-prefix}-stop-circle-o:before { content: $fa-var-stop-circle-o; } .#{$fa-css-prefix}-shopping-bag:before { content: $fa-var-shopping-bag; } .#{$fa-css-prefix}-shopping-basket:before { content: $fa-var-shopping-basket; } .#{$fa-css-prefix}-hashtag:before { content: $fa-var-hashtag; } .#{$fa-css-prefix}-bluetooth:before { content: $fa-var-bluetooth; } .#{$fa-css-prefix}-bluetooth-b:before { content: $fa-var-bluetooth-b; } .#{$fa-css-prefix}-percent:before { content: $fa-var-percent; } .#{$fa-css-prefix}-gitlab:before { content: $fa-var-gitlab; } .#{$fa-css-prefix}-wpbeginner:before { content: $fa-var-wpbeginner; } .#{$fa-css-prefix}-wpforms:before { content: $fa-var-wpforms; } .#{$fa-css-prefix}-envira:before { content: $fa-var-envira; } .#{$fa-css-prefix}-universal-access:before { content: $fa-var-universal-access; } .#{$fa-css-prefix}-wheelchair-alt:before { content: $fa-var-wheelchair-alt; } .#{$fa-css-prefix}-question-circle-o:before { content: $fa-var-question-circle-o; } .#{$fa-css-prefix}-blind:before { content: $fa-var-blind; } .#{$fa-css-prefix}-audio-description:before { content: $fa-var-audio-description; } .#{$fa-css-prefix}-volume-control-phone:before { content: $fa-var-volume-control-phone; } .#{$fa-css-prefix}-braille:before { content: $fa-var-braille; } .#{$fa-css-prefix}-assistive-listening-systems:before { content: $fa-var-assistive-listening-systems; } .#{$fa-css-prefix}-asl-interpreting:before, .#{$fa-css-prefix}-american-sign-language-interpreting:before { content: $fa-var-american-sign-language-interpreting; } .#{$fa-css-prefix}-deafness:before, .#{$fa-css-prefix}-hard-of-hearing:before, .#{$fa-css-prefix}-deaf:before { content: $fa-var-deaf; } .#{$fa-css-prefix}-glide:before { content: $fa-var-glide; } .#{$fa-css-prefix}-glide-g:before { content: $fa-var-glide-g; } .#{$fa-css-prefix}-signing:before, .#{$fa-css-prefix}-sign-language:before { content: $fa-var-sign-language; } .#{$fa-css-prefix}-low-vision:before { content: $fa-var-low-vision; } .#{$fa-css-prefix}-viadeo:before { content: $fa-var-viadeo; } .#{$fa-css-prefix}-viadeo-square:before { content: $fa-var-viadeo-square; } .#{$fa-css-prefix}-snapchat:before { content: $fa-var-snapchat; } .#{$fa-css-prefix}-snapchat-ghost:before { content: $fa-var-snapchat-ghost; } .#{$fa-css-prefix}-snapchat-square:before { content: $fa-var-snapchat-square; } .#{$fa-css-prefix}-pied-piper:before { content: $fa-var-pied-piper; } .#{$fa-css-prefix}-first-order:before { content: $fa-var-first-order; } .#{$fa-css-prefix}-yoast:before { content: $fa-var-yoast; } .#{$fa-css-prefix}-themeisle:before { content: $fa-var-themeisle; } .#{$fa-css-prefix}-google-plus-circle:before, .#{$fa-css-prefix}-google-plus-official:before { content: $fa-var-google-plus-official; } .#{$fa-css-prefix}-fa:before, .#{$fa-css-prefix}-font-awesome:before { content: $fa-var-font-awesome; } .#{$fa-css-prefix}-handshake-o:before { content: $fa-var-handshake-o; } .#{$fa-css-prefix}-envelope-open:before { content: $fa-var-envelope-open; } .#{$fa-css-prefix}-envelope-open-o:before { content: $fa-var-envelope-open-o; } .#{$fa-css-prefix}-linode:before { content: $fa-var-linode; } .#{$fa-css-prefix}-address-book:before { content: $fa-var-address-book; } .#{$fa-css-prefix}-address-book-o:before { content: $fa-var-address-book-o; } .#{$fa-css-prefix}-vcard:before, .#{$fa-css-prefix}-address-card:before { content: $fa-var-address-card; } .#{$fa-css-prefix}-vcard-o:before, .#{$fa-css-prefix}-address-card-o:before { content: $fa-var-address-card-o; } .#{$fa-css-prefix}-user-circle:before { content: $fa-var-user-circle; } .#{$fa-css-prefix}-user-circle-o:before { content: $fa-var-user-circle-o; } .#{$fa-css-prefix}-user-o:before { content: $fa-var-user-o; } .#{$fa-css-prefix}-id-badge:before { content: $fa-var-id-badge; } .#{$fa-css-prefix}-drivers-license:before, .#{$fa-css-prefix}-id-card:before { content: $fa-var-id-card; } .#{$fa-css-prefix}-drivers-license-o:before, .#{$fa-css-prefix}-id-card-o:before { content: $fa-var-id-card-o; } .#{$fa-css-prefix}-quora:before { content: $fa-var-quora; } .#{$fa-css-prefix}-free-code-camp:before { content: $fa-var-free-code-camp; } .#{$fa-css-prefix}-telegram:before { content: $fa-var-telegram; } .#{$fa-css-prefix}-thermometer-4:before, .#{$fa-css-prefix}-thermometer:before, .#{$fa-css-prefix}-thermometer-full:before { content: $fa-var-thermometer-full; } .#{$fa-css-prefix}-thermometer-3:before, .#{$fa-css-prefix}-thermometer-three-quarters:before { content: $fa-var-thermometer-three-quarters; } .#{$fa-css-prefix}-thermometer-2:before, .#{$fa-css-prefix}-thermometer-half:before { content: $fa-var-thermometer-half; } .#{$fa-css-prefix}-thermometer-1:before, .#{$fa-css-prefix}-thermometer-quarter:before { content: $fa-var-thermometer-quarter; } .#{$fa-css-prefix}-thermometer-0:before, .#{$fa-css-prefix}-thermometer-empty:before { content: $fa-var-thermometer-empty; } .#{$fa-css-prefix}-shower:before { content: $fa-var-shower; } .#{$fa-css-prefix}-bathtub:before, .#{$fa-css-prefix}-s15:before, .#{$fa-css-prefix}-bath:before { content: $fa-var-bath; } .#{$fa-css-prefix}-podcast:before { content: $fa-var-podcast; } .#{$fa-css-prefix}-window-maximize:before { content: $fa-var-window-maximize; } .#{$fa-css-prefix}-window-minimize:before { content: $fa-var-window-minimize; } .#{$fa-css-prefix}-window-restore:before { content: $fa-var-window-restore; } .#{$fa-css-prefix}-times-rectangle:before, .#{$fa-css-prefix}-window-close:before { content: $fa-var-window-close; } .#{$fa-css-prefix}-times-rectangle-o:before, .#{$fa-css-prefix}-window-close-o:before { content: $fa-var-window-close-o; } .#{$fa-css-prefix}-bandcamp:before { content: $fa-var-bandcamp; } .#{$fa-css-prefix}-grav:before { content: $fa-var-grav; } .#{$fa-css-prefix}-etsy:before { content: $fa-var-etsy; } .#{$fa-css-prefix}-imdb:before { content: $fa-var-imdb; } .#{$fa-css-prefix}-ravelry:before { content: $fa-var-ravelry; } .#{$fa-css-prefix}-eercast:before { content: $fa-var-eercast; } .#{$fa-css-prefix}-microchip:before { content: $fa-var-microchip; } .#{$fa-css-prefix}-snowflake-o:before { content: $fa-var-snowflake-o; } .#{$fa-css-prefix}-superpowers:before { content: $fa-var-superpowers; } .#{$fa-css-prefix}-wpexplorer:before { content: $fa-var-wpexplorer; } .#{$fa-css-prefix}-meetup:before { content: $fa-var-meetup; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_icons.scss
SCSS
unknown
50,498
// Icon Sizes // ------------------------- /* makes the font 33% larger relative to the icon container */ .#{$fa-css-prefix}-lg { font-size: (4em / 3); line-height: (3em / 4); vertical-align: -15%; } .#{$fa-css-prefix}-2x { font-size: 2em; } .#{$fa-css-prefix}-3x { font-size: 3em; } .#{$fa-css-prefix}-4x { font-size: 4em; } .#{$fa-css-prefix}-5x { font-size: 5em; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_larger.scss
SCSS
unknown
375
// List Icons // ------------------------- .#{$fa-css-prefix}-ul { padding-left: 0; margin-left: $fa-li-width; list-style-type: none; > li { position: relative; } } .#{$fa-css-prefix}-li { position: absolute; left: -$fa-li-width; width: $fa-li-width; top: (2em / 14); text-align: center; &.#{$fa-css-prefix}-lg { left: -$fa-li-width + (4em / 14); } }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_list.scss
SCSS
unknown
378
// Mixins // -------------------------- @mixin fa-icon() { display: inline-block; font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration font-size: inherit; // can't have font-size inherit on line above, so need to override text-rendering: auto; // optimizelegibility throws things off #1094 -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } @mixin fa-icon-rotate($degrees, $rotation) { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; -webkit-transform: rotate($degrees); -ms-transform: rotate($degrees); transform: rotate($degrees); } @mixin fa-icon-flip($horiz, $vert, $rotation) { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; -webkit-transform: scale($horiz, $vert); -ms-transform: scale($horiz, $vert); transform: scale($horiz, $vert); } // Only display content to screen readers. A la Bootstrap 4. // // See: http://a11yproject.com/posts/how-to-hide-content/ @mixin sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; } // Use in conjunction with .sr-only to only display content when it's focused. // // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 // // Credit: HTML5 Boilerplate @mixin sr-only-focusable { &:active, &:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; } }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_mixins.scss
SCSS
unknown
1,637
/* FONT PATH * -------------------------- */ @font-face { font-family: 'FontAwesome'; src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts font-weight: normal; font-style: normal; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_path.scss
SCSS
unknown
783
// Rotated & Flipped Icons // ------------------------- .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } // Hook for IE8-9 // ------------------------- :root .#{$fa-css-prefix}-rotate-90, :root .#{$fa-css-prefix}-rotate-180, :root .#{$fa-css-prefix}-rotate-270, :root .#{$fa-css-prefix}-flip-horizontal, :root .#{$fa-css-prefix}-flip-vertical { filter: none; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_rotated-flipped.scss
SCSS
unknown
672
// Screen Readers // ------------------------- .sr-only { @include sr-only(); } .sr-only-focusable { @include sr-only-focusable(); }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_screen-reader.scss
SCSS
unknown
134
// Stacked Icons // ------------------------- .#{$fa-css-prefix}-stack { position: relative; display: inline-block; width: 2em; height: 2em; line-height: 2em; vertical-align: middle; } .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { position: absolute; left: 0; width: 100%; text-align: center; } .#{$fa-css-prefix}-stack-1x { line-height: inherit; } .#{$fa-css-prefix}-stack-2x { font-size: 2em; } .#{$fa-css-prefix}-inverse { color: $fa-inverse; }
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_stacked.scss
SCSS
unknown
482
// Variables // -------------------------- $fa-font-path: "../fonts" !default; $fa-font-size-base: 14px !default; $fa-line-height-base: 1 !default; //$fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts" !default; // for referencing Bootstrap CDN font files directly $fa-css-prefix: fa !default; $fa-version: "4.7.0" !default; $fa-border-color: #eee !default; $fa-inverse: #fff !default; $fa-li-width: (30em / 14) !default; $fa-var-500px: "\f26e"; $fa-var-address-book: "\f2b9"; $fa-var-address-book-o: "\f2ba"; $fa-var-address-card: "\f2bb"; $fa-var-address-card-o: "\f2bc"; $fa-var-adjust: "\f042"; $fa-var-adn: "\f170"; $fa-var-align-center: "\f037"; $fa-var-align-justify: "\f039"; $fa-var-align-left: "\f036"; $fa-var-align-right: "\f038"; $fa-var-amazon: "\f270"; $fa-var-ambulance: "\f0f9"; $fa-var-american-sign-language-interpreting: "\f2a3"; $fa-var-anchor: "\f13d"; $fa-var-android: "\f17b"; $fa-var-angellist: "\f209"; $fa-var-angle-double-down: "\f103"; $fa-var-angle-double-left: "\f100"; $fa-var-angle-double-right: "\f101"; $fa-var-angle-double-up: "\f102"; $fa-var-angle-down: "\f107"; $fa-var-angle-left: "\f104"; $fa-var-angle-right: "\f105"; $fa-var-angle-up: "\f106"; $fa-var-apple: "\f179"; $fa-var-archive: "\f187"; $fa-var-area-chart: "\f1fe"; $fa-var-arrow-circle-down: "\f0ab"; $fa-var-arrow-circle-left: "\f0a8"; $fa-var-arrow-circle-o-down: "\f01a"; $fa-var-arrow-circle-o-left: "\f190"; $fa-var-arrow-circle-o-right: "\f18e"; $fa-var-arrow-circle-o-up: "\f01b"; $fa-var-arrow-circle-right: "\f0a9"; $fa-var-arrow-circle-up: "\f0aa"; $fa-var-arrow-down: "\f063"; $fa-var-arrow-left: "\f060"; $fa-var-arrow-right: "\f061"; $fa-var-arrow-up: "\f062"; $fa-var-arrows: "\f047"; $fa-var-arrows-alt: "\f0b2"; $fa-var-arrows-h: "\f07e"; $fa-var-arrows-v: "\f07d"; $fa-var-asl-interpreting: "\f2a3"; $fa-var-assistive-listening-systems: "\f2a2"; $fa-var-asterisk: "\f069"; $fa-var-at: "\f1fa"; $fa-var-audio-description: "\f29e"; $fa-var-automobile: "\f1b9"; $fa-var-backward: "\f04a"; $fa-var-balance-scale: "\f24e"; $fa-var-ban: "\f05e"; $fa-var-bandcamp: "\f2d5"; $fa-var-bank: "\f19c"; $fa-var-bar-chart: "\f080"; $fa-var-bar-chart-o: "\f080"; $fa-var-barcode: "\f02a"; $fa-var-bars: "\f0c9"; $fa-var-bath: "\f2cd"; $fa-var-bathtub: "\f2cd"; $fa-var-battery: "\f240"; $fa-var-battery-0: "\f244"; $fa-var-battery-1: "\f243"; $fa-var-battery-2: "\f242"; $fa-var-battery-3: "\f241"; $fa-var-battery-4: "\f240"; $fa-var-battery-empty: "\f244"; $fa-var-battery-full: "\f240"; $fa-var-battery-half: "\f242"; $fa-var-battery-quarter: "\f243"; $fa-var-battery-three-quarters: "\f241"; $fa-var-bed: "\f236"; $fa-var-beer: "\f0fc"; $fa-var-behance: "\f1b4"; $fa-var-behance-square: "\f1b5"; $fa-var-bell: "\f0f3"; $fa-var-bell-o: "\f0a2"; $fa-var-bell-slash: "\f1f6"; $fa-var-bell-slash-o: "\f1f7"; $fa-var-bicycle: "\f206"; $fa-var-binoculars: "\f1e5"; $fa-var-birthday-cake: "\f1fd"; $fa-var-bitbucket: "\f171"; $fa-var-bitbucket-square: "\f172"; $fa-var-bitcoin: "\f15a"; $fa-var-black-tie: "\f27e"; $fa-var-blind: "\f29d"; $fa-var-bluetooth: "\f293"; $fa-var-bluetooth-b: "\f294"; $fa-var-bold: "\f032"; $fa-var-bolt: "\f0e7"; $fa-var-bomb: "\f1e2"; $fa-var-book: "\f02d"; $fa-var-bookmark: "\f02e"; $fa-var-bookmark-o: "\f097"; $fa-var-braille: "\f2a1"; $fa-var-briefcase: "\f0b1"; $fa-var-btc: "\f15a"; $fa-var-bug: "\f188"; $fa-var-building: "\f1ad"; $fa-var-building-o: "\f0f7"; $fa-var-bullhorn: "\f0a1"; $fa-var-bullseye: "\f140"; $fa-var-bus: "\f207"; $fa-var-buysellads: "\f20d"; $fa-var-cab: "\f1ba"; $fa-var-calculator: "\f1ec"; $fa-var-calendar: "\f073"; $fa-var-calendar-check-o: "\f274"; $fa-var-calendar-minus-o: "\f272"; $fa-var-calendar-o: "\f133"; $fa-var-calendar-plus-o: "\f271"; $fa-var-calendar-times-o: "\f273"; $fa-var-camera: "\f030"; $fa-var-camera-retro: "\f083"; $fa-var-car: "\f1b9"; $fa-var-caret-down: "\f0d7"; $fa-var-caret-left: "\f0d9"; $fa-var-caret-right: "\f0da"; $fa-var-caret-square-o-down: "\f150"; $fa-var-caret-square-o-left: "\f191"; $fa-var-caret-square-o-right: "\f152"; $fa-var-caret-square-o-up: "\f151"; $fa-var-caret-up: "\f0d8"; $fa-var-cart-arrow-down: "\f218"; $fa-var-cart-plus: "\f217"; $fa-var-cc: "\f20a"; $fa-var-cc-amex: "\f1f3"; $fa-var-cc-diners-club: "\f24c"; $fa-var-cc-discover: "\f1f2"; $fa-var-cc-jcb: "\f24b"; $fa-var-cc-mastercard: "\f1f1"; $fa-var-cc-paypal: "\f1f4"; $fa-var-cc-stripe: "\f1f5"; $fa-var-cc-visa: "\f1f0"; $fa-var-certificate: "\f0a3"; $fa-var-chain: "\f0c1"; $fa-var-chain-broken: "\f127"; $fa-var-check: "\f00c"; $fa-var-check-circle: "\f058"; $fa-var-check-circle-o: "\f05d"; $fa-var-check-square: "\f14a"; $fa-var-check-square-o: "\f046"; $fa-var-chevron-circle-down: "\f13a"; $fa-var-chevron-circle-left: "\f137"; $fa-var-chevron-circle-right: "\f138"; $fa-var-chevron-circle-up: "\f139"; $fa-var-chevron-down: "\f078"; $fa-var-chevron-left: "\f053"; $fa-var-chevron-right: "\f054"; $fa-var-chevron-up: "\f077"; $fa-var-child: "\f1ae"; $fa-var-chrome: "\f268"; $fa-var-circle: "\f111"; $fa-var-circle-o: "\f10c"; $fa-var-circle-o-notch: "\f1ce"; $fa-var-circle-thin: "\f1db"; $fa-var-clipboard: "\f0ea"; $fa-var-clock-o: "\f017"; $fa-var-clone: "\f24d"; $fa-var-close: "\f00d"; $fa-var-cloud: "\f0c2"; $fa-var-cloud-download: "\f0ed"; $fa-var-cloud-upload: "\f0ee"; $fa-var-cny: "\f157"; $fa-var-code: "\f121"; $fa-var-code-fork: "\f126"; $fa-var-codepen: "\f1cb"; $fa-var-codiepie: "\f284"; $fa-var-coffee: "\f0f4"; $fa-var-cog: "\f013"; $fa-var-cogs: "\f085"; $fa-var-columns: "\f0db"; $fa-var-comment: "\f075"; $fa-var-comment-o: "\f0e5"; $fa-var-commenting: "\f27a"; $fa-var-commenting-o: "\f27b"; $fa-var-comments: "\f086"; $fa-var-comments-o: "\f0e6"; $fa-var-compass: "\f14e"; $fa-var-compress: "\f066"; $fa-var-connectdevelop: "\f20e"; $fa-var-contao: "\f26d"; $fa-var-copy: "\f0c5"; $fa-var-copyright: "\f1f9"; $fa-var-creative-commons: "\f25e"; $fa-var-credit-card: "\f09d"; $fa-var-credit-card-alt: "\f283"; $fa-var-crop: "\f125"; $fa-var-crosshairs: "\f05b"; $fa-var-css3: "\f13c"; $fa-var-cube: "\f1b2"; $fa-var-cubes: "\f1b3"; $fa-var-cut: "\f0c4"; $fa-var-cutlery: "\f0f5"; $fa-var-dashboard: "\f0e4"; $fa-var-dashcube: "\f210"; $fa-var-database: "\f1c0"; $fa-var-deaf: "\f2a4"; $fa-var-deafness: "\f2a4"; $fa-var-dedent: "\f03b"; $fa-var-delicious: "\f1a5"; $fa-var-desktop: "\f108"; $fa-var-deviantart: "\f1bd"; $fa-var-diamond: "\f219"; $fa-var-digg: "\f1a6"; $fa-var-dollar: "\f155"; $fa-var-dot-circle-o: "\f192"; $fa-var-download: "\f019"; $fa-var-dribbble: "\f17d"; $fa-var-drivers-license: "\f2c2"; $fa-var-drivers-license-o: "\f2c3"; $fa-var-dropbox: "\f16b"; $fa-var-drupal: "\f1a9"; $fa-var-edge: "\f282"; $fa-var-edit: "\f044"; $fa-var-eercast: "\f2da"; $fa-var-eject: "\f052"; $fa-var-ellipsis-h: "\f141"; $fa-var-ellipsis-v: "\f142"; $fa-var-empire: "\f1d1"; $fa-var-envelope: "\f0e0"; $fa-var-envelope-o: "\f003"; $fa-var-envelope-open: "\f2b6"; $fa-var-envelope-open-o: "\f2b7"; $fa-var-envelope-square: "\f199"; $fa-var-envira: "\f299"; $fa-var-eraser: "\f12d"; $fa-var-etsy: "\f2d7"; $fa-var-eur: "\f153"; $fa-var-euro: "\f153"; $fa-var-exchange: "\f0ec"; $fa-var-exclamation: "\f12a"; $fa-var-exclamation-circle: "\f06a"; $fa-var-exclamation-triangle: "\f071"; $fa-var-expand: "\f065"; $fa-var-expeditedssl: "\f23e"; $fa-var-external-link: "\f08e"; $fa-var-external-link-square: "\f14c"; $fa-var-eye: "\f06e"; $fa-var-eye-slash: "\f070"; $fa-var-eyedropper: "\f1fb"; $fa-var-fa: "\f2b4"; $fa-var-facebook: "\f09a"; $fa-var-facebook-f: "\f09a"; $fa-var-facebook-official: "\f230"; $fa-var-facebook-square: "\f082"; $fa-var-fast-backward: "\f049"; $fa-var-fast-forward: "\f050"; $fa-var-fax: "\f1ac"; $fa-var-feed: "\f09e"; $fa-var-female: "\f182"; $fa-var-fighter-jet: "\f0fb"; $fa-var-file: "\f15b"; $fa-var-file-archive-o: "\f1c6"; $fa-var-file-audio-o: "\f1c7"; $fa-var-file-code-o: "\f1c9"; $fa-var-file-excel-o: "\f1c3"; $fa-var-file-image-o: "\f1c5"; $fa-var-file-movie-o: "\f1c8"; $fa-var-file-o: "\f016"; $fa-var-file-pdf-o: "\f1c1"; $fa-var-file-photo-o: "\f1c5"; $fa-var-file-picture-o: "\f1c5"; $fa-var-file-powerpoint-o: "\f1c4"; $fa-var-file-sound-o: "\f1c7"; $fa-var-file-text: "\f15c"; $fa-var-file-text-o: "\f0f6"; $fa-var-file-video-o: "\f1c8"; $fa-var-file-word-o: "\f1c2"; $fa-var-file-zip-o: "\f1c6"; $fa-var-files-o: "\f0c5"; $fa-var-film: "\f008"; $fa-var-filter: "\f0b0"; $fa-var-fire: "\f06d"; $fa-var-fire-extinguisher: "\f134"; $fa-var-firefox: "\f269"; $fa-var-first-order: "\f2b0"; $fa-var-flag: "\f024"; $fa-var-flag-checkered: "\f11e"; $fa-var-flag-o: "\f11d"; $fa-var-flash: "\f0e7"; $fa-var-flask: "\f0c3"; $fa-var-flickr: "\f16e"; $fa-var-floppy-o: "\f0c7"; $fa-var-folder: "\f07b"; $fa-var-folder-o: "\f114"; $fa-var-folder-open: "\f07c"; $fa-var-folder-open-o: "\f115"; $fa-var-font: "\f031"; $fa-var-font-awesome: "\f2b4"; $fa-var-fonticons: "\f280"; $fa-var-fort-awesome: "\f286"; $fa-var-forumbee: "\f211"; $fa-var-forward: "\f04e"; $fa-var-foursquare: "\f180"; $fa-var-free-code-camp: "\f2c5"; $fa-var-frown-o: "\f119"; $fa-var-futbol-o: "\f1e3"; $fa-var-gamepad: "\f11b"; $fa-var-gavel: "\f0e3"; $fa-var-gbp: "\f154"; $fa-var-ge: "\f1d1"; $fa-var-gear: "\f013"; $fa-var-gears: "\f085"; $fa-var-genderless: "\f22d"; $fa-var-get-pocket: "\f265"; $fa-var-gg: "\f260"; $fa-var-gg-circle: "\f261"; $fa-var-gift: "\f06b"; $fa-var-git: "\f1d3"; $fa-var-git-square: "\f1d2"; $fa-var-github: "\f09b"; $fa-var-github-alt: "\f113"; $fa-var-github-square: "\f092"; $fa-var-gitlab: "\f296"; $fa-var-gittip: "\f184"; $fa-var-glass: "\f000"; $fa-var-glide: "\f2a5"; $fa-var-glide-g: "\f2a6"; $fa-var-globe: "\f0ac"; $fa-var-google: "\f1a0"; $fa-var-google-plus: "\f0d5"; $fa-var-google-plus-circle: "\f2b3"; $fa-var-google-plus-official: "\f2b3"; $fa-var-google-plus-square: "\f0d4"; $fa-var-google-wallet: "\f1ee"; $fa-var-graduation-cap: "\f19d"; $fa-var-gratipay: "\f184"; $fa-var-grav: "\f2d6"; $fa-var-group: "\f0c0"; $fa-var-h-square: "\f0fd"; $fa-var-hacker-news: "\f1d4"; $fa-var-hand-grab-o: "\f255"; $fa-var-hand-lizard-o: "\f258"; $fa-var-hand-o-down: "\f0a7"; $fa-var-hand-o-left: "\f0a5"; $fa-var-hand-o-right: "\f0a4"; $fa-var-hand-o-up: "\f0a6"; $fa-var-hand-paper-o: "\f256"; $fa-var-hand-peace-o: "\f25b"; $fa-var-hand-pointer-o: "\f25a"; $fa-var-hand-rock-o: "\f255"; $fa-var-hand-scissors-o: "\f257"; $fa-var-hand-spock-o: "\f259"; $fa-var-hand-stop-o: "\f256"; $fa-var-handshake-o: "\f2b5"; $fa-var-hard-of-hearing: "\f2a4"; $fa-var-hashtag: "\f292"; $fa-var-hdd-o: "\f0a0"; $fa-var-header: "\f1dc"; $fa-var-headphones: "\f025"; $fa-var-heart: "\f004"; $fa-var-heart-o: "\f08a"; $fa-var-heartbeat: "\f21e"; $fa-var-history: "\f1da"; $fa-var-home: "\f015"; $fa-var-hospital-o: "\f0f8"; $fa-var-hotel: "\f236"; $fa-var-hourglass: "\f254"; $fa-var-hourglass-1: "\f251"; $fa-var-hourglass-2: "\f252"; $fa-var-hourglass-3: "\f253"; $fa-var-hourglass-end: "\f253"; $fa-var-hourglass-half: "\f252"; $fa-var-hourglass-o: "\f250"; $fa-var-hourglass-start: "\f251"; $fa-var-houzz: "\f27c"; $fa-var-html5: "\f13b"; $fa-var-i-cursor: "\f246"; $fa-var-id-badge: "\f2c1"; $fa-var-id-card: "\f2c2"; $fa-var-id-card-o: "\f2c3"; $fa-var-ils: "\f20b"; $fa-var-image: "\f03e"; $fa-var-imdb: "\f2d8"; $fa-var-inbox: "\f01c"; $fa-var-indent: "\f03c"; $fa-var-industry: "\f275"; $fa-var-info: "\f129"; $fa-var-info-circle: "\f05a"; $fa-var-inr: "\f156"; $fa-var-instagram: "\f16d"; $fa-var-institution: "\f19c"; $fa-var-internet-explorer: "\f26b"; $fa-var-intersex: "\f224"; $fa-var-ioxhost: "\f208"; $fa-var-italic: "\f033"; $fa-var-joomla: "\f1aa"; $fa-var-jpy: "\f157"; $fa-var-jsfiddle: "\f1cc"; $fa-var-key: "\f084"; $fa-var-keyboard-o: "\f11c"; $fa-var-krw: "\f159"; $fa-var-language: "\f1ab"; $fa-var-laptop: "\f109"; $fa-var-lastfm: "\f202"; $fa-var-lastfm-square: "\f203"; $fa-var-leaf: "\f06c"; $fa-var-leanpub: "\f212"; $fa-var-legal: "\f0e3"; $fa-var-lemon-o: "\f094"; $fa-var-level-down: "\f149"; $fa-var-level-up: "\f148"; $fa-var-life-bouy: "\f1cd"; $fa-var-life-buoy: "\f1cd"; $fa-var-life-ring: "\f1cd"; $fa-var-life-saver: "\f1cd"; $fa-var-lightbulb-o: "\f0eb"; $fa-var-line-chart: "\f201"; $fa-var-link: "\f0c1"; $fa-var-linkedin: "\f0e1"; $fa-var-linkedin-square: "\f08c"; $fa-var-linode: "\f2b8"; $fa-var-linux: "\f17c"; $fa-var-list: "\f03a"; $fa-var-list-alt: "\f022"; $fa-var-list-ol: "\f0cb"; $fa-var-list-ul: "\f0ca"; $fa-var-location-arrow: "\f124"; $fa-var-lock: "\f023"; $fa-var-long-arrow-down: "\f175"; $fa-var-long-arrow-left: "\f177"; $fa-var-long-arrow-right: "\f178"; $fa-var-long-arrow-up: "\f176"; $fa-var-low-vision: "\f2a8"; $fa-var-magic: "\f0d0"; $fa-var-magnet: "\f076"; $fa-var-mail-forward: "\f064"; $fa-var-mail-reply: "\f112"; $fa-var-mail-reply-all: "\f122"; $fa-var-male: "\f183"; $fa-var-map: "\f279"; $fa-var-map-marker: "\f041"; $fa-var-map-o: "\f278"; $fa-var-map-pin: "\f276"; $fa-var-map-signs: "\f277"; $fa-var-mars: "\f222"; $fa-var-mars-double: "\f227"; $fa-var-mars-stroke: "\f229"; $fa-var-mars-stroke-h: "\f22b"; $fa-var-mars-stroke-v: "\f22a"; $fa-var-maxcdn: "\f136"; $fa-var-meanpath: "\f20c"; $fa-var-medium: "\f23a"; $fa-var-medkit: "\f0fa"; $fa-var-meetup: "\f2e0"; $fa-var-meh-o: "\f11a"; $fa-var-mercury: "\f223"; $fa-var-microchip: "\f2db"; $fa-var-microphone: "\f130"; $fa-var-microphone-slash: "\f131"; $fa-var-minus: "\f068"; $fa-var-minus-circle: "\f056"; $fa-var-minus-square: "\f146"; $fa-var-minus-square-o: "\f147"; $fa-var-mixcloud: "\f289"; $fa-var-mobile: "\f10b"; $fa-var-mobile-phone: "\f10b"; $fa-var-modx: "\f285"; $fa-var-money: "\f0d6"; $fa-var-moon-o: "\f186"; $fa-var-mortar-board: "\f19d"; $fa-var-motorcycle: "\f21c"; $fa-var-mouse-pointer: "\f245"; $fa-var-music: "\f001"; $fa-var-navicon: "\f0c9"; $fa-var-neuter: "\f22c"; $fa-var-newspaper-o: "\f1ea"; $fa-var-object-group: "\f247"; $fa-var-object-ungroup: "\f248"; $fa-var-odnoklassniki: "\f263"; $fa-var-odnoklassniki-square: "\f264"; $fa-var-opencart: "\f23d"; $fa-var-openid: "\f19b"; $fa-var-opera: "\f26a"; $fa-var-optin-monster: "\f23c"; $fa-var-outdent: "\f03b"; $fa-var-pagelines: "\f18c"; $fa-var-paint-brush: "\f1fc"; $fa-var-paper-plane: "\f1d8"; $fa-var-paper-plane-o: "\f1d9"; $fa-var-paperclip: "\f0c6"; $fa-var-paragraph: "\f1dd"; $fa-var-paste: "\f0ea"; $fa-var-pause: "\f04c"; $fa-var-pause-circle: "\f28b"; $fa-var-pause-circle-o: "\f28c"; $fa-var-paw: "\f1b0"; $fa-var-paypal: "\f1ed"; $fa-var-pencil: "\f040"; $fa-var-pencil-square: "\f14b"; $fa-var-pencil-square-o: "\f044"; $fa-var-percent: "\f295"; $fa-var-phone: "\f095"; $fa-var-phone-square: "\f098"; $fa-var-photo: "\f03e"; $fa-var-picture-o: "\f03e"; $fa-var-pie-chart: "\f200"; $fa-var-pied-piper: "\f2ae"; $fa-var-pied-piper-alt: "\f1a8"; $fa-var-pied-piper-pp: "\f1a7"; $fa-var-pinterest: "\f0d2"; $fa-var-pinterest-p: "\f231"; $fa-var-pinterest-square: "\f0d3"; $fa-var-plane: "\f072"; $fa-var-play: "\f04b"; $fa-var-play-circle: "\f144"; $fa-var-play-circle-o: "\f01d"; $fa-var-plug: "\f1e6"; $fa-var-plus: "\f067"; $fa-var-plus-circle: "\f055"; $fa-var-plus-square: "\f0fe"; $fa-var-plus-square-o: "\f196"; $fa-var-podcast: "\f2ce"; $fa-var-power-off: "\f011"; $fa-var-print: "\f02f"; $fa-var-product-hunt: "\f288"; $fa-var-puzzle-piece: "\f12e"; $fa-var-qq: "\f1d6"; $fa-var-qrcode: "\f029"; $fa-var-question: "\f128"; $fa-var-question-circle: "\f059"; $fa-var-question-circle-o: "\f29c"; $fa-var-quora: "\f2c4"; $fa-var-quote-left: "\f10d"; $fa-var-quote-right: "\f10e"; $fa-var-ra: "\f1d0"; $fa-var-random: "\f074"; $fa-var-ravelry: "\f2d9"; $fa-var-rebel: "\f1d0"; $fa-var-recycle: "\f1b8"; $fa-var-reddit: "\f1a1"; $fa-var-reddit-alien: "\f281"; $fa-var-reddit-square: "\f1a2"; $fa-var-refresh: "\f021"; $fa-var-registered: "\f25d"; $fa-var-remove: "\f00d"; $fa-var-renren: "\f18b"; $fa-var-reorder: "\f0c9"; $fa-var-repeat: "\f01e"; $fa-var-reply: "\f112"; $fa-var-reply-all: "\f122"; $fa-var-resistance: "\f1d0"; $fa-var-retweet: "\f079"; $fa-var-rmb: "\f157"; $fa-var-road: "\f018"; $fa-var-rocket: "\f135"; $fa-var-rotate-left: "\f0e2"; $fa-var-rotate-right: "\f01e"; $fa-var-rouble: "\f158"; $fa-var-rss: "\f09e"; $fa-var-rss-square: "\f143"; $fa-var-rub: "\f158"; $fa-var-ruble: "\f158"; $fa-var-rupee: "\f156"; $fa-var-s15: "\f2cd"; $fa-var-safari: "\f267"; $fa-var-save: "\f0c7"; $fa-var-scissors: "\f0c4"; $fa-var-scribd: "\f28a"; $fa-var-search: "\f002"; $fa-var-search-minus: "\f010"; $fa-var-search-plus: "\f00e"; $fa-var-sellsy: "\f213"; $fa-var-send: "\f1d8"; $fa-var-send-o: "\f1d9"; $fa-var-server: "\f233"; $fa-var-share: "\f064"; $fa-var-share-alt: "\f1e0"; $fa-var-share-alt-square: "\f1e1"; $fa-var-share-square: "\f14d"; $fa-var-share-square-o: "\f045"; $fa-var-shekel: "\f20b"; $fa-var-sheqel: "\f20b"; $fa-var-shield: "\f132"; $fa-var-ship: "\f21a"; $fa-var-shirtsinbulk: "\f214"; $fa-var-shopping-bag: "\f290"; $fa-var-shopping-basket: "\f291"; $fa-var-shopping-cart: "\f07a"; $fa-var-shower: "\f2cc"; $fa-var-sign-in: "\f090"; $fa-var-sign-language: "\f2a7"; $fa-var-sign-out: "\f08b"; $fa-var-signal: "\f012"; $fa-var-signing: "\f2a7"; $fa-var-simplybuilt: "\f215"; $fa-var-sitemap: "\f0e8"; $fa-var-skyatlas: "\f216"; $fa-var-skype: "\f17e"; $fa-var-slack: "\f198"; $fa-var-sliders: "\f1de"; $fa-var-slideshare: "\f1e7"; $fa-var-smile-o: "\f118"; $fa-var-snapchat: "\f2ab"; $fa-var-snapchat-ghost: "\f2ac"; $fa-var-snapchat-square: "\f2ad"; $fa-var-snowflake-o: "\f2dc"; $fa-var-soccer-ball-o: "\f1e3"; $fa-var-sort: "\f0dc"; $fa-var-sort-alpha-asc: "\f15d"; $fa-var-sort-alpha-desc: "\f15e"; $fa-var-sort-amount-asc: "\f160"; $fa-var-sort-amount-desc: "\f161"; $fa-var-sort-asc: "\f0de"; $fa-var-sort-desc: "\f0dd"; $fa-var-sort-down: "\f0dd"; $fa-var-sort-numeric-asc: "\f162"; $fa-var-sort-numeric-desc: "\f163"; $fa-var-sort-up: "\f0de"; $fa-var-soundcloud: "\f1be"; $fa-var-space-shuttle: "\f197"; $fa-var-spinner: "\f110"; $fa-var-spoon: "\f1b1"; $fa-var-spotify: "\f1bc"; $fa-var-square: "\f0c8"; $fa-var-square-o: "\f096"; $fa-var-stack-exchange: "\f18d"; $fa-var-stack-overflow: "\f16c"; $fa-var-star: "\f005"; $fa-var-star-half: "\f089"; $fa-var-star-half-empty: "\f123"; $fa-var-star-half-full: "\f123"; $fa-var-star-half-o: "\f123"; $fa-var-star-o: "\f006"; $fa-var-steam: "\f1b6"; $fa-var-steam-square: "\f1b7"; $fa-var-step-backward: "\f048"; $fa-var-step-forward: "\f051"; $fa-var-stethoscope: "\f0f1"; $fa-var-sticky-note: "\f249"; $fa-var-sticky-note-o: "\f24a"; $fa-var-stop: "\f04d"; $fa-var-stop-circle: "\f28d"; $fa-var-stop-circle-o: "\f28e"; $fa-var-street-view: "\f21d"; $fa-var-strikethrough: "\f0cc"; $fa-var-stumbleupon: "\f1a4"; $fa-var-stumbleupon-circle: "\f1a3"; $fa-var-subscript: "\f12c"; $fa-var-subway: "\f239"; $fa-var-suitcase: "\f0f2"; $fa-var-sun-o: "\f185"; $fa-var-superpowers: "\f2dd"; $fa-var-superscript: "\f12b"; $fa-var-support: "\f1cd"; $fa-var-table: "\f0ce"; $fa-var-tablet: "\f10a"; $fa-var-tachometer: "\f0e4"; $fa-var-tag: "\f02b"; $fa-var-tags: "\f02c"; $fa-var-tasks: "\f0ae"; $fa-var-taxi: "\f1ba"; $fa-var-telegram: "\f2c6"; $fa-var-television: "\f26c"; $fa-var-tencent-weibo: "\f1d5"; $fa-var-terminal: "\f120"; $fa-var-text-height: "\f034"; $fa-var-text-width: "\f035"; $fa-var-th: "\f00a"; $fa-var-th-large: "\f009"; $fa-var-th-list: "\f00b"; $fa-var-themeisle: "\f2b2"; $fa-var-thermometer: "\f2c7"; $fa-var-thermometer-0: "\f2cb"; $fa-var-thermometer-1: "\f2ca"; $fa-var-thermometer-2: "\f2c9"; $fa-var-thermometer-3: "\f2c8"; $fa-var-thermometer-4: "\f2c7"; $fa-var-thermometer-empty: "\f2cb"; $fa-var-thermometer-full: "\f2c7"; $fa-var-thermometer-half: "\f2c9"; $fa-var-thermometer-quarter: "\f2ca"; $fa-var-thermometer-three-quarters: "\f2c8"; $fa-var-thumb-tack: "\f08d"; $fa-var-thumbs-down: "\f165"; $fa-var-thumbs-o-down: "\f088"; $fa-var-thumbs-o-up: "\f087"; $fa-var-thumbs-up: "\f164"; $fa-var-ticket: "\f145"; $fa-var-times: "\f00d"; $fa-var-times-circle: "\f057"; $fa-var-times-circle-o: "\f05c"; $fa-var-times-rectangle: "\f2d3"; $fa-var-times-rectangle-o: "\f2d4"; $fa-var-tint: "\f043"; $fa-var-toggle-down: "\f150"; $fa-var-toggle-left: "\f191"; $fa-var-toggle-off: "\f204"; $fa-var-toggle-on: "\f205"; $fa-var-toggle-right: "\f152"; $fa-var-toggle-up: "\f151"; $fa-var-trademark: "\f25c"; $fa-var-train: "\f238"; $fa-var-transgender: "\f224"; $fa-var-transgender-alt: "\f225"; $fa-var-trash: "\f1f8"; $fa-var-trash-o: "\f014"; $fa-var-tree: "\f1bb"; $fa-var-trello: "\f181"; $fa-var-tripadvisor: "\f262"; $fa-var-trophy: "\f091"; $fa-var-truck: "\f0d1"; $fa-var-try: "\f195"; $fa-var-tty: "\f1e4"; $fa-var-tumblr: "\f173"; $fa-var-tumblr-square: "\f174"; $fa-var-turkish-lira: "\f195"; $fa-var-tv: "\f26c"; $fa-var-twitch: "\f1e8"; $fa-var-twitter: "\f099"; $fa-var-twitter-square: "\f081"; $fa-var-umbrella: "\f0e9"; $fa-var-underline: "\f0cd"; $fa-var-undo: "\f0e2"; $fa-var-universal-access: "\f29a"; $fa-var-university: "\f19c"; $fa-var-unlink: "\f127"; $fa-var-unlock: "\f09c"; $fa-var-unlock-alt: "\f13e"; $fa-var-unsorted: "\f0dc"; $fa-var-upload: "\f093"; $fa-var-usb: "\f287"; $fa-var-usd: "\f155"; $fa-var-user: "\f007"; $fa-var-user-circle: "\f2bd"; $fa-var-user-circle-o: "\f2be"; $fa-var-user-md: "\f0f0"; $fa-var-user-o: "\f2c0"; $fa-var-user-plus: "\f234"; $fa-var-user-secret: "\f21b"; $fa-var-user-times: "\f235"; $fa-var-users: "\f0c0"; $fa-var-vcard: "\f2bb"; $fa-var-vcard-o: "\f2bc"; $fa-var-venus: "\f221"; $fa-var-venus-double: "\f226"; $fa-var-venus-mars: "\f228"; $fa-var-viacoin: "\f237"; $fa-var-viadeo: "\f2a9"; $fa-var-viadeo-square: "\f2aa"; $fa-var-video-camera: "\f03d"; $fa-var-vimeo: "\f27d"; $fa-var-vimeo-square: "\f194"; $fa-var-vine: "\f1ca"; $fa-var-vk: "\f189"; $fa-var-volume-control-phone: "\f2a0"; $fa-var-volume-down: "\f027"; $fa-var-volume-off: "\f026"; $fa-var-volume-up: "\f028"; $fa-var-warning: "\f071"; $fa-var-wechat: "\f1d7"; $fa-var-weibo: "\f18a"; $fa-var-weixin: "\f1d7"; $fa-var-whatsapp: "\f232"; $fa-var-wheelchair: "\f193"; $fa-var-wheelchair-alt: "\f29b"; $fa-var-wifi: "\f1eb"; $fa-var-wikipedia-w: "\f266"; $fa-var-window-close: "\f2d3"; $fa-var-window-close-o: "\f2d4"; $fa-var-window-maximize: "\f2d0"; $fa-var-window-minimize: "\f2d1"; $fa-var-window-restore: "\f2d2"; $fa-var-windows: "\f17a"; $fa-var-won: "\f159"; $fa-var-wordpress: "\f19a"; $fa-var-wpbeginner: "\f297"; $fa-var-wpexplorer: "\f2de"; $fa-var-wpforms: "\f298"; $fa-var-wrench: "\f0ad"; $fa-var-xing: "\f168"; $fa-var-xing-square: "\f169"; $fa-var-y-combinator: "\f23b"; $fa-var-y-combinator-square: "\f1d4"; $fa-var-yahoo: "\f19e"; $fa-var-yc: "\f23b"; $fa-var-yc-square: "\f1d4"; $fa-var-yelp: "\f1e9"; $fa-var-yen: "\f157"; $fa-var-yoast: "\f2b1"; $fa-var-youtube: "\f167"; $fa-var-youtube-play: "\f16a"; $fa-var-youtube-square: "\f166";
2301_76469554/Bootstrap_project
static/plugins/font-awesome-4.7.0/scss/_variables.scss
SCSS
unknown
22,644
import java.util.Scanner; public class maijipiao { // 类名首字母大写(规范) // 只创建一个Scanner对象,全局复用(避免重复创建) private static Scanner sc = new Scanner(System.in); public static void main(String[] args) { /* 机票价格按照淡季旺季、头等舱和经济舱收费、输入机票原价、月份和头等舱或经济舱。 按照如下规则计算机票价格:旺季(5-10月)头等舱9折,经济舱8.5折,淡季(11月到来年4月)头等舱7 折,经济舱6.5折。 */ // 主流程:选择舱位 → 输入月份 → 输入原价 → 计算折扣价 chooseCabin(); sc.close(); // 程序结束后关闭Scanner,释放资源 } // 1. 让用户选择舱位类型(头等舱/经济舱) public static void chooseCabin() { System.out.println("请选择舱位类型:"); System.out.println("1. 头等舱"); System.out.println("2. 经济舱"); int choice = sc.nextInt(); // 根据选择调用对应价格计算方法 switch (choice) { case 1: calculateVipPrice(); // 计算头等舱价格 break; case 2: calculateVipPrice(); // 计算经济舱价格 break; default: System.out.println("输入错误!请选择1或2"); chooseCabin(); // 重新选择(递归复用) } } // 2. 判断淡/旺季(抽取为独立方法,复用性更强) public static boolean isPeakSeason(int month) { // 5-10月为旺季,返回true;其他为淡季,返回false boolean flag = month >= 5 && month <= 10; return flag; } // 3. 计算折扣价 public static void calculateVipPrice() { // 输入出行月份 System.out.println("请输入您需要购买的出行月份(1-12):"); int month = sc.nextInt(); // 校验月份合法性 if (month < 1 || month > 12) { System.out.println("月份输入错误!请输入1-12之间的数字"); calculateVipPrice(); // 重新输入 return; } // 输入机票原价 System.out.println("请输入机票原价(元):"); double originalPrice = sc.nextDouble(); // 定义淡/旺季折扣 if (isPeakSeason(month)) { System.out.println("当前为旺季"); System.out.println("旺季普通用户9折"); System.out.println("旺季会员8.5折"); double COMDiscount = 0.9; // 旺季普通用户9折 double VIPDiscount = 0.85; // 旺季会员8.5折 double ComPrice = originalPrice * COMDiscount; double VIPPrice = originalPrice * VIPDiscount; System.out.println("普通用户折扣价:" + ComPrice); System.out.println("会员折扣价:" + VIPPrice); } else { System.out.println("当前为淡季"); System.out.println("淡季普通用户8折"); System.out.println("当淡季会员7.5折"); double COMDiscount = 0.8; // 淡季普通用户8折 double VIPDiscount = 0.75; // 淡季会员7.5折 double ComPrice = originalPrice * COMDiscount; double VIPPrice = originalPrice * VIPDiscount; System.out.println("普通用户折扣价:" + ComPrice); System.out.println("会员折扣价:" + VIPPrice); } } }
2301_76974020/private
TicketCalculator.java
Java
unknown
3,557
#include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ extern ADC_HandleTypeDef hadc1; /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ void MX_ADC1_Init(void); /* USER CODE BEGIN Prototypes */ /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /* __ADC_H__ */
2301_76993462/myproject
Core/Inc/adc.h
C
unknown
335
#ifndef __GPIO_H__ #define __GPIO_H__ #ifdef __cplusplus extern "C" { #endif #include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ void MX_GPIO_Init(void); /* USER CODE BEGIN Prototypes */ /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /*__ GPIO_H__ */
2301_76993462/myproject
Core/Inc/gpio.h
C
unknown
381
#ifndef __I2C_H__ #define __I2C_H__ #ifdef __cplusplus extern "C" { #endif #include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ extern I2C_HandleTypeDef hi2c1; extern I2C_HandleTypeDef hi2c2; /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ void MX_I2C1_Init(void); void MX_I2C2_Init(void); /* USER CODE BEGIN Prototypes */ /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /* __I2C_H__ */
2301_76993462/myproject
Core/Inc/i2c.h
C
unknown
470
#ifndef __MAIN_H #define __MAIN_H #ifdef __cplusplus extern "C" { #endif #include "stm32g0xx_hal.h" #include "stm32g0xx_ll_rcc.h" #include "stm32g0xx_ll_bus.h" #include "stm32g0xx_ll_system.h" #include "stm32g0xx_ll_exti.h" #include "stm32g0xx_ll_cortex.h" #include "stm32g0xx_ll_utils.h" #include "stm32g0xx_ll_pwr.h" #include "stm32g0xx_ll_dma.h" #include "stm32g0xx_ll_gpio.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "stdio.h" /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ //数据类型 typedef uint32_t u32; typedef uint16_t u16; typedef uint8_t u8; void Error_Handler(void); #ifdef __cplusplus } #endif #endif /* __MAIN_H */
2301_76993462/myproject
Core/Inc/main.h
C
unknown
814
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file stm32_assert.h * @brief STM32 assert file. ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32_ASSERT_H #define __STM32_ASSERT_H #ifdef __cplusplus extern "C" { #endif /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0U) #endif /* USE_FULL_ASSERT */ #ifdef __cplusplus } #endif #endif /* __STM32_ASSERT_H */
2301_76993462/myproject
Core/Inc/stm32_assert.h
C
unknown
1,892
#ifndef STM32G0xx_HAL_CONF_H #define STM32G0xx_HAL_CONF_H #ifdef __cplusplus extern "C" { #endif /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* ########################## Module Selection ############################## */ /** * @brief This is the list of modules to be used in the HAL driver */ #define HAL_MODULE_ENABLED #define HAL_ADC_MODULE_ENABLED /* #define HAL_CEC_MODULE_ENABLED */ /* #define HAL_COMP_MODULE_ENABLED */ /* #define HAL_CRC_MODULE_ENABLED */ /* #define HAL_CRYP_MODULE_ENABLED */ /* #define HAL_DAC_MODULE_ENABLED */ /* #define HAL_EXTI_MODULE_ENABLED */ /* #define HAL_FDCAN_MODULE_ENABLED */ /* #define HAL_HCD_MODULE_ENABLED */ #define HAL_I2C_MODULE_ENABLED /* #define HAL_I2S_MODULE_ENABLED */ /* #define HAL_IWDG_MODULE_ENABLED */ /* #define HAL_IRDA_MODULE_ENABLED */ /* #define HAL_LPTIM_MODULE_ENABLED */ /* #define HAL_PCD_MODULE_ENABLED */ /* #define HAL_RNG_MODULE_ENABLED */ /* #define HAL_RTC_MODULE_ENABLED */ /* #define HAL_SMARTCARD_MODULE_ENABLED */ /* #define HAL_SMBUS_MODULE_ENABLED */ /* #define HAL_SPI_MODULE_ENABLED */ #define HAL_TIM_MODULE_ENABLED #define HAL_UART_MODULE_ENABLED /* #define HAL_USART_MODULE_ENABLED */ /* #define HAL_WWDG_MODULE_ENABLED */ #define HAL_GPIO_MODULE_ENABLED #define HAL_EXTI_MODULE_ENABLED #define HAL_DMA_MODULE_ENABLED #define HAL_RCC_MODULE_ENABLED #define HAL_FLASH_MODULE_ENABLED #define HAL_PWR_MODULE_ENABLED #define HAL_CORTEX_MODULE_ENABLED /* ########################## Register Callbacks selection ############################## */ /** * @brief This is the list of modules where register callback can be used */ #define USE_HAL_ADC_REGISTER_CALLBACKS 0u #define USE_HAL_CEC_REGISTER_CALLBACKS 0u #define USE_HAL_COMP_REGISTER_CALLBACKS 0u #define USE_HAL_CRYP_REGISTER_CALLBACKS 0u #define USE_HAL_DAC_REGISTER_CALLBACKS 0u #define USE_HAL_FDCAN_REGISTER_CALLBACKS 0u #define USE_HAL_HCD_REGISTER_CALLBACKS 0u #define USE_HAL_I2C_REGISTER_CALLBACKS 0u #define USE_HAL_I2S_REGISTER_CALLBACKS 0u #define USE_HAL_IRDA_REGISTER_CALLBACKS 0u #define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u #define USE_HAL_PCD_REGISTER_CALLBACKS 0u #define USE_HAL_RNG_REGISTER_CALLBACKS 0u #define USE_HAL_RTC_REGISTER_CALLBACKS 0u #define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u #define USE_HAL_SPI_REGISTER_CALLBACKS 0u #define USE_HAL_TIM_REGISTER_CALLBACKS 0u #define USE_HAL_UART_REGISTER_CALLBACKS 0u #define USE_HAL_USART_REGISTER_CALLBACKS 0u #define USE_HAL_WWDG_REGISTER_CALLBACKS 0u /* ########################## Oscillator Values adaptation ####################*/ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ #if !defined (HSE_VALUE) #define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSE_STARTUP_TIMEOUT) #define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */ /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx) /** * @brief Internal High Speed oscillator (HSI48) value for USB FS, SDMMC and RNG. * This internal oscillator is mainly dedicated to provide a high precision clock to * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency * which is subject to manufacturing process variations. */ #if !defined (HSI48_VALUE) #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz. The real value my vary depending on manufacturing process variations.*/ #endif /* HSI48_VALUE */ #endif /** * @brief Internal Low Speed oscillator (LSI) value. */ #if !defined (LSI_VALUE) #define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations in voltage and temperature.*/ /** * @brief External Low Speed oscillator (LSE) value. * This value is used by the UART, RTC HAL module to compute the system frequency */ #if !defined (LSE_VALUE) #define LSE_VALUE (32768UL) /*!< Value of the External oscillator in Hz*/ #endif /* LSE_VALUE */ #if !defined (LSE_STARTUP_TIMEOUT) #define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ #endif /* LSE_STARTUP_TIMEOUT */ /** * @brief External clock source for I2S1 peripheral * This value is used by the RCC HAL module to compute the I2S1 clock source * frequency. */ #if !defined (EXTERNAL_I2S1_CLOCK_VALUE) #define EXTERNAL_I2S1_CLOCK_VALUE (12288000UL) /*!< Value of the I2S1 External clock source in Hz*/ #endif /* EXTERNAL_I2S1_CLOCK_VALUE */ #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx) /** * @brief External clock source for I2S2 peripheral * This value is used by the RCC HAL module to compute the I2S2 clock source * frequency. */ #if !defined (EXTERNAL_I2S2_CLOCK_VALUE) #define EXTERNAL_I2S2_CLOCK_VALUE 48000U /*!< Value of the I2S2 External clock source in Hz*/ #endif /* EXTERNAL_I2S2_CLOCK_VALUE */ #endif /* Tip: To avoid modifying this file each time you need to use different HSE, === you can define the HSE value in your toolchain compiler preprocessor. */ /* ########################### System Configuration ######################### */ /** * @brief This is the HAL system configuration section */ #define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ #define TICK_INT_PRIORITY 1U /*!< tick interrupt priority */ #define USE_RTOS 0U #define PREFETCH_ENABLE 1U #define INSTRUCTION_CACHE_ENABLE 1U /* ################## SPI peripheral configuration ########################## */ /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver * Activated: CRC code is present inside driver * Deactivated: CRC code cleaned from driver */ #define USE_SPI_CRC 0U /* ################## CRYP peripheral configuration ########################## */ #define USE_HAL_CRYP_SUSPEND_RESUME 1U /* ########################## Assert Selection ############################## */ /** * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ /* #define USE_FULL_ASSERT 1U */ /* Includes ------------------------------------------------------------------*/ /** * @brief Include modules header file */ #ifdef HAL_RCC_MODULE_ENABLED #include "stm32g0xx_hal_rcc.h" #endif /* HAL_RCC_MODULE_ENABLED */ #ifdef HAL_GPIO_MODULE_ENABLED #include "stm32g0xx_hal_gpio.h" #endif /* HAL_GPIO_MODULE_ENABLED */ #ifdef HAL_DMA_MODULE_ENABLED #include "stm32g0xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ #ifdef HAL_CORTEX_MODULE_ENABLED #include "stm32g0xx_hal_cortex.h" #endif /* HAL_CORTEX_MODULE_ENABLED */ #ifdef HAL_ADC_MODULE_ENABLED #include "stm32g0xx_hal_adc.h" #include "stm32g0xx_hal_adc_ex.h" #endif /* HAL_ADC_MODULE_ENABLED */ #ifdef HAL_CEC_MODULE_ENABLED #include "stm32g0xx_hal_cec.h" #endif /* HAL_CEC_MODULE_ENABLED */ #ifdef HAL_COMP_MODULE_ENABLED #include "stm32g0xx_hal_comp.h" #endif /* HAL_COMP_MODULE_ENABLED */ #ifdef HAL_CRC_MODULE_ENABLED #include "stm32g0xx_hal_crc.h" #endif /* HAL_CRC_MODULE_ENABLED */ #ifdef HAL_CRYP_MODULE_ENABLED #include "stm32g0xx_hal_cryp.h" #endif /* HAL_CRYP_MODULE_ENABLED */ #ifdef HAL_DAC_MODULE_ENABLED #include "stm32g0xx_hal_dac.h" #endif /* HAL_DAC_MODULE_ENABLED */ #ifdef HAL_EXTI_MODULE_ENABLED #include "stm32g0xx_hal_exti.h" #endif /* HAL_EXTI_MODULE_ENABLED */ #ifdef HAL_FLASH_MODULE_ENABLED #include "stm32g0xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ #ifdef HAL_FDCAN_MODULE_ENABLED #include "stm32g0xx_hal_fdcan.h" #endif /* HAL_FDCAN_MODULE_ENABLED */ #ifdef HAL_HCD_MODULE_ENABLED #include "stm32g0xx_hal_hcd.h" #endif /* HAL_HCD_MODULE_ENABLED */ #ifdef HAL_I2C_MODULE_ENABLED #include "stm32g0xx_hal_i2c.h" #endif /* HAL_I2C_MODULE_ENABLED */ #ifdef HAL_I2S_MODULE_ENABLED #include "stm32g0xx_hal_i2s.h" #endif /* HAL_I2S_MODULE_ENABLED */ #ifdef HAL_IRDA_MODULE_ENABLED #include "stm32g0xx_hal_irda.h" #endif /* HAL_IRDA_MODULE_ENABLED */ #ifdef HAL_IWDG_MODULE_ENABLED #include "stm32g0xx_hal_iwdg.h" #endif /* HAL_IWDG_MODULE_ENABLED */ #ifdef HAL_LPTIM_MODULE_ENABLED #include "stm32g0xx_hal_lptim.h" #endif /* HAL_LPTIM_MODULE_ENABLED */ #ifdef HAL_PCD_MODULE_ENABLED #include "stm32g0xx_hal_pcd.h" #endif /* HAL_PCD_MODULE_ENABLED */ #ifdef HAL_PWR_MODULE_ENABLED #include "stm32g0xx_hal_pwr.h" #endif /* HAL_PWR_MODULE_ENABLED */ #ifdef HAL_RNG_MODULE_ENABLED #include "stm32g0xx_hal_rng.h" #endif /* HAL_RNG_MODULE_ENABLED */ #ifdef HAL_RTC_MODULE_ENABLED #include "stm32g0xx_hal_rtc.h" #endif /* HAL_RTC_MODULE_ENABLED */ #ifdef HAL_SMARTCARD_MODULE_ENABLED #include "stm32g0xx_hal_smartcard.h" #endif /* HAL_SMARTCARD_MODULE_ENABLED */ #ifdef HAL_SMBUS_MODULE_ENABLED #include "stm32g0xx_hal_smbus.h" #endif /* HAL_SMBUS_MODULE_ENABLED */ #ifdef HAL_SPI_MODULE_ENABLED #include "stm32g0xx_hal_spi.h" #endif /* HAL_SPI_MODULE_ENABLED */ #ifdef HAL_TIM_MODULE_ENABLED #include "stm32g0xx_hal_tim.h" #endif /* HAL_TIM_MODULE_ENABLED */ #ifdef HAL_UART_MODULE_ENABLED #include "stm32g0xx_hal_uart.h" #endif /* HAL_UART_MODULE_ENABLED */ #ifdef HAL_USART_MODULE_ENABLED #include "stm32g0xx_hal_usart.h" #endif /* HAL_USART_MODULE_ENABLED */ #ifdef HAL_WWDG_MODULE_ENABLED #include "stm32g0xx_hal_wwdg.h" #endif /* HAL_WWDG_MODULE_ENABLED */ /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for functions parameters check. * @param expr If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t *file, uint32_t line); #else #define assert_param(expr) ((void)0U) #endif /* USE_FULL_ASSERT */ #ifdef __cplusplus } #endif #endif /* STM32G0xx_HAL_CONF_H */
2301_76993462/myproject
Core/Inc/stm32g0xx_hal_conf.h
C
unknown
11,332
#ifndef __STM32G0xx_IT_H #define __STM32G0xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ /* USER CODE END EC */ /* Exported macro ------------------------------------------------------------*/ /* USER CODE BEGIN EM */ /* USER CODE END EM */ /* Exported functions prototypes ---------------------------------------------*/ void NMI_Handler(void); void HardFault_Handler(void); void SVC_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void EXTI4_15_IRQHandler(void); void TIM3_IRQHandler(void); void TIM14_IRQHandler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ #ifdef __cplusplus } #endif #endif /* __STM32G0xx_IT_H */
2301_76993462/myproject
Core/Inc/stm32g0xx_it.h
C
unknown
1,042
#ifndef __TIM_H__ #define __TIM_H__ #ifdef __cplusplus extern "C" { #endif #include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ extern TIM_HandleTypeDef htim3; extern TIM_HandleTypeDef htim14; /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ void MX_TIM3_Init(void); void MX_TIM14_Init(void); /* USER CODE BEGIN Prototypes */ /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /* __TIM_H__ */
2301_76993462/myproject
Core/Inc/tim.h
C
unknown
472
#ifndef __USART_H__ #define __USART_H__ #ifdef __cplusplus extern "C" { #endif #include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ extern UART_HandleTypeDef huart2; /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ void MX_USART2_UART_Init(void); /* USER CODE BEGIN Prototypes */ /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /* __USART_H__ */
2301_76993462/myproject
Core/Inc/usart.h
C
unknown
427
#ifndef INC_USER_QC_GET_H_ #define INC_USER_QC_GET_H_ void QC_DP_Init(void); u8 QC_Check(void); void QC2_adj(u8 vol); void QC3_adj(u8 direct); void QC_DeInit(void); #endif
2301_76993462/myproject
Core/Inc/user/QC_Get.h
C
unknown
175
#ifndef INC_USER_INA220_H_ #define INC_USER_INA220_H_ #include "main.h" #include "stdlib.h" #define CFG_REG 0x00 //配置寄存器 #define SV_REG 0x01 //分流电压, 此处分流电阻为5mΩ #define BV_REG 0x02 //总线电压 #define PWR_REG 0x03 //电源功率 #define CUR_REG 0x04 //电流 #define CAL_REG 0x05 //校准,设定满量程范围以及电流和功率测数的 #define INA220_ADDR 0x80 //数据类型 typedef uint32_t u32; typedef uint16_t u16; typedef uint8_t u8; u16 INA220_GetVoltage(void); u16 INA220_GetCurrent(void); u16 INA220_GetPower(void); void INA220_Init(void); u8 INA220_CNVR(void); #endif /* INC_USER_INA220_H_ */
2301_76993462/myproject
Core/Inc/user/ina220.h
C
unknown
687
#ifndef INC_USER_MENU_H_ #define INC_USER_MENU_H_ extern void (*current_operation_index)(); typedef struct { unsigned char current; unsigned char up;//上键 unsigned char down;//下键 unsigned char enter;//确认键 void (*current_operation)(); } key_table; void fun0(void); void fun1(void); void fun2(void); void fun3(void); void fun4(void); void fun5(void); void fun6(void); void fun7(void); void fun8(void); void fun9(void); void fun10(void); void fun11(void); extern key_table table[30]; void Clear_mem(void); void DrawPct(u8 x,u8 y,u8 len); void CLear0(u8 x,u8 y,u16 num); #endif /* INC_USER_MENU_H_ */
2301_76993462/myproject
Core/Inc/user/menu.h
C
unknown
642
#ifndef INC_USER_OLED_H_ #define INC_USER_OLED_H_ #include "main.h" #include "stdlib.h" //设备地址 #define OLED_ADDRESS 0x78 typedef uint32_t u32; typedef uint16_t u16; typedef uint8_t u8; #define OLED_CMD 0 //写命令 #define OLED_DATA 1 //写数据 //OLED控制用函数 void OLED_Refresh(void); void OLED_WR_Byte(unsigned dat,unsigned cmd); void OLED_Display_On(void); void OLED_Display_Off(void); void OLED_Init(void); void OLED_Init_096(void); void OLED_Clear(void); void OLED_On(void); void OLED_DrawPoint(u8 x,u8 y,u8 t); void OLED_DrawLine(u8 x1,u8 y1,u8 x2,u8 y2,u8 mode); void OLED_DrawCircle(u8 x,u8 y,u8 r); void OLED_Fill(u8 x1,u8 y1,u8 x2,u8 y2,u8 dot); void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size1,u8 mode); void OLED_ShowString_H(u8 x,u8 y,u8 *chr,u8 size1,u8 mode); void OLED_ShowString_V(u8 x,u8 y,u8 *chr,u8 size1,u8 mode); u32 OLED_Pow(u8 m,u8 n); void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size1,u8 mode); void OLED_ShowDotNum(u8 x,u8 y,u32 num,u8 len,u8 size1,u8 mode); void OLED_ShowChinese(u8 x,u8 y,u8 num,u8 size1,u8 mode); void OLED_Set_Pos(unsigned char x, unsigned char y); void OLED_ShowCHinese(u8 x,u8 y,u8 no); void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[]); void fill_picture(unsigned char fill_Data); void Picture(); void Write_IIC_Command(unsigned char IIC_Command); void Write_IIC_Data(unsigned char IIC_Data); void Write_IIC_Byte(unsigned char IIC_Byte); #endif /* INC_USER_OLED_H_ */
2301_76993462/myproject
Core/Inc/user/oled.h
C
unknown
1,504
#ifndef INC_USER_OLEDFONT_H_ #define INC_USER_OLEDFONT_H_ const unsigned char asc2_0806[][6] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},// sp {0x00, 0x00, 0x00, 0x2f, 0x00, 0x00},// ! {0x00, 0x00, 0x07, 0x00, 0x07, 0x00},// " {0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14},// # {0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12},// $ {0x00, 0x62, 0x64, 0x08, 0x13, 0x23},// % {0x00, 0x36, 0x49, 0x55, 0x22, 0x50},// & {0x00, 0x00, 0x05, 0x03, 0x00, 0x00},// ' {0x00, 0x00, 0x1c, 0x22, 0x41, 0x00},// ( {0x00, 0x00, 0x41, 0x22, 0x1c, 0x00},// ) {0x00, 0x14, 0x08, 0x3E, 0x08, 0x14},// * {0x00, 0x08, 0x08, 0x3E, 0x08, 0x08},// + {0x00, 0x00, 0x00, 0xA0, 0x60, 0x00},// , {0x00, 0x08, 0x08, 0x08, 0x08, 0x08},// - {0x00, 0x00, 0x60, 0x60, 0x00, 0x00},// . {0x00, 0x20, 0x10, 0x08, 0x04, 0x02},// / {0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E},// 0 {0x00, 0x00, 0x42, 0x7F, 0x40, 0x00},// 1 {0x00, 0x42, 0x61, 0x51, 0x49, 0x46},// 2 {0x00, 0x21, 0x41, 0x45, 0x4B, 0x31},// 3 {0x00, 0x18, 0x14, 0x12, 0x7F, 0x10},// 4 {0x00, 0x27, 0x45, 0x45, 0x45, 0x39},// 5 {0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30},// 6 {0x00, 0x01, 0x71, 0x09, 0x05, 0x03},// 7 {0x00, 0x36, 0x49, 0x49, 0x49, 0x36},// 8 {0x00, 0x06, 0x49, 0x49, 0x29, 0x1E},// 9 {0x00, 0x00, 0x36, 0x36, 0x00, 0x00},// : {0x00, 0x00, 0x56, 0x36, 0x00, 0x00},// ; {0x00, 0x08, 0x14, 0x22, 0x41, 0x00},// < {0x00, 0x14, 0x14, 0x14, 0x14, 0x14},// = {0x00, 0x00, 0x41, 0x22, 0x14, 0x08},// > {0x00, 0x02, 0x01, 0x51, 0x09, 0x06},// ? {0x00, 0x32, 0x49, 0x59, 0x51, 0x3E},// @ {0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C},// A {0x00, 0x7F, 0x49, 0x49, 0x49, 0x36},// B {0x00, 0x3E, 0x41, 0x41, 0x41, 0x22},// C {0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C},// D {0x00, 0x7F, 0x49, 0x49, 0x49, 0x41},// E {0x00, 0x7F, 0x09, 0x09, 0x09, 0x01},// F {0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A},// G {0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F},// H {0x00, 0x00, 0x41, 0x7F, 0x41, 0x00},// I {0x00, 0x20, 0x40, 0x41, 0x3F, 0x01},// J {0x00, 0x7F, 0x08, 0x14, 0x22, 0x41},// K {0x00, 0x7F, 0x40, 0x40, 0x40, 0x40},// L {0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F},// M {0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F},// N {0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E},// O {0x00, 0x7F, 0x09, 0x09, 0x09, 0x06},// P {0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E},// Q {0x00, 0x7F, 0x09, 0x19, 0x29, 0x46},// R {0x00, 0x46, 0x49, 0x49, 0x49, 0x31},// S {0x00, 0x01, 0x01, 0x7F, 0x01, 0x01},// T {0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F},// U {0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F},// V {0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F},// W {0x00, 0x63, 0x14, 0x08, 0x14, 0x63},// X {0x00, 0x07, 0x08, 0x70, 0x08, 0x07},// Y {0x00, 0x61, 0x51, 0x49, 0x45, 0x43},// Z {0x00, 0x00, 0x7F, 0x41, 0x41, 0x00},// [ {0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55},// 55 {0x00, 0x00, 0x41, 0x41, 0x7F, 0x00},// ] {0x00, 0x04, 0x02, 0x01, 0x02, 0x04},// ^ {0x00, 0x40, 0x40, 0x40, 0x40, 0x40},// _ {0x00, 0x00, 0x01, 0x02, 0x04, 0x00},// ' {0x00, 0x20, 0x54, 0x54, 0x54, 0x78},// a {0x00, 0x7F, 0x48, 0x44, 0x44, 0x38},// b {0x00, 0x38, 0x44, 0x44, 0x44, 0x20},// c {0x00, 0x38, 0x44, 0x44, 0x48, 0x7F},// d {0x00, 0x38, 0x54, 0x54, 0x54, 0x18},// e {0x00, 0x08, 0x7E, 0x09, 0x01, 0x02},// f {0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C},// g {0x00, 0x7F, 0x08, 0x04, 0x04, 0x78},// h {0x00, 0x00, 0x44, 0x7D, 0x40, 0x00},// i {0x00, 0x40, 0x80, 0x84, 0x7D, 0x00},// j {0x00, 0x7F, 0x10, 0x28, 0x44, 0x00},// k {0x00, 0x00, 0x41, 0x7F, 0x40, 0x00},// l {0x00, 0x7C, 0x04, 0x18, 0x04, 0x78},// m {0x00, 0x7C, 0x08, 0x04, 0x04, 0x78},// n {0x00, 0x38, 0x44, 0x44, 0x44, 0x38},// o {0x00, 0xFC, 0x24, 0x24, 0x24, 0x18},// p {0x00, 0x18, 0x24, 0x24, 0x18, 0xFC},// q {0x00, 0x7C, 0x08, 0x04, 0x04, 0x08},// r {0x00, 0x48, 0x54, 0x54, 0x54, 0x20},// s {0x00, 0x04, 0x3F, 0x44, 0x40, 0x20},// t {0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C},// u {0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C},// v {0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C},// w {0x00, 0x44, 0x28, 0x10, 0x28, 0x44},// x {0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C},// y {0x00, 0x44, 0x64, 0x54, 0x4C, 0x44},// z {0x14, 0x14, 0x14, 0x14, 0x14, 0x14},// horiz lines }; //12*12 ASCII字符集点阵 const unsigned char asc2_1206[95][12]={ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ {0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00},/*"!",1*/ {0x00,0x0C,0x02,0x0C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/ {0x90,0xD0,0xBC,0xD0,0xBC,0x90,0x00,0x03,0x00,0x03,0x00,0x00},/*"#",3*/ {0x18,0x24,0xFE,0x44,0x8C,0x00,0x03,0x02,0x07,0x02,0x01,0x00},/*"$",4*/ {0x18,0x24,0xD8,0xB0,0x4C,0x80,0x00,0x03,0x00,0x01,0x02,0x01},/*"%",5*/ {0xC0,0x38,0xE4,0x38,0xE0,0x00,0x01,0x02,0x02,0x01,0x02,0x02},/*"&",6*/ {0x08,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ {0x00,0x00,0x00,0xF8,0x04,0x02,0x00,0x00,0x00,0x01,0x02,0x04},/*"(",8*/ {0x00,0x02,0x04,0xF8,0x00,0x00,0x00,0x04,0x02,0x01,0x00,0x00},/*")",9*/ {0x90,0x60,0xF8,0x60,0x90,0x00,0x00,0x00,0x01,0x00,0x00,0x00},/*"*",10*/ {0x20,0x20,0xFC,0x20,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00},/*"+",11*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x06,0x00,0x00,0x00,0x00},/*",",12*/ {0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",13*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00},/*".",14*/ {0x00,0x80,0x60,0x1C,0x02,0x00,0x04,0x03,0x00,0x00,0x00,0x00},/*"/",15*/ {0xF8,0x04,0x04,0x04,0xF8,0x00,0x01,0x02,0x02,0x02,0x01,0x00},/*"0",16*/ {0x00,0x08,0xFC,0x00,0x00,0x00,0x00,0x02,0x03,0x02,0x00,0x00},/*"1",17*/ {0x18,0x84,0x44,0x24,0x18,0x00,0x03,0x02,0x02,0x02,0x02,0x00},/*"2",18*/ {0x08,0x04,0x24,0x24,0xD8,0x00,0x01,0x02,0x02,0x02,0x01,0x00},/*"3",19*/ {0x40,0xB0,0x88,0xFC,0x80,0x00,0x00,0x00,0x00,0x03,0x02,0x00},/*"4",20*/ {0x3C,0x24,0x24,0x24,0xC4,0x00,0x01,0x02,0x02,0x02,0x01,0x00},/*"5",21*/ {0xF8,0x24,0x24,0x2C,0xC0,0x00,0x01,0x02,0x02,0x02,0x01,0x00},/*"6",22*/ {0x0C,0x04,0xE4,0x1C,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00},/*"7",23*/ {0xD8,0x24,0x24,0x24,0xD8,0x00,0x01,0x02,0x02,0x02,0x01,0x00},/*"8",24*/ {0x38,0x44,0x44,0x44,0xF8,0x00,0x00,0x03,0x02,0x02,0x01,0x00},/*"9",25*/ {0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00},/*":",26*/ {0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00},/*";",27*/ {0x00,0x20,0x50,0x88,0x04,0x02,0x00,0x00,0x00,0x00,0x01,0x02},/*"<",28*/ {0x90,0x90,0x90,0x90,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"=",29*/ {0x00,0x02,0x04,0x88,0x50,0x20,0x00,0x02,0x01,0x00,0x00,0x00},/*">",30*/ {0x18,0x04,0xC4,0x24,0x18,0x00,0x00,0x00,0x02,0x00,0x00,0x00},/*"?",31*/ {0xF8,0x04,0xE4,0x94,0xF8,0x00,0x01,0x02,0x02,0x02,0x02,0x00},/*"@",32*/ {0x00,0xE0,0x9C,0xF0,0x80,0x00,0x02,0x03,0x00,0x00,0x03,0x02},/*"A",33*/ {0x04,0xFC,0x24,0x24,0xD8,0x00,0x02,0x03,0x02,0x02,0x01,0x00},/*"B",34*/ {0xF8,0x04,0x04,0x04,0x0C,0x00,0x01,0x02,0x02,0x02,0x01,0x00},/*"C",35*/ {0x04,0xFC,0x04,0x04,0xF8,0x00,0x02,0x03,0x02,0x02,0x01,0x00},/*"D",36*/ {0x04,0xFC,0x24,0x74,0x0C,0x00,0x02,0x03,0x02,0x02,0x03,0x00},/*"E",37*/ {0x04,0xFC,0x24,0x74,0x0C,0x00,0x02,0x03,0x02,0x00,0x00,0x00},/*"F",38*/ {0xF0,0x08,0x04,0x44,0xCC,0x40,0x00,0x01,0x02,0x02,0x01,0x00},/*"G",39*/ {0x04,0xFC,0x20,0x20,0xFC,0x04,0x02,0x03,0x00,0x00,0x03,0x02},/*"H",40*/ {0x04,0x04,0xFC,0x04,0x04,0x00,0x02,0x02,0x03,0x02,0x02,0x00},/*"I",41*/ {0x00,0x04,0x04,0xFC,0x04,0x04,0x06,0x04,0x04,0x03,0x00,0x00},/*"J",42*/ {0x04,0xFC,0x24,0xD0,0x0C,0x04,0x02,0x03,0x02,0x00,0x03,0x02},/*"K",43*/ {0x04,0xFC,0x04,0x00,0x00,0x00,0x02,0x03,0x02,0x02,0x02,0x03},/*"L",44*/ {0xFC,0x3C,0xC0,0x3C,0xFC,0x00,0x03,0x00,0x03,0x00,0x03,0x00},/*"M",45*/ {0x04,0xFC,0x30,0xC4,0xFC,0x04,0x02,0x03,0x02,0x00,0x03,0x00},/*"N",46*/ {0xF8,0x04,0x04,0x04,0xF8,0x00,0x01,0x02,0x02,0x02,0x01,0x00},/*"O",47*/ {0x04,0xFC,0x24,0x24,0x18,0x00,0x02,0x03,0x02,0x00,0x00,0x00},/*"P",48*/ {0xF8,0x84,0x84,0x04,0xF8,0x00,0x01,0x02,0x02,0x07,0x05,0x00},/*"Q",49*/ {0x04,0xFC,0x24,0x64,0x98,0x00,0x02,0x03,0x02,0x00,0x03,0x02},/*"R",50*/ {0x18,0x24,0x24,0x44,0x8C,0x00,0x03,0x02,0x02,0x02,0x01,0x00},/*"S",51*/ {0x0C,0x04,0xFC,0x04,0x0C,0x00,0x00,0x02,0x03,0x02,0x00,0x00},/*"T",52*/ {0x04,0xFC,0x00,0x00,0xFC,0x04,0x00,0x01,0x02,0x02,0x01,0x00},/*"U",53*/ {0x04,0x7C,0x80,0xE0,0x1C,0x04,0x00,0x00,0x03,0x00,0x00,0x00},/*"V",54*/ {0x1C,0xE0,0x3C,0xE0,0x1C,0x00,0x00,0x03,0x00,0x03,0x00,0x00},/*"W",55*/ {0x04,0x9C,0x60,0x9C,0x04,0x00,0x02,0x03,0x00,0x03,0x02,0x00},/*"X",56*/ {0x04,0x1C,0xE0,0x1C,0x04,0x00,0x00,0x02,0x03,0x02,0x00,0x00},/*"Y",57*/ {0x0C,0x84,0x64,0x1C,0x04,0x00,0x02,0x03,0x02,0x02,0x03,0x00},/*"Z",58*/ {0x00,0x00,0xFE,0x02,0x02,0x00,0x00,0x00,0x07,0x04,0x04,0x00},/*"[",59*/ {0x00,0x0E,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x00},/*"\",60*/ {0x00,0x02,0x02,0xFE,0x00,0x00,0x00,0x04,0x04,0x07,0x00,0x00},/*"]",61*/ {0x00,0x04,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08},/*"_",63*/ {0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ {0x00,0x40,0xA0,0xA0,0xC0,0x00,0x00,0x01,0x02,0x02,0x03,0x02},/*"a",65*/ {0x04,0xFC,0x20,0x20,0xC0,0x00,0x00,0x03,0x02,0x02,0x01,0x00},/*"b",66*/ {0x00,0xC0,0x20,0x20,0x60,0x00,0x00,0x01,0x02,0x02,0x02,0x00},/*"c",67*/ {0x00,0xC0,0x20,0x24,0xFC,0x00,0x00,0x01,0x02,0x02,0x03,0x02},/*"d",68*/ {0x00,0xC0,0xA0,0xA0,0xC0,0x00,0x00,0x01,0x02,0x02,0x02,0x00},/*"e",69*/ {0x00,0x20,0xF8,0x24,0x24,0x04,0x00,0x02,0x03,0x02,0x02,0x00},/*"f",70*/ {0x00,0x40,0xA0,0xA0,0x60,0x20,0x00,0x07,0x0A,0x0A,0x0A,0x04},/*"g",71*/ {0x04,0xFC,0x20,0x20,0xC0,0x00,0x02,0x03,0x02,0x00,0x03,0x02},/*"h",72*/ {0x00,0x20,0xE4,0x00,0x00,0x00,0x00,0x02,0x03,0x02,0x00,0x00},/*"i",73*/ {0x00,0x00,0x20,0xE4,0x00,0x00,0x08,0x08,0x08,0x07,0x00,0x00},/*"j",74*/ {0x04,0xFC,0x80,0xE0,0x20,0x20,0x02,0x03,0x02,0x00,0x03,0x02},/*"k",75*/ {0x04,0x04,0xFC,0x00,0x00,0x00,0x02,0x02,0x03,0x02,0x02,0x00},/*"l",76*/ {0xE0,0x20,0xE0,0x20,0xC0,0x00,0x03,0x00,0x03,0x00,0x03,0x00},/*"m",77*/ {0x20,0xE0,0x20,0x20,0xC0,0x00,0x02,0x03,0x02,0x00,0x03,0x02},/*"n",78*/ {0x00,0xC0,0x20,0x20,0xC0,0x00,0x00,0x01,0x02,0x02,0x01,0x00},/*"o",79*/ {0x20,0xE0,0x20,0x20,0xC0,0x00,0x08,0x0F,0x0A,0x02,0x01,0x00},/*"p",80*/ {0x00,0xC0,0x20,0x20,0xE0,0x00,0x00,0x01,0x02,0x0A,0x0F,0x08},/*"q",81*/ {0x20,0xE0,0x40,0x20,0x20,0x00,0x02,0x03,0x02,0x00,0x00,0x00},/*"r",82*/ {0x00,0x60,0xA0,0xA0,0x20,0x00,0x00,0x02,0x02,0x02,0x03,0x00},/*"s",83*/ {0x00,0x20,0xF8,0x20,0x00,0x00,0x00,0x00,0x01,0x02,0x02,0x00},/*"t",84*/ {0x20,0xE0,0x00,0x20,0xE0,0x00,0x00,0x01,0x02,0x02,0x03,0x02},/*"u",85*/ {0x20,0xE0,0x20,0x80,0x60,0x20,0x00,0x00,0x03,0x01,0x00,0x00},/*"v",86*/ {0x60,0x80,0xE0,0x80,0x60,0x00,0x00,0x03,0x00,0x03,0x00,0x00},/*"w",87*/ {0x20,0x60,0x80,0x60,0x20,0x00,0x02,0x03,0x00,0x03,0x02,0x00},/*"x",88*/ {0x20,0xE0,0x20,0x80,0x60,0x20,0x08,0x08,0x07,0x01,0x00,0x00},/*"y",89*/ {0x00,0x20,0xA0,0x60,0x20,0x00,0x00,0x02,0x03,0x02,0x02,0x00},/*"z",90*/ {0x00,0x00,0x20,0xDE,0x02,0x00,0x00,0x00,0x00,0x07,0x04,0x00},/*"{",91*/ {0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00},/*"|",92*/ {0x00,0x02,0xDE,0x20,0x00,0x00,0x00,0x04,0x07,0x00,0x00,0x00},/*"}",93*/ {0x02,0x01,0x02,0x04,0x04,0x02,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",94*/ }; //16*16 ASCII字符集点阵 const unsigned char asc2_1608[][16]={ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ {0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00},/*"!",1*/ {0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/ {0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00},/*"#",3*/ {0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00},/*"$",4*/ {0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00},/*"%",5*/ {0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10},/*"&",6*/ {0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ {0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00},/*"(",8*/ {0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00},/*")",9*/ {0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00},/*"*",10*/ {0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00},/*"+",11*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00},/*",",12*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01},/*"-",13*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00},/*".",14*/ {0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00},/*"/",15*/ {0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00},/*"0",16*/ {0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"1",17*/ {0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00},/*"2",18*/ {0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00},/*"3",19*/ {0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00},/*"4",20*/ {0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00},/*"5",21*/ {0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00},/*"6",22*/ {0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00},/*"7",23*/ {0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00},/*"8",24*/ {0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00},/*"9",25*/ {0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00},/*":",26*/ {0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00},/*";",27*/ {0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00},/*"<",28*/ {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00},/*"=",29*/ {0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00},/*">",30*/ {0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00},/*"?",31*/ {0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00},/*"@",32*/ //{0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20},/*"A",33*/ {0x00,0x80,0x78,0x47,0x5C,0xE0,0x00,0x00,0x04,0x07,0x04,0x00,0x00,0x04,0x07,0x04},/*"A",33*/ {0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00},/*"B",34*/ {0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00},/*"C",35*/ {0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00},/*"D",36*/ {0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00},/*"E",37*/ {0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00},/*"F",38*/ {0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00},/*"G",39*/ {0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20},/*"H",40*/ {0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"I",41*/ {0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00},/*"J",42*/ {0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00},/*"K",43*/ {0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00},/*"L",44*/ {0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00},/*"M",45*/ {0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00},/*"N",46*/ {0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00},/*"O",47*/ {0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00},/*"P",48*/ {0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00},/*"Q",49*/ {0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20},/*"R",50*/ {0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00},/*"S",51*/ {0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00},/*"T",52*/ {0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00},/*"U",53*/ //{0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00},/*"V",54*/ {0x01,0x0F,0xF1,0x00,0xC0,0x39,0x07,0x01,0x00,0x00,0x00,0x07,0x01,0x00,0x00,0x00},/*"V",54*/ //{0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00},/*"W",55*/ {0x7F,0x81,0xE0,0x1F,0xE0,0x81,0x7F,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00},/*"W",55*/ {0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20},/*"X",56*/ {0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00},/*"Y",57*/ {0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00},/*"Z",58*/ {0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00},/*"[",59*/ {0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00},/*"\",60*/ {0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00},/*"]",61*/ {0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},/*"_",63*/ {0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ {0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20},/*"a",65*/ {0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00},/*"b",66*/ {0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00},/*"c",67*/ {0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20},/*"d",68*/ {0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00},/*"e",69*/ {0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"f",70*/ {0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00},/*"g",71*/ {0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20},/*"h",72*/ {0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"i",73*/ {0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00},/*"j",74*/ {0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00},/*"k",75*/ {0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"l",76*/ //{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F},/*"m",77*/ {0x10,0xF0,0x10,0x10,0xF0,0x10,0x10,0xE0,0x04,0x07,0x04,0x00,0x07,0x04,0x00,0x07},/*"m",77*/ {0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20},/*"n",78*/ {0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00},/*"o",79*/ {0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00},/*"p",80*/ {0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80},/*"q",81*/ {0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00},/*"r",82*/ {0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00},/*"s",83*/ {0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00},/*"t",84*/ {0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20},/*"u",85*/ {0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00},/*"v",86*/ {0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00},/*"w",87*/ {0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00},/*"x",88*/ {0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00},/*"y",89*/ {0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00},/*"z",90*/ {0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40},/*"{",91*/ {0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},/*"|",92*/ {0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00},/*"}",93*/ {0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",94*/ }; const unsigned char Hzk1[][24]={ {0xFC,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0xFC,0x00,0x00,0x00,0x03,0x01,0x01,0x01,0x07,0x09,0x09,0x09,0x09,0x08,0x0E,0x00},/*"电",0*/ {0x00,0xFE,0x02,0x42,0x42,0x42,0xFA,0x42,0x42,0x42,0x02,0x00,0x08,0x07,0x08,0x08,0x08,0x08,0x0F,0x08,0x09,0x0A,0x08,0x00},/*"压",1*/ /*"电",0*/ {0x22,0x44,0x00,0x24,0xB4,0x2C,0xA5,0x26,0xA4,0x34,0x64,0x00,0x04,0x02,0x08,0x04,0x03,0x00,0x0F,0x00,0x07,0x08,0x0E,0x00},/*"流",2*/ {0x04,0x04,0xFC,0x04,0x04,0x08,0xFF,0x08,0x08,0x08,0xF8,0x00,0x02,0x02,0x01,0x09,0x05,0x03,0x00,0x00,0x08,0x08,0x07,0x00},/*"功",3*/ {0x02,0x8A,0x52,0x9A,0xD6,0xB3,0xD2,0x8A,0x52,0x8A,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x0F,0x02,0x02,0x02,0x02,0x02,0x00},/*"率",4*/ {0x10,0x11,0xF2,0x00,0x50,0xCF,0x41,0x41,0x4F,0xD0,0x10,0x00,0x00,0x00,0x07,0x02,0x08,0x08,0x05,0x02,0x05,0x08,0x08,0x00},/*"设",5*/ {0x10,0x17,0xD5,0x55,0x57,0x7D,0x57,0x55,0xD5,0x17,0x10,0x00,0x08,0x08,0x0F,0x08,0x08,0x0E,0x08,0x08,0x0F,0x08,0x08,0x00},/*"置",6*/ {0x78,0x00,0xFF,0x48,0x44,0x44,0xFF,0x44,0x44,0x7C,0x40,0x00,0x00,0x00,0x0F,0x08,0x04,0x03,0x00,0x03,0x04,0x08,0x08,0x00},/*"快",7*/ {0x04,0x44,0x64,0xD4,0x4D,0x46,0x44,0xD4,0x64,0xC4,0x04,0x00,0x08,0x08,0x04,0x03,0x00,0x00,0x00,0x07,0x08,0x08,0x0E,0x00},/*"充",8*/ {0x88,0x68,0xFF,0x48,0x10,0x28,0xA4,0x23,0x24,0xA8,0x10,0x00,0x00,0x00,0x0F,0x00,0x09,0x0E,0x08,0x0B,0x0C,0x0B,0x08,0x00},/*"检",9*/ {0x22,0x44,0xFE,0x02,0xFA,0x02,0xFE,0x00,0xFC,0x00,0xFF,0x00,0x04,0x02,0x09,0x04,0x03,0x04,0x09,0x00,0x01,0x08,0x0F,0x00},/*"测",10*/ {0x10,0x11,0xF2,0x00,0x28,0x5A,0xCA,0x7E,0x49,0xD9,0x28,0x00,0x00,0x00,0x07,0x02,0x09,0x06,0x01,0x00,0x09,0x09,0x07,0x00},/*"诱",11*/ {0x7A,0x42,0xDE,0x80,0xFE,0x2A,0xEA,0x2B,0xEA,0x2A,0xEE,0x00,0x0A,0x09,0x07,0x00,0x0F,0x01,0x07,0x01,0x07,0x09,0x0F,0x00},/*"骗",12*/ {0x2C,0x24,0xA4,0x24,0x25,0xE6,0x24,0x24,0x24,0x24,0x2C,0x00,0x08,0x04,0x03,0x04,0x08,0x0F,0x09,0x09,0x09,0x09,0x08,0x00},/*"定",13*/ {0xFE,0x22,0x22,0xFE,0x00,0x08,0x48,0x88,0x08,0xFF,0x08,0x00,0x07,0x02,0x02,0x07,0x00,0x00,0x00,0x09,0x08,0x0F,0x00,0x00},/*"时",14*/ {0x48,0x2A,0x98,0x7F,0x28,0x4A,0x10,0xEF,0x08,0xF8,0x08,0x00,0x09,0x0B,0x05,0x05,0x0B,0x00,0x08,0x05,0x02,0x05,0x08,0x00},/*"数",15*/ {0x88,0x88,0xFF,0x48,0x00,0xFE,0xAA,0xAA,0xFA,0xAA,0xAE,0x00,0x00,0x08,0x0F,0x08,0x06,0x01,0x0F,0x04,0x04,0x04,0x0F,0x00},/*"据",16*/ {0x10,0x11,0xF2,0x00,0x00,0xE2,0x22,0x22,0x22,0x3E,0x00,0x00,0x00,0x00,0x07,0x02,0x01,0x07,0x08,0x08,0x08,0x08,0x0E,0x00},/*"记",17*/ {0x10,0x51,0x95,0x15,0x95,0xF5,0x95,0x15,0x9F,0x50,0x10,0x00,0x04,0x04,0x02,0x01,0x08,0x0F,0x00,0x01,0x02,0x04,0x04,0x00},/*"录",18*/ {0x08,0xFA,0xAA,0xAA,0xAA,0xFE,0xA9,0xA9,0xA9,0xF9,0x08,0x00,0x08,0x0A,0x0A,0x0A,0x0A,0x0F,0x0A,0x0A,0x0A,0x0A,0x08,0x00},/*"重",19*/ {0x08,0xFF,0xA9,0xA9,0xA9,0xFB,0xAD,0xA9,0xA9,0xFF,0x08,0x00,0x08,0x0A,0x0A,0x0A,0x0A,0x0F,0x0A,0x0A,0x0A,0x0A,0x08,0x00},/*"量",20*/ {0x10,0x11,0xF2,0x00,0xFE,0x0A,0x2A,0x4A,0x89,0x49,0x39,0x00,0x08,0x04,0x03,0x06,0x09,0x08,0x0A,0x09,0x08,0x09,0x0A,0x00},/*"返",21*/ {0x00,0xFE,0x02,0x02,0xF2,0x92,0x92,0xF2,0x02,0x02,0xFE,0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x0F,0x00},/*"回",22*/ {0x04,0x44,0x64,0xD4,0x4D,0x46,0x44,0xD4,0x64,0xC4,0x04,0x00,0x08,0x08,0x04,0x03,0x00,0x00,0x00,0x07,0x08,0x08,0x0E,0x00},/*"充",23*/ {0x00,0x00,0x01,0x81,0x72,0x0C,0x70,0x80,0x00,0x00,0x00,0x00,0x08,0x04,0x02,0x01,0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x00},/*"入",24*/ {0x88,0xFF,0x48,0x00,0xFF,0x05,0x95,0xD5,0xB5,0x95,0xD7,0x00,0x08,0x0F,0x00,0x08,0x07,0x08,0x0A,0x0A,0x0F,0x0A,0x0A,0x00},/*"握",25*/ {0x80,0x92,0x92,0x92,0x92,0xFE,0x91,0x91,0x91,0x91,0x80,0x00,0x00,0x00,0x00,0x08,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,0x00},/*"手",26*/ {0x00,0xF8,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0xF8,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x01,0x00,0x00},/*"中",27*/ {0x00,0x12,0x94,0x90,0x90,0x9F,0x90,0x90,0x94,0xF2,0x00,0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x0F,0x00,0x00},/*"当",28*/ {0x04,0xF4,0x55,0x56,0x54,0xF4,0x04,0xE6,0x05,0xF4,0x04,0x00,0x00,0x0F,0x01,0x01,0x09,0x0F,0x00,0x03,0x08,0x0F,0x00,0x00},/*"前",29*/ {0x00,0xFE,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x0F,0x00,0x00},/*"目",30*/ {0x88,0x68,0xFF,0x48,0x10,0x92,0x12,0xF2,0x12,0x92,0x10,0x00,0x00,0x00,0x0F,0x00,0x02,0x01,0x08,0x0F,0x00,0x00,0x03,0x00},/*"标",31*/ /*"电",0*/ /*"量",20*/ {0x82,0x82,0xBA,0xAA,0xAA,0xAB,0xAA,0xAA,0xBA,0x82,0x82,0x00,0x09,0x08,0x06,0x02,0x02,0x02,0x02,0x06,0x08,0x08,0x0D,0x00},/*"亮",32*/ {0x00,0xFE,0x0A,0x8A,0xBE,0xAA,0xAB,0xAA,0xBE,0x8A,0x0A,0x00,0x08,0x07,0x00,0x08,0x09,0x0A,0x04,0x04,0x0A,0x09,0x08,0x00},/*"度",33*/ }; #endif
2301_76993462/myproject
Core/Inc/user/oledfont.h
C
unknown
25,209
#include "adc.h" ADC_HandleTypeDef hadc1; /* ADC1 init function */ void MX_ADC1_Init(void) { /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc1.Init.LowPowerAutoWait = DISABLE; hadc1.Init.LowPowerAutoPowerOff = ENABLE; hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.NbrOfConversion = 1; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc1.Init.DMAContinuousRequests = DISABLE; hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED; hadc1.Init.SamplingTimeCommon1 = ADC_SAMPLETIME_160CYCLES_5; hadc1.Init.SamplingTimeCommon2 = ADC_SAMPLETIME_160CYCLES_5; hadc1.Init.OversamplingMode = DISABLE; hadc1.Init.TriggerFrequencyMode = ADC_TRIGGER_FREQ_HIGH; if (HAL_ADC_Init(&hadc1) != HAL_OK) { Error_Handler(); } /** Configure Regular Channel */ sConfig.Channel = ADC_CHANNEL_0; sConfig.Rank = ADC_REGULAR_RANK_1; sConfig.SamplingTime = ADC_SAMPLINGTIME_COMMON_1; if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN ADC1_Init 2 */ /* USER CODE END ADC1_Init 2 */ } void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(adcHandle->Instance==ADC1) { /* USER CODE BEGIN ADC1_MspInit 0 */ /* USER CODE END ADC1_MspInit 0 */ LL_RCC_SetADCClockSource(LL_RCC_ADC_CLKSOURCE_HSI); /* ADC1 clock enable */ __HAL_RCC_ADC_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); GPIO_InitStruct.Pin = GPIO_PIN_0; GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); GPIO_InitStruct.Pin = GPIO_PIN_1; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_PULLDOWN; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); } } void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) { if(adcHandle->Instance==ADC1) { __HAL_RCC_ADC_CLK_DISABLE(); /**ADC1 GPIO Configuration PA0 ------> ADC1_IN0 */ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0); /* USER CODE BEGIN ADC1_MspDeInit 1 */ /* USER CODE END ADC1_MspDeInit 1 */ } } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */
2301_76993462/myproject
Core/Src/adc.c
C
unknown
2,727
#include "gpio.h" void MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); /*Configure GPIO pins : PA4 PA5 PA6 PA7 */ GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); } /* USER CODE BEGIN 2 */ /* USER CODE END 2 */
2301_76993462/myproject
Core/Src/gpio.c
C
unknown
476
#include "i2c.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ I2C_HandleTypeDef hi2c1; I2C_HandleTypeDef hi2c2; /* I2C1 init function */ void MX_I2C1_Init(void) { /* USER CODE BEGIN I2C1_Init 0 */ /* USER CODE END I2C1_Init 0 */ /* USER CODE BEGIN I2C1_Init 1 */ /* USER CODE END I2C1_Init 1 */ hi2c1.Instance = I2C1; hi2c1.Init.Timing = 0x20000209; hi2c1.Init.OwnAddress1 = 0; hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; hi2c1.Init.OwnAddress2 = 0; hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK; hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; if (HAL_I2C_Init(&hi2c1) != HAL_OK) { Error_Handler(); } /** Configure Analogue filter */ if (HAL_I2CEx_ConfigAnalogFilter(&hi2c1, I2C_ANALOGFILTER_ENABLE) != HAL_OK) { Error_Handler(); } /** Configure Digital filter */ if (HAL_I2CEx_ConfigDigitalFilter(&hi2c1, 0) != HAL_OK) { Error_Handler(); } /** I2C Fast mode Plus enable */ HAL_I2CEx_EnableFastModePlus(I2C_FASTMODEPLUS_I2C1); /* USER CODE BEGIN I2C1_Init 2 */ /* USER CODE END I2C1_Init 2 */ } /* I2C2 init function */ void MX_I2C2_Init(void) { /* USER CODE BEGIN I2C2_Init 0 */ /* USER CODE END I2C2_Init 0 */ /* USER CODE BEGIN I2C2_Init 1 */ /* USER CODE END I2C2_Init 1 */ hi2c2.Instance = I2C2; hi2c2.Init.Timing = 0x20303E5D; hi2c2.Init.OwnAddress1 = 0; hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; hi2c2.Init.OwnAddress2 = 0; hi2c2.Init.OwnAddress2Masks = I2C_OA2_NOMASK; hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; if (HAL_I2C_Init(&hi2c2) != HAL_OK) { Error_Handler(); } /** Configure Analogue filter */ if (HAL_I2CEx_ConfigAnalogFilter(&hi2c2, I2C_ANALOGFILTER_ENABLE) != HAL_OK) { Error_Handler(); } /** Configure Digital filter */ if (HAL_I2CEx_ConfigDigitalFilter(&hi2c2, 0) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN I2C2_Init 2 */ /* USER CODE END I2C2_Init 2 */ } void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(i2cHandle->Instance==I2C1) { /* USER CODE BEGIN I2C1_MspInit 0 */ /* USER CODE END I2C1_MspInit 0 */ LL_RCC_SetI2CClockSource(LL_RCC_I2C1_CLKSOURCE_PCLK1); __HAL_RCC_GPIOB_CLK_ENABLE(); GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF6_I2C1; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); HAL_I2CEx_EnableFastModePlus(SYSCFG_FASTMODEPLUS_PB8); HAL_I2CEx_EnableFastModePlus(SYSCFG_FASTMODEPLUS_PB9); /* I2C1 clock enable */ __HAL_RCC_I2C1_CLK_ENABLE(); /* USER CODE BEGIN I2C1_MspInit 1 */ /* USER CODE END I2C1_MspInit 1 */ } else if(i2cHandle->Instance==I2C2) { /* USER CODE BEGIN I2C2_MspInit 0 */ /* USER CODE END I2C2_MspInit 0 */ __HAL_RCC_GPIOA_CLK_ENABLE(); GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF6_I2C2; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /* I2C2 clock enable */ __HAL_RCC_I2C2_CLK_ENABLE(); /* USER CODE BEGIN I2C2_MspInit 1 */ /* USER CODE END I2C2_MspInit 1 */ } } void HAL_I2C_MspDeInit(I2C_HandleTypeDef* i2cHandle) { if(i2cHandle->Instance==I2C1) { /* USER CODE BEGIN I2C1_MspDeInit 0 */ /* USER CODE END I2C1_MspDeInit 0 */ /* Peripheral clock disable */ __HAL_RCC_I2C1_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOB, GPIO_PIN_8); HAL_GPIO_DeInit(GPIOB, GPIO_PIN_9); /* USER CODE BEGIN I2C1_MspDeInit 1 */ /* USER CODE END I2C1_MspDeInit 1 */ } else if(i2cHandle->Instance==I2C2) { /* USER CODE BEGIN I2C2_MspDeInit 0 */ /* USER CODE END I2C2_MspDeInit 0 */ /* Peripheral clock disable */ __HAL_RCC_I2C2_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11); HAL_GPIO_DeInit(GPIOA, GPIO_PIN_12); /* USER CODE BEGIN I2C2_MspDeInit 1 */ /* USER CODE END I2C2_MspDeInit 1 */ } } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */
2301_76993462/myproject
Core/Src/i2c.c
C
unknown
4,428
#include "main.h" #include "i2c.h" #include "tim.h" #include "usart.h" #include "gpio.h" #include "user/oled.h" #include "user/ina220.h" #include "user/menu.h" #include "adc.h" #include "user/QC_Get.h" #define voltage ina220_data[0] #define current ina220_data[1] #define power ina220_data[2] #define energy ina220_data[3] u16 ina220_data[4]={0,0,0,0}; double energy_temp=0; u8 key_enter=0,key_up=0,key_down=0,key_back=0; u8 adj_up=0,adj_down=0; u8 time_1s_ok=0; u8 func_index=0; u16 mem_addr_base=0x0000; u16 mem_addr_base_r=0x0000; u8 oled_on=1; u8 data_sw=0; void SystemClock_Config(void); static void MX_NVIC_Init(void); int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_I2C1_Init(); MX_I2C2_Init(); MX_USART2_UART_Init(); MX_TIM3_Init(); MX_TIM14_Init(); MX_NVIC_Init(); HAL_TIM_Base_Start_IT(&htim14); HAL_TIM_Base_Start_IT(&htim3); Clear_mem(); OLED_Init_096(); //初始化OLED INA220_Init(); //初始化ina220 key_back=key_enter=key_up=key_down=0; while (1) { OLED_Refresh(); if(time_1s_ok) { time_1s_ok=0; voltage = INA220_GetVoltage(); current = INA220_GetCurrent(); power = INA220_GetPower(); energy_temp = energy_temp + power*0.00027777; energy = energy_temp; if(power!=0&&mem_addr_base<0xE00) { HAL_I2C_Mem_Write(&hi2c1,0xA0,mem_addr_base,I2C_MEMADD_SIZE_16BIT,(u8*)ina220_data,4,100); mem_addr_base=mem_addr_base+4; } } /*******************find index****************************/ if((key_enter==1)||(key_up==1)||(key_down==1)) { if(key_up==1) { func_index=table[func_index].up; //up key_up=0; } if(key_down==1) { func_index=table[func_index].down; //down key_down=0; } if(key_enter==1) { OLED_Clear(); func_index=table[func_index].enter; //enter key_enter=0; } } if(key_back==1) { key_back=0; if(oled_on==1) oled_on=0; else oled_on=1; } current_operation_index=table[func_index].current_operation; (*current_operation_index)(); HAL_Delay(10); } } void SystemClock_Config(void) { LL_FLASH_SetLatency(LL_FLASH_LATENCY_1); while(LL_FLASH_GetLatency() != LL_FLASH_LATENCY_1) { } LL_RCC_HSI_Enable(); while(LL_RCC_HSI_IsReady() != 1) { } LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI, LL_RCC_PLLM_DIV_1, 9, LL_RCC_PLLR_DIV_3); LL_RCC_PLL_Enable(); LL_RCC_PLL_EnableDomain_SYS(); while(LL_RCC_PLL_IsReady() != 1) { } LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1); LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL); while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL) { } LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1); LL_SetSystemCoreClock(48000000); if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK) { Error_Handler(); } } static void MX_NVIC_Init(void) { HAL_NVIC_SetPriority(EXTI4_15_IRQn, 3, 0); HAL_NVIC_EnableIRQ(EXTI4_15_IRQn); HAL_NVIC_SetPriority(TIM3_IRQn, 2, 0); HAL_NVIC_EnableIRQ(TIM3_IRQn); HAL_NVIC_SetPriority(TIM14_IRQn, 2, 0); HAL_NVIC_EnableIRQ(TIM14_IRQn); } void HAL_GPIO_EXTI_Rising_Callback(uint16_t GPIO_Pin) { HAL_NVIC_DisableIRQ(EXTI4_15_IRQn); __HAL_TIM_ENABLE(&htim14); if(GPIO_Pin==GPIO_PIN_4) { key_back=1; if(func_index==9) data_sw=1; } if(GPIO_Pin==GPIO_PIN_5) { key_down=1; if(func_index==5||func_index==9||func_index==10||func_index==11)//向下调节 adj_down=1; } if(GPIO_Pin==GPIO_PIN_6) { key_up=1; if(func_index==5||func_index==9||func_index==10||func_index==11)//向上调节 adj_up=1; } if(GPIO_Pin==GPIO_PIN_7) { key_enter=1; if(func_index==10||func_index==11)//退出QC QC_DeInit(); if(func_index==9) mem_addr_base_r=0; } } void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { if(htim == &htim3) { time_1s_ok=1;//1s时间到 } if(htim == &htim14) { HAL_NVIC_EnableIRQ(EXTI4_15_IRQn); } } void Error_Handler(void) { __disable_irq(); while (1) { } } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
2301_76993462/myproject
Core/Src/main.c
C
unknown
4,626
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file stm32g0xx_hal_msp.c * @brief This file provides code for the MSP Initialization * and de-Initialization codes. ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN TD */ /* USER CODE END TD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN Define */ /* USER CODE END Define */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN Macro */ /* USER CODE END Macro */ /* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* External functions --------------------------------------------------------*/ /* USER CODE BEGIN ExternalFunctions */ /* USER CODE END ExternalFunctions */ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /** * Initializes the Global MSP. */ void HAL_MspInit(void) { /* USER CODE BEGIN MspInit 0 */ /* USER CODE END MspInit 0 */ __HAL_RCC_SYSCFG_CLK_ENABLE(); __HAL_RCC_PWR_CLK_ENABLE(); /* System interrupt init*/ /* USER CODE BEGIN MspInit 1 */ /* USER CODE END MspInit 1 */ } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */
2301_76993462/myproject
Core/Src/stm32g0xx_hal_msp.c
C
unknown
2,148
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file stm32g0xx_it.c * @brief Interrupt Service Routines. ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32g0xx_it.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN TD */ /* USER CODE END TD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /* External variables --------------------------------------------------------*/ extern TIM_HandleTypeDef htim3; extern TIM_HandleTypeDef htim14; /* USER CODE BEGIN EV */ /* USER CODE END EV */ /******************************************************************************/ /* Cortex-M0+ Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. */ void NMI_Handler(void) { /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ /* USER CODE END NonMaskableInt_IRQn 0 */ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ while (1) { } /* USER CODE END NonMaskableInt_IRQn 1 */ } /** * @brief This function handles Hard fault interrupt. */ void HardFault_Handler(void) { /* USER CODE BEGIN HardFault_IRQn 0 */ /* USER CODE END HardFault_IRQn 0 */ while (1) { /* USER CODE BEGIN W1_HardFault_IRQn 0 */ /* USER CODE END W1_HardFault_IRQn 0 */ } } /** * @brief This function handles System service call via SWI instruction. */ void SVC_Handler(void) { /* USER CODE BEGIN SVC_IRQn 0 */ /* USER CODE END SVC_IRQn 0 */ /* USER CODE BEGIN SVC_IRQn 1 */ /* USER CODE END SVC_IRQn 1 */ } /** * @brief This function handles Pendable request for system service. */ void PendSV_Handler(void) { /* USER CODE BEGIN PendSV_IRQn 0 */ /* USER CODE END PendSV_IRQn 0 */ /* USER CODE BEGIN PendSV_IRQn 1 */ /* USER CODE END PendSV_IRQn 1 */ } /** * @brief This function handles System tick timer. */ void SysTick_Handler(void) { /* USER CODE BEGIN SysTick_IRQn 0 */ /* USER CODE END SysTick_IRQn 0 */ HAL_IncTick(); /* USER CODE BEGIN SysTick_IRQn 1 */ /* USER CODE END SysTick_IRQn 1 */ } /******************************************************************************/ /* STM32G0xx Peripheral Interrupt Handlers */ /* Add here the Interrupt Handlers for the used peripherals. */ /* For the available peripheral interrupt handler names, */ /* please refer to the startup file (startup_stm32g0xx.s). */ /******************************************************************************/ /** * @brief This function handles EXTI line 4 to 15 interrupts. */ void EXTI4_15_IRQHandler(void) { /* USER CODE BEGIN EXTI4_15_IRQn 0 */ // printf("hello\n"); // HAL_Delay(10); /* USER CODE END EXTI4_15_IRQn 0 */ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_6); HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_7); /* USER CODE BEGIN EXTI4_15_IRQn 1 */ /* USER CODE END EXTI4_15_IRQn 1 */ } /** * @brief This function handles TIM3 global interrupt. */ void TIM3_IRQHandler(void) { /* USER CODE BEGIN TIM3_IRQn 0 */ //printf("hello\n"); /* USER CODE END TIM3_IRQn 0 */ HAL_TIM_IRQHandler(&htim3); /* USER CODE BEGIN TIM3_IRQn 1 */ /* USER CODE END TIM3_IRQn 1 */ } /** * @brief This function handles TIM14 global interrupt. */ void TIM14_IRQHandler(void) { /* USER CODE BEGIN TIM14_IRQn 0 */ /* USER CODE END TIM14_IRQn 0 */ HAL_TIM_IRQHandler(&htim14); /* USER CODE BEGIN TIM14_IRQn 1 */ /* USER CODE END TIM14_IRQn 1 */ } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */
2301_76993462/myproject
Core/Src/stm32g0xx_it.c
C
unknown
5,097
/** ****************************************************************************** * @file system_stm32g0xx.c * @author MCD Application Team * @brief CMSIS Cortex-M0+ Device Peripheral Access Layer System Source File * * This file provides two functions and one global variable to be called from * user application: * - SystemInit(): This function is called at startup just after reset and * before branch to main program. This call is made inside * the "startup_stm32g0xx.s" file. * * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used * by the user application to setup the SysTick * timer or configure other parameters. * * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution. * * After each device reset the HSI (8 MHz then 16 MHz) is used as system clock source. * Then SystemInit() function is called, in "startup_stm32g0xx.s" file, to * configure the system clock before to branch to main program. * * This file configures the system clock as follows: *============================================================================= *----------------------------------------------------------------------------- * System Clock source | HSI *----------------------------------------------------------------------------- * SYSCLK(Hz) | 16000000 *----------------------------------------------------------------------------- * HCLK(Hz) | 16000000 *----------------------------------------------------------------------------- * AHB Prescaler | 1 *----------------------------------------------------------------------------- * APB Prescaler | 1 *----------------------------------------------------------------------------- * HSI Division factor | 1 *----------------------------------------------------------------------------- * PLL_M | 1 *----------------------------------------------------------------------------- * PLL_N | 8 *----------------------------------------------------------------------------- * PLL_P | 7 *----------------------------------------------------------------------------- * PLL_Q | 2 *----------------------------------------------------------------------------- * PLL_R | 2 *----------------------------------------------------------------------------- * Require 48MHz for RNG | Disabled *----------------------------------------------------------------------------- *============================================================================= ****************************************************************************** * @attention * * Copyright (c) 2018-2021 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /** @addtogroup CMSIS * @{ */ /** @addtogroup stm32g0xx_system * @{ */ /** @addtogroup STM32G0xx_System_Private_Includes * @{ */ #include "stm32g0xx.h" #if !defined (HSE_VALUE) #define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSI_VALUE) #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ #if !defined (LSI_VALUE) #define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/ #endif /* LSI_VALUE */ #if !defined (LSE_VALUE) #define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/ #endif /* LSE_VALUE */ /** * @} */ /** @addtogroup STM32G0xx_System_Private_TypesDefinitions * @{ */ /** * @} */ /** @addtogroup STM32G0xx_System_Private_Defines * @{ */ /************************* Miscellaneous Configuration ************************/ /* Note: Following vector table addresses must be defined in line with linker configuration. */ /*!< Uncomment the following line if you need to relocate the vector table anywhere in Flash or Sram, else the vector table is kept at the automatic remap of boot address selected */ /* #define USER_VECT_TAB_ADDRESS */ #if defined(USER_VECT_TAB_ADDRESS) /*!< Uncomment the following line if you need to relocate your vector Table in Sram else user remap will be done in Flash. */ /* #define VECT_TAB_SRAM */ #if defined(VECT_TAB_SRAM) #define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field. This value must be a multiple of 0x200. */ #define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ #else #define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field. This value must be a multiple of 0x200. */ #define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ #endif /* VECT_TAB_SRAM */ #endif /* USER_VECT_TAB_ADDRESS */ /******************************************************************************/ /** * @} */ /** @addtogroup STM32G0xx_System_Private_Macros * @{ */ /** * @} */ /** @addtogroup STM32G0xx_System_Private_Variables * @{ */ /* The SystemCoreClock variable is updated in three ways: 1) by calling CMSIS function SystemCoreClockUpdate() 2) by calling HAL API function HAL_RCC_GetHCLKFreq() 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency Note: If you use this function to configure the system clock; then there is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. */ uint32_t SystemCoreClock = 16000000UL; const uint32_t AHBPrescTable[16UL] = {0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL, 6UL, 7UL, 8UL, 9UL}; const uint32_t APBPrescTable[8UL] = {0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL}; /** * @} */ /** @addtogroup STM32G0xx_System_Private_FunctionPrototypes * @{ */ /** * @} */ /** @addtogroup STM32G0xx_System_Private_Functions * @{ */ /** * @brief Setup the microcontroller system. * @param None * @retval None */ void SystemInit(void) { /* Configure the Vector Table location -------------------------------------*/ #if defined(USER_VECT_TAB_ADDRESS) SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation */ #endif /* USER_VECT_TAB_ADDRESS */ } /** * @brief Update SystemCoreClock variable according to Clock Register Values. * The SystemCoreClock variable contains the core clock (HCLK), it can * be used by the user application to setup the SysTick timer or configure * other parameters. * * @note Each time the core clock (HCLK) changes, this function must be called * to update SystemCoreClock variable value. Otherwise, any configuration * based on this variable will be incorrect. * * @note - The system frequency computed by this function is not the real * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: * * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) / HSI division factor * * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) * * - If SYSCLK source is LSI, SystemCoreClock will contain the LSI_VALUE * * - If SYSCLK source is LSE, SystemCoreClock will contain the LSE_VALUE * * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***) * or HSI_VALUE(*) multiplied/divided by the PLL factors. * * (**) HSI_VALUE is a constant defined in stm32g0xx_hal_conf.h file (default value * 16 MHz) but the real value may vary depending on the variations * in voltage and temperature. * * (***) HSE_VALUE is a constant defined in stm32g0xx_hal_conf.h file (default value * 8 MHz), user has to ensure that HSE_VALUE is same as the real * frequency of the crystal used. Otherwise, this function may * have wrong result. * * - The result of this function could be not correct when using fractional * value for HSE crystal. * * @param None * @retval None */ void SystemCoreClockUpdate(void) { uint32_t tmp; uint32_t pllvco; uint32_t pllr; uint32_t pllsource; uint32_t pllm; uint32_t hsidiv; /* Get SYSCLK source -------------------------------------------------------*/ switch (RCC->CFGR & RCC_CFGR_SWS) { case RCC_CFGR_SWS_0: /* HSE used as system clock */ SystemCoreClock = HSE_VALUE; break; case (RCC_CFGR_SWS_1 | RCC_CFGR_SWS_0): /* LSI used as system clock */ SystemCoreClock = LSI_VALUE; break; case RCC_CFGR_SWS_2: /* LSE used as system clock */ SystemCoreClock = LSE_VALUE; break; case RCC_CFGR_SWS_1: /* PLL used as system clock */ /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN SYSCLK = PLL_VCO / PLLR */ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL; if(pllsource == 0x03UL) /* HSE used as PLL clock source */ { pllvco = (HSE_VALUE / pllm); } else /* HSI used as PLL clock source */ { pllvco = (HSI_VALUE / pllm); } pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos); pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL); SystemCoreClock = pllvco/pllr; break; case 0x00000000U: /* HSI used as system clock */ default: /* HSI used as system clock */ hsidiv = (1UL << ((READ_BIT(RCC->CR, RCC_CR_HSIDIV))>> RCC_CR_HSIDIV_Pos)); SystemCoreClock = (HSI_VALUE/hsidiv); break; } /* Compute HCLK clock frequency --------------------------------------------*/ /* Get HCLK prescaler */ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)]; /* HCLK clock frequency */ SystemCoreClock >>= tmp; } /** * @} */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
2301_76993462/myproject
Core/Src/system_stm32g0xx.c
C
unknown
11,462
#include "tim.h" TIM_HandleTypeDef htim3; TIM_HandleTypeDef htim14; /* TIM3 init function */ void MX_TIM3_Init(void) { /* USER CODE BEGIN TIM3_Init 0 */ /* USER CODE END TIM3_Init 0 */ TIM_ClockConfigTypeDef sClockSourceConfig = {0}; TIM_MasterConfigTypeDef sMasterConfig = {0}; htim3.Instance = TIM3; htim3.Init.Prescaler = 47999; htim3.Init.CounterMode = TIM_COUNTERMODE_UP; htim3.Init.Period = 999; htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; if (HAL_TIM_Base_Init(&htim3) != HAL_OK) { Error_Handler(); } sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; if (HAL_TIM_ConfigClockSource(&htim3, &sClockSourceConfig) != HAL_OK) { Error_Handler(); } sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK) { Error_Handler(); } } /* TIM14 init function */ void MX_TIM14_Init(void) { htim14.Instance = TIM14; htim14.Init.Prescaler = 47999; htim14.Init.CounterMode = TIM_COUNTERMODE_UP; htim14.Init.Period = 199; htim14.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim14.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; if (HAL_TIM_Base_Init(&htim14) != HAL_OK) { Error_Handler(); } if (HAL_TIM_OnePulse_Init(&htim14, TIM_OPMODE_SINGLE) != HAL_OK) { Error_Handler(); } } void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) { if(tim_baseHandle->Instance==TIM3) { __HAL_RCC_TIM3_CLK_ENABLE(); } else if(tim_baseHandle->Instance==TIM14) { __HAL_RCC_TIM14_CLK_ENABLE(); } } void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) { if(tim_baseHandle->Instance==TIM3) { __HAL_RCC_TIM3_CLK_DISABLE(); HAL_NVIC_DisableIRQ(TIM3_IRQn); } else if(tim_baseHandle->Instance==TIM14) { __HAL_RCC_TIM14_CLK_DISABLE(); HAL_NVIC_DisableIRQ(TIM14_IRQn); /* USER CODE BEGIN TIM14_MspDeInit 1 */ /* USER CODE END TIM14_MspDeInit 1 */ } }
2301_76993462/myproject
Core/Src/tim.c
C
unknown
2,106
#include "usart.h" UART_HandleTypeDef huart2; /* USART2 init function */ void MX_USART2_UART_Init(void) { huart2.Instance = USART2; huart2.Init.BaudRate = 115200; huart2.Init.WordLength = UART_WORDLENGTH_8B; huart2.Init.StopBits = UART_STOPBITS_1; huart2.Init.Parity = UART_PARITY_NONE; huart2.Init.Mode = UART_MODE_TX_RX; huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart2.Init.OverSampling = UART_OVERSAMPLING_16; huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart2.Init.ClockPrescaler = UART_PRESCALER_DIV1; huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_UART_Init(&huart2) != HAL_OK) { Error_Handler(); } } void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(uartHandle->Instance==USART2) { __HAL_RCC_USART2_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF1_USART2; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); } } void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) { if(uartHandle->Instance==USART2) { __HAL_RCC_USART2_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3); } } /* USER CODE BEGIN 1 */ #ifdef __GNUC__ /* With GCC, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) #else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) #endif /* __GNUC__ */ PUTCHAR_PROTOTYPE { /* Place your implementation of fputc here */ /* e.g. write a character to the USART3 and Loop until the end of transmission */ HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xFFFF); return ch; }
2301_76993462/myproject
Core/Src/usart.c
C
unknown
1,875
#include "main.h" #include "adc.h" #define DP0_0V QC_DP_vol(0) #define DP0_6V QC_DP_vol(6) #define DP3_3V QC_DP_vol(33) #define DM0_0V QC_DM_vol(0) #define DM0_6V QC_DM_vol(6) #define DM3_3V QC_DM_vol(33) extern u8 QC_handshake; extern u8 voltage_num; extern u8 adj_up,adj_down;//电压+、电压- extern u8 func_index; //D+初始化 void QC_DP_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOB_CLK_ENABLE(); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_SET); /*Configure GPIO pins : PB0 PB3 */ GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_3; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); } //D-初始化 void QC_DM_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOA_CLK_ENABLE(); if(func_index==10)//QC2.0 { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_RESET); } else//QC3.0 { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET); } /*Configure GPIO pins : PB0 PB3 */ GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); } //调整DP引脚的电压 void QC_DP_vol(u8 vol) { if(vol==0)//0V { HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); } if(vol==6)//0.6V { HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_SET); } if(vol==33)//3.3V { HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_SET); } } //调整DM引脚的电压 void QC_DM_vol(u8 vol) { if(vol==0)//0V { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_RESET); } if(vol==6)//0.6V { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET); } if(vol==33)//3.3V { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET); } } //检测充电头是否支持QC协议 u8 QC_Check(void) { u8 i; u16 DP_voltage; MX_ADC1_Init(); HAL_ADCEx_Calibration_Start(&hadc1); QC_DP_Init(); HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1,100); DP_voltage=HAL_ADC_GetValue(&hadc1); if(DP_voltage<700||DP_voltage>850) return 0; for(i=0;i<15;i++) { HAL_Delay(100); HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1, 100); DP_voltage = HAL_ADC_GetValue(&hadc1); if(DP_voltage<20) { HAL_ADC_DeInit(&hadc1); QC_DM_Init(); return 1; } } return 0; } //QC2.0电压调整 void QC2_adj(u8 vol) { if(vol==5) { DP0_6V; DM0_0V; } if(vol==9) { DP3_3V; DM0_6V; } if(vol==12) { DP0_6V; DM0_6V; } if(vol==20) { DP3_3V; DM3_3V; } } //QC3.0电压调整。1,升高电压;0,降低电压 void QC3_adj(u8 direct) { if(direct) { DP3_3V; HAL_Delay(250); DP0_6V; } if(!direct) { DM0_6V; HAL_Delay(250); DM3_3V; } } //解除QC void QC_DeInit(void) { DP0_0V; DM0_0V; QC_handshake=0; voltage_num=0; adj_up=adj_down=0; HAL_ADC_DeInit(&hadc1); HAL_GPIO_DeInit(GPIOA,GPIO_PIN_0); HAL_GPIO_DeInit(GPIOA,GPIO_PIN_1); HAL_GPIO_DeInit(GPIOB,GPIO_PIN_0); HAL_GPIO_DeInit(GPIOB,GPIO_PIN_3); }
2301_76993462/myproject
Core/Src/user/QC_Get.c
C
unknown
3,726
#include "user/ina220.h" extern I2C_HandleTypeDef hi2c1; u16 INA220_GetVoltage(void) { u16 temp=0; u8 buffer[2] = {0,0}; HAL_I2C_Mem_Read(&hi2c1,INA220_ADDR,BV_REG,I2C_MEMADD_SIZE_8BIT,&buffer[0],2,100); temp = buffer[0]<<8|buffer[1]; temp >>= 3; temp *= 4; return temp; } //读取电流 1mA/bit u16 INA220_GetCurrent(void) { u16 temp=0; u8 buffer[2] = {0,0}; HAL_I2C_Mem_Read(&hi2c1,INA220_ADDR,CUR_REG,I2C_MEMADD_SIZE_8BIT,&buffer[0],2,100); temp = buffer[0]<<8|buffer[1]; return temp; } //读取功率 20mW/bit u16 INA220_GetPower(void) { u16 temp=0; u8 buffer[2] = {0,0}; HAL_I2C_Mem_Read(&hi2c1,INA220_ADDR,PWR_REG,I2C_MEMADD_SIZE_8BIT,&buffer[0],2,100); temp = buffer[0]<<8|buffer[1]; temp*= 20; return temp; } void INA220_Init(void) { u8 CFG[2] = {0x27,0xff}; //配置寄存器0x21D7 u8 CAL[2] = {0x20,0x00}; //校准寄存器0x5000,1ma/bit HAL_I2C_Mem_Write(&hi2c1,INA220_ADDR,CFG_REG,I2C_MEMADD_SIZE_8BIT,&CFG[0],2,100);//设置配置寄存器 HAL_I2C_Mem_Write(&hi2c1,INA220_ADDR,CAL_REG,I2C_MEMADD_SIZE_8BIT,&CAL[0],2,100);//设置校准寄存器 } u8 INA220_CNVR(void) { u8 buffer[2] = {0,0}; HAL_I2C_Mem_Read(&hi2c1,INA220_ADDR,BV_REG,I2C_MEMADD_SIZE_8BIT,&buffer[0],2,100); buffer[1] >>= 1; return buffer[1]&1; }
2301_76993462/myproject
Core/Src/user/ina220.c
C
unknown
1,272
#include "user/oled.h" #include "i2c.h" #include "user/menu.h" #include "user/QC_Get.h" #define voltage ina220_data[0] #define current ina220_data[1] #define power ina220_data[2] #define energy ina220_data[3] extern u16 ina220_data[4]; extern u8 func_index; extern u8 adj_down,adj_up;//-、+ extern u8 oled_on; extern u8 data_sw; extern u16 mem_addr_base; void (*current_operation_index)(); u8 brightness=0xCD;//亮度 u8 QC_handshake=0;//QC握手成功标志 u8 QC2_voltage[4]={5,9,12,20};//QC2.0目标电压列表 u8 voltage_num=0;//QC2.0电压序号 u16 QC3_voltage;//QC3.0目标电压 extern u16 mem_addr_base_r; u8 Target_voltage; void Clear_mem(void) { u8 temp[128]; u16 i; u16 addr_base=0x0000; for(i=0;i<128;i++) { temp[i]=0x00; } for(i=0;i<128;i++) { HAL_I2C_Mem_Write(&hi2c1,0xA0,addr_base,I2C_MEMADD_SIZE_16BIT,temp,128,100); HAL_Delay(5); addr_base+=128; } } //清除高位的0 void CLear0(u8 x,u8 y,u16 num) { u8 i; u8 j=0; u16 temp=10000; for(i=0;i<4;i++) { if(num/temp==0) { j++; temp/=10; } else break; } OLED_ShowNum(x,y,0,j,12,2);//消除0 } //绘制画百分比条 void DrawPctLine(u8 x,u8 y,u8 len,u8 mode) { u8 i,temp; if(mode!=3) if(len==0) temp=0; else temp=len*0.7-1; else { if(len==0) temp=0; else temp=len*0.35-1; mode=1; } if(temp==0&&len!=0) temp=1; if(temp<35) for(i=0;i<temp;i++) { OLED_DrawLine(x,y-5,x,y,mode); x++; } else { temp=temp-35; for(i=0;i<temp;i++) { OLED_DrawLine(x,y-5-8,x,y-8,mode); x++; } x=0; for(i=0;i<35;i++) { OLED_DrawLine(x,y-5,x,y,mode); x++; } } } //刷新百分比条 void Pct_Refresh(void) { u8 temp; DrawPctLine(0,15,100,0);//clear P DrawPctLine(0,28,100,0);//clear V DrawPctLine(0,45,100,0);//clear I temp=power/650;//temp=power/1000/65*100 if(temp>100) temp=100; DrawPctLine(0,15,temp,1); temp=voltage/200;//temp=voltage/1000/20*100 if(temp>100) temp=100; DrawPctLine(0,28,temp,3); temp=current/60;//temp=current/1000/6*100 if(temp>100) temp=100; DrawPctLine(0,45,temp,1); OLED_DrawLine(0,15,34,15,1);//P OLED_DrawLine(0,28,34,12,1);//V OLED_DrawLine(0,45,34,12,1);//I } void Show_power(u8 x,u8 y)//显示功率 { OLED_ShowChinese(x,y,3,12,1); //功 OLED_ShowChinese(x+13,y,4,12,1); //率 OLED_ShowChar(x+24,y+3,58,8,1); //: OLED_ShowNum(x+30,y,power,5,12,1); //功率值 CLear0(x+30,y,power); OLED_ShowChar(x+64,y,109,16,1); //m OLED_ShowChar(x+74,y,87,16,1); //W } void Show_voltage(u8 x,u8 y)//显示电压 { OLED_ShowChinese(x,y,0,12,1); //电 OLED_ShowChinese(x+13,y,1,12,1); //压 OLED_ShowChar(x+24,y+3,58,8,1); //: OLED_ShowNum(x+30,y,voltage,5,12,1);//电压值 CLear0(x+30,y,voltage); OLED_ShowChar(x+64,y,109,16,1); //m OLED_ShowChar(x+74,y,86,16,1); //V } void Show_current(u8 x,u8 y)//显示电流 { OLED_ShowChinese(x,y,0,12,1); //电 OLED_ShowChinese(x+13,y,2,12,1); //流 OLED_ShowChar(x+24,y+3,58,8,1); //: OLED_ShowNum(x+30,y,current,5,12,1);//电流值 CLear0(x+30,y,current); OLED_ShowChar(x+64,y,109,16,1); //m OLED_ShowChar(x+74,y,65,16,1); //A } void Show_energy(u8 x,u8 y)//显示电量 { OLED_ShowChinese(x-26,y,23,12,1); //充 OLED_ShowChinese(x-13,y,24,12,1); //入 OLED_ShowChinese(x,y,0,12,1); //电 OLED_ShowChinese(x+13,y,20,12,1); //量 OLED_ShowChar(x+24,y+3,58,8,1); //: OLED_ShowNum(x+30,y,energy,5,12,1); //电量值 CLear0(x+30,y,energy); OLED_ShowChar(x+64,y,109,16,1); //m OLED_ShowChar(x+74,y,87,16,1); //W OLED_ShowChar(x+84,y-3,104,16,1); //h } //显示固定菜单 void show1_fun1_3(void) { OLED_ShowChinese(20,0,5,12,1); //设 OLED_ShowChinese(33,0,6,12,1); //置 OLED_ShowChinese(68,0,7,12,1); //快 OLED_ShowChinese(81,0,8,12,1); //充 OLED_ShowChinese(94,0,11,12,1); //诱 OLED_ShowChinese(107,0,12,12,1); //骗 OLED_ShowChinese(10,16,15,12,1); //数 OLED_ShowChinese(23,16,16,12,1); //据 OLED_ShowChinese(36,16,17,12,1); //计 OLED_ShowChinese(49,16,18,12,1); //录 OLED_ShowChinese(78,16,21,12,1); //返 OLED_ShowChinese(91,16,22,12,1); //回 } //显示或清除[] void show_brackets(u8 func_index,u8 mode) { switch(func_index) { case 1: OLED_ShowChar(14,0,91,12,mode); //[ OLED_ShowChar(55,0,93,12,mode); //] break; case 2: OLED_ShowChar(62,0,91,12,mode); //[ OLED_ShowChar(119,0,93,12,mode); //] break; case 3: OLED_ShowChar(4,16,91,12,mode); //[ OLED_ShowChar(61,16,93,12,mode); //] break; case 4: OLED_ShowChar(72,16,91,12,mode); //[ OLED_ShowChar(107,16,93,12,mode); //] break; default:break; } } //显示固定菜单 void show1_fun6_8(void) { OLED_ShowChar(20, 0, 81, 12, 1); //Q OLED_ShowChar(27, 0, 67, 12, 1); //C OLED_ShowChar(34, 0, 50, 12, 1); //2 OLED_ShowChar(40, 0, 46, 12, 1); //. OLED_ShowChar(44, 0, 48, 12, 1); //0 OLED_ShowChar(73, 0, 81, 12, 1); //Q OLED_ShowChar(80, 0, 67, 12, 1); //C OLED_ShowChar(87, 0, 51, 12, 1); //3 OLED_ShowChar(93, 0, 46, 12, 1); //. OLED_ShowChar(97, 0, 48, 12, 1); //0 OLED_ShowChinese(78, 16, 21, 12, 1); //返 OLED_ShowChinese(91, 16, 22, 12, 1); //回 } void fun0(void) { Pct_Refresh();//刷新百分比条 Show_energy(28,50); Show_current(40,34); Show_voltage(40,18); Show_power(40,2); if(!oled_on) OLED_Clear(); } void fun1(void) { show1_fun1_3(); show_brackets(2,2); show_brackets(4,2); show_brackets(1,1); } void fun2(void) { show1_fun1_3(); show_brackets(1,2); show_brackets(3,2); show_brackets(2,1); } void fun3(void) { show1_fun1_3(); show_brackets(2,2); show_brackets(4,2); show_brackets(3,1); } void fun4(void) { show1_fun1_3(); show_brackets(3,2); show_brackets(1,2); show_brackets(4,1); } void fun5(void)//亮度调整 { OLED_On(); OLED_ShowChinese(36,16,32,12,1); //亮 OLED_ShowChinese(49,16,33,12,1); //度 OLED_ShowChar(60,19,58,8,1); //: OLED_ShowNum(66,16,brightness,3,12,1); //电量值 if(adj_up==1 && brightness<255) { brightness+=10; adj_up=0; OLED_WR_Byte(0x81,OLED_CMD); OLED_WR_Byte(brightness,OLED_CMD); } if(adj_down==1 && brightness>5) { brightness-=10; adj_down=0; OLED_WR_Byte(0x81,OLED_CMD); OLED_WR_Byte(brightness,OLED_CMD); } } void fun6(void) { show1_fun6_8(); show_brackets(2,2); show_brackets(4,2); show_brackets(1,1); } void fun7(void) { show1_fun6_8(); show_brackets(1,2); show_brackets(4,2); show_brackets(2,1); } void fun8(void) { show1_fun6_8(); show_brackets(2,2); show_brackets(1,2); show_brackets(4,1); } void fun9(void) { u16 temp[2]={0,0}; u8 x,y; u16 offset=0; static u8 fun9_mode=0; switch(fun9_mode) { case 0: { OLED_ShowString_H(0, 55, (u8*) "5V", 8, 1); OLED_ShowString_H(0, 0, (u8*) "20V", 8, 1); OLED_ShowString_H(0, 26, (u8*) "V", 8, 1); for(x=8;x<128;x++) { HAL_I2C_Mem_Read(&hi2c1,0xA1,mem_addr_base_r+offset,I2C_MEMADD_SIZE_16BIT,(u8*)temp,4,100); y=temp[fun9_mode]/236; y=64-y+21; OLED_DrawPoint(x, y, 1); offset+=4; } offset=0; break; } case 1: { OLED_ShowString_H(0, 55, (u8*) "0A", 8, 1); OLED_ShowString_H(0, 0, (u8*) "6A", 8, 1); OLED_ShowString_H(0, 26, (u8*) "A", 8, 1); for(x=8;x<128;x++) { HAL_I2C_Mem_Read(&hi2c1,0xA1,mem_addr_base_r+offset,I2C_MEMADD_SIZE_16BIT,(u8*)temp,4,100); y=temp[fun9_mode]/125; y=64-y; OLED_DrawPoint(x, y, 1); offset+=4; } offset=0; break; } case 2: { OLED_ShowString_H(0, 55, (u8*) "0W", 8, 1); OLED_ShowString_H(0, 0, (u8*) "20W", 8, 1); OLED_ShowString_H(0, 26, (u8*) "P", 8, 1); for(x=8;x<128;x++) { HAL_I2C_Mem_Read(&hi2c1,0xA1,mem_addr_base_r+offset,I2C_MEMADD_SIZE_16BIT,(u8*)temp,4,100); y=temp[0]*temp[1]/1875; y=64-y; OLED_DrawPoint(x, y, 1); offset+=4; } offset=0; break; } default: break; } if(data_sw==1) { data_sw=0; fun9_mode++; if(fun9_mode>2) fun9_mode=0; OLED_Clear(); } if(adj_up==1) { adj_up=0; mem_addr_base_r+=120; if(mem_addr_base_r>0x3FFF) mem_addr_base_r=0x3FFF; OLED_Clear(); } if(adj_down==1) { adj_down=0; mem_addr_base_r-=120; if(mem_addr_base_r>0x3FFF) mem_addr_base_r=0x0000; OLED_Clear(); } } void fun10(void)//QC2.0诱骗 { if(!QC_handshake) { QC_handshake=1; OLED_ShowChinese(20, 0, 25, 12, 1); //握 OLED_ShowChinese(33, 0, 26, 12, 1); //手 OLED_ShowChinese(46, 0, 27, 12, 1); //中 OLED_ShowChar(57, 0, 46, 12, 1); //. OLED_ShowChar(61, 0, 46, 12, 1); //. OLED_Refresh(); if (!QC_Check()) { voltage_num=0; QC_handshake=0; } else OLED_Clear(); } else { OLED_ShowChar(0, 0, 81, 12, 1); //Q OLED_ShowChar(7, 0, 67, 12, 1); //C OLED_ShowChar(14, 0, 50, 12, 1); //2 OLED_ShowChar(20, 0, 46, 12, 1); //. OLED_ShowChar(24, 0, 48, 12, 1); //0 OLED_ShowChinese(31,0,30,12,1); //目 OLED_ShowChinese(44,0,31,12,1); //标 OLED_ShowChinese(57,0,0,12,1); //电 OLED_ShowChinese(70,0,1,12,1); //压 OLED_ShowChar(81,3,58,8,1); //: OLED_ShowNum(87,0,QC2_voltage[voltage_num],2,12,1);//电压值 if(QC2_voltage[voltage_num]/10==0) OLED_ShowNum(87,0,0,1,12,2); //消除首位的0 OLED_ShowChar(103,0,86,12,1); //V Show_voltage(0, 16); Show_current(0, 31); Show_power(0, 48); if(adj_up==1) { adj_up=0; voltage_num++; if(voltage_num>3) voltage_num=3; } if(adj_down==1) { adj_down=0; voltage_num--; if(voltage_num>3) voltage_num=0; } QC2_adj(QC2_voltage[voltage_num]);//调整电压 } } void fun11(void)//QC3.0诱骗 { if(!QC_handshake) { QC_handshake=1; OLED_ShowChinese(20, 0, 25, 12, 1); //握 OLED_ShowChinese(33, 0, 26, 12, 1); //手 OLED_ShowChinese(46, 0, 27, 12, 1); //中 OLED_ShowChar(57, 0, 46, 12, 1); //. OLED_ShowChar(61, 0, 46, 12, 1); //. OLED_ShowChar(65, 0, 46, 12, 1); //. OLED_Refresh(); if (!QC_Check()) { QC_handshake=0; } else { OLED_Clear(); Target_voltage=50; } } else { OLED_ShowChar(0, 0, 81, 12, 1); //Q OLED_ShowChar(7, 0, 67, 12, 1); //C OLED_ShowChar(14, 0, 51, 12, 1); //3 OLED_ShowChar(20, 0, 46, 12, 1); //. OLED_ShowChar(24, 0, 48, 12, 1); //0 OLED_ShowChinese(31,0,30,12,1); //目 OLED_ShowChinese(44,0,31,12,1); //标 OLED_ShowChinese(57,0,0,12,1); //电 OLED_ShowChinese(70,0,1,12,1); //压 OLED_ShowChar(81,3,58,8,1); //: OLED_ShowNum(87,0,Target_voltage/10,2,12,1);//电压值1 if(Target_voltage/100==0) OLED_ShowNum(87,0,0,1,12,2); //消除首位的0 OLED_ShowChar(99, 0, 46, 12, 1); //. OLED_ShowNum(103,0,Target_voltage,1,12,1);//电压值2 OLED_ShowChar(111,0,86,12,1); //V Show_voltage(0, 16); Show_current(0, 31); Show_power(0, 48); if(adj_up==1) { adj_up=0; QC3_adj(1); Target_voltage+=2; if(Target_voltage>200) Target_voltage=200; } if(adj_down==1) { adj_down=0; if(voltage>4500) QC3_adj(0); Target_voltage-=2; if(Target_voltage<45) Target_voltage=44; } } } key_table table[30]= { {0,0,0,1,(*fun0)}, //第0层,显示主界面 {1,4,2,5,(*fun1)}, //第一层,显示【亮度设置】、快充诱骗、 数据记录、 返回 {2,1,3,6,(*fun2)}, //第一层,显示 亮度设置、【快充诱骗】、数据记录、 返回 {3,2,4,9,(*fun3)}, //第一层,显示 亮度设置、 快充诱骗、【数据记录】、返回 {4,3,1,0,(*fun4)}, //第一层,显示 亮度设置、 快充诱骗、 数据记录、【返回】 {5,5,5,1,(*fun5)}, //第二层,亮度设置 {6,8,7,10,(*fun6)}, //第二层,快充诱骗层下显示【QC 2.0】、 QC3.0 、 返回 {7,6,8,11,(*fun7)}, //第二层,快充诱骗层下显示 QC 2.0 、【QC3.0】、 返回 {8,7,6,2,(*fun8)}, //第二层,快充诱骗层下显示 QC 2.0 、 QC3.0 、【返回】 {9,9,9,3,(*fun9)}, //第二层,数据记录 {10,10,10,6,(*fun10)}, //第三层,快充诱骗QC 2.0 {11,11,11,7,(*fun11)},//第三层,快充诱骗QC 3.0 };
2301_76993462/myproject
Core/Src/user/menu.c
C
unknown
11,871
#include "user/oled.h" #include "stdlib.h" #include "user/oledfont.h" extern I2C_HandleTypeDef hi2c2; u8 OLED_GRAM[8][128];//显存 void Write_IIC_Command(unsigned char I2C_Command)//写命令 { uint8_t *pData; pData = &I2C_Command; HAL_I2C_Mem_Write(&hi2c2,OLED_ADDRESS,0x00,I2C_MEMADD_SIZE_8BIT,pData,1,100); } void Write_IIC_Data(unsigned char IIC_Data)//写数据 { uint8_t *pData; pData = &IIC_Data; HAL_I2C_Mem_Write(&hi2c2,OLED_ADDRESS,0x40,I2C_MEMADD_SIZE_8BIT,pData,1,100); } void OLED_WR_Byte(unsigned dat,unsigned cmd)//写1字节 { if(cmd) { Write_IIC_Data(dat); } else { Write_IIC_Command(dat); } } //更新显存到OLED void OLED_Refresh(void) { u8 i; for(i=0;i<8;i++) { OLED_WR_Byte(0xb0+i,OLED_CMD); //设置行起始地址 OLED_WR_Byte(0x00,OLED_CMD); //设置低列起始地址 OLED_WR_Byte(0x10,OLED_CMD); //设置高列起始地址 HAL_I2C_Mem_Write(&hi2c2,OLED_ADDRESS,0x40,I2C_MEMADD_SIZE_8BIT,&OLED_GRAM[i][0],128,100); } } //开启OLED显示 void OLED_Display_On(void) { OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC命令 OLED_WR_Byte(0X14,OLED_CMD); //DCDC ON OLED_WR_Byte(0XAF,OLED_CMD); //DISPLAY ON } //关闭OLED显示 void OLED_Display_Off(void) { OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC命令 OLED_WR_Byte(0X10,OLED_CMD); //DCDC OFF OLED_WR_Byte(0XAE,OLED_CMD); //DISPLAY OFF } void OLED_Clear(void) { u8 i,j; for(i=0;i<8;i++) //清空显示缓冲区 for(j=0;j<128;j++) OLED_GRAM[i][j]=0; OLED_Refresh(); //刷新显存 } //点亮 void OLED_On(void) { u8 i,j; for(i=0;i<8;i++) //清空显示缓冲区 for(j=0;j<128;j++) OLED_GRAM[i][j]=255; } //画点 //x:0~127 //y:0~31 //t:1 填充 0,清空 void OLED_DrawPoint(u8 x,u8 y,u8 t) { u8 i,m,n; i=y/8; m=y%8; n=1<<m; if(t){OLED_GRAM[i][x]|=n;} else { OLED_GRAM[i][x]=~OLED_GRAM[i][x]; OLED_GRAM[i][x]|=n; OLED_GRAM[i][x]=~OLED_GRAM[i][x]; } } //画线 //x1,y1:起点坐标 //x2,y2:结束坐标 void OLED_DrawLine(u8 x1,u8 y1,u8 x2,u8 y2,u8 mode) { u16 t; int xerr=0,yerr=0,delta_x,delta_y,distance; int incx,incy,uRow,uCol; delta_x=x2-x1; //计算坐标增量 delta_y=y2-y1; uRow=x1;//画线起点坐标 uCol=y1; if(delta_x>0)incx=1; //设置单步方向 else if (delta_x==0)incx=0;//垂直线 else {incx=-1;delta_x=-delta_x;} if(delta_y>0)incy=1; else if (delta_y==0)incy=0;//水平线 else {incy=-1;delta_y=-delta_x;} if(delta_x>delta_y)distance=delta_x; //选取基本增量坐标轴 else distance=delta_y; for(t=0;t<distance+1;t++) { OLED_DrawPoint(uRow,uCol,mode);//画点 xerr+=delta_x; yerr+=delta_y; if(xerr>distance) { xerr-=distance; uRow+=incx; } if(yerr>distance) { yerr-=distance; uCol+=incy; } } } void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size1,u8 mode) { u8 i,m,temp,size2,chr1; u8 x0=x,y0=y; if(size1==8)size2=6; else size2=(size1/8+((size1%8)?1:0))*(size1/2); //得到字体一个字符对应点阵集所占的字节数 chr1=chr-' '; //计算偏移后的值 for(i=0;i<size2;i++) { if(size1==8) {temp=asc2_0806[chr1][i];} //调用0806字体 else if(size1==12) {temp=asc2_1206[chr1][i];} //调用1206字体 else if(size1==16) {temp=asc2_1608[chr1][i];} //调用1608字体 else return; if(mode==2) for(m=0;m<8;m++) { if(temp&0x01)OLED_DrawPoint(x,y,0); else OLED_DrawPoint(x,y,0); temp>>=1; y++; } else for(m=0;m<8;m++) { if(temp&0x01)OLED_DrawPoint(x,y,mode); else OLED_DrawPoint(x,y,!mode); temp>>=1; y++; } x++; if((size1!=8)&&((x-x0)==size1/2)) {x=x0;y0=y0+8;} y=y0; } } void OLED_ShowString_H(u8 x,u8 y,u8 *chr,u8 size1,u8 mode) { while((*chr>=' ')&&(*chr<='~'))//判断是不是非法字符! { OLED_ShowChar(x,y,*chr,size1,mode); if(size1==8)x+=6; else x+=size1/2; chr++; } } //垂直显示字符串 void OLED_ShowString_V(u8 x,u8 y,u8 *chr,u8 size1,u8 mode) { while((*chr>=' ')&&(*chr<='~'))//判断是不是非法字符! { OLED_ShowChar(x,y,*chr,size1,mode); y+=size1; chr++; } } u32 OLED_Pow(u8 m,u8 n) { u32 result=1; while(n--) { result*=m; } return result; } void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size1,u8 mode) { u8 t,temp,m=0; if(size1==8)m=2; for(t=0;t<len;t++) { temp=(num/OLED_Pow(10,len-t-1))%10; if(temp==0) { OLED_ShowChar(x+(size1/2+m)*t,y,'0',size1,mode); } else { OLED_ShowChar(x+(size1/2+m)*t,y,temp+'0',size1,mode); } } } //显示定点数 void OLED_ShowDotNum(u8 x,u8 y,u32 num,u8 len,u8 size1,u8 mode) { u8 t,temp,m=0; if(size1==8)m=2; for(t=0;t<len;t++) { if(t==2) { OLED_ShowChar(x+(size1/2+m)*t-1,y,46,size1,mode); x+=3; } temp=(num/OLED_Pow(10,len-t-1))%10; if(temp==0) { OLED_ShowChar(x+(size1/2+m)*t,y,'0',size1,mode); } else { OLED_ShowChar(x+(size1/2+m)*t,y,temp+'0',size1,mode); } } } void OLED_ShowChinese(u8 x,u8 y,u8 num,u8 size1,u8 mode) { u8 m,temp; u8 x0=x,y0=y; u16 i,size3=(size1/8+((size1%8)?1:0))*size1; for(i=0;i<size3;i++) { if(size1==12) {temp=Hzk1[num][i];} else return; for(m=0;m<8;m++) { if(temp&0x01)OLED_DrawPoint(x,y,mode); else OLED_DrawPoint(x,y,!mode); temp>>=1; y++; } x++; if((x-x0)==size1) {x=x0;y0=y0+8;} y=y0; } } //OLED的初始化 void OLED_Init_096(void) { OLED_WR_Byte(0xAE,OLED_CMD);//--turn off oled panel OLED_WR_Byte(0x00,OLED_CMD);//---set low column address OLED_WR_Byte(0x10,OLED_CMD);//---set high column address OLED_WR_Byte(0x40,OLED_CMD);//--set start line address Set Mapping RAM Display Start Line (0x00~0x3F) OLED_WR_Byte(0x81,OLED_CMD);//--set contrast control register OLED_WR_Byte(0xCD,OLED_CMD);// Set SEG Output Current Brightness OLED_WR_Byte(0xA1,OLED_CMD);//--Set SEG/Column Mapping 0xa0左右反置 0xa1正常 OLED_WR_Byte(0xC8,OLED_CMD);//Set COM/Row Scan Direction 0xc0上下反置 0xc8正常 OLED_WR_Byte(0xA6,OLED_CMD);//--set normal display OLED_WR_Byte(0xA8,OLED_CMD);//--set multiplex ratio(1 to 64) OLED_WR_Byte(0x3f,OLED_CMD);//--1/64 duty OLED_WR_Byte(0xD3,OLED_CMD);//-set display offset Shift Mapping RAM Counter (0x00~0x3F) OLED_WR_Byte(0x00,OLED_CMD);//-not offset OLED_WR_Byte(0xd5,OLED_CMD);//--set display clock divide ratio/oscillator frequency OLED_WR_Byte(0x80,OLED_CMD);//--set divide ratio, Set Clock as 100 Frames/Sec OLED_WR_Byte(0xD9,OLED_CMD);//--set pre-charge period OLED_WR_Byte(0xF1,OLED_CMD);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock OLED_WR_Byte(0xDA,OLED_CMD);//--set com pins hardware configuration OLED_WR_Byte(0x12,OLED_CMD); OLED_WR_Byte(0xDB,OLED_CMD);//--set vcomh OLED_WR_Byte(0x30,OLED_CMD);//Set VCOM Deselect Level OLED_WR_Byte(0x20,OLED_CMD);//-Set Page Addressing Mode (0x00/0x01/0x02) OLED_WR_Byte(0x02,OLED_CMD);// OLED_WR_Byte(0x8D,OLED_CMD);//--set Charge Pump enable/disable OLED_WR_Byte(0x14,OLED_CMD);//--set(0x10) disable OLED_Clear(); OLED_WR_Byte(0xAF,OLED_CMD); }
2301_76993462/myproject
Core/Src/user/oled.c
C
unknown
6,943
/** ****************************************************************************** * @file startup_stm32g030xx.s * @author MCD Application Team * @brief STM32G030xx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * Copyright (c) 2018-2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief This is the code that gets called when the processor first * starts execution following a reset event. Only the absolutely * necessary set is performed, after which the application * supplied main() routine is called. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word WWDG_IRQHandler /* Window WatchDog */ .word 0 /* reserved */ .word RTC_TAMP_IRQHandler /* RTC through the EXTI line */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ .word DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler /* DMA1 Channel 4 to Channel 5, DMAMUX1 overrun */ .word ADC1_IRQHandler /* ADC1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word TIM3_IRQHandler /* TIM3 */ .word 0 /* reserved */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word TIM16_IRQHandler /* TIM16 */ .word TIM17_IRQHandler /* TIM17 */ .word I2C1_IRQHandler /* I2C1 */ .word I2C2_IRQHandler /* I2C2 */ .word SPI1_IRQHandler /* SPI1 */ .word SPI2_IRQHandler /* SPI2 */ .word USART1_IRQHandler /* USART1 */ .word USART2_IRQHandler /* USART2 */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak WWDG_IRQHandler .thumb_set WWDG_IRQHandler,Default_Handler .weak RTC_TAMP_IRQHandler .thumb_set RTC_TAMP_IRQHandler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak DMA1_Channel1_IRQHandler .thumb_set DMA1_Channel1_IRQHandler,Default_Handler .weak DMA1_Channel2_3_IRQHandler .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler .weak DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler .thumb_set DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler,Default_Handler .weak ADC1_IRQHandler .thumb_set ADC1_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak TIM3_IRQHandler .thumb_set TIM3_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak TIM16_IRQHandler .thumb_set TIM16_IRQHandler,Default_Handler .weak TIM17_IRQHandler .thumb_set TIM17_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak I2C2_IRQHandler .thumb_set I2C2_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak SPI2_IRQHandler .thumb_set SPI2_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler .weak USART2_IRQHandler .thumb_set USART2_IRQHandler,Default_Handler /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
2301_76993462/myproject
Core/Startup/startup_stm32g030f6px.s
Unix Assembly
unknown
8,980
#include <iostream> #include <cstdlib> #include <ctime> #include <vector> #include <unordered_set> #include <string> #include <algorithm> // 添加该头文件用于打乱 #include "easyrdlist.h" using namespace std; // 定义变量 bool f = false; //为第24行定义旗帜 int n, m; char t; vector<int> r; // 存储权重抽取的人员索引 unordered_set<int> drawn; // 用于记录已经抽中的人员 struct rdlist { string name; // 使用 string 存储名字 int num{ }; int right{ }; // 权重 } a[100001]; // 抽取函数,避免重复 void rd() { if (drawn.size() == r.size()) { cout << "!> 所有人员都已经抽取过或权重均为0,无法继续抽取!" << endl; f = true; //升旗 return; } while (true) { int rdresult = rand() % r.size(); // 随机抽取 if (drawn.find(r[rdresult]) == drawn.end()) { // 检查是否已经抽中 drawn.insert(r[rdresult]); // 标记为已抽中 cout << "·> " << a[r[rdresult]].name << endl; return; } } } int main() { titlere(); //自定义头文件修改窗口标题 // 标题输出 cout << "--- 权重式随机抽取工具 1.1 ---" << endl; srand(time(NULL)); // 初始化随机数生成器 cout << "!> 请输入抽取人数: "; cin >> n; cout << "!> 下面是数据的读入,按照 名字 权 的顺序读入" << endl; cout << "> 例如:张三 3" << endl; cout << "!> 权的等级为0-5级" << endl; // 读取参与抽取的人物数据 for (int i = 1; i <= n; i++) { cin >> a[i].name; a[i].num = i; // 记录人员编号 cin >> a[i].right; // 读取权重等级 if (a[i].right > 5 || a[i].right < 0) { cout << "!> 等级超出范围,终止运行......" << endl; cout << "!> 输入任意字符退出......" << endl; cin >> t; return 0; } // 根据权重将人员的编号加入抽取池 for (int j = 0; j < a[i].right; j++) { if (a[i].right > 0) { r.push_back(i); // 权重为 1 -> 1 次,2 -> 2 次,3 -> 3 次, 4 -> 4 次,5 -> 5 次 } } } // 打乱抽取池的顺序 random_shuffle(r.begin(), r.end()); cout << endl; cout << "!> 请输入需要抽取的人数:"; cin >> m; cout << endl; if (n < m) { cout << "!> 人数超出限制" << endl;; cout << "!> 输入任意字符退出......" << endl; cin >> t; return 0; } cout << "------------ 抽取名单 ------------" << endl; // 循环进行抽取 for (int i = 1; i <= m; i++) { rd(); // 调用抽取函数 if (f == true) { //判断旗帜状态 cout << "-----------------------------------" << endl; cout << "!> 抽取已结束,输入任意字符退出......" << endl; cin >> t; return 0; } } if (drawn.size() < m) { cout << "!> 没有足够的人被抽取,可能是所有人都已抽取过。" << endl; cout << "-----------------------------------" << endl; cout << "!> 抽取已结束,输入任意字符退出......" << endl; cin >> t; return 0; } cout << "-----------------------------------" << endl; cout << "!> 抽取已结束,输入任意字符退出......" << endl; cin >> t; return 0; }
2301_77103943/WeightedRandomSelectionTool
权重式随机抽取工具.cpp
C++
agpl-3.0
3,475
<script> export default { onLaunch: function() { console.log('App Launch') }, onShow: function() { console.log('App Show') }, onHide: function() { console.log('App Hide') } } </script> <style> /*每个页面公共css */ </style>
2301_77385112/TEST
App.vue
Vue
unknown
254
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <script> var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) document.write( '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />') </script> <title></title> <!--preload-links--> <!--app-context--> </head> <body> <div id="app"><!--app-html--></div> <script type="module" src="/main.js"></script> </body> </html> //ts //NZP //nzp //123 //456aaa //2113123 //ts123 //11111111111111111111
2301_77385112/TEST
index.html
HTML
unknown
744
import App from './App' // #ifndef VUE3 import Vue from 'vue' import './uni.promisify.adaptor' Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ ...App }) app.$mount() // #endif // #ifdef VUE3 import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) return { app } } // #endif
2301_77385112/TEST
main.js
JavaScript
unknown
352
<template> <view class="content"> <image class="logo" src="/static/logo.png"></image> <view class="text-area"> <text class="title">{{title}}</text> </view> </view> </template> <script> export default { data() { return { title: 'Hello' } }, onLoad() { }, methods: { } } </script> <style> .content { display: flex; flex-direction: column; align-items: center; justify-content: center; } .logo { height: 200rpx; width: 200rpx; margin-top: 200rpx; margin-left: auto; margin-right: auto; margin-bottom: 50rpx; } .text-area { display: flex; justify-content: center; } .title { font-size: 36rpx; color: #8f8f94; } </style>
2301_77385112/TEST
pages/index/index.vue
Vue
unknown
694
uni.addInterceptor({ returnValue (res) { if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) { return res; } return new Promise((resolve, reject) => { res.then((res) => { if (!res) return resolve(res) return res[0] ? reject(res[0]) : resolve(res[1]) }); }); }, });
2301_77385112/TEST
uni.promisify.adaptor.js
JavaScript
unknown
373
/** * 这里是uni-app内置的常用样式变量 * * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App * */ /** * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 * * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 */ /* 颜色变量 */ /* 行为相关颜色 */ $uni-color-primary: #007aff; $uni-color-success: #4cd964; $uni-color-warning: #f0ad4e; $uni-color-error: #dd524d; /* 文字基本颜色 */ $uni-text-color:#333;//基本色 $uni-text-color-inverse:#fff;//反色 $uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 $uni-text-color-placeholder: #808080; $uni-text-color-disable:#c0c0c0; /* 背景颜色 */ $uni-bg-color:#ffffff; $uni-bg-color-grey:#f8f8f8; $uni-bg-color-hover:#f1f1f1;//点击状态颜色 $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 /* 边框颜色 */ $uni-border-color:#c8c7cc; /* 尺寸变量 */ /* 文字尺寸 */ $uni-font-size-sm:12px; $uni-font-size-base:14px; $uni-font-size-lg:16px; /* 图片尺寸 */ $uni-img-size-sm:20px; $uni-img-size-base:26px; $uni-img-size-lg:40px; /* Border Radius */ $uni-border-radius-sm: 2px; $uni-border-radius-base: 3px; $uni-border-radius-lg: 6px; $uni-border-radius-circle: 50%; /* 水平间距 */ $uni-spacing-row-sm: 5px; $uni-spacing-row-base: 10px; $uni-spacing-row-lg: 15px; /* 垂直间距 */ $uni-spacing-col-sm: 4px; $uni-spacing-col-base: 8px; $uni-spacing-col-lg: 12px; /* 透明度 */ $uni-opacity-disabled: 0.3; // 组件禁用态的透明度 /* 文章场景相关 */ $uni-color-title: #2C405A; // 文章标题颜色 $uni-font-size-title:20px; $uni-color-subtitle: #555555; // 二级标题颜色 $uni-font-size-subtitle:26px; $uni-color-paragraph: #3F536E; // 文章段落颜色 $uni-font-size-paragraph:15px;
2301_77385112/TEST
uni.scss
SCSS
unknown
2,217
<?php /* * 支付宝当面付极简版(生成付款链接) * 只需配置以下三个参数: */ $config = [ 'app_id' => '', // 应用APPID 'private_key' => <<<EOD -----BEGIN RSA PRIVATE KEY----- 应用私钥 -----END RSA PRIVATE KEY----- EOD, 'alipay_public_key' => <<<EOD -----BEGIN PUBLIC KEY----- 支付宝公钥 -----END PUBLIC KEY----- EOD ]; //------------------------- 以下代码无需修改 ------------------------- // 自动生成订单信息 $order = [ 'out_trade_no' => date('YmdHis').mt_rand(1000,9999), 'total_amount' => $_GET['money'], 'subject' => '电商购物' ]; // 构造请求参数 $params = [ 'app_id' => $config['app_id'], 'method' => 'alipay.trade.precreate', 'charset' => 'utf-8', 'sign_type' => 'RSA2', 'timestamp' => date('Y-m-d H:i:s'), 'version' => '1.0', 'biz_content' => json_encode($order) ]; // 生成签名 ksort($params); $signStr = urldecode(http_build_query($params)); // 验证私钥有效性 if(!$privateKey = openssl_pkey_get_private($config['private_key'])){ die("私钥错误:".openssl_error_string()); } openssl_sign($signStr, $sign, $privateKey, OPENSSL_ALGO_SHA256); $params['sign'] = base64_encode($sign); // 发送请求 $gateway = 'https://openapi.alipay.com/gateway.do'; $response = json_decode(file_get_contents($gateway.'?'.http_build_query($params)), true); // 输出结果 if(isset($response['alipay_trade_precreate_response']['qr_code'])){ echo "电商付款码:".$response['alipay_trade_precreate_response']['qr_code']; } else { echo "生成失败,错误信息:<pre>"; print_r($response); } ?> <html> <head> <title>url-pay</title> <meta charset="UTF-8"> <meta name="google" value="notranslate"> <meta name="baidu-site-verification" content="0fFS5DZPGS" /> <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"> </head> <body> <!-- 前端显示示例 --> <center> <img src="https://qun.qq.com/qrcode/index?&size=300&data=<? echo $response['alipay_trade_precreate_response']['qr_code']?>"> </body> </html>
2301_77417188/alipay
pay.php
PHP
unknown
2,244