{"id":20881471,"url":"https://github.com/js-bhavyansh/blur_effect","last_synced_at":"2025-12-28T04:22:32.914Z","repository":{"id":251336231,"uuid":"837095136","full_name":"js-bhavyansh/Blur_Effect","owner":"js-bhavyansh","description":"Jetpack Compose sample showcasing animated blur effects on UI elements.","archived":false,"fork":false,"pushed_at":"2024-08-03T11:30:13.000Z","size":10170,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T10:08:05.599Z","etag":null,"topics":["android-studio","animated-blur","blur-effect","jetpack-compose","kotlin","material-ui"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/js-bhavyansh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-02T07:48:02.000Z","updated_at":"2024-08-03T11:30:17.000Z","dependencies_parsed_at":"2024-10-22T08:56:33.801Z","dependency_job_id":null,"html_url":"https://github.com/js-bhavyansh/Blur_Effect","commit_stats":null,"previous_names":["bhavyansh03-tech/blur_effect","js-bhavyansh/blur_effect"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBlur_Effect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBlur_Effect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBlur_Effect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBlur_Effect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js-bhavyansh","download_url":"https://codeload.github.com/js-bhavyansh/Blur_Effect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243258498,"owners_count":20262300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-studio","animated-blur","blur-effect","jetpack-compose","kotlin","material-ui"],"created_at":"2024-11-18T07:24:59.633Z","updated_at":"2025-12-28T04:22:32.855Z","avatar_url":"https://github.com/js-bhavyansh.png","language":"Kotlin","readme":"# Blur Animation Sample\n\nThis project demonstrates a simple blur animation effect in Jetpack Compose using the `animateDpAsState` function. The screen contains a text element and an elevated card that apply a blur effect when toggled by a switch.\n\n## Features\n\n- Blur Animation: Animated blur effect on text and card elements.\n- Elevated Card: A card that navigates to a second screen on click.\n- Switch Toggle: A switch to toggle the blur effect.\n\n## Libraries Used\n\n- Jetpack Compose: Modern toolkit for building native Android UI.\n- Material 3: Material Design 3 components and theming.\n- Navigation: Jetpack Navigation component for handling navigation between screens.\n\n## Screenshots\n\n### Text And Card :\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/bedd2768-c688-4f0c-85c5-ecef4ad1cc3f\" alt=\"First Screenshot\" style=\"width: 200px; height: auto; margin-right: 10px;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/dcadb79a-d7d5-481f-bf83-71a0ca67227b\" alt=\"Second Screenshot\" style=\"width: 200px; height: auto;\"\u003e\n\u003c/div\u003e\n\n### Image :\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/256029ab-27df-4368-93e0-87a8e7adbc00\" alt=\"First Screenshot\" style=\"width: 200px; height: auto; margin-right: 10px;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/9467a795-3f30-477e-84ae-7e4fc7d3e55c\" alt=\"Second Screenshot\" style=\"width: 200px; height: auto;\"\u003e\n\u003c/div\u003e\n\n## Getting Started\n\n### Installation\n\n1. Clone the repository:\n\n   ```sh\n     git clone https://github.com/Bhavyansh03-tech/Blur_Effect.git\n   ```\n   \n2. Open the project in Android Studio.\n3. Build the project and run it on an emulator or a physical device.\n\n## Code Overview\n\n### Text and Card\n\n```kotlin\n@Composable\nfun MainScreen(\n    navController: NavController\n) {\n    val checked by remember { mutableStateOf(true) }\n    val animatedBlur by animateDpAsState(targetValue = if (checked) 10.dp else 0.dp, label = \"\")\n\n    Column(\n        modifier = Modifier\n            .fillMaxSize()\n            .background(Color(0xFF181A18)),\n        verticalArrangement = Arrangement.Center,\n        horizontalAlignment = Alignment.CenterHorizontally\n    ) {\n        Text(\n            modifier = Modifier.blur(\n                radius = animatedBlur,\n                edgeTreatment = BlurredEdgeTreatment.Unbounded\n            ),\n            text = \"Blur Effect\",\n            color = Color.White,\n            fontSize = MaterialTheme.typography.displayLarge.fontSize\n        )\n        Spacer(modifier = Modifier.height(24.dp))\n\n        Box(\n            modifier = Modifier\n                .fillMaxWidth(0.8f)\n                .fillMaxHeight(0.2f)\n        ) {\n            ElevatedCard(\n                modifier = Modifier\n                    .fillMaxWidth()\n                    .clip(RoundedCornerShape(20.dp))\n                    .border(width = 1.dp, color = Color.White, shape = RoundedCornerShape(20.dp))\n                    .size(150.dp)\n                    .blur(\n                        radius = animatedBlur,\n                        edgeTreatment = BlurredEdgeTreatment.Unbounded\n                    ),\n                elevation = CardDefaults.cardElevation(16.dp),\n                onClick = {\n                    navController.navigate(\"SecondScreen\")\n                }\n            ) {\n                Image(\n                    modifier = Modifier.height(200.dp),\n                    painter = painterResource(id = R.drawable.img),\n                    contentDescription = null,\n                    contentScale = ContentScale.Crop\n                )\n            }\n        }\n\n        Spacer(modifier = Modifier.height(24.dp))\n\n        Switch(checked = checked, onCheckedChange = { !checked })\n    }\n}\n```\n\n### Image\n\n```kotlin\n@Composable\nfun SecondScreen() {\n\n    val isBlurred = remember { mutableStateOf(false) }\n    val animatedBlur by animateDpAsState(targetValue = if (isBlurred.value) 10.dp else 0.dp, label = \"...\")\n    val scrollState = rememberScrollState()\n\n    val imageList = listOf(\n        R.drawable.img,\n        R.drawable.img1,\n        R.drawable.img2,\n        R.drawable.img4,\n    )\n\n    Column(\n        modifier = Modifier\n            .fillMaxSize()\n            .verticalScroll(scrollState)\n    ) {\n        imageList.forEach { imageResId -\u003e\n            Image(\n                modifier = Modifier\n                    .fillMaxWidth()\n                    .padding(bottom = 4.dp)\n                    .blur(\n                        radius = animatedBlur,\n                        edgeTreatment = BlurredEdgeTreatment.Unbounded\n                    )\n                    .clickable {\n                        isBlurred != isBlurred\n                    },\n                painter = painterResource(id = imageResId),\n                contentDescription = null,\n                contentScale = ContentScale.Crop\n            )\n        }\n    }\n}\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feature/your-feature`).\n3. Commit your changes (`git commit -am 'Add some feature'`).\n4. Push to the branch (`git push origin feature/your-feature`).\n5. Create a new Pull Request.\n\n## Contact\n\nFor questions or feedback, please contact [@Bhavyansh03-tech](https://github.com/Bhavyansh03-tech).\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fblur_effect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs-bhavyansh%2Fblur_effect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fblur_effect/lists"}