Drag and Drop Flora Editor

Developer
Size
2,425 Kb
Views
46,552

How do I make an drag and drop flora editor?

What is a drag and drop flora editor? How do you make a drag and drop flora editor? This script and codes were developed by Helana Nosrat on 12 August 2022, Friday.

Drag and Drop Flora Editor Previews

Drag and Drop Flora Editor - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Drag and Drop Flora Editor</title>
</head>
<body>
<html ng-app="myApp">
<head> <title>HTML5 Draggable and Droppable Directives</title> <style> dropit, img, p{ vertical-align: top; text-align: center; width: 100px; display: inline-block;	}	p { color: white; background-color: black; font: bold 14px/16px arial; margin: 0px; width: 96px; border: 2px ridge grey; background: linear-gradient(#888888, #000000);	}	span{ display:inline-block; width: 100px; font: 16px/18px Georgia, serif; text-align: center; padding: 2px; background: linear-gradient(#FFFFFF, #888888);	}	.dragItem { color: red; opacity: .5;	} .dropItem { border: 3px solid red; opacity: .5; } #dragItems { width: 400px; } </style>
</head>
<body> <h2>HTML5 Drag and Drop Components</h2> <div ng-controller="myController"> Drag Status: {{dragStatus}}<br> Drop Status: {{dropStatus}} <hr> <div id="dragItems"> <span dragit>Nature</span> <span dragit>Landscape</span> <span dragit>Flora</span> <span dragit>Sunset</span> <span dragit>Arch</span> <span dragit>Beauty</span> <span dragit>Inspiring</span> <span dragit>Summer</span> <span dragit>Fun</span> </div> <hr> <dropit><img src="/images/arch.jpg" /></dropit> <dropit><img src="/images/flower.jpg" /></dropit> <dropit><img src="/images/cliff.jpg" /></dropit> <dropit><img src="/images/jump.jpg" /></dropit> </div> <script src="http://code.angularjs.org/1.3.0/angular.min.js"></script> <script src="js/dragdrop.js"></script>
</body>
</html> <script src="js/index.js"></script>
</body>
</html>

Drag and Drop Flora Editor - Script Codes JS Codes

var app = angular.module('myApp', []);
app.controller('myController', function($scope) { $scope.dragStatus = "none"; $scope.dropStatus = "none"; $scope.dropValue = "";
})
.directive('dragit', function($document, $window) { function makeDraggable(scope, element, attr) { angular.element(element).attr("draggable", "true"); element.on('dragstart', function(event) { element.addClass('dragItem'); scope.$apply(function(){ scope.dragStatus = "Dragging " + element.html(); scope.dropValue = element.html(); }); event.dataTransfer.setData('Text', element.html()); }); element.on('drag', function(event) { scope.$apply(function(){ scope.dragStatus = "X: " + event.pageX + " Y: " + event.pageY; }); }); element.on('dragend', function(event) { event.preventDefault(); element.removeClass('dragItem'); }); } return { link: makeDraggable };
})
.directive('dropit', function($document, $window) { return { restrict: 'E', link: function makeDroppable(scope, element, attr){ element.on('dragover', function(event) { event.preventDefault(); scope.$apply(function(){ scope.dropStatus = "Drag Over"; }); }); element.on('dragleave', function(event) { event.preventDefault(); element.removeClass('dropItem'); scope.$apply(function(){ scope.dropStatus = "Drag Leave"; }); }); element.on('dragenter', function(event) { event.preventDefault(); element.addClass('dropItem'); scope.$apply(function(){ scope.dropStatus = "Drag Enter"; }); }); element.on('drop', function(event) { event.preventDefault(); element.removeClass('dropItem'); scope.$apply(function(){ element.append('<p>' + event.dataTransfer.getData('Text') + '</p>'); scope.dropStatus = "Dropped " + scope.dropValue; }); }); } };
});
Drag and Drop Flora Editor - Script Codes
Drag and Drop Flora Editor - Script Codes
Home Page Home
Developer Helana Nosrat
Username HelanaN
Uploaded August 12, 2022
Rating 3
Size 2,425 Kb
Views 46,552
Do you need developer help for Drag and Drop Flora Editor?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Helana Nosrat (HelanaN) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!