From 0b76a44b6b47bd2fec62a592654d4a2ef7ee7806 Mon Sep 17 00:00:00 2001 From: mehak mansoori Date: Sat, 20 Jan 2024 20:48:18 +0530 Subject: [PATCH 1/4] hii --- app/windows/runner/h.html | 17 ++++++++++++++ app/windows/runner/sytles.css | 10 ++++++++ assets/images/script.js | 44 +++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 app/windows/runner/h.html create mode 100644 app/windows/runner/sytles.css create mode 100644 assets/images/script.js diff --git a/app/windows/runner/h.html b/app/windows/runner/h.html new file mode 100644 index 0000000..2a55a72 --- /dev/null +++ b/app/windows/runner/h.html @@ -0,0 +1,17 @@ + + + + + + + Your App + + +
+

Welcome to Your App

+ + +
+ + + diff --git a/app/windows/runner/sytles.css b/app/windows/runner/sytles.css new file mode 100644 index 0000000..9576056 --- /dev/null +++ b/app/windows/runner/sytles.css @@ -0,0 +1,10 @@ +/* Add your styles here */ +.container { + padding: 20px; +} + +input { + width: 100%; + padding: 10px; + margin-bottom: 10px; +} diff --git a/assets/images/script.js b/assets/images/script.js new file mode 100644 index 0000000..9d3b90b --- /dev/null +++ b/assets/images/script.js @@ -0,0 +1,44 @@ +document.addEventListener('DOMContentLoaded', function () { + // Get references to the input field and search results container + const searchInput = document.getElementById('searchInput'); + const searchResults = document.getElementById('searchResults'); + + // Add event listener to the input field for real-time searching + searchInput.addEventListener('input', function () { + const searchTerm = searchInput.value.toLowerCase(); + + // Perform your search logic here (e.g., filter an array of items) + const searchResultsData = performSearch(searchTerm); + + // Update the UI with the search results + displaySearchResults(searchResultsData); + }); +}); + +// Example search function - replace this with your actual search logic +function performSearch(searchTerm) { + // Replace this with your actual data and search logic + const data = [ + { id: 1, name: 'Item 1' }, + { id: 2, name: 'Item 2' }, + { id: 3, name: 'Item 3' }, + // ... add more items as needed + ]; + + return data.filter(item => item.name.toLowerCase().includes(searchTerm)); +} + +// Update the UI with search results +function displaySearchResults(results) { + const searchResults = document.getElementById('searchResults'); + + // Clear previous results + searchResults.innerHTML = ''; + + // Display the new results + results.forEach(result => { + const listItem = document.createElement('li'); + listItem.textContent = result.name; + searchResults.appendChild(listItem); + }); +} From c0909d5e54893db6e05c1f4db0ede1c2c2e3d605 Mon Sep 17 00:00:00 2001 From: mehak mansoori Date: Sat, 20 Jan 2024 21:07:50 +0530 Subject: [PATCH 2/4] changes --- .vscode/settings.json | 3 +++ H.html | 15 +++++++++++++++ app/android/app/src/debug/script.js | 27 +++++++++++++++++++++++++++ app/android/app/src/debug/styles.css | 17 +++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 H.html create mode 100644 app/android/app/src/debug/script.js create mode 100644 app/android/app/src/debug/styles.css diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/H.html b/H.html new file mode 100644 index 0000000..c1a048a --- /dev/null +++ b/H.html @@ -0,0 +1,15 @@ + + + + + + + Your App + + +
+ +
+ + + diff --git a/app/android/app/src/debug/script.js b/app/android/app/src/debug/script.js new file mode 100644 index 0000000..b66549f --- /dev/null +++ b/app/android/app/src/debug/script.js @@ -0,0 +1,27 @@ +document.addEventListener('DOMContentLoaded', function () { + const storyButton = document.getElementById('storyButton'); + + storyButton.addEventListener('click', function () { + // Toggle the 'active' class to change the button appearance + storyButton.classList.toggle('active'); + + // Add your logic to handle the story creation or navigation + if (storyButton.classList.contains('active')) { + // The button is active, handle story creation or navigation + handleStoryClick(); + } else { + // The button is not active, handle closing the story or other actions + handleStoryClose(); + } + }); +}); + +function handleStoryClick() { + // Add your logic for story creation or navigation when the button is clicked + console.log('Story button clicked - handle story creation or navigation.'); +} + +function handleStoryClose() { + // Add your logic for closing the story or other actions when the button is not active + console.log('Story button closed - handle closing the story or other actions.'); +} diff --git a/app/android/app/src/debug/styles.css b/app/android/app/src/debug/styles.css new file mode 100644 index 0000000..85cef1a --- /dev/null +++ b/app/android/app/src/debug/styles.css @@ -0,0 +1,17 @@ +/* Add your styles here */ +.container { + padding: 20px; +} + +.story-button { + padding: 10px 20px; + background-color: #3498db; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; +} + +.story-button.active { + background-color: #e74c3c; /* Change the color when active */ +} From 5f3ab84dd6d6692c6d7910f79a3b37065b8b6412 Mon Sep 17 00:00:00 2001 From: mehak mansoori Date: Mon, 22 Jan 2024 20:09:26 +0530 Subject: [PATCH 3/4] ha --- H.html | 15 ------- app/.dart_tool/main.dart | 19 ++++++++ app/.dart_tool/search_page.dart | 78 +++++++++++++++++++++++++++++++++ assets/images/script.js | 44 ------------------- 4 files changed, 97 insertions(+), 59 deletions(-) delete mode 100644 H.html create mode 100644 app/.dart_tool/main.dart create mode 100644 app/.dart_tool/search_page.dart delete mode 100644 assets/images/script.js diff --git a/H.html b/H.html deleted file mode 100644 index c1a048a..0000000 --- a/H.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - Your App - - -
- -
- - - diff --git a/app/.dart_tool/main.dart b/app/.dart_tool/main.dart new file mode 100644 index 0000000..3184a8d --- /dev/null +++ b/app/.dart_tool/main.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'search_page.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Search Bar', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: SearchPage(), + ); + } +} diff --git a/app/.dart_tool/search_page.dart b/app/.dart_tool/search_page.dart new file mode 100644 index 0000000..cb26b13 --- /dev/null +++ b/app/.dart_tool/search_page.dart @@ -0,0 +1,78 @@ +import 'package:flutter/material.dart'; + +class SearchPage extends StatefulWidget { + @override + _SearchPageState createState() => _SearchPageState(); +} + +class _SearchPageState extends State { + TextEditingController _searchController = TextEditingController(); + List _dataList = ["Item 1", "Item 2", "Item 3", "Item 4"]; + List _searchResult = []; + + @override + void initState() { + super.initState(); + _searchResult.addAll(_dataList); + } + + void _filterSearchResults(String query) { + List searchResults = []; + if (query.isNotEmpty) { + _dataList.forEach((item) { + if (item.toLowerCase().contains(query.toLowerCase())) { + searchResults.add(item); + } + }); + } else { + searchResults.addAll(_dataList); + } + + setState(() { + _searchResult.clear(); + _searchResult.addAll(searchResults); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("Search Page"), + ), + body: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: TextField( + controller: _searchController, + onChanged: (value) { + _filterSearchResults(value); + }, + decoration: InputDecoration( + labelText: "Search", + hintText: "Search...", + prefixIcon: Icon(Icons.search), + border: OutlineInputBorder( + borderRadius: BorderRadius.all( + Radius.circular(25.0), + ), + ), + ), + ), + ), + Expanded( + child: ListView.builder( + itemCount: _searchResult.length, + itemBuilder: (context, index) { + return ListTile( + title: Text(_searchResult[index]), + ); + }, + ), + ), + ], + ), + ); + } +} diff --git a/assets/images/script.js b/assets/images/script.js deleted file mode 100644 index 9d3b90b..0000000 --- a/assets/images/script.js +++ /dev/null @@ -1,44 +0,0 @@ -document.addEventListener('DOMContentLoaded', function () { - // Get references to the input field and search results container - const searchInput = document.getElementById('searchInput'); - const searchResults = document.getElementById('searchResults'); - - // Add event listener to the input field for real-time searching - searchInput.addEventListener('input', function () { - const searchTerm = searchInput.value.toLowerCase(); - - // Perform your search logic here (e.g., filter an array of items) - const searchResultsData = performSearch(searchTerm); - - // Update the UI with the search results - displaySearchResults(searchResultsData); - }); -}); - -// Example search function - replace this with your actual search logic -function performSearch(searchTerm) { - // Replace this with your actual data and search logic - const data = [ - { id: 1, name: 'Item 1' }, - { id: 2, name: 'Item 2' }, - { id: 3, name: 'Item 3' }, - // ... add more items as needed - ]; - - return data.filter(item => item.name.toLowerCase().includes(searchTerm)); -} - -// Update the UI with search results -function displaySearchResults(results) { - const searchResults = document.getElementById('searchResults'); - - // Clear previous results - searchResults.innerHTML = ''; - - // Display the new results - results.forEach(result => { - const listItem = document.createElement('li'); - listItem.textContent = result.name; - searchResults.appendChild(listItem); - }); -} From 1167714e6b987e73abc9d9b46f930ec69cfbcab7 Mon Sep 17 00:00:00 2001 From: mehak mansoori Date: Sun, 28 Jan 2024 10:50:35 +0530 Subject: [PATCH 4/4] swift --- .vscode/settings.json | 2 +- ViewController.swift | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ViewController.swift diff --git a/.vscode/settings.json b/.vscode/settings.json index 6f3a291..f673a71 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "liveServer.settings.port": 5501 + "liveServer.settings.port": 5502 } \ No newline at end of file diff --git a/ViewController.swift b/ViewController.swift new file mode 100644 index 0000000..1731b10 --- /dev/null +++ b/ViewController.swift @@ -0,0 +1,26 @@ +import UIKit + +class MainViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { + + // Connect this to your "Add Story" button in Interface Builder + @IBAction func addStoryButtonTapped(_ sender: UIButton) { + let imagePicker = UIImagePickerController() + imagePicker.delegate = self + imagePicker.sourceType = .camera // or .photoLibrary if you prefer + present(imagePicker, animated: true, completion: nil) + } + + // MARK: - UIImagePickerControllerDelegate + + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { + if let image = info[.originalImage] as? UIImage { + // Handle the selected image here, you can save it, process it, or upload it + // You might want to navigate the user to another screen for editing or adding captions + } + picker.dismiss(animated: true, completion: nil) + } + + func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { + picker.dismiss(animated: true, completion: nil) + } +}